2007-03-19 Chris Toshok <toshok@ximian.com>
[mcs.git] / gmcs / ChangeLog
blobe1e86eb52120dc3c73f72b432326b7af30375a3d
1 2007-03-15  Marek Safar  <marek.safar@gmail.com>
3         * generic.cs (InflatedConstraints): Fixed the check order.
4         (TypeArguments.Resolve): Small optimization for generic parameters.
5         (InferTypeArguments): Add infering support for anonymous methods.
7 2007-03-15  Martin Baulig  <martin@ximian.com>
9         Fix #79984.
11         * generic.cs
12         (TypeParameter.HasConstructorConstraint): Removed.
13         (ConstraintChecker.HasDefaultConstructor): Removed the
14         `TypeBuilder' argument here; correctly check for the ctor
15         constraint on type parameters.
17 2007-03-15  Martin Baulig  <martin@ximian.com>
19         Fix #79302.
21         * generic.cs
22         (TypeParameter): Create a `MemberCache' here as well.  Note that
23         we need to create this on-demand when it's actually used.
25 2007-03-10  Marek Safar  <marek.safar@gmail.com>
27         * generic.cs (TypeArguments.Resolve): Avoid redundant checks.
29 2007-03-09  Raja R Harinath  <rharinath@novell.com>
31         * cs-parser.jay (WHERE): Move before QUERY_FIRST_TOKEN.  'where'
32         is a valid keyword outside a linq expression too.
34 2007-03-03  Marek Safar  <marek.safar@gmail.com>
36         * cs-parser.jay: Implemented basic linq grammar.
38         * linq.cs: New file for hosting query specific classes.
40 2007-02-26  Marek Safar  <marek.safar@gmail.com>
42         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
44 2007-02-20  Marek Safar  <marek.safar@gmail.com>
46         A fix for bug #80650
47         * cs-parser.jay: Anonymous container starts at constructor declaration
48         and not at block beginning because it has to be usable in constructor
49         initializer.
51 2007-02-18  Marek Safar  <marek.safar@gmail.com>
53         A fix for bug #80493 by Atsushi Enomoto
54         * cs-parser.jay: Ignore invalid attribute target.
56 2007-02-15  Miguel de Icaza  <miguel@novell.com>
58         * Remove the call to SetExpression for lambda expressions, we do
59         not actually need it.
61         Remove expression tracking code as its not needed.
63 2007-02-11  Miguel de Icaza  <miguel@novell.com>
65         * cs-parser.jay (lambda_expression_body): when the body is an
66         expression add a statement of the form:
68                 contextual-return expression.
70         Where `contextual-return' is similar to `return', the difference
71         being that if the delegate that the lambda will be converted to
72         has a void return type, it will check that the result is a
73         ExpressionStatement and the result is a plain ret (no return
74         values on the stack).  If the return type of the delegate is of a
75         given type, this turns into a return with a value and does the
76         regular checking to check that the computed value can be
77         implicitly converted to the delegate return.
79 2007-01-30  Miguel de Icaza  <miguel@novell.com>
81         * cs-parser.jay (anonymous_method_expression): move the
82         before/after productions to the start_anonymous and end_anonymous
83         methods so the code can be reused for lambda functions.
85         (lambda_expression_body): wrap expressions implicitly into a
86         block.
88         (block): factor out the setup/teardown of parsing a block so we
89         can reuse that in lambda_expression_body
91         (lambda_expression): use new anonymous method helper methods.
93 2007-01-29  Miguel de Icaza  <miguel@novell.com>
95         * cs-parser.jay: oob_stack make it static (am guessing that is why
96         we no longer initialize it anymore) and reuse it across
97         instances.
99 2007-01-28  Miguel de Icaza  <miguel@novell.com>
101         * cs-parser.jay (open_parens): Introduce new non-terminal that
102         abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
103         be returned in places where types are followed by identifiers
104         (this is expected in declaration, fixed, using, foreach and catch
105         clauses). 
107         Use open_parens in those places, keep OPEN_PARENS in the
108         expressions.  
110         cs-parser.jay: New grammar bits for parsing lambda expressions. 
112 2007-01-28  Raja R Harinath  <rharinath@novell.com>
114         Fix #80534, gtest-309.cs
115         * generic.cs (UnifyType): Rename from InferType.  Make unification
116         of generic insts simpler and don't insist on inferring all generic
117         parameters in a single generic inst unification.
118         (UnifyTypes): New.
119         (InferGenericInstance): Remove.
120         Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
122 2007-01-20  Marek Safar  <marek.safar@gmail.com>
124         * cs-parser.jay: Better parameter error handling.
126 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
127             Raja R Harinath  <rharinath@novell.com>
129         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
130         Note the order in which accessors are declared in the source.
132 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
134         * generic.cs (TypeParameter.FindMembers): Use the generic
135         constraints, not the constraints to check for methods (first fix
136         of 80518).
138 2006-12-30  Marek Safar  <marek.safar@gmail.com>
140         * cs-parser.jay: Better syntax errors handling.
142 2006-11-21  Marek Safar  <marek.safar@gmail.com>
144         * cs-parser.jay: Tiny change to work with mcs tokenizer.
146         * cs-tokenizer.cs: Remove after unification with mcs.
148 2006-10-28  Marek Safar  <marek.safar@gmail.com>
150         A fix for bug #78998
151         * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
152         arguments as well.
154 2006-10-26  Marek Safar  <marek.safar@gmail.com>
156         A fix for bug #76591
157         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
159 2006-10-25  Brian Crowell  <brian@fluggo.com>
161         Fix #79703
162         * generic.cs (CheckConstraints): Allow generic parameters with
163         inheritance constraints to satisfy reference type constraints.
165 2006-10-09  Martin Baulig  <martin@ximian.com>
167         * generic.cs
168         (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
170 2006-09-25  Martin Baulig  <martin@ximian.com>
172         * class.cs: Remove after unification with mcs source.
174 2006-09-24  Raja R Harinath  <harinath@gmail.com>
176         * convert.cs: Remove after unification with mcs source.
178 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
180         * class.cs (MemberBase.VerifyClsCompliance): When method has type
181         parameters verify them as well.
183         * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
184         the type parameter constraints.
185         (Generics.VerifyClsCompliance): Ditto.
187 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
189         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
190         for anonymous block with out argument.
192 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
194         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
195         not used private events only.
197 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
199         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
201         * cs-parser.jay: Parse correctly cast of default (T).
203         * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
204         Store original type via EmptyConstantCast.
206 2006-09-22  Martin Baulig  <martin@ximian.com>
208         * delegate.cs: Removed; this file is now shared with mcs.
210         * attribute.cs: Removed; this file is now shared with mcs.
212 2006-09-22  Martin Baulig  <martin@ximian.com>
214         * ecore.cs: Removed; this file is now shared with mcs.
216 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
218         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
220         * ecore.cs (NullCast): Derives from NullConstant.
222         * generic.cs (DefaultValueExpression): Fixed to cope with the constant
223         results.
225 2006-09-21  Martin Baulig  <martin@ximian.com>
227         * decl.cs: Removed; this file is now shared with mcs.
229 2006-09-21  Raja R Harinath  <rharinath@novell.com>
231         * rootcontext.cs: Remove after unification with mcs source.
233         * report.cs: Remove after unification with mcs source.
234         * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
235         mcs/typemanager.cs.
236         (InitGenerics, CleanUpGenerics): Remove.
238         * support.cs: Remove after unification with mcs source.
240 2006-09-20  Raja R Harinath  <rharinath@novell.com>
242         * codegen.cs: Remove after unification with mcs source.
244 2006-09-19  Martin Baulig  <martin@ximian.com>
246         * expression.cs: Removed; this file is now shared with mcs.
248 2006-09-19  Martin Baulig  <martin@ximian.com>
250         * generic.cs
251         (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
252         (TypeManager.DropGenericTypeArguments): Likewise.
253         (TypeManager.DropGenericMethodArguments): Likewise.
254         (TypeManager.GetTypeArguments): Likewise.
255         (TypeManager.HasGenericArguments): Likewise.
257 2006-09-19  Martin Baulig  <martin@ximian.com>
259         * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
261 2006-09-19  Martin Baulig  <martin@ximian.com>
263         * typemanager.cs: Removed; this file is now shared with mcs.
265 2006-09-16  Raja R Harinath  <rharinath@novell.com>
267         * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
268         * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
270 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
272         A fix for #79401
273         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
274         only if parent type is class.
275         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
276         update.
278 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
280         * cs-parser.jay,
281         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
282         keywords are used.
283         * typemanager.cs(CSharpName): Converts NullType to null.
285 2006-09-15  Martin Baulig  <martin@ximian.com>
287         * pending.cs: Removed; this file is now shared with mcs.
289 2006-09-15  Martin Baulig  <martin@ximian.com>
291         * statement.cs: Removed; this file is now shared with mcs.
293 2006-09-15  Martin Baulig  <martin@ximian.com>
295         * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
297         * driver.cs: Removed the `--broken-cycles' argument.
299 2006-09-15  Martin Baulig  <martin@ximian.com>
301         * namespace.cs: Removed; this file is now shared with mcs.
303 2006-09-15  Martin Baulig  <martin@ximian.com>
305         * decl.cs (MemberName): Minor code cleanups.
307 2006-09-15  Martin Baulig  <martin@ximian.com>
309         * parameter.cs: Removed; this file is now shared with mcs.
311 2006-09-15  Martin Baulig  <martin@ximian.com>
313         * enum.cs: Removed; this file is now shared with mcs.
315 2006-09-15  Martin Baulig  <martin@ximian.com>
317         * Makefile: Define `GMCS_SOURCE'.
319         * flowanalysis.cs: Removed; this file is now shared with mcs.
321 2006-09-15  Martin Baulig  <martin@ximian.com>
323         Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
324         assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
325         doc.cs - they are now shared with mcs.
327         * gmcs.exe.sources: Include these files from ../mcs/.
329 2006-09-15  Martin Baulig  <martin@ximian.com>
331         * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
332         * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
334 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
336         * assign.cs, ecore.cs, expression.cs: Share error message text.
337         * class.cs (FieldMember.Define): Check for variable of static type.
338         * decl.cs (check_type_parameter): Report correct type name.
339         * driver.cs (LoadAssembly): Uses error output for errors.
340         * generic.cs (Constraints.Resolve): Add check for constraint accessibility
341         (TypeArguments.Resolve): Static class cannot be used as an argument.
342         * statement.cs (ResolveMeta): Constants cannot be generic types.
344 2006-09-12  Martin Baulig  <martin@ximian.com>
346         * generic.cs (TypeManager.IsIList): Moved into convert.cs.
348         * convert.cs (Convert.Array_To_IList): Moved here and correctly
349         implement it; fixes #79345.
351 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
353         * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
354         parameter.
355         * expression.cs (TypeOf.GetAttributableValue): Check for open generic
356         types.
357         * generic.cs: Improved error messages.
358         * typemanager.cs (RemoveGenericArity): Made public.
360 2006-09-08  Martin Baulig  <martin@ximian.com>
362         * typemanager.cs (TypeManager.interlocked_type): New public field.
363         (TypeManager.int_interlocked_compare-exchange): New public field.
364         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
365         enumerator types here and call InitGenericCoreTypes().
366         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
367         after calling InitEnumUnderlyingTypes().
369         * rootcontext.cs
370         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
371         `classes_second_stage'. 
373 2006-09-07  Marek Safar  <marek.safar@seznam.cz>
375         * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
376         collisions.
377         * statement.cs (Block.Variables): Made public.
379 2006-09-07  Martin Baulig  <martin@ximian.com>
381         * driver.cs
382         (MainDriver): Revert r62663 from Marek; see #70506 for details.
384 2006-09-01  Martin Baulig  <martin@ximian.com>
386         * generic.cs
387         (TypeManager.IsIList): Also handle base classes and interfaces. 
389 2006-09-01  Raja R Harinath  <rharinath@novell.com>
391         Fix #79238
392         * expression.cs (Invocation.MoreSpecific): Check for reference
393         types earlier.
395 2006-08-29  Miguel de Icaza  <miguel@novell.com>
397         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
399 2006-08-17  Miguel de Icaza  <miguel@novell.com>
401         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
402         #52019 and #79064, the use of the \uXXXX sequence in source code
403         to represent unicode characters.
405 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
407         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
408         support.
409         * class.cs, ecore.cs, statement.cs: Merged to one error message.
411 2006-08-14  Raja R Harinath  <rharinath@novell.com>
413         Fix #79067
414         * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
415         parameter too.  This only avoids a parse error -- the semantic
416         error is caught elsewhere.
418 2006-08-13  Miguel de Icaza  <miguel@novell.com>
420         * assign.cs: Catch attempts to assign to a method groups in += and
421         report as 1656
423 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
425         A fix for #79056
426         * cs-parser.jay: Don't destroy current array type by typeof of array's.
428 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
430         * cs-parser.jay: Check whether a constraint clause has already been
431         specified for type parameter.
432         * generic.cs (Constraints): Exposed location.
434 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
436         * class.cs (Method.Define): Issue a warning when generic method looks like
437         an entry point.
438         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
439         as well.
440         * report.cs: New warning number.
442 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
444         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
445         looking for ctor.
446         * decl.cs (MemberCache.FindMembers): When container is interface we need to
447         search all base interfaces as a member can be ambiguous.
448         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
449         Constructor member type filter. 
450         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
451         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
452         reporting for returned memberinfos.
453         * report.cs: Updated.
454         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
455         version to work on all runtimes.
456         (TypeManager.RealMemberLookup): Removed members filtering.
458 2006-08-08  Raja R Harinath  <rharinath@novell.com>
460         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
461         (PropertyExpr.EmitAssign): Likewise.
462         * expression.cs (Indirection.EmitAssign): Likewise.
463         (LocalVariableReference.EmitAssign): Likewise.
464         (ParameterReference.EmitAssign): Likewise.
465         (Invocation.EmitArguments): Likewise.
466         (ArrayAccess.EmitAssign): Likewise.
467         (IndexerAccess.EmitAssign): Likewise.
468         (This.EmitAssign): Likewise.
469         (ConditionalLogicalOperator.Emit): Likewise.
471         Fix #79026
472         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
473         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
474         leave it in after returning it.
475         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
477 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
479         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
480         message.
482 2006-08-05  Marek Safar  <marek.safar@seznam.cz>
484         * class.cs (TypeContainer.AddPartial): Add check for partial declarations
485         with different type names.
486         (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
488 2006-08-03  Raja R Harinath  <rharinath@novell.com>
490         Fix cs0146-3.cs and cs0146-4.cs.
491         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
492         enclosing types don't depend on the current type.
494 2006-08-02  Raja R Harinath  <rharinath@novell.com>
496         Fix #77963
497         * class.cs (TypeContainer.DoDefineMembers): Use
498         FindBaseMemberWithSameName on Parent, since we're interested in
499         whether we hide inherited members or not.
500         (FindBaseMemberWithSameName): Make slightly more robust.
502         Fix #77396
503         * codegen.cs (IResolveContext.GenericDeclContainer): New.
504         (EmitContext): Implement new interface requirement.
505         * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
506         * decl.cs (MemberCore): Likewise.
507         (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
508         * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
509         ec.GenericDeclContainer to check for generic parameters.
510         (SimpleName.DoSimpleNameResolve): Likewise.
511         * generic.cs (TypeParameter.DeclContainer): Remove override.
513         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
514         declspaces for doppelgangers too.
515         (UsingEntry): Implement IResolveContext.
516         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
517         'this' as the resolve context.
518         (LocalAliasEntry): Likewise.
520         Implement parts of #77403
521         * roottypes.cs (RootDeclSpace): New.  Used to represent the
522         toplevel declaration space.  Each namespace declaration introduces
523         a "partial" root declaretion space.
524         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
525         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
526         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
527         from 'current_namespace.SlaveDeclSpace'.
528         (namespace_declaration): Likewise.
529         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
530         check.  It can't happen now.
531         * decl.cs (DeclSpace.LookupType): Likewise.
532         * driver.cs (MainDriver): Sanity check.
534 2006-08-01  Raja R Harinath  <rharinath@novell.com>
536         * decl.cs (DeclSpace.FindNestedType): Remove.
537         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
538         LookupTypeContainer to get the container of the nested type.
539         * class.cs (TypeContainer.FindNestedType): Make non-override.
541 2006-07-31  Raja R Harinath  <rharinath@novell.com>
543         * decl.cs (DeclSpace.PartialContainer): Move field from ...
544         * class.cs (TypeContainer.PartialContainer): ... here.
545         (TypeContainer.AddBasesForPart): New helper.
546         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
547         instead.
548         * cs-parser.jay (current_class): Convert to DeclSpace.
549         (struct_declaration, interface_declaration, class_declaration):
550         Use AddBasesForPart instead of .Bases directly.
551         * const.cs, iterators.cs: Update to changes.
553 2006-07-28  Raja R Harinath  <rharinath@novell.com>
555         * class.cs (TypeContainer.AddMemberType): Rename from
556         AddToTypeContainer.
557         (TypeContainer.AddMember): Rename from AddToMemberContainer.
558         (AddTypeContainer): New.  Combine AddClassOrStruct and
559         AddInterface.
560         (AddPartial): Update.  Add 'is_partial' argument.
561         * roottypes.cs: Update to changes.
562         * cs-parser.jay (push_current_class): New helper for handling
563         current_container and current_class.
564         (struct_declaration, interface_declaration, class_declaration):
565         Use it.
567 2006-07-26  Raja R Harinath  <rharinath@novell.com>
569         * roottypes.cs: Rename from tree.cs.
571         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
572         * tree.cs (Tree, ITreeDump): Remove types.
573         * rootcontext.cs (tree, Tree): Remove fields.
574         (root, ToplevelTypes): New.
575         * *.cs: Update to rename.
577         * tree.cs (Tree.RecordDecl): Remove.
578         (RootTypes.AddToTypeContainer): Record the toplevel type in its
579         namespace here.
580         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
582 2006-07-23  Raja R Harinath  <harinath@gmail.com>
584         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
585         DoFlowAnalysis and OmitStructFlowAnalysis here.
586         (ec.With): Rename from WithUnsafe and generalize.
587         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
588         (ec.WithFlowAnalyis): New.
589         * ecore.cs, expression.cs, statement.cs: Update.
591 2006-07-22  Raja R Harinath  <harinath@gmail.com>
593         * statement.cs (Block.ResolveMeta): Simplify slightly.
595         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
596         multiple boolean fields.  Convert InUnsafe, constant_check_state,
597         check_state to flags.
598         (CheckState, ConstantCheckState): Update.
599         (InUnsafe): New read-only property.
600         (FlagsHandle): Rename from CheckStateHandle and convert to handle
601         arbitrary flags.
602         (WithUnsafe): New helper similar to WithCheckState.
603         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
604         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
606 2006-07-21  Raja R Harinath  <rharinath@novell.com>
608         Make comparisons use the same IL irrespective of whether they're
609         in a 'checked' or 'unchecked' context: one of the issues in #78899
610         * codegen.cs (EmitContext.CheckState): Make read-only property.
611         (EmitContext.ConstantCheckState): Likewise.
612         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
613         helper that implement a save/restore stack for CheckState
614         values.  This is the only way to change check-state.
615         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
616         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
617         (CheckedExpr.EmitBranchable): New forwarding method.
618         (UnCheckedExpr): Likewise.
619         * statement.cs (Block.ResolveMeta): Use WithCheckState.
620         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
621         (Checked.Resolve, checked.DoEmit): Likewise.
623 2006-07-21  Martin Baulig  <martin@ximian.com>
625         * generic.cs (TypeManager.InferType): When inferring an array
626         type, also allow IList<T> and ICollection<T>.  Fixes #78900.
628 2006-07-21  Martin Baulig  <martin@ximian.com>
630         * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
631         and allow IList`1 and all its base interfaces.
633         * convert.cs (Convert.ImplicitReferenceConversion): Allow
634         converting from an array-type of T to IList<T>.
636 2006-07-21  Martin Baulig  <martin@ximian.com>
638         * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
640 2006-07-20  Miguel de Icaza  <miguel@novell.com>
642         * anonymous.cs: Cache the resolved anonymous delegate, and return
643         this so that the ResolveTopBlock is only triggered once, not
644         twice.
646         Currently we trigger ResolvetopBlock twice due to a first pass of
647         argument check compatibility, and a second pass that does the
648         actual resolution.   
650 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
652         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
653         modifiers.
654         * rootcontext.cs (Reset): Add helper_classes.
656 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
658         A fix for #78860
659         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
660         correctly.
662 2006-07-13  Miguel de Icaza  <miguel@novell.com>
664         * statement.cs (Lock): Handle expressions of type
665         TypeManager.null_type specially.  Fixes #78770
667 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
669         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
670         to an event.
672 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
674         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
675         for accessors as well.
676         * ecore.cs (EventExpr): Add AccessorTable.
678 2006-07-03  Martin Baulig  <martin@ximian.com>
680         * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
681         instances of value types.
683         * convert.cs (Convert.ExplicitConversion): Correctly handle
684         object->nullable conversions.   
686 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
688         A fix for #78738
689         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
690         for CS0122 where appropriate.
691         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
692         level attributes.
693         (Filter): Assembly can be null in the case of top level attributes.
695 2006-06-28  Raja R Harinath  <rharinath@novell.com>
697         Fix #78716
698         * generic.cs (TypeManager.InferParamsTypeArguments): If there are
699         no arguments, return 'false': nothing can be inferred.
701 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
703         A fix for #78690
705         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
706         is done at global level.
708 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
710         A fix for #77002, Implemented TypeForwarder support.
712         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
713         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
714         attribute handling.
715         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
716         * typemanager.cs (): Add type_forwarder_attr_type.
718 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
720         * report.cs: Add CS0469 warning.
722 2006-06-22  Martin Baulig  <martin@ximian.com>
724         * class.cs
725         (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
726         for interfaces; fixes #78686, which is a modification of #78380
727         with interfaces instead of classes.
729 2006-06-21  Martin Baulig  <martin@ximian.com>
731         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
732         the `try'-block, so we also report CS0016 etc. there.
734 2006-06-21  Martin Baulig  <martin@ximian.com>
736         * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
737         handle SetAssigned() and SetMemberIsUsed() for generic types;
738         fixes #77545.
740 2006-06-21  Martin Baulig  <martin@ximian.com>
742         * delegate.cs
743         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
745 2006-06-21  Martin Baulig  <martin@ximian.com>
747         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
748         also report CS1686 for parameters.
750 2006-06-21  Martin Baulig  <martin@ximian.com>
752         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
753         instead of an error if the value is not implicitly convertible to
754         the switch types; fixes #77964.
756 2006-06-21  Raja R Harinath  <rharinath@novell.com>
758         Fix #78673
759         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
760         FieldBuilder is null.
762         Fix #78662
763         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
764         'left' and 'right' before error-checking.
766 2006-06-19  Martin Baulig  <martin@ximian.com>
768         * convert.cs
769         (Convert.ImplicitConversionStandard): Cleanup and correctly
770         implement nullable conversions.
771         (Convert.ImplicitStandardConversionExists): Likewise.
772         (Convert.ExplicitConversion): Likewise.
774 2006-06-19  Martin Baulig  <martin@ximian.com>
776         * generic.cs
777         (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
778         methods; make the ctors protected.
780 2006-06-19  Martin Baulig  <martin@ximian.com>
782         Fixed #78380; added gtest-273.cs.
784         * ecore.cs
785         (Expression.ResolveAsBaseTerminal): Move the constraint checking
786         into ResolveAsTypeTerminal().
788         * generic.cs
789         (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
790         TypeManager.FindMembers() to check for the default ctor.
792 2006-06-18  Marek Safar  <marek.safar@seznam.cz>
794         * generic.cs: Fixed NullableInfo accessibility.
796 2006-06-16  Martin Baulig  <martin@ximian.com>
798         * generic.cs
799         (Constraints.InflatedConstraints.inflate): Correctly inflate
800         generic types; fixes #78400.
802 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
804         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
805         Fixed bug #78601.
806         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
807         (FieldExpr.DoResolve): likewise.
808         (PropertyExpr.InstanceResolve): likewise.
809         (EventExpr.InstanceResolve): likewise. 
811 2006-06-15  Martin Baulig  <martin@ximian.com>
813         * statement.cs
814         (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
815         argument; always allow a `null' label if true.
816         (Switch.SwitchGoverningType): Take an `Expression expr' argument.
817         (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
818         we have a `null' label and mark the new `null_target' label;
819         default to the `default' label.
820         (Switch.Resolve): Add support for nullable types.  Fixes #78630.
822 2006-06-15  Martin Baulig  <martin@ximian.com>
824         * class.cs (Operator.Define): Allow an implicit/explicit operator
825         to convert to/from a nullable value of the enclosing type.
827         * generic.cs (TypeManager.IsNullableTypeOf): New public method.
828         (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
830         * convert.cs
831         (Convert.ImplicitStandardConversionExists): Add support for lifted
832         implicit/explicit conversions.
833         (Convert.ImplicitConversionStandard): Likewise.
835 2006-06-13  Martin Baulig  <martin@ximian.com>
837         * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
838         type arguments and create a ConstructedType if necessary.  Fixes #78400.
840 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
842         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
843         attribute applicable tests for attribute argument.
845 2006-06-02  Raja R Harinath  <rharinath@novell.com>
847         Fix #78079
848         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
849         (Binary.OverloadResolve_PredefinedIntegral): New.
850         (Binary.OverloadResolve_PredefinedFloating): New.
851         (Binary.OverloadResolve_PredefinedString): New.
852         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
853         Follow the standard more closely, and treat numeric promotions in
854         terms of overload resolution.
855         (Binary.CheckShiftArguments): Simplify.
857 2006-06-01  Raja R Harinath  <rharinath@novell.com>
859         * flowanalysis.cs (MyBitVector): Simplify representation.
860         (MyBitVector.Clone): Avoid allocating BitArray.
861         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
862         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
863         (*): Update.  Change all references to MyBitVector.And and
864         MyBitVector.Or to &= and |=.
866 2006-05-31  Raja R Harinath  <rharinath@novell.com>
868         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
869         Use bne.un instead of ceq+brfalse.
871         Fix cs0208-[23].cs
872         * typemanager.cs (IsUnmanagedType): Disallow generic types and
873         generic parameters.
875 2006-05-29  Raja R Harinath  <rharinath@novell.com>
877         Fix cs0231-[34].cs.
878         * cs-parser.jay (formal_parameter_list): Extend the pattern below
879         to param arguments too.
881 2006-05-26  Miguel de Icaza  <miguel@novell.com>
883         * cs-parser.jay: Catch another parsing form for arglist being
884         followed by other arguments.  Fixes #78313.
886 2006-05-25  Raja R Harinath  <rharinath@novell.com>
888         Fix #78324
889         * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
890         also when one of the operands is a null literal.
891         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
892         to improve clarity, and generate slightly better code.
894 2006-05-24  Raja R Harinath  <rharinath@novell.com>
896         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
897         checking of out parameters to ...
898         (FlowBranchingToplevel.Merge): ... here.
899         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
900         set, propagate the origin upward, and only complain if there was
901         no other error.
902         (FlowBranchingException.AddContinueOrigin): Likewise.
903         (FlowBranchingException.AddReturnOrigin): Likewise.
904         (FlowBranchingException.AddGotoOrigin): Likewise.       
906 2006-05-23  Raja R Harinath  <rharinath@novell.com>
908         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
909         unreachable, skip it.
910         (FlowBranchingException.Merge): Always propagate jumps, even if
911         the finally block renders subsequent code unreachable.
913 2006-05-18  Raja R Harinath  <rharinath@novell.com>
915         Fix #77601
916         * statement.cs (Goto.Resolve): Move responsibility for resolving
917         'goto' to FlowBranching.AddGotoOrigin.
918         (Goto.SetResolvedTarget): New.  Callback to set the
919         LabeledStatement that's the target of the goto.
920         (Goto.DoEmit): Use Leave instead of Br when crossing an
921         unwind-protect boundary.
922         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
923         LookupLabel and adjust to new semantics.
924         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
925         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
926         Goto.SetResolvedTarget to update target.
927         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
928         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
929         AddBreakOrigin & co.  Delay propagation until ...
930         (FlowBranchingException.Merge): ... this.
932         * statement.cs (Block.Resolve): Always depend on flow-branching to
933         determine unreachability.  Kill workaround that originally emitted
934         only one statement after an "unreachable" label (see infloop in
935         test-515.cs).
937         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
938         This is still "wrong", but anything better would probably need a
939         multi-pass algorithm.
940         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
941         usage vector.  Force current usage vector to be reachable, to
942         optimistically signify backward jumps.
943         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
944         detected.
945         (FlowBranchingLabeled.Merge): New.  If no backward jump was
946         detected, return the original salted-away usage vector instead,
947         updated with appropriate changes.  Print unreachable warning if
948         necessary.
949         * statement.cs (Block.Resolve): Don't print unreachable warning on
950         a labeled statement.
952 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
954         * driver.cs: Pass filename without path to AssemblyBuilder's
955         AddResourceFile. Fixes bug #78407.
957 2006-05-17  Raja R Harinath  <rharinath@novell.com>
959         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
960         * flowanalysis.cs (FlowBranchingLabeled): ... here.
961         (FlowBranching.MergeChild): Overwrite
962         reachability information from Labeled branchings too.
964 2006-05-16  Raja R Harinath  <rharinath@novell.com>
966         * statement.cs (Goto.Resolve): Merge jump origins here ...
967         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
969         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
970         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
971         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
972         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
973         here, ...
974         * statement.cs (Goto.Resolve): ... not here.
975         (Goto.Emit): Remove CS1632 check.
977 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
979         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
980         error message.
982 2006-05-11  Raja R Harinath  <rharinath@novell.com>
984         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
985         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
986         (FlowBranchingException.Label): Likewise.
988         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
989         given value.
990         (MyBitVector.Or): Use it to avoid losing information (Count).
991         (FlowBranching.MergeOrigins): Likewise.
993         * flowanalysis.cs (UsageVector.IsDirty): Remove.
994         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
995         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
996         (UsageVector.ToString): Simplify.
997         (UsageVector.MergeSiblings): Move here from ...
998         (FlowBranching.Merge): ... here.
999         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1000         not a MyBitVector.
1002 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1004         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1005         null bitvector is treated as all-true.
1007         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1008         (MyBitVector): Rationalize invariants.  'vector != null' implies
1009         that we have our own copy of the bitvector.  Otherwise,
1010         'InheritsFrom == null' implies all inherited bits are true.
1012 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1014         * statement.cs (LocalInfo): Add IsConstant.
1015         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1016         local variable for constants.
1018 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1020         * flowanalysis.cs (MyBitVector.Empty): New.
1021         (MyBitVector): Don't allow InheritedFrom to be null.
1022         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1023         (UsageVector, FlowBranching): Update to changes.
1025         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1026         recursion.  The 'Parent == null' condition isn't sufficient for
1027         anonymous methods.
1028         (FlowBranching.AddBreakOrigin): Likewise.
1029         (FlowBranching.AddContinueOrigin): Likewise.
1030         (FlowBranching.AddReturnOrigin): Likewise.
1031         (FlowBranching.StealFinallyClauses): Likewise.
1032         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1033         (FlowBranching.CheckOutParameters): Likewise.
1034         (FlowBranchingToplevel): Terminate all the above recursions here.
1035         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1036         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1038         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1039         toplevel block.
1040         (FlowBranchingToplevel): New.  Empty for now.
1041         (FlowBranching.MergeTopBlock): Update.
1042         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1043         branching for the anonymous delegate.
1044         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1046         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1047         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1048         information at the start of the merge.  Reorganize.
1050 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1052         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1054 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1056         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1057         to newly introduced ctor.
1059         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1060         message to one place.
1061         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1062         global namespace.
1064 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1066         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1068         * ecore.cs (Expression.ResolveAsConstant): Updated.
1070         * statement.cs (ResolveMeta): Updated.
1072 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1074         * cs-parser.jay: __arglist cannot be used in initializer.
1076 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1078         A fix for #77879
1079         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1080         private types.
1082 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1084         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1085         (LabeledStatement): Add 'name' parameter.
1086         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1087         (Block.AddLabel): Update to changes.
1088         * cs-parser.jay (labeled_statement): Likewise.
1090         * flowanalysis.cs (BranchingType.Labeled): New.
1091         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1092         (FlowBranchingLabeled): New.  Does nothing for now, but will
1093         eventually handle 'goto' flows.
1094         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1095         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1096         that's terminated ...
1097         (Block.Resolve): ... here.
1099         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1100         (UsageVector.MergeFinallyOrigins): Likewise.
1101         (FlowBranching.InTryOrCatch): Likewise.
1102         (FlowBranching.AddFinallyVector): Likewise.
1103         (FlowBranchingException): Update to changes.
1105         Fix #78290
1106         * statement.cs (Return.Resolve): Move error checking to ...
1107         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1108         (FlowBranchingException): Handle return origins like break and
1109         continue origins.
1110         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1112 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1114         A fix for #76122
1115         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1116         filter.
1118 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1120         A fix for #77543
1121         * class.cs (MethodData.Define): Do public accessor check only when method
1122         implements an interface.
1124 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1126         Remove special handling of 'break'
1127         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1128         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1129         (UsageVector.Break): Remove.
1130         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1131         reachability.
1132         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1134         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1135         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1137 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1139         A fix for #75726
1140         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1141         be the interface member.
1143 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1145         A fix for #60069
1146         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1147         for emitting small (int) values.
1149 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1151         Fix #59427
1152         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1153         control-flow passes through the 'finally' after merging-in all the
1154         control-flows from 'try' and the 'catch' clauses.
1156         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1157         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1158         always true at the only non-recursive entry point.
1159         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1160         FlowBranchingBreakable.
1161         (FlowBranchingLoop): Remove.
1162         * statement.cs (Return.DoResolve): Update to changes.
1164         Fix #76471, #76665
1165         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1166         (FlowBranching.CreateBranching): Handle it: create a
1167         FlowBranchingContinuable.
1168         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1169         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1170         except that it handles the 'continue' command.
1171         (FlowBranching.UsageVector.MergeOrigins): Rename from
1172         MergeBreakOrigins.
1173         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1174         except that it overrides AddContinueOrigin.
1175         (FlowBranchingException): Override AddContinueOrigin, similar to
1176         AddBreakOrigin.
1177         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1178         Create a new branching around the embedded statement.
1179         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1180         control flow after the embedded statement.
1181         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1183         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1184         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1185         FlowBranchingBreakable.
1186         (FlowBranchingSwitch): Remove.
1188         Fix test-503.cs
1189         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1190         error reporting to ...
1191         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1192         Rename from 'AddBreakVector'.  Add new location argument.  Return
1193         a bool indicating whether the 'break' crosses an unwind-protect.
1194         (FlowBranchingException.AddBreakOrigin): Add.
1195         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1196         flowbranching after updating with the effects of the 'finally'
1197         clause.
1198         (FlowBranchingBreakable): New common base class for
1199         FlowBranchingLoop and FlowBranchingSwitch.
1201         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1202         embedded statement.
1203         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1205 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1207         * statement.cs (Do.Resolve): If the loop is infinite, set the
1208         barrier.
1209         (While.Resolve, For.Resolve): Set a barrier after the embedded
1210         statement.  There's no direct control flow that goes from the end
1211         of the embedded statement to the end of the loop.
1212         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1213         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1214         above ensure that the reachability is correctly computed.
1216         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1217         (UsageVector.MergeBreakOrigins): If the current path is
1218         unreachable, treat it as if all parameters/locals are initialized.
1219         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1220         infinite loops before merging-in break origins.
1222         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1223         (Reachability.Reachable): Split part into ...
1224         (Reachability.Unreachable): ... this.  Simplify.
1225         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1227         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1228         (Reachability.SetThrowsSometimes): Likewise.
1229         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1230         TriState.Always, use corresponding property.
1231         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1232         (Block.Resolve): Likewise.  Remove some redundant checks.
1234 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1236         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1237         (Reachability.Meet): Don't bother checking AlwaysThrows --
1238         barrier is always set.
1239         (FlowBranchingBlock.Merge): Likewise.
1241 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1243         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1244         defined, so it's references should also compile only for NET_2_0
1245         (as occurs in mcs version)
1247 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1249         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1250         checks for unreachable.
1252 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1254         A fix for #77980
1255         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1257         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1258         whether field is really assigned.
1260 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1262         * flowanalysis.cs (Reachability): Make 4-argument constructor
1263         private.
1264         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1265         (Reachability.Always): Rename from the highly misleading
1266         'Reachability.Never'.
1267         (FlowBranching.Merge): Update to changes.  Mark an impossible
1268         situation with a 'throw'.
1269         (*): Update to changes.
1271 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1273         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1274         Remove 'Undefined'.
1275         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1276         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1277         (*): Update to changes.
1278         * statement.cs: Update to changes.
1280 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1282         A fix for #78049
1283         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1285 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1287         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1288         dummy UsageVector.
1290         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1291         argument to two arguments: an usage-vector and a bool.  Move call
1292         to FlowBranching.Merge () ...
1293         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1295         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1296         handling of loop and switch reachability to ...
1297         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1299 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1301         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1302         handling to FlowBranchingLoop.InLoop.
1303         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1305 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1307         A fix for #78115
1308         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1309         anonymous method is allowed from AnonymousContainer here.
1311         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1313 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1315         Fix #78156
1316         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1318 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1320         A fix for #49011.
1321         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1322         (DoubleConstant.Reduce): Ditto.
1324 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1326         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1327         Remove 'lvalue_right_side' argument.  Move parts to ...
1328         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1329         (LocalVariable.DoResolveLValue): ... these.
1331 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1333         Fix cs1655.cs
1334         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1335         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1336         (LocalVariableReference.DoResolveBase): Use it to implement new
1337         CS1655 check.
1338         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1339         (Argument.Resolve): Simplify.  Move CS1510 check ...
1340         * ecore.cs (Expression.ResolveLValue): ... here.
1341         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1342         (PropertyExpr.DoResolveLValue): Likewise.
1343         (FieldExpr.Report_AssignToReadonly): Likewise.
1344         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1345         LValueMemberAccess or LValueMemberOutAccess on instance depending
1346         on it.
1347         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1348         DoResolve as appropriate.
1350 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1352         Fix #75800
1353         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1354         implicit conversions on 'out' and 'ref' arguments.
1356         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1357         improve clarity.  Remove dead code.
1359         Fix #66031
1360         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1361         (Catch.Resolve): Resolve VarBlock if it exists.
1363 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1365         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1366         twice, this was some residual code, the enumerator was emitted
1367         properly in the two branche of if later.
1369         Fixes #78031
1370         
1371         Thanks to Martin for finding the source of the problem
1372         
1373 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1375         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1376         cast is never an lvalue.
1377         (Cast.DoResolve, Cast.ResolveRest): Combine.
1378         (Argument.Emit): Simplify slightly.  Move 'Expr is
1379         IMemoryLocation' check ...
1380         (Argument.Resolve): ... here.
1381         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1383         Simplifications.  Fix cs0191-2.cs
1384         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1385         CS1649 and CS1651 to ...
1386         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1387         the actual selection of the error code and message to a lookup
1388         table.  Add a dummy return value to simplify callsites.
1389         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1390         readonly fields of other instances of the same type.  Move CS0197
1391         warning from ...
1392         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1393         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1394         resolution of an out or ref argument.  The code simplification
1395         above uses this invariant.
1397 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1399         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1400         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1401         CheckMarshallByRefAccess.  Drop parameter.
1402         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1403         warning.
1404         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1405         InstanceExpression.
1406         * report.cs (AllWarnings): Add CS1690.
1407         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1408         for ref access too.
1409         (LocalVariableReference.DoResolveBase): Update.
1411 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1413         * class.cs (MethodOrOperator): Moved common parts from method class.
1414         detect obsolete attributes.
1415         (Method.Define): Simplified as it reuses code from base.
1416         (Constructor.ValidAttributeTargets): Fixed issue found during
1417         refactoring.
1418         (Destructor.ValidAttributeTargets): Fixed issue found during
1419         refactoring.
1420         (Operator): Finished refactoring set off by #78020. Operator class is now
1421         ordinary method class.
1423         * anonymous.cs: Updated.
1425 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1427         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1429 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1431         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1432         detect obsolete attributes.
1433         (Method.CreateEmitContext): Moved to MethodOrOperator.
1435 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1437         A fix for #78048.
1438         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1439         customized exception to make crash detection easier.
1440         (MethodOrOperator): Started to work on new base class for methods and
1441         operators.
1442         (Method): Derives from MethodOrOperator.
1443         (Constructor.Emit): Emits its own attributes.
1444         (AbstractPropertyEventMethod.Emit): Ditto.
1445         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1446         patch.
1447         (Operator.Emit): It's temporary more tricky than should be.
1448         
1449         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1451         * report.cs (InternalErrorException): Add ctor with inner exception.
1453 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1455         A fix for #76744.
1456         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1457         only not visible.
1459 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1461         A fix for #77916.
1462         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1463         array.
1465 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1467         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1468         attribute is present and Guid not.
1469         (Interface.ApplyAttributeBuilder): Ditto.
1471         * attribute.cs: Add error message.
1473 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1475         A fix for #78020.
1477         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1478         sources (it's composite) so hold them in extra array as they are used in
1479         Emit phase only. It worked in the previous versions by mistake.
1480         (Attribute.Emit): Emit attribute for more owners when exist.
1482         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1483         it has now different behaviour.
1485 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1487         * constant.cs (Constant.IsDefaultInitializer): New method.
1489         * class.cs: Updated.
1491         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1492         re-initialize default values. It saves KBs almost for every assembly.
1493         Thanks Zoltan for the idea.
1494         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1495         (ArrayCreation.DoResolve): Resolve only once.
1496         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1497         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1499 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1501         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1502         From #77961.
1504 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1506         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1507         in an embedded statement too.
1509 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1511         Fix #77929
1512         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1513         testing.
1515         Fix #77958
1516         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1518         Fix #77962
1519         * report.cs (SymbolRelatedToPreviousError): Drop generic type
1520         arguments before checking whether a type is reflected or not.
1522         Fix #77954
1523         * expression.cs (Invocation.IsApplicable): Ensure a generic method
1524         definition doesn't take part in overload resolution.
1525         (Invocation.IsParamsMethodApplicable): Likewise.
1526         (Invocation.OverloadResolve): When replacing a reflected override
1527         method with its base definition, ensure that type arguments are
1528         applied.
1530 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1532         A fix for #77966.
1534         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1535         was not specified.
1537         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1539 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1541         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1542         phase.
1544         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1545         LocalTemporary change.
1547         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1548         TypeContainer.
1549         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1550         initializers optimization.
1551         (ClassOrStruct.TypeAttr): Moved from modifiers.
1552         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1553         (FieldBase.ResolveInitializer): Resolves initializer.
1554         (FieldBase.HasDefaultInitializer): New property.
1556         * cs-parser.jay: Removed message.
1558         * expression.cs (CompilerGeneratedThis): New specialization.
1560         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1562 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1564         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1566 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1568         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1569         be now EnumConstants only.
1571 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1573         * attribute.cs, driver.cs: Reset more caches.
1575 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1577         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1579 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1581         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1582         for easier reuse. Updated all overrides.
1583         (IntegralConstant): New base class for all integral constants.
1584         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1585         of the constant range, report custom error.
1586         (UIntConstant.Reduce): Fixed uint conversion.
1588         * ecore.cs, literal.cs: Reduce updates.
1590 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1592         A fix for #75813.
1594         * class.cs (Constructor.Define): Removed extra if for default ctors.
1595         A patch from Atsushi Enomoto.
1597 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1599         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1600         GetAttributableValue.
1602         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1603         when required.
1605         * convert.cs (ImplicitConversionRequired): Error message moved to
1606         DoubleLiteral.
1608         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1609         automatic implicit conversion of an output value.
1610         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1612         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1613         conversion.
1614         (TypeOf.GetAttributableValue): Add extra handling for object type.
1616         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1617         special error message.
1619 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1621         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1622         InternalCall.
1623         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1624         compatible with MS runtime.
1626 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1628         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1629         attribute arguments here.
1631         * class.cs (Indexer.Define): The check was moved to attribute class.
1633 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1635         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1637 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1639         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1641         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1642         the blocks too.
1644 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1646         * doc-bootstrap.cs : fix build.
1648 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1650         * expression.cs (StringConcat.Append): Issue a warning when empty string
1651         is going to append.
1653 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1655         * assign.cs (CompoundAssign.ResolveSource): Removed.
1657         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1658         clean up.
1660         * class.cs (TypeContainer.FindMethods): Removed.
1661         (TypeContainer.CheckMemberUsage): Made static.
1663         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1665         * constant.cs (CheckRange): Removed unused type argument.
1666         (CheckUnsigned): Removed unused type argument.
1668         * cs-parser.jay: Updated after MemberAccess clean up.
1669         Uses Length for empty string test.
1671         * cs-tokenizer.cs: Uses Length for empty string test.
1672         (IsCastToken): Made static.
1673         (is_hex): Made static.
1674         (real_type_suffix): Made static.
1676         * decl.cs (SetupCache): Made static.
1677         (OnGenerateDocComment): Removed unused ds argument.
1679         * delegate.cs (VerifyDelegate): Removed unused argument.
1681         * doc.cs: Uses Length for empty string test.
1683         * driver.cs: Uses Length for empty string test.
1685         * enum.cs (IsValidEnumType): Made static
1687         * expression.cs (EnumLiftUp): Removed unused argument.
1688         (ResolveMethodGroup): Ditto.
1689         (BetterConversion): Ditto.
1690         (GetVarargsTypes): Ditto.
1691         (UpdateIndices): Ditto.
1692         (ValidateInitializers): Ditto.
1693         (MemberAccess.ctor): Ditto.
1694         (GetIndexersForType): Ditto.
1696         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1698         * iterators.cs: Updated after MemberAccess clean up.
1700         * location.cs: Uses Length for empty string test.
1702         * namespace.cs: Uses Length for empty string test.
1704          * report.cs (CheckWarningCode): Made static.
1706         * statement.cs (LabeledStatement): Removed unused argument.
1708         * typemanager.cs (FilterNone): Removed.
1710 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1712         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1713         obsolete.
1715         * class.cs: Updated.
1717 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1719         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1721 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1723         A fix for #77816.
1725         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1726         host container.
1727         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1728         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1729         Add more error reporting; Fixed issue with params.
1731         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1733         * cs-parser.jay: AnonymousMethod requires host container.
1735         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1737 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1739         * class.cs: Change 'TypeContainer ds' constructor argument to
1740         'DeclSpace parent'.  Some classes were missed below due to
1741         different naming convention.
1743         * class.cs (MemberCore.Parent): Delete.  This makes the
1744         ParentContainer changes below enforceable by the compiler.
1746         Treat pointers to enclosing declaration space as 'DeclSpace', not
1747         'TypeContainer'.
1748         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1749         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1751         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1752         of TypeContainer.
1753         (Block.AddThisVariable): Likewise.
1754         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1755         (AbstractPropertyEventMethod.Emit): Likewise.
1756         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1757         (GetMethod.Define, SetMethod.Define): Likewise.
1758         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1759         (DelegateMethod.EmitMethod): Likewise.
1761         Fix regression test-partial-13.cs.
1762         Rationalize use of PartialContainer.  Ensure that the partial
1763         class semantics can be tied to type-correctness, i.e., any
1764         violation will cause a compile error.
1765         * class.cs, const.cs: Access all fields that belong to class
1766         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1767         Resolve()-like functions still use 'Parent'.
1769         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1770         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1771         (PropertyMethod.CheckModifiers): Remove unused argument.
1772         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1773         DeclSpace.
1775 2006-03-28  Raja R Harinath  <rharinath@novell.com>
1777         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1779 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1781         Make semantics of PartialContainer simpler.
1782         * decl.cs (DeclSpace.IsPartial): Remove.
1783         * class.cs (TypeContainer.IsPartial): Likewise.
1784         (TypeContainer..ctor): Set PartialContainer to point to self.
1785         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1786         (TypeContainer.FindNestedType): Likewise.
1787         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1789 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1791         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1793 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1795         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1796         classes.
1798 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1800         * class.cs (Operator.Define): An error for base conversion was not
1801         reported correctly.
1803 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1805         A fix for #77593, #77574.
1807         * class.cs (MethodCore.CheckBase): Another if for operator.
1809 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1811         A fix for #77822.
1813         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1814         reporting, it's more tricky than I thought.
1816 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1818         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1819         were not resolved
1821         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1822         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1823         conversion test.
1824         
1825         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1826         not needed.
1828 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1830         A fix for #77353.
1832         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1833         (Event.Define): ditto
1834         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1836         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1837         Removed redundant code and set NewSlot for Invoke method too.
1839         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1840         (Parameters.MergeGenerated): New method. Use this method when you merge
1841         compiler generated argument with user arguments.
1843 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1845         * attribute.cs (ResolveAsTypeTerminal): Removed.
1847         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1848         specialization for predefined types; 30% speed up.
1849         Finally placed obsolete check to right place.
1850         (Expression.ResolveType): Removed.
1852         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1853         Updated after ResolveType was removed.
1855         * expression.cs (Cast.ctor): Check void cast.
1856         (Binary.ResolveAsTypeTerminal): Is never type.
1857         (Conditional.ResolveAsTypeTerminal): Is never type.
1859         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1861 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1863         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1865 2006-03-23  Martin Baulig  <martin@ximian.com>
1867         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1868         type check if either of the types is an open generic type.
1870 2006-03-23  Martin Baulig  <martin@ximian.com>
1872         * convert.cs
1873         (Convert.ExplicitTypeParameterConversion): New method; implement
1874         explicit type parameter conversions.
1876 2006-03-23  Martin Baulig  <martin@ximian.com>
1878         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1879         blindly allow all conversions if we do not have any constraints.
1881 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1883         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1884         these two separated members to simplify the code.
1885         (Attribute.Resolve): Refactored to use new fields and methods.
1886         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1887         implemented obsolete attribute checking.
1888         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1889         implemented obsolete checking again. It look line never ending quest ;-)
1890         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1892         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1894         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1896         *class.cs (Property.Define): Add RegisterProperty call.
1898         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1899         argument groups (only 2).
1901         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1902         encoding expression to arguments.
1903         (Expression.ExprClassToResolveFlags): Just turned to property.
1905         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1906         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1907         optimized as well as implemented support for zero-length attributes.
1909         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1910         Add caching of PropertyInfo's.
1912 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1914         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1915         error multiple times.
1917 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1919         New partial class implementation.
1920         A fix for #77027, #77029, #77403
1922         * attribute.cs (Attributable): Made attributes protected.
1924         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1925         the replacements of ClassPart and PartialContainer.
1926         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1927         (TypeContainer.AddInterface): Ditto.
1928         (TypeContainer.AddPartial): The main method for partial classes. It checks
1929         for errors and merges ModFlags and attributes. At the end class is added to
1930         partial_parts list.
1931         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1932         required here.
1933         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1934         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1935         from the rest of partial classes.
1936         (TypeContainer.GetClassBases): Simplified.
1937         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1938         DefineType.
1939         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1940         (TypeContainer.HasExplicitLayout): Uses Flags now.
1941         (PartialContainer): Removed.
1942         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1943         (StaticClass): Was merged with Class.
1944         (Class.GetClassBases): class and static class bases are verified here.
1945         (Class.TypeAttr): Added static attributes when class is static.
1946         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1947         (MemberBase): In some cases we need to call parent container for partial
1948         class. It should be eliminated but it's not easy now.
1950         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1952         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1953         partial classed to accumulate class comments.
1954         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1956         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1958         * driver.cs (MainDriver): Tree.GetDecl was removed.
1960         * modifiers.cs (Modifiers): Add partial modifier.
1962         * tree.cs (Tree.decl): Removed.
1963         (RootTypes): Started to use this class more often for root types
1964         specializations.
1966 2006-03-23  Raja R Harinath  <rharinath@novell.com>
1968         * generic.cs (TypeParameter.UpdateConstraints): Update
1969         'constraints' if null.
1971 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1973         A fix for #77615
1975         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1976         external interface does not have an attribute.
1978 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1980         Another prerequisites for new partial classs implementation.
1981         
1982         * attribute.cs (Attribute.Equal): Implemented.
1983         (Attribute.Emit): Changed as attributes can be applied more than twice.
1984         (Attributes.Emit): Check for duplicate attributes here.
1986         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1987         as a parameter, clean-up.
1989 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1991         A fix for #77485
1993         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1994         contains obsolete attribute check which can in some cases look for base
1995         type of current class which is not initialized yet.
1996         (TypeContainer.BaseType): Replacement of ptype.
1998         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2000 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2002         First of prerequisites for new partial classs implemention.
2003         
2004         * attribute.cs (Attributable): Extended by ResolveContext;
2005         Attributes finally have correct context for resolving in all cases.
2006         (AttachTo): Attribute owner is assigned here.
2008         * codegen.cs (IResolveContext): Introduce new interface to hold
2009         all information needed in resolving phase.
2010         (EmitContext): Implements IResolveContext; more clean-up needed here.
2011         
2012         * decl.cs (MemberCore): Implemented IResolveContext.
2014         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2015         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2016         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2017         Refactored to use new IResolveContext instead of EmitContext; cleanup
2019 2006-03-22  Raja R Harinath  <rharinath@novell.com>
2021         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
2022         mcs to keep code differences small.
2023         * attribute.cs (Attribute.GetParameterDefaultValue): New.
2024         * typemanager.cs (parameter_default_value_attribute_type): New.
2025         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
2026         CS1908 check.
2028 2006-03-22  Martin Baulig  <martin@ximian.com>
2030         * generic.cs
2031         (Nullable.NullableLiteral): Derive from `NullLiteral'.
2033         * convert.cs
2034         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
2035         instead of the normal `NullLiteral'.
2037 2006-03-21  Martin Baulig  <martin@ximian.com>
2039         Fix #77583.
2040         * generic.cs (TypeManager.InferType): If `pt' is a generic
2041         parameter, don't check whether `pt == at'.
2043 2006-03-20  Raja R Harinath  <rharinath@novell.com>
2045         Fix #77852
2046         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
2047         (TypeParameter.Resolve): Update to change.
2048         (ConstraintChecker.CheckConstraints): Resolve type-argument
2049         constraints before use.
2051 2006-03-16  Martin Baulig  <martin@ximian.com>
2053         * generic.cs
2054         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
2055         and don't have any instance constructors, also lookup in the base class.
2056         (TypeManager.IsNullableValueType): New public method.
2058         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
2059         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
2060         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2062         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2063         instead of just TypeManager.IsNullableType() to determine whether
2064         a lifted operator exists.
2065         (UnaryMutator.DoResolve): Likewise.
2066         (Conditional.DoResolve): Likewise.
2067         (Binary.DoResolve): A lifted operator only exists if both operands
2068         are valuetypes and at least one of them is a nullable type.
2070 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2072         * iterator.cs : yield break is allowed in try statement which has
2073           catch clauses. Fixed bug #77767.
2075 2006-03-12  Martin Baulig  <martin@ximian.com>
2077         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2078         private IsSignatureEqual() to compare types; see the comment in
2079         that method; fixes #77674.
2081 2006-03-10  Raja R Harinath  <rharinath@novell.com>
2083         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2084         (Expression.ResolveAsTypeTerminal): Likewise.
2085         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2086         * expression.cs, generic.cs, iterators.cs: Likewise.
2087         * parameter.cs, statement.cs, typemanager.cs: Likewise.
2089 2006-03-09  Martin Baulig  <martin@ximian.com>
2091         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2092         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2094 2006-03-09  Martin Baulig  <martin@ximian.com>
2096         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2097         `prepared' flag is set.
2099         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2100         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2101         issues; see gtest-254.cs.
2103 2006-03-07  Martin Baulig  <martin@ximian.com>
2105         * generic.cs (TypeManager.InferType): Allow infering
2106         `IEnumerable<T>' with an array of T; see gtest-251.cs.
2108 2006-03-06  Martin Baulig  <martin@ximian.com>
2110         * generic.cs
2111         (TypeManager.InferType): Fix gtest-250.cs.
2113         * typemanager.cs
2114         (TypeManager.IsSubclassOf): Also check the base class.
2116         * expression.cs
2117         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2118         fixes gtest-249.cs.
2120 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2122         Fix #77679.
2123         * expression.cs (ParameterReference.DoResolveBase): Change return
2124         type to bool.
2125         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2126         Update.
2128         Fix #77628.
2129         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2131         Fix #77642.
2132         * typemanager.cs (GetFullNameSignature): Don't nullref on
2133         protected accessors.
2135 2006-02-16  Martin Baulig  <martin@ximian.com>
2137         * generic.cs
2138         (TypeManager.GetGenericFieldDefinition): New public method; use it
2139         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2141 2006-02-14  Martin Baulig  <martin@ximian.com>
2143         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2145 2006-02-14  Martin Baulig  <martin@ximian.com>
2147         * generic.cs
2148         (TypeManager.DropGenericMethodArguments): New public method; don't
2149         use GetGenericMethodDefinition() on something which is not a
2150         generic method.
2152 2006-02-14  Martin Baulig  <martin@ximian.com>
2154         * generic.cs
2155         (ConstraintChecker.CheckConstraints): If a type parameter has the
2156         `struct' constraint, the type must be a non-nullable valuetype.
2158 2006-02-10  Martin Baulig  <martin@ximian.com>
2160         * typemanager.cs
2161         (TypeManager.IsOverride): Make this work for instantiated methods
2162         in a generic class; fixes #77509.
2163         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2164         rather than calling it directly; fixes #77488.  
2166 2006-02-08  Martin Baulig  <martin@ximian.com>
2168         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2169         reporting into CheckConstraint() so we can use the correctly
2170         instantiated type.
2172 2006-02-08  Martin Baulig  <martin@ximian.com>
2174         * expression.cs (BaseAccess): Add support for generic methods.
2176         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2177         the new MethodGroupExpr.
2179 2006-02-07  Martin Baulig  <martin@ximian.com>
2181         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2182         also reference types; fixes #77483.
2184 2006-02-07  Martin Baulig  <martin@ximian.com>
2186         * generic.cs
2187         (TypeManager.IsGenericMethod): We now return whether something is
2188         an instantiated generic method (and not a generic method def).
2189         (TypeManager.IsGenericMethodDefinition): New public method.
2191         * typemanager.cs
2192         (TypeManager.CSharpSignature): Only include type arguments for
2193         "real" generic methods, not for any instantiated method.
2194         (TypeManager.GetMethodName): Likewise, but also allow generic
2195         method definitions here.
2197 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2199         * codegen.cs (EmitScopeInitFromBlock): check here the
2200         capture_context, there is no need to make two calls to the
2201         EmitContext. 
2203         * anonymous.cs: Add some debugging messages that might help me
2204         track other instances of this problem in the future (the
2205         regression of test 467).
2207         * cs-parser.jay: track the variable block, as we need to initalize
2208         any captured variables declared in this block for the "catch"
2209         portion of the "Try" statement.
2211         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2212         scope initialization for captured variables. 
2214         Also, move the emit for the variables after the block location has
2215         been marked.
2217 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2219        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2220         
2221 2006-02-06  Martin Baulig  <martin@ximian.com>
2223         * class.cs (TypeContainer.DefineType): If we're a struct, pass
2224         `TypeManager.value_type' as parent type to
2225         ModuleBuilder.DefineType().  Fixes #77358.      
2227 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2229         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2230         commit yesterday, the initialization for the roots is necessary.
2231         What is not necessary is the scope activation.
2233 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2235         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2236         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2237         CS0206 checks.
2238         (Argument.Resolve): Remove CS0206 checks.
2240 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2242         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2243         scopes for all the roots, the scopes will now be emitted when the
2244         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2246         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2247         code.  This reduces a lot of existing cruft.
2248         
2249         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2250         that the ScopeInfo is generated as we enter the scope, not at the
2251         time of use, which is what we used to do before.
2253         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2254         every time a Block is about to be emitted if we have a
2255         CaptureContext. 
2257 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2259         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2260         attribute for mscorlib too.
2262         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2263         (Reset): Update.
2264         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2266         * typemanager.cs (cons_param_array_attribute): Make private.
2267         (Reset): Set it to null.
2268         (InitCoreHelpers): Don't initialize it.
2269         (ConsParamArrayAttribute): New.  Initialize it as needed.
2270         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2272 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2274         * expression.cs: There might be errors reported during the
2275         selection of applicable methods.  If there are errors, do not
2276         continue execution as it will lead the compiler to crash.
2278 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2280         * expression.cs: Member access is not allowed on anonymous
2281         methods.  Fixes #77402.
2283 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2285         Fix #77401
2286         * cs-parser.jay (VariableDeclaration): Don't set
2287         current_array_type to null.
2288         (field_declaration, event_declaration, declaration_statement):
2289         Set it to null here.
2291 2006-01-29  Raja R Harinath  <harinath@gmail.com>
2293         Fix part of #77397
2294         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2296 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2298         * typemanager.cs (GenericParameterPosition): New.
2299         * doc.cs: Use it.
2301 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2303         * doc.cs : To process "include" elements, first we should create
2304           another list than XmlNodeList, because it could result in node
2305           removal, which could result in that the XmlNodeList gives up
2306           yielding next node.
2308 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2310         * expression.cs: Introduce an error report that we were not
2311         catching before.   Gonzalo ran into it.
2313 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2315         A fix for bug: #76957
2316         
2317         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2318         ComputeMethodHost before creating the method, this is a new
2319         requirement. 
2321         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2322         that this method references (RegisterScope).  The actual scope
2323         where the method is hosted is computed with the ComputeMethodHost
2324         before we create the method.
2326         Moved the Deepest routine here.
2328         (AnonymousContainer.ComputeMethodHost): New routine used to
2329         compute the proper ScopeInfo that will host the anonymous method.
2331         (ScopeInfo): Deal with multiple roots.  The problem was that we
2332         did not have a unique root where all ScopeInfos could be hanged
2333         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2334         of roots.  
2336         Remove AdjustMethodScope which is now computed at the end.  Remove
2337         LinkScope which did a partial link, instead link all ScopeInfos
2338         before code generation from the new "LinkScopes" routine. 
2340         Simplify all the Add* routines as they no longer need to maintain
2341         the tree, they just need to record that they are using variables
2342         from a ScopeInfo.
2344         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2345         routines to produce the forest of ScopeInfo trees.
2347         * class.cs (TypeContainer.AppendMethod): This is just like
2348         AddMethod, but ensures that an interface implementation method
2349         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2350         methods, but at the end.
2352         We use this functionality to ensure that the generated MoveNext
2353         method in the iterator class is resolved/emitted before the
2354         enumerator methods created.   
2356         This is required because the MoveNext method computes the right
2357         ScopeInfo for the method.  And the other methods will eventually
2358         need to resolve and fetch information computed from the anonymous
2359         method. 
2361         
2362 2006-01-23  Raja R Harinath  <rharinath@novell.com>
2364         Improve implementation of section 14.4.2.2 (Better function member).
2365         * expression.cs (Invocation.MoreSpecific): Compare all type
2366         arguments before deciding if one type is more specific than
2367         another.  Handle array types too.  Return the more specific type.
2368         (Invocation.BetterFunction): Add more tie-breaking rules from
2369         section 14.4.2.2.  Perform "more specific" check after
2370         other tie-breaking rules.  Compare all parameter types before
2371         choosing the "more specific" method.
2373 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2374             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2376         Fix rest of #76995.
2377         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2378         the 'aliases' hash.
2379         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2380         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2382 2006-01-18  Martin Baulig  <martin@ximian.com>
2384         * class.cs (TypeContainer.AddToMemberContainer): Use
2385         `symbol.MemberName.MethodName' instead of just `symbol.Name';
2386         fixes #77124.
2388 2006-01-18  Martin Baulig  <martin@ximian.com>
2390         Fix #76417: a generic class may now have methods which may unify
2391         for some type parameter substitutions.
2393         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2394         for methods which may unify anymore.
2396         * expression.cs (Invocation.MoreSpecific): New private static
2397         method; checks whether one method is more specific than another
2398         according to 14.4.2.2 of the spec.
2399         (Invocation.BetterFunction): Implement the tie-breaking rules from
2400         14.4.2.2 of the spec: if two methods unify for some type parameter
2401         substitution, we need to pick the more specific one.
2403 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2405         Fix #76656, cs0231-2.cs.
2406         * cs-parser.jay (formal_parameter_list): Make error case catch
2407         more issues.
2408         (parenthesized_expression_0): Add CS1026 check.
2409         (invocation_expression): Remove unused { $$ = lexer.Location }.
2411 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2413         Fix #76824.
2414         * cs-parser.jay (statement_expression): Don't list out the
2415         individual statement-expressions.  Convert syntax error into
2416         CS0201 check.
2418 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2420         Fix #76874.
2421         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2422         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2423         CheckIntermediateModification.
2424         (FieldExpr.DoResolve): Add new two-argument version that
2425         allows us to resolve the InstanceExpression as an lvalue.
2426         The one-argument variant is now just a wrapper.
2427         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2428         Resolve the lhs as an lvalue if the it has a value type.
2429         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2430         from Assign.DoResolve.
2431         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2432         resolved as an lvalue.
2433         (PropertyExpr.DoResolve): Update.
2434         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2435         has a value type.  Move CS1612 check here from
2436         CheckIntermediateModification.
2437         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2438         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2439         'right_side' of a ResolveLValue on an 'out' argument.
2440         (EmptyExpression.LValueMemberAccess): New.  Used as the
2441         'right_side' of a propagated ResolveLValue on a value type.
2442         (LocalVariableReference.DoResolveBase): Recognize
2443         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2444         Add CS1654 check.
2445         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2446         EmptyExpression.Null.
2448 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2450         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2451           Type.IsGenericParameter(). Fixed bug #77183.
2452         * doc.cs : it is now identical to doc.cs in mcs.
2454 2006-01-16  Martin Baulig  <martin@ximian.com>
2456         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2458 2006-01-16  Martin Baulig  <martin@ximian.com>
2460         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2461         ctors; fixes #77250.
2463 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2465         This fixes the problem where we used ldfld instead of ldflda to
2466         load the "THIS" pointer on captured parameters, when THIS is a
2467         value type.  See bug #77205.
2468         
2469         * iterators.cs (CapturedThisReference.Emit): Pass false to
2470         EmitThis (we do not need the address).
2472         * codegen.cs (EmitThis): it needs to know whether we need the
2473         address of `this' or not.  This is used by value types.  
2475         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2476         every other call passes false.
2478 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2480         Fix #77221.
2481         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2482         GetOverride.
2483         * expression.cs (Invocation.OverloadResolve): Update.
2484         (Invocation.DoResolve): Avoid double resolution of invocation.
2486 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2488         Fix #77180.
2489         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2490         unary negation of floating point types as 0-expr; negation cannot
2491         overflow in floating point types.
2493         Fix #77204.
2494         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2495         on operands of 'void' type.
2497         Fix #77200.
2498         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2499         and ExclusiveOr for boolean constants too.
2501 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2503         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2505 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2507         * cs-tokenizer.cs (Position): New class used to save and restore
2508         the position state in the tokenizer.  Before this patch the save
2509         and restore was not complete enough so the line and columns would
2510         start to drift and the debugger and stack traces will get the
2511         wrong data.
2513 2006-01-10  Martin Baulig  <martin@ximian.com>
2515         * generic.cs
2516         (TypeParameter.InflateConstraints): New public method.
2518         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2519         constraints; fixes #77042.
2521 2006-01-10  Martin Baulig  <martin@ximian.com>
2523         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2524         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2525         #77061. 
2527 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2529         Fix #75636.
2530         * expression.cs (Invocation.OverloadResolve): Replace reflected
2531         override methods with their base virtual methods, rather than
2532         skipping over them.
2533         * typemanager.cs (TypeManager.GetOverride): New.
2535 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2537         * driver.cs: Report the case of no source files and no -out:
2538         argument provided.
2540 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2542         Fix #77035.
2543         * expression.cs (ComposedCast.GetSignatureForError): Define.
2545 2006-01-05  Jb Evain  <jbevain@gmail.com>
2547         * class.cs (Property.Define, Indexer.Define): do not tag the
2548         properties as SpecialName | RTSpecialName.
2550 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2552         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2553         doing a low-level comparission of parameter types.  It was lacking
2554         a check for __argslist. 
2556 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2558         * expression.cs (ParameterReference.DoResolveBase): Allow
2559         reference parameters if they are local to this block. 
2561         This allows the ref and out parameters of a delegate to be used in
2562         an anonymous method, for example:
2564         delegate void set (out int x);
2566         set s = delegate (out int x){
2567                 x = 0;
2568         };
2570         This is used by functionality introduced late in the C# language.
2571         
2572         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2573         method that take ref and out parameters. 
2575         Fixes #77119 which was a late change in the spec.
2577 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2579         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2580         parent if its the same scope.  Fixes #77060.
2582 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
2584         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2586 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2588         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2589         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
2590         that doesn't contain the full public key. This is a update of the
2591         friend assemblies in .Net 2.0 release.
2592         
2593 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2595         Fix #76995
2597         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2598         ListDictionary, to contain the ExternAliasEntry entries (in
2599         addition to the NamespaceEntry.aliases hashtable). This field is
2600         shared between the original entry and its doppelganger (bodyless 
2601         copy of it).
2602         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2603         extern_aliases field.
2604         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2605         lookup in extern_aliases.
2607 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2609         Fix #77006.
2610         * class.cs (TypeContainer.Mark_HasEquals): New.
2611         (TypeContainer.Mark_HasGetHashCode): New.
2612         (ClassPart): Override them.
2613         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2615         * generic.cs (GenericMethod.DefineMembers): Update to changes.
2616         (TypeParameter.TypeParameter): Change type of 'parent' argument to
2617         DeclSpace.
2619         Fix #77008.
2620         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2621         'parent' argument to the base constructor.
2623         Remove all mention of TypeContainer from decl.cs.
2624         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2625         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2626         (DeclSpace.DeclSpace): Likewise.
2627         (DeclSpace.DefineMembers): Remove unused argument.
2628         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2629         debugging check -- we don't care if the debug code throws an
2630         InvalidCastException instead of an InternalErrorException.
2631         * class.cs (TypeContainer.DefineMembers): Update to changes.
2632         (TypeContainer.DoDefineMembers): Likewise.
2633         (TypeContainer.GetMethods): Likewise.
2634         (PropertyMember.Define): Likewise.
2635         (MemberBase.Parent): New property that forwards to
2636         MemberCore.Parent, but ensures that we get a TypeContainer.
2637         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2638         (RootContext.PopulateTypes): Likewise.  Remove special case code
2639         for !RootContext.StdLib: DefineMembers is idempotent.
2641 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2643         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2645 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2647         * doc.cs : The search for referenced namespace was insufficient to
2648           get global one as it used to do. Fixed bug #76965.
2650 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2652         * doc.cs : check name in cref in the last phase that whether it is
2653           namespace or not.
2655 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2657         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2658           Mono.C5.
2660 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2662         * doc.cs : so it turned out that we cannot skip override check for 
2663           interface members. Fixed bug #76954.
2665 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2667         * cs-tokenizer.cs : fixed bug #75984:
2668           - #warning and #error should not be handled when the source line
2669             is disabled.
2670           - #line is not checked strictly when the source line is disabled.
2671           - #define and #undef is on the other hand checked strictly at any
2672             state.
2674 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2676         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2677           CS1027 report.
2679 2005-12-15  Raja R Harinath  <rharinath@novell.com>
2681         * generic.cs (TypeManager.IsGeneric): Remove unused method.
2683         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2684         nested types.
2686 2005-12-14  Martin Baulig  <martin@ximian.com>
2688         * typemanager.cs (TypeManager.GetFullName): Make this public;
2689         `Type.Fullname' now never returns null.
2691         * class.cs (Method.Define): Use TypeManager.GetFullName() for
2692         explicit interface implementations; we're now using the same
2693         naming convention than csc does.
2695 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2697         * convert.cs (ExplicitConversionCore): Check the return value from
2698         ExplicitConversionCore which can return null on failure.  Fixes #76914
2700 2005-12-09  Raja R Harinath  <rharinath@novell.com>
2702         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2703         instead of IsGenericInstance.
2704         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
2705         code that's now covered by the more general test.
2706         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2708         * generic.cs (DropGenericTypeArguments): New.  Captures the common
2709         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2710         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2711         * generic.cs, report.cs, typemanager.cs: Likewise.
2713 2005-12-08  Martin Baulig  <martin@ximian.com>
2715         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2717         * typemanager.cs (TypeManager.CSharpSignature): Include type
2718         arguments in the signature of a generic method.
2720 2005-12-07  Martin Baulig  <martin@ximian.com>
2722         Add support for custom attributes on type parameters.
2724         * cs-parser.jay (type_arguments): Added `opt_attributes'.
2726         * generic.cs (TypeParameterName): New public class; we use this
2727         instead of a `string' to store the name of a type parameter, so we
2728         can also have `Attributes'.
2729         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2730         array instead of a `string[]' array.
2731         (TypeParameter.ctor): We now also take an `Attributes' argument.
2732         (TypeParameter.EmitAttributes): New public method; emit our
2733         `OptAttributes' here.
2734         (GenericMethod.EmitAttributes): New public method; emit the custom
2735         attributes on all our type parameters.
2737         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2738         our type parameters.
2739         (MethodData.Define): If we're a generic method, call
2740         EmitAttributes() on it.
2742 2005-12-07  Martin Baulig  <martin@ximian.com>
2744         * generic.cs
2745         (ConstraintChecker): New public abstract class; move the
2746         constraint checking here from `ConstructedType' and also do
2747         constraint checking for generic methods here.
2749         * expression.cs (Invocation.OverloadResolve): Use
2750         ConstraintChecker.CheckConstraints() if we resolved to a generic
2751         method.  Fix #76806.
2753 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2755         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2757         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2758         event initializers.
2759         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2760         (FieldBase.Initializer): Initializer is now optional.
2761         (EventField.Define): Only event field can have initializer.
2763         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2765         * const.cs (Const): Reuse initializer.
2767         * cs-parser.jay: Updated after FieldBase changes.
2768         Added current_array_type to simplify array initializers.
2770         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2772         * expression.cs, iterators.cs: Updated.
2774         * namespace.cs (NamespaceEntry): Made UsingFound private.
2776 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2778         * parameterCollection.cs: Obsolete, removed.
2779         * parser.cs: Obsolete, removed.
2781 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2783         Fix #76849.
2784         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2786         * enum.cs (Enum.Define): Set obsolete context here.
2788 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2790         * doc.cs :
2791           - FindDocumentedMember() now expects 1) paramList as null
2792             when "we don't have to check the number of parameters" and
2793             2) Type.EmptyTypes when "there is no arguments".
2794           - Introduced FoundMember struct to hold the exact type which was
2795             used to find the documented member (the above change broke
2796             test-xml-044; it might be better just to use DeclaringType than
2797             what MS does, like this change does, but it depends on usage.)
2799 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2801         * doc.cs : documented member might be from DeclaringType for nested
2802           types. Fixed bug #76782.
2804 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2806         * anonymous.cs: Have the param code handle leaving copies on the
2807         stack etc. Allows anonymous params to take part in the assignment
2808         code (++, +=, etc). Fixes bug #76550
2810         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2811         it down to the anon code.
2813         * iterators.cs: Use dummy var here
2815         * codegen.cs: Handle new vars
2817 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2819         Fix #76849.
2820         * class.cs (MethodData.Define): Set proper Obsolete context.
2822         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2823         obsolete context.
2824         (FieldExpr.DoResolve): Ditto.
2826 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2828         Fix #76849.
2829         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2830         parent is not obsolete.
2832 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2834         * doc.cs : (FindDocumentedMember) find parameterless members first
2835           and get CS0419 in the early stage. Fixed first case of bug #76727.
2837 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2839         Fix #76859.
2840         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2841         no error was reported.
2843         *expression.cs (Binary.DoResolve): left can be null.
2845 2005-12-06  Raja R Harinath  <rharinath@novell.com>
2847         * class.cs (MethodCore.CheckGenericOverride): Delete unused
2848         abstract method and all overrides.
2849         * support.cs (ParameterData.GenericConstraints): Delete.
2850         (ReflectionParameters.type_params): Delete.
2851         (ReflectionParameters.ReflectionParameters): Make private.
2852         (ReflectionParameters.GetConstaints): New factory method.
2853         * generic.cs (TypeParameterDefineType): Use it.
2854         (TypeManager.GetTypeParameterConstraints): Likewise.
2856 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2858         Fix #76783.
2859         * class.cs (MethodData.Emit): Parameters should be labeled first.
2861 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2863         Fix #76761.
2864         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2866 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2868         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2870         * class.cs (MethodCore): Parameter clean up.
2871         (IMethodData): Added ParameterInfo.
2872         (MethodData): Parameter clean up.
2873         (Indexer.Define): Parameter clean up.
2875         * anonymous.cs,
2876         * codegen.cs,
2877         * cs-parser.jay,
2878         * decl.cs,
2879         * doc.cs,
2880         * ecore.cs,
2881         * flowanalysis.cs,
2882         * iterators.cs,
2883         * pending.cs,
2884         * statement.cs,
2885         * typemanager.cs: Parameter clean up.
2887         * delegate.cs (Define): Get rid of duplicated code.
2889         * expression.cs (ParameterReference): Removed useless parameters
2890         and simplified.
2891         (Invocation): Ditto.
2893         * parameter.cs (ParamsParameter): New class, params specialization.
2894         (ArglistParameter): Attemp to separate arglist.
2895         (Parameter): Refactored to be reusable and faster.
2896         (Parameter.Modifier): Made understandable.
2897         (Parameters): Changed to be used as a class for `this' assembly
2898         parameters. Refactored to use new specialized classes.
2900         * support.cs (ParameterData): Added Types property.
2901         (InternalParameters): Deleted.
2903 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2905         * doc.cs : the previous patch does not actually fix the bug.
2906           PropertyInfo override check is now implemented and really fixed it.
2907         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2909 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2911         * doc.cs : apply "override filter" also to properties.
2912           Fixed bug #76730.
2914 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2916         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2917           no need to check overrides. For classes, omit those results from 
2918           interfaces since they must exist in the class. Fixed bug #76726.
2920 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2922         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2923           with different parameters. Fixed the second problem in #76685.
2925 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2927         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2928           get expected 'protected' access in CheckValidFamilyAccess()).
2929           Fixed bug #76692.
2931 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2933         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2934           Fixed bug #76705.  CS1569 was incorrectly commented out.
2936 2005-11-23  Martin Baulig  <martin@ximian.com>
2938         * generic.cs (Constraints.Define): Removed.
2939         (TypeParameter.DefineConstraints): Removed.
2940         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2941         on the GenericTypeParameterBuilder here.
2943 2005-11-23  Martin Baulig  <martin@ximian.com>
2945         * typemanager.cs (TypeManager.GetProperty): Make this public.
2947         * generic.cs (Nullable.NullableInfo.ctor): Use
2948         TypeManager.GetProperty() rather than using reflection directly.
2950 2005-11-17  Martin Baulig  <martin@ximian.com>
2952         * expression.cs (Indexers.GetIndexersForType): Added support for
2953         generic parameters; fixes #76587.
2955 2005-11-17  Martin Baulig  <martin@ximian.com>
2957         * anonymous.cs
2958         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2959         inherit the scope from our parent.  Fixes #76653.
2961 2005-11-15  Martin Baulig  <martin@ximian.com>
2963         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2964         instead of `ScopeTypeBuilder' to refer to the "current" type.
2965         (AnonymousMethod.CreateScopeType): Correctly create the helper
2966         class if we're inside a generic type definition.
2968 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2970         * doc.cs : use Invocation.IsOverride() to do real override check.
2971         * expression.cs : made Invocation.IsOverride() internal.
2973 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2975         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2976           TypeBuilder.FindMembers() and filter overriden base members out.
2977           Fixed bug #76990.
2979 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2981         * doc.cs : ref/out parameters are represented as '@' (instead of
2982           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2984 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2986         * doc.cs : when there was no '.' in cref to methods in doc comment,
2987           then parameters were missing in the output. Fixed bug #76691.
2989 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2991         * driver.cs : don't output docs when there is an error.
2992           Fixed bug #76693.
2994 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2996         * doc.cs :
2997           Now it should detect indexers. Fixed primary concern in bug #76685.
2998           Fixed CS0419 message to not show the identical member signature in
2999           the message.
3001 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3003         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3004           instead of Type.FindMembers() since it does not handle events.
3005           Fixed bug #71604.
3007 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3009         * codegen.cs: Fixed typo (speficied -> specified).
3011 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3013         Fix #76369.
3014         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3016 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3018         * attribute.cs: Changed error message.
3020         * cs-tokenizer.cs: One more check.
3022 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3024         * statement.cs (Block.Resolve): Ignore empty statement.
3026 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3028         * report.cs: Made error/warning methods more strict to avoid
3029         their misuse.
3031         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3032         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3033         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3034         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3036 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3038         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
3039         Use the more explicit AssemblyName.FullName instead of 
3040         AssemblyName.Name to report errors.
3041         
3042 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3044         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
3045         with mcs.
3047 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3049         * class.cs,
3050         * convert.cs,
3051         * cs-parser.jay,
3052         * decl.cs,
3053         * enum.cs,
3054         * expression.cs,
3055         * generic.cs,
3056         * pending.cs,
3057         * report.cs: Fixed error reporting and typos.
3059         * generic.cs (TypeParameter.GetSignatureForError): New method.
3060         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3062         * typemanager.cs (GetFullName): Refactored.
3064 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3066         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3067         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3069         * class.cs (TypeContainer.IsComImport): New property.
3070         (Constructor.Define): Create proper ctor for ComImport types.
3072         * expression.cs (New.CheckComImport): Fixed.
3074 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3076         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3077         that a parameter has been captured does not mean that we do not
3078         have to do the rest of the processing.  This fixes the second part
3079         of #76592.  If there was another anonymous method capturing
3080         values in the past, the Scope would never be set for the second
3081         method that captured the same parameter.
3083         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3084         properly manipulate the stack.   Second part of fix for #76592.
3086         * expression.cs (New): Add support for invoking "new" on
3087         interfaces that have been flagged with the ComImport attribute and
3088         the CoClass.  Fixes #76637 
3090         * statement.cs (Try.DoEmit): When a variable is captured, do not
3091         try to emit the vi.LocalBuilder variable as it has been captured.
3092         Create a temporary variable and store the results on the
3093         FieldBuilder.  Fixes #76642
3095 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3097         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3099         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3101         * expression.cs (Binary.DoResolve): Added && optimalization.
3102     
3103         * typemanager.cs (AddUserType): Removed useless argument.
3105 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3107         * statement.cs (Block.variables): Uses ListDictionary.
3109 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3111         Fix #75969.
3112         * class.cs (PartialContainer.EmitType): Customized to emit
3113         security attributes.
3114         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3115         for partial classes.
3117 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3119         Fix #76599.
3120         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3121         access has to be fixed.
3122         
3123         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3125 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3127         Fix #76590.
3128         * ecore.cs (NullCast.Reduce): Implemented.
3130         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3131         constant type.
3132         
3133         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3134         properly.
3135         (Foreach.Resolve): Catch null properly.
3137 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3139         * cs-tokenizer.cs: Warning text fix.
3141         * driver.cs: AllWarningNumbers exposed on public interface.
3143         * report.cs (): Reviewed warning numbers.
3144         (IsValidWarning): Use binary search.
3146 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3148         * driver.cs: Implemeted resource visibility.
3149         (Resources): New class for code sharing between /res: and
3150         /linkres:
3152 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3154         decl.cs (CurrentTypeParameters): Fixed to be public.
3156 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3158         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3160 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3162         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3164 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
3166         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3168 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3170         Add friend assembly access support.
3171         * typemanager.cs: assembly_internals_vis_attrs
3172         cache for friend assembly access. 
3173         (TypeManager.IsFriendAssembly): New method for
3174         checking friend assembly access.
3175         (TypeManager.Error_FriendAccessNameNotMatching): New
3176         helper method.
3177         (TypeManager.CompareKeyTokens): Likewise.
3178         (TypeManager.Filter): Handle friend accessible
3179         members.
3181         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3182         friend accessible types.
3184         * ecore.cs (Expression.IsAccessorAccessible): Handle
3185         friend accessible properties.
3187         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3188         accessible types.
3189         
3190 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3192         Fix #76568.
3193         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3194         folding.
3195         
3196         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3197         contants only.
3198         
3199         * ecore.cs (NullCast): Child is contant only.
3200         
3201         * literal.cs (NullLiteral.Reduce): null can be converted to any
3202         reference type.
3204 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3206         * driver.cs: Use Encoding.Default as default code page instead
3207           of ISO-28591.
3209 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3211         Fix #76085.
3212         * expression.cs (Invocation.Error_InvalidArguments): Handle
3213         __arglist parameters.
3214         (Invocation.VerifyArgumentsCompat): Likewise.
3215         * support.cs (ReflectionParameters.GetSignatureForError): Print
3216         __arglist parameters.
3217         (InternalParamters.GetSignatureForError): Likewise.
3218         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3220 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3222         * attribute.cs (GetPropertyValue): Made public.
3224         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3225         Resolve.
3226         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3227         attribute.
3228         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3229         is not defined.
3230         
3231         * driver.cs: Reflect method name change.
3232         
3233         * statement.cs (Try.Resolve): Warn when try has both general
3234         exception handlers.
3235         
3236         * typemanager.cs: runtime_compatibility_attr_type new predefined
3237         type.
3239 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3241         Fix #76419.
3242         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3243         treat it as an empty parameter list.
3245 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3247         Fix #76271.     
3248         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3249         ResolveAsTypeStep silent.
3250         * statement.cs (Block.AddConstant): Mark block as used.
3251         (Block.ResolveMeta): Avoid piling on error messages
3252         if a constant initializer resolution fails.
3254 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3256         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3257         Remove.
3258         (NamespaceEntry.VerifyAllUsing): New.
3259         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3260         behaviour.  Delegates actual resolution of alias to ...
3261         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3262         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3263         Update.
3264         * driver.cs (Driver.MainDriver): Update.
3265         
3266         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3267         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3268         property.
3269         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3270         Remove.
3271         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3272         RootNamespace.DefineNamespacesForAll.
3274 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3276         * typemanager.cs (assemblies, external_aliases, modules)
3277         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3278         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3279         overhead.  Move resposibility ...
3280         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3281         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3283 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3285         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3286         cached_namespaces.  Improve usage.
3287         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3288         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3289         Move from GlobalRootNamespace and simplify.
3290         (RootNamespace.Global): Make instance variable.
3291         (RootNamespace.RootNamespace): Add "alias name" parameter.
3292         (GlobalRootNamespace): Simplify drastically.
3293         (Namespace.Lookup): Don't use GetNamespace.
3294         * typemanager.cs (GetRootNamespace): Rename from
3295         ComputeNamespaceForAlias.
3296         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3298 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3300         * anonymous.cs (AnonymousContainer): Don't crash when container
3301         doesn't exist.
3303 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3305         * expression.cs (Binary.DoResolve): Warn when comparing same
3306         values.
3308 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3310         Fix #76486.
3311         * expression.cs (Binary.DoResolve): It looks like there are no
3312         convetsion rules in enum context.
3314 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3316         Add support for extern alias qualifiers.
3317         * typemanager.cs: Move some LookupTypeReflection code
3318         to namespace.cs, to have cleaner code. Added some methods
3319         to help us keep track of the extern aliased references.
3320         * driver.cs: Add suport for extern alias assemblies on command
3321         line and check for their warnings/errors. Also keep track of the
3322         extern aliased assemblies.
3323         * namespace.cs: Move the global functionality of Namespace
3324         to GlobalRootNamespace/RootNamespace. Now the global namespace
3325         is GlobalRootNamespace.Globa. Also the code moved from 
3326         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3327         Finally added LocalAliasEntry (AliasEntry before) and
3328         ExternAliasEntry, to handle alias statements.
3329         * cs-parser.jay: Add support in the grammar for extern alias
3330         statement.
3331         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3332         Update callings to Namespace (now in GlobalRootNamespace).
3334 2005-10-25  Martin Baulig  <martin@ximian.com>
3336         * convert.cs (ImplicitTypeParameterConversion): Make base
3337         interfaces actually work; fixes #76557.
3339 2005-10-25  Martin Baulig  <martin@ximian.com>
3341         * generic.cs
3342         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3343         all the type parameters; fixes #76551.
3345 2005-10-25  Martin Baulig  <martin@ximian.com>
3347         Fix #76472.
3349         * generic.cs
3350         (GenericMethod.ctor): Added `Expression return_type' and
3351         `Parameters parameters' arguments.
3352         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3353         parameter and return types to check their constraints if they're
3354         generic types.
3356         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3357         boolean field.
3359         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3360         constraints of a generic type if `ec.ResolvingGenericMethod'.
3362         * class.cs (MethodCore.DoDefineParameters): Set
3363         `ec.ResolvingGenericMethod' if we're a generic method.
3364         (MemberBase.MemberType): Likewise.
3366 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3368         * typemanager.cs (TypeManager): Added 
3369         TypeManager.internals_visible_attr_type to cache
3370         S.R.CompilerServices.InternalsVisibleToAttribute.
3372         * codegen.cs (AssemblyClass): Added checks for 
3373         InternalsVisibleToAttribute in new method 
3374         CheckInternalsVisibleAttribute () and also cache the
3375         AssemblyName in AssemblyClass.Name.
3376         
3377 2005-10-24  Martin Baulig  <martin@ximian.com>
3379         * typemanager.cs
3380         (TypeManager.ExpandInterfaces): Added overloaded version which
3381         just takes a `Type[]' array.
3383         * generic.cs
3384         (Constraints.Resolve): Don't expand the interfaces here; ie. we
3385         just use the interfaces which were explicitly specified and not
3386         the interfaces they inherit.  Fixes #76482.
3387         (TypeParameter.FindMembers): Expand the interfaces here.
3389 2005-10-21  Martin Baulig  <martin@ximian.com>
3391         * generic.cs
3392         (Constraints.Resolve): Also resolve the actual types here.
3393         (Constraints.ResolveTypes): Just check the constraints here.
3394         Fixes #76363; see gtest-218.cs.
3396 2005-10-21  Martin Baulig  <martin@ximian.com>
3398         * convert.cs
3399         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3400         instead of a `BoxedCast'; fixes gtest-217.cs.
3402 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
3404         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3405           1) "new()" is specified as generic parameter constraint and 2) the
3406           type is TypeBuilder and 3) the type is abstract even if it has a
3407           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3409 2005-10-20  Martin Baulig  <martin@ximian.com>
3411         * generic.cs
3412         (GenericConstraints.TypeParameter): New public property.
3413         (TypeParameter.ctor): Also take a `DeclSpace' argument.
3414         (TypeParameter.DeclSpace): New public property.
3415         (TypeParameter.DefineType): Inflate the constraints if our
3416         `DeclSpace' is an `Iterator'.   
3418 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
3420         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
3421           GenericMethod argument to compare methods' generic type arguments.
3422           Fixed bug #76382.
3424 2005-10-19  Martin Baulig  <martin@ximian.com>
3426         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3427         not ResolveType() when resolving the base type, so we're not
3428         checking the constraints here.
3429         (TypeContainer.ResolveType): Call ResolveType() on our base_type
3430         if we have any.
3432 2005-10-19  Martin Baulig  <martin@ximian.com>
3434         * generic.cs (ConstructedType.CheckConstraints): Committing
3435         untested fix for #76441.
3437 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3439         Fix #76371.
3440         * class.cs (TypeContainer.DefineType): Move updating of
3441         topological sort earlier in the code.
3442         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3444 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3446         Fix #76273.
3447         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3448         
3449         * constant.cs (Constant.TryReduce): Moved from Cast class.
3450         (Reduce): Made little bit more OO and fixed missing conversions.
3451         
3452         * ecore.cs (Reduce): Implemented.
3453         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3454         
3455         * literal.cs (Reduce): Implemented.
3456         
3457         * class.cs: Reverted Miguel's wrong commit.
3459 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3461         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3463 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3465         * cs-parser.jay, expression.cs : CS0214 was missing error location
3466           for constants. Fixed bug #76404.
3468 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3470         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3471         InstanceExpression.
3472         (PropertyExpr.EmitCall): Likewise.
3473         * expression.cs (Invocation.EmitArguments): Handle case where
3474         arguments == null.
3475         (Invocation.EmitCall): Avoid allocating temporary variable if
3476         there are no arguments.
3478 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3480         Fix #76370.
3481         * convert.cs (ExplicitConversionCore): Fixed object->enum
3482         conversion.
3484 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3486         Fix #76323.
3487         * convert.cs (ImplicitConversionStandard): Move conversion of
3488         void* to arbitrary pointer types ...
3489         (ExplicitConversionStandard): .. here.
3490         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3491         error to always print typenames.
3493 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3495         * convert.cs (GetConversionOperator): Rename from
3496         GetConversionOperators.  Move operator selection code from ...
3497         (UserDefinedConversion): ... here.
3499 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3501         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3502         conversion.
3504 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3506         * assign.cs (Assign.DoResolve): Error method changed.
3508         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3509         
3510         * const.cs (ResolveValue): Reset in_transit immediately.
3511         
3512         * constant.cs: Error method changed.
3513         
3514         * convert.cs: Removed useless location parameter.
3515         (ExplicitNumericConversion): Don't do double enum check.
3516         (ExplicitConversionCore): Renamed from ExplicitConversion.
3517         (ExplicitUnsafe): Extracted from ExplicitConversion.
3518         (ExplicitConversion): Uses for error reporting.
3519         
3520         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3521         error messages.
3522         (ResolveBoolean): Uses common error method.
3523         (CastToDecimal): Get rid of ec.
3524         (CastFromDecimal): Optimized.
3525         (ConvCast): Get rid of ec.
3526         
3527         * enum.cs (ResolveValue): Reset in_transit immediately.
3528         (Emit): Return after first error.
3529         
3530         * expression.cs: Convert changes.
3531         
3532         * literal.cs: Error method changed.
3533         
3534         * statement.cs: Error method changed.
3536 2005-10-06  Raja R Harinath  <rharinath@novell.com>
3538         Fix gtest-131.cs and gtest-211.cs.
3539         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3540         Only emit code for a label if it is used.  Unreachable code can
3541         violate ECMA evaluation stack invariants.
3543 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3545         * anonymous.cs: Implemented ExprClassName.
3546         
3547         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3548         delegate.
3549         
3550         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3551         check.
3552         
3553         * class.cs (StaticClass.DefineContainerMembers): Report protected
3554         members as error.
3555         
3556         * codegen.cs: if(ed) PRODUCTION.
3557         
3558         * convert.cs (Error_CannotImplicitConversion): Better error
3559         distinction.
3560         
3561         * cs-parser.jay: More error checks.
3562         
3563         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3564         
3565         * driver.cs (CSCParseOption): Enabled wrong option check.
3566         
3567         * ecore.cs (Expression.ExprClassName): Turned to property.
3568         (MemberExpr.CheckIntermediateModification): For checking boxed
3569         value types     modification.
3570         
3571         * statement.cs (Fixed.Resolve): Expression type must be
3572         convertible to fixed type.
3573         (CollectionForeach.GetEnumeratorFilter,TryType):
3574         Small refactoring for easier error checking.
3576 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3578         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3579         attributes.
3580         
3581         * class.cs (GeneratedBaseInitializer): New class for customization
3582         compiler generated initializers.
3583         (MemberBase.DoDefine): Check Obsolete attribute here.
3584         (FieldMember.DoDefine): Ditto.
3585         
3586         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3587         constants.
3588         
3589         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3590         (MemberCore.GetObsoleteAttribute): Removed argument.
3591         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3592         (MemberCore.CheckObsoleteType): New helper.
3593         
3594         * delegate.cs,
3595         * enum.cs,
3596         * statement.cs: Updates after MemberCore changes.
3597         
3598         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3599         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3600         
3601         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3602         obsolete attribute for compiler construct.
3603         (As.DoResolve): Cache result.
3604         
3605         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3607 2005-10-01  Miguel de Icaza  <miguel@novell.com>
3609         * expression.cs (Probe): instead of having a "Type probe_type"
3610         keep the extra information as a TypeExpr probe_type_expr since the
3611         "As" operator needs to perform some type checks.
3613         * (As.DoResolve): If the type is a type parameter, ensure that it
3614         is constrained by a class.
3616 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3618         * statement.cs (Lock): Use the TemporaryVariable class instead of
3619         manually using local variables as those do not work when variables
3620         are captured.
3622         * ecore.cs: Moved the TemporaryVariable class from being a nested
3623         class inside Foreach to be a public class that can be employed in
3624         other places. 
3626 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3628         * cs-parser.jay: interface_accessors replaced by
3629         accessor_declarations.
3631         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3632         location.
3633         
3634         * statement.cs (GotoCase.Resolve): Convert null constant to
3635         null case.
3636         (SwitchLabel.ResolveAndReduce): Ditto.
3637         (SwitchLabel.NullStringCase): Custom null stamp.
3638         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3639         
3640         typemanager.cs (CSharpSignature): Don't skip first argument
3641         for full names.
3643 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3645         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3646         expression.cs, iterators.cs, literal.cs: Store constants and
3647         literals location.
3648         
3649         * class.cs (MemberBase.ShortName): Pass location.
3650         
3651         * cs-parser.jay: Some location fixes.
3652         
3653         * ecore.cs (Expression.Location): Made virtual.
3655 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3657         Fix #72930.
3658         * const.cs (Const.ResolveValue): Check for assigning non-null
3659         value to reference type.
3661 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3663         Fix #76133.
3664         * expression.cs (This.VerifyFixed): In a value type T, the type of
3665         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3666         value type R, 'this' is treated as a value parameter.
3668 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3670         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3671         if the underlying types are the same, otherwise we need to produce
3672         code that will do the proper cast.
3674         This was exposed by Marek's constant rewrite which produced
3675         invalid code for the call site:
3677         enum X : long { a }
3678         void Method (X v) {}
3680         Method ((X) 5)
3682         This fixes test-49.cs
3684 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3686         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3687           Type/Object should be allowed as well. Fixed bug #75968.
3689 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3691         * expression.cs : (Binary.DoResolve): when one is enum constant and
3692           another is constant 0, then return enum one *as enum type*.
3693           Fixed bug 74846.
3695 2005-10-04  Martin Baulig  <martin@ximian.com>
3697         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3698         `SetMemberIsUsed()' work for generics, too.
3700 2005-10-04  Martin Baulig  <martin@ximian.com>
3702         * expression.cs (DelegateInvocation.EmitStatement): Make this work
3703         for corlib.  Fixes #75691.
3705 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3707         Fix #76255.
3708         * driver.cs: Fix compilation files with full root path.
3710 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3712         * report.cs (SymbolRelatedToPreviousError): Format the output so
3713         it does not use an open parenthesis that is never closed. 
3715         * driver.cs: Follow coding guidelines
3717 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3719         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3721         * location.cs (InEmacs): in this mode, do not report column
3722         location as it confuses Emacs.
3724 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3726         * support.cs (SeekableStreamReader.Position): Don't error out when
3727         the requested position is just beyond the end of the current
3728         buffered data.
3730 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3732         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3733         try to keep in sync with the byte count of the underlying Stream.
3734         However, this limits us to a window size of 2048 characters: i.e.,
3735         the maximum lookahead of our lexer/parser can be 2048 characters.
3737 2005-09-22  Martin Baulig  <martin@ximian.com>
3739         * driver.cs: Removed a debugging FIXME.
3741 2005-09-21  Raja R Harinath  <rharinath@novell.com>
3743         * cs-parser.jay (type_arguments): Add CS1644 check.
3744         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3746 2005-09-15  Raja R Harinath  <rharinath@novell.com>
3748         * Makefile (PROGRAM): Make profile specific.
3749         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3750         the current directory.
3752         Fix test-455.cs.
3753         * expression.cs (Invocation.EmitCall): Remove optimization on
3754         this_call since it doesn't handle 'this' being a value type.
3756 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
3758         * driver.cs: Ensure file handles are closed after parsing
3760 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3762         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3763         if the underlying types are the same, otherwise we need to produce
3764         code that will do the proper cast.
3766         This was exposed by Marek's constant rewrite which produced
3767         invalid code for the call site:
3769         enum X : long { a }
3770         void Method (X v) {}
3772         Method ((X) 5)
3774         This fixes test-49.cs
3776 2005-09-05  Martin Baulig  <martin@ximian.com>
3778         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3779         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3781         * cs-parser.jay (delegate_declaration): Small fix for #75852.
3783 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3785         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3786           to be a pointer type due to the spec 25.2, so check if declaring
3787           type is generic type definition. Fixed bug #75772.
3789 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3791         Fixed bug #75957.
3792         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3793           both types are not defined by methods.
3794         * expression.cs : (Invocation.IsApplicable): it should work when
3795           the argument type is equal to the parameter type, not only when
3796           ImplicitConversionExists() returns true.
3798 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3800         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3801         internal.
3803         Fix #75941.
3804         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3805         flow-branching for LocalVariableReferences in case we were invoked
3806         from a MemberAccess.
3807         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3808         Carved out of ...
3809         (LocalVariableReference.DoResolveBase): ... this.
3810         (MemberAccess.Resolve): Do the check that was disabled during
3811         SimpleNameResolve.
3813 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3815         * class.cs :
3816           (PartialContainer.Create): check abstract/sealed/static strictly
3817           but abstract/sealed can exist only at one side. Fixed bug #75883.
3819 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3821         Fix #75945.
3822         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3823         specified, don't default to UnmanagedType.I4.
3825 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3827         * expression.cs : conditional operator should check possibly
3828           incorrect assign expression. Fixed bug #75946.
3830 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3832         Fix #75934.
3833         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3834         (ScopeInfo.EmitScopeType): Use it to construct field names from
3835         names of captured locals.
3837         Fix #75929.
3838         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3839         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3840         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3841         (ExplicitConversion): Remove enum cases already handled by
3842         implicit conversion.  Move implicit conversion check to the beginning.
3843         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3844         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3845         Don't treat System.Enum as a struct.
3847 2005-08-30  Jb Evain  <jbevain@gmail.com>
3849         * attribute.cs: handles as expression in parameters.
3851 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3853         Fix #75802.
3854         * class.cs (TypeContainer.VerifyClsName): Don't use a
3855         PartialContainer when verifying CLS compliance.
3856         (AbstractPropertyEventMethod): Set Parent here, ...
3857         (PropertyMethod): ... not here.
3859 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3861         * attribute.cs : escaped attribute name should not be allowed to be
3862           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3864 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3866         Fix #75927.
3867         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3868         when converting a long constant to unsigned long.
3869         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3870         detect where IsApplicable and VerifyArgumentsCompat disagree.
3872 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3873         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3875         Fix #75848.
3876         * class.cs (TypeContainer.CanElideInitializer): New helper.
3877         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3878         can safely emitting the initializer of a field.
3880 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3882         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3883           allowed inside a switch (without loop). Fixed bug #75433.
3885 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3887         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3888         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3890 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3892         * driver.cs : kinda reverting the default encoding changes (not exact 
3893           revert since I noticed that "codepage:reset" might not work fine).
3895 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3897         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3898           Location. Now getter and setter store location correctly.
3899           (errors/cs0111-12.cs now reports the expected location.)
3901 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3903         * driver.cs : Use default encoding on the environment.
3904           Removed (now that) extra parameter for SeekableStreamReader.
3905         * support.cs : (SeekableStreamReader) third .ctor() argument for
3906           StreamReader is not required (always true). preamble size could
3907           be acquired in simpler and safe way.
3909 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3911         * cs-parser.jay: report CS0642 at warning level 3
3912           and report CS0642 for an if else statement also
3913           fixes bug #74745. Patch by John Luke (and a bit
3914           modified by me).
3915           Removed extra CS0642 warning check for "while",
3916           "for" and "fixed".
3917         * statement.cs: In Block.Resolve(), CS0642 check
3918           is reimplemented to check a sequence of an empty
3919           statement and a block.
3921           Both fix bug #66777.
3923 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3925         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3926         detection until I fix it.
3927         
3928         * cs-tokenizer.cs: Changed error message.
3929         
3930         * cs-parser.jay: Fixed 2 error locations.
3931         
3932         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3933         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3934         properties.
3935         
3936         * enum.cs (GetSignatureForError): Fixed.
3937         
3938         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3939         method detection.
3940         
3941         * class.cs,
3942         * typemanager.cs (RegisterProperty): Removed.
3943         
3944         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3946 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3948         Fix #75874.
3949         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3950         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3952 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3954         * expression.cs : tiny fix is required for not warning positive ulong.
3955           See test-441.cs.
3957 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3959         * expression.cs : add CS0652 check for constant and integral
3960           expression. Fixed bug #53974.
3962 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3964         * expression.cs : in DoNumericPromotions(), check if there is implicit
3965           conversion overload for string (to check CS0034). Fixed bug #52492.
3967 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3969         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3971 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3973         * ecore.cs : report location when it is *not* Null.
3975 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3977         * codegen.cs,
3978           ecore.cs,
3979           flowanalysis.cs,
3980           expression.cs:
3981           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3982           correctly. Fixed bug #75721.
3984 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3986         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3987         loop that performs 'min (pos, char_count)'.
3989         Fix #75862.
3990         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3991         converted value in Operator.OnesComplement.
3993 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3995         * anonymous.cs: If the anon method is pulled into a helper class,
3996         it needs to be `internal' not `private'. Fixes runtime behavior on
3997         msft. bug #75704
3999 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
4001         Fix #75803
4002         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4003         is a partial class.
4005 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
4007         The big constants rewrite
4008         Fix #75746, #75685 and more
4009         As a side effect saved 1MB for MWF ;-)
4010         
4011         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4012         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4013         enum based for corlib compilation.
4014         
4015         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4016         subtractions.
4017         
4018         * class.cs (FixedField.Define): Use ResolveAsConstant.
4019         
4020         * const.cs (IConstant): Interface constants and enums.
4021         (Const.ResolveValue): New method for constant resolvning.
4022         (ExternalConstant): Constants from imported assemblies.
4023         
4024         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4025         conversion; like enums.
4026         (Constant.ToType): Converts this constant to different type.
4027         (Constant.Increment): Adds 1.
4028         
4029         * convert.cs (ImplicitConversionRequired): Simplified.
4030         
4031         * cs-parser.jay: Create EnumMember directly.
4032         
4033         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4034         
4035         * doc.cs (GenerateEnumDocComment): Removed.
4036         
4037         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4038         (ConvertIntLiteral): Removed.
4039         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4040         
4041         * enum.cs (EnumMember): Implement IConstant.
4042         (Enum.IsValidEnumConstant): Removed.
4043         (Enum.GetNextDefaultValue): Removed.
4044         (Enum.FindMembers): Updated.
4045         (Enum.GenerateDocComment): Iterate enum members.
4046         
4047         * expression.cs (Cast.TryReduce): Handle enums correctly.
4048         (New.Constantify): Made public.
4049         (MemberAccess.DoResolve): Removed contant specific if(s).
4050         
4051         * literal.cs (NullLiteral): Implement new abstract methods.
4052         
4053         * statement.cs (GotoCase.Resolve): Use new constant methods.
4054         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4055         
4056         * typemanager.cs (LookupEnum): Removed.
4057         (IsEnumType): Fixed to work with corlib.
4058         (RegisterConstant): Removed.
4059         (LookupConstant): Removed.
4060         (GetConstant): Changed to work with IConstant.
4062 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4064         * location.cs : Fixed overflown (>255) column number.
4066 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4068         First cut of the qualified-alias-member feature.
4069         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4070         token.
4071         * cs-parser.jay (DOUBLE_COLON): New token.
4072         (namespace_or_type_name): Add rule for recognizing
4073         qualified-alias-members.
4074         (primary_expression): Likewise.
4075         (element_access): Allow QualifiedAliasMember as a possible
4076         type-bearing expression.
4077         (local_variable_type, local_variable_pointer_type): Likewise.
4078         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4079         aliases in the current and enclosing namespace declarations.
4080         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4081         * decl.cs (MemberName.is_double_colon): New.
4082         (MemberName.MemberName): Add new constructor for alias-member.
4083         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4084         * expression.cs (QualifiedAliasMember): New expression type.
4086 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4088         * location.cs : it borked when no argument was specified.
4090 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4092         * location.cs : tiny ToString() format fix.
4094 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4096         * statement.cs : oops, it was missing.
4098 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4100         A set of fixes for precise line/column location.
4102         * location.cs :
4103           "token" field now holds a file/line "delta", a line number offset 
4104           from the segment, and a column number. See also:
4105           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4106           December/009508.html
4107           Removed static IsNull. Use instance IsNull property instead.
4108         * cs-tokenizer.cs :
4109           For some tokens it stores Location. For Identifier it stores
4110           LocatedToken which is a pair of string name and location.
4111           Column numbers are adjusted only at getChar().
4112         * report.cs :
4113           Use Location.ToString() for reporting (it now contains column).
4114         * cs-parser.jay :
4115           Largely modified to use LocatedToken instead of
4116           string (IDENTIFIER), and to acquire Location from some tokens.
4117         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4118           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4119           codegen.cs :
4120           Now MemberName holds Location. DeclSpace.ctor() receives Location
4121           as a parameter. Removed extra parameters to all derived classes.
4122           Replaced Location.IsNull() with instance property.
4123         * assign.cs, expression.cs :
4124           Added .ctor() overload that omits Location.
4125         * attribute.cs :
4126           Added "nameEscaped" flag that indicates the identifier was escaped
4127           in the source file. This fixes bug #57047.
4129 2005-09-02  Martin Baulig  <martin@ximian.com>
4131         * class.cs: Make CS3005 a warning, not an error.
4133 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4135         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4136         New method, looking for lo-case imported cls type.
4138         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4139         here.
4141         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4143         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4145         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4146         all_imported_types.
4147         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4149         Optimized to save 3.5 MB for SWF compilation.
4151 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4153         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4154         (PartialContainer.Create): Moved logic AddToContainer.
4155         (PartialContainer.MarkForDuplicationCheck): Shares name.
4156         
4157         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4158         place.
4159         
4160         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4161         initialization.
4162         (Namespace.GetSignatureForError): New method.
4163         
4164         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4165         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4167 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4169         Fix #75669.
4170         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4171         member lookup rather than qualifier_type, since qualifier_type can
4172         be null.
4174 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4176         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4177         enum member.
4179 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4181         * statement.cs: Copy the local exception into the exception
4182         captured local.  Fixes 75674
4184 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4186         Fix #75658.
4187         * expression.cs (Invocation.OverloadResolve): Don't report error
4188         CS1501 if error CS1502 has been reported.
4189         (New.DoResolve): Delegate CS1501 reporting to
4190         Invocation.OverloadResolve.
4192         Fix #75656.
4193         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4194         invariant-meaning-in-block property in an enclosing block if
4195         necessary.
4197 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4199         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4200         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4201         (Switch.CheckSwitch): Just save 50kb for SWF.
4203 2005-07-27  Martin Baulig  <martin@ximian.com>
4205         * anonymous.cs (CaptureContext.AddField): Added
4206         `AnonymousContainer am' argument; compute its toplevel scope if
4207         it's not already computed.  Fixes #75649.
4209 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4211         Fix #75628.
4212         * class.cs (Constructor.Emit): Reset block to null if the block
4213         resolve fails.
4215 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4217         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4219 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4221         * class.cs (MethodData.Define): Check whether accessor implementing
4222         interface is public.
4224         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4226 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4228         Fix #57245
4229         * namespace.cs (LookupType): Moved same type check to...
4230         
4231         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4232         with the same name.
4234 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4236         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4237         already found a typebuilder.
4238         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4239         MemberNames, not strings.
4241         * const.cs (Error_ExpressionMustBeConst): 
4242         Rename from Error_EpressionMustBeConst.
4243         * const.cs, class.cs, statement.cd: Update.
4245 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4247         Fix #65573
4249         * const.cs (Const.LookupConstantValue): Report missing contant expression
4250         everytime.
4251         (Error_EpressionMustBeConstant): Only one error method.
4253         * class.cs, statement.c: Updated.
4255 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4257         * statement.cs (Block.Flags): Add back HasVarargs.
4258         (Block.flags): Make protected.
4259         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4261         * typemanager.cs (types, typecontainers, user_types): Remove.
4262         (UserTypes, TypeContainers): Likewise.
4263         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4264         (CleanUp, Reset): Update.
4265         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4266         (GetNestedType): Use Type.GetNestedType.
4267         (CoreLookupType): Take two arguments, the namespace and the
4268         basename of the type.  Update to use the Namespace.Lookup
4269         mechanism.
4270         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4271         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4272         string concatenation and substring matches.
4273         * class.cs, enum.cs, delegate.cs: Update to changes.
4275 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4277         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4278         Expression and made virtual.
4280         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4281         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4283         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4285         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4286         error message.
4288         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4289         change.
4291 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4293         Fix #57707
4294         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4295         AssemblyCultureAttribute is not used on executable.
4297         * rootcontext.cs,
4298         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4300 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4302         Fix #60638.
4303         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4304         New.  Reports CS0252/CS0253.
4305         Mostly taken from preliminary patch by Duncak Mak.
4306         (Binary.DoResolveOperator): Store results of operator lookup.
4307         Use them to detect if we need to warn about unintended reference
4308         comparisons.
4310 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4312         Fix #72969.
4313         * namespace.cs (Namespace.Lookup): Add back location parameter.
4314         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4315         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4317         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4318         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4319         (Namespace.LookupType): ... this.
4320         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4321         of namespaces.
4322         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4323         purported to handle pointers.
4324         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4325         CoreLookupType.
4327 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4329         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4330         type as namespace.
4332 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4334         * namespace.cs (Namespace.Lookup): Drop location parameter.
4335         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4336         (NamespaceEntry.Lookup): ... this.
4337         (NamespaceEntry.Error_AmbiguousTypeReference):
4338         Move here from DeclSpace.
4339         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4340         names ...
4341         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4342         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4343         Move to NamespaceEntry.
4344         * delegate.cs, expression.cs: Update to changes.
4346 2005-08-31  Martin Baulig  <martin@ximian.com>
4348         Committing a patch from Atsushi Enomoto for #75850.
4350         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4351         Prefer a generic enumerator over a non-generic one.
4353 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4355         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4356         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4358 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4360         * driver.cs : reverting default encoding change as well as mcs.
4362 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4364         * driver.cs, support.cs : merged r48826.
4365           Marek Safer wrote:
4366           > could you integrate your mcs changes to gmcs otherwise
4367           > gmcs cannot compile some files.
4369 2005-08-20  Martin Baulig  <martin@ximian.com>
4371         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4372         scope if we don't already have it.
4374         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4375         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4376         fixes #75867.
4378 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4380         * statement.cs: Copy the local exception into the exception
4381         captured local.  Fixes 75674
4383 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4385         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4386         type as namespace.
4388 2005-08-12  Martin Baulig  <martin@ximian.com>
4390         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4391         for nested types here to avoid hitting the cache too early.
4393 2005-08-09  Miguel de Icaza  <miguel@novell.com>
4395         * enum.cs: On the new compiler CLS error 3005 is now a warning not
4396         an error. 
4398 2005-08-03  Martin Baulig  <martin@ximian.com>
4400         Make iterators in generic methods work; see gtest-191.cs.
4402         * generic.cs
4403         (Constraints.Resolve): Protect against being called twice.
4405         * class.cs
4406         (TypeContainer.GetClassBases): Make this `protected virtual'.
4408         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4409         (Iterator.GetClassBases): Override this and compute the base
4410         classes here.
4411         (Iterator.DefineNestedTypes): If we're a generic method, all our
4412         method type parameters become class type parameters on the proxy
4413         class.
4415         * statement.cs
4416         (ToplevelBlock.Parameters): Make this a property, not a field.
4417         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4419 2005-08-03  Martin Baulig  <martin@ximian.com>
4421         * typemanager.cs (TypeManager.IsSubclassOf): Use
4422         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4423         (TypeManager.GetFullName_recursed): Improved.
4425 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4427         Fix #75417
4428         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4429         Private accessor case, using TypeManager.IsPrivateAccessible instead of
4430         invocation_type == mi.DeclaringType, since the first one also checks
4431         other condition used by generic instances.
4432         
4433 2005-07-27  Martin Baulig  <martin@ximian.com>
4435         * anonymous.cs (CaptureContext.AddField): Added
4436         `AnonymousContainer am' argument; compute its toplevel scope if
4437         it's not already computed.  Fixes #75649.
4439 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4441         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4442         CheckAttributeType and refactored.
4443         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4444         ResolveAsTypeTerminal error handling.
4445         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4446         handling.
4447         (GetSignatureForError): Print errors in same way.
4449         * class.cs,
4450         * codegen.cs: Reflect attribute GetSignatureForError change.
4452         * ecore.cs,
4453         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4455         * namespace.cs (UsingEntry): Refactored to make fields private.
4457         * assign.cs,
4458         statement.cs: Error_UnexpectedKind has extra parameter.
4460 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4462         * ecore.cs (IAlias): Remove.
4463         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4464         that implement the interface.
4465         * namespace.cs (Namespace): Likewise.
4466         (Namespace.declspaces): Renamed from 'defined_names'.
4467         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4468         DeclSpace instead of an IAlias.
4469         * tree.cs (Tree.AddDecl): Update.
4471 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4473         * statement.cs (Block.Flags); Remove HasVarargs.
4474         (Block.HasVarargs): Move to ToplevelBlock.
4475         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4476         (Block.Variables): Make protected.  Initialize variable hashtable
4477         if necessary.
4478         (Block.AddVariable): Update.
4479         (Block.Resolve): Update to changes.
4480         (ToplevelBlock.HasVarargs): New boolean.
4481         (ToplevelBlock.ThisVariable): Move here from Block.
4482         (ToplevelBlock.AddThisVariable): Likewise.
4483         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4484         * expression.cs (This.ResolveBase): Update to changes.
4485         (ArglistAccess.DoResolve): Likewise.
4487 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4489         Fix #75321
4490         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4492         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4493         not used and not used & assigned.
4494         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4496 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4498         Fix #75053
4499         * expression.cs (Is.DoResolve): null is never provided type.
4501 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4503         Fix #52496
4504         * cs-parser.jay: Less strict event error rule to catch more errors.
4506 2005-07-11  Martin Baulig  <martin@ximian.com>
4508         * generic.cs (ConstructedType.CheckConstraints): Improve the check
4509         for the constructor constraint: we do not only have to check
4510         whether the class has a public constructor, but also ensure that
4511         it's parameterless.  Fixes #75492.
4513 2005-07-11  Martin Baulig  <martin@ximian.com>
4515         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4516         between type parameters if they either have the reference type
4517         constraint or the class constraint.
4519 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
4521         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4523 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4525         Fix #74975
4526         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4527         (ExtractSecurityPermissionSet): Cope with self referencing security
4528         attributes properly.
4530         * driver.cs (SetOutputFile): Made public property OutputFile.
4532 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4534         Fix #75486.
4535         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4536         has_nonstatic_fields.  Make into a FieldBase pointer.
4537         (TypeContainer.AddField): Add CS0282 check.
4538         (TypeContainer.EmitType): Update.
4540 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4542         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4543         compare if they start with __.
4545 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4547         * statement.cs (Switch.SwitchGoverningType): Only look at
4548         UserCasts that don't need implicit standard conversions to one of
4549         the allowed switch types (Fixes test-322.cs).
4550         (LocalInfo.Resolve): Re-enable sanity-test.
4552 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4554         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4555         
4556         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4557         
4558         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4560 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4562         Fix #75472.
4563         * ecore.cs (SimpleName.GetSignatureForError): Add.
4564         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4565         (MemberAccess.GetSignatureForError): Add.
4567 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4569         The big error and warning messages review.
4570         
4571         * anonymous.cs,
4572         * assign.cs,
4573         * attribute.cs,
4574         * class.cs,
4575         * codegen.cs,
4576         * convert.cs,
4577         * cs-parser.jay,
4578         * cs-tokenizer.cs,
4579         * decl.cs,
4580         * delegate.cs,
4581         * doc.cs,
4582         * driver.cs,
4583         * ecore.cs,
4584         * enum.cs,
4585         * expression.cs,
4586         * flowanalysis.cs,
4587         * iterators.cs,
4588         * literal.cs,
4589         * location.cs,
4590         * modifiers.cs,
4591         * namespace.cs,
4592         * parameter.cs,
4593         * pending.cs,
4594         * report.cs,
4595         * rootcontext.cs,
4596         * statement.cs,
4597         * support.cs,
4598         * tree.cs,
4599         * typemanager.cs: Updated.
4600         
4601         * class.cs: (MethodCore.SetYields): Moved here to share.
4602         (PropertyMethod.Define): Moved iterator setup here.
4603         
4604         * iterators.cs: Add orig_method to have full access to parent
4605         container.
4607 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4609         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4610         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4611         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4612         variable of struct type.
4613         * expression.cs (Unary.ResolveOperator): Update to change.
4614         (Indirection.VerifyFixed): Likewise.
4615         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4616         (ParameterReference.VerifyFixed): Value parameters are fixed.
4617         (This.VerifyFixed): Treat 'this' as a value parameter.
4618         * statement.cs (LocalInfo.IsFixed): Remove.
4620 2005-07-01  Martin Baulig  <martin@ximian.com>
4622         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4623         `ec.EmitThis ()' to get the correct scope.
4625 2005-07-01  Martin Baulig  <martin@ximian.com>
4627         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4628         instance is a ParameterReference; fixes #75299.
4630 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4632         Fix #75412.
4633         * expression.cs (Indexers.map): Remove.
4634         (Indexers.Append): Filter out inaccessible setters and getters.
4635         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4637         Fix #75283.
4638         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4639         Refactored from ...
4640         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4641         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4642         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4643         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4645 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4647         Fix #75322
4648         * class.cs (FieldBase.GetInitializerExpression): One more field
4649         for backup.
4651 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4653         * pending.cs: Do not define a proxy if the base method is virtual,
4654         it will be picked up by the runtime (bug 75270).
4656 2005-07-08  Martin Baulig  <martin@ximian.com>
4658         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4659         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4661 2005-07-07  Martin Baulig  <martin@ximian.com>
4663         * generic.cs (ConstructedType.CheckConstraint): Use
4664         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4665         called recursively; fixes #75329.
4667 2005-07-06  Martin Baulig  <martin@ximian.com>
4669         * generic.cs (TypeManager.InferTypeArguments): Added support for
4670         anonymous methods; fixes #75461.
4672 2005-07-01  Martin Baulig  <martin@ximian.com>
4674         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4675         `ec.EmitThis ()' to get the correct scope.
4677 2005-07-01  Martin Baulig  <martin@ximian.com>
4679         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4680         instance is `This'; fixes #75299.
4682 2005-06-30  Martin Baulig  <martin@ximian.com>
4684         * class.cs (Indexer): Implement IIteratorContainer; added support
4685         for iterators in indexers.
4687         * codegen.cs
4688         (EmitContext.CurrentIterator): Make this a property, not a field.
4690         * anonymous.cs (AnonymousContainer.Iterator): New public property.
4692 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4694         * pending.cs: Do not define a proxy if the base method is virtual,
4695         it will be picked up by the runtime (bug 75270).
4697 2005-06-28  Martin Baulig  <martin@ximian.com>
4699         * cs-parser.jay (interface_method_declaration): Avoid a
4700         reduce/reduce conflict by moving some of the code into a separate
4701         `interface_method_declaration_body' rule; fixes #75368.
4703 2005-06-28  Martin Baulig  <martin@ximian.com>
4705         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4706         array check after the check for TypeBuilder's.
4708 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4710         * convert.cs (FindMostEncompassedType): Add two trivial special
4711         cases (number_of_types == 0 || number_of_types == 1).
4712         (FindMostEncompasingType): Likewise.
4714 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4716         Some cleanups preparing for the fix of #75283.
4717         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4718         error testing.
4719         (EventExpr.InstanceResolve): Likewise.
4720         (EventExpr.DoResolve): Remove redundant checks.
4722 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4724         * class.cs: Small fix.
4726 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4728         Fix #75160.
4729         * class.cs (GetPartialBases): Fix return value check of
4730         part.GetClassBases.
4732 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4734         Ensure that partial classes are registered in their enclosing
4735         namespace.  Initial part of fix of #75160.
4736         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4737         Register declspace with namespace here, not in
4738         DeclSpace.RecordDecl.
4739         * cs-parser.jay: Pass namespace to RecordDecl.
4740         * class.cs (PartialContainer.Create): Likewise.
4741         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4742         called.
4743         * decl.cs (Declspace.RecordDecl): Remove.
4744         * namespace.cs (NamespaceEntry.DefineName): Remove.
4746 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4748         * rootcontext.cs: Reset TargetExt as well.
4750 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4752         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4753         -langversion:ISO-1.
4755 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4757         Fix #75080, cs0119.cs.
4758         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4759         of ...
4760         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4761         allowing ExprClass.Type and ExprClass.Namespace for
4762         ResolveFlags.VariableOrValue.
4763         (Expression.Resolve) [1-argument variant]: Change default resolve
4764         flags based on language version.
4765         (Expression.Error_UnexpectedKind): Use a simple string array
4766         rather than an ArrayList.
4767         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4768         not ExprClass.Type.
4769         (TypeOfVoid.DoResolve): Likewise.
4770         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4771         flags argument -- it always has the same value.
4773 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4775         Fix #75081.
4776         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4777         Use it in the error message.
4778         * assign.cs, expression.cs, statement.cs: Update.
4780 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4782         Fix #75088.
4783         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4784         the "almostMatchedMember" case too.
4785         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4786         that failed the accessibility checks to 'almost_match'.
4788 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4790         * attribute.cs: Use internal MethodBuilder methods to set
4791         ExactSpelling and SetLastError on PInvoke methods, instead
4792         of passing them via charset.  Fixes #75060.
4794 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4796         * parameter.cs (Parameter): Remove TODO comment.
4797         (Parameter.DefineParameter): Remove Location parameter.
4798         (Parameters.LabelParameters): Likewise.
4799         * class.cs (Constructor.Emit): Update to change.
4800         (MethodData.Emit): Likewise.
4801         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4802         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4804 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4806         * parameter.cs,
4807           Removed Parameters.Location and added Parameter.Location instead.
4808           Removed Location parameter from Emit() and GetSignature().
4809         * anonymous.cs,
4810           class.cs,
4811           cs-parser.jay,
4812           delegate.cs,
4813           iterators.cs,
4814           statement.cs :
4815           Modified all related calls.
4817 2005-06-21  Martin Baulig  <martin@ximian.com>
4819         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4820         left-hand side is not a nullable type; fixes #75328.
4822 2005-06-21  Martin Baulig  <martin@ximian.com>
4824         * typemanager.cs
4825         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4826         (TypeManager.GetFullNameSignature): Likewise.
4828         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4829         `source.FullName' and `target.FullName' to check whether there are
4830         two conflicting definitions.
4832 2005-06-21  Martin Baulig  <martin@ximian.com>
4834         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4835         a BoxedCast - also for reference types - to be compatible with csc.
4837 2005-06-21  Martin Baulig  <martin@ximian.com>
4839         * expression.cs (MemberAccess.DoResolve): Add support for nested
4840         types in a generic instance; fixes #75320.
4842 2005-06-20  Martin Baulig  <martin@ximian.com>
4844         * generic.cs (TypeManager.InferType): Also walk the class
4845         hierarchy for generic instances; fixes #75261.
4847 2005-06-17  Martin Baulig  <martin@ximian.com>
4849         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4850         to make things work for corlib.
4852 2005-06-15  Martin Baulig  <martin@ximian.com>
4854         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4855         obsolete `SecurityAction' values.
4857 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4859         * rootcontext.cs: Reset TargetExt as well.
4860         
4861 2005-06-09  Martin Baulig  <martin@ximian.com>
4863         * delegate.cs (Delegate.VerifyMethod): Added
4864         `MethodGroupExpr old_mg' argument; inherit its
4865         `HasTypeParameters'; fix #75085.
4867 2005-06-09  Martin Baulig  <martin@ximian.com>
4869         * expression.cs (Invocation.OverloadResolve): Correctly handle
4870         generic methods for the SetMemberIsUsed(); fix #75064.
4872 2005-06-09  Martin Baulig  <martin@ximian.com>
4874         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4875         fixes #75062.
4877 2005-06-08  Martin Baulig  <martin@ximian.com>
4879         * cs-parser.jay (nullable_type_or_conditional): If we put the
4880         nullable back and our `type' is a `ComposedCast', remove the
4881         nullable from it.  Fixes #75156.
4883         * expression.cs (ComposedCast.RemoveNullable): New public method.
4885 2005-06-08  Martin Baulig  <martin@ximian.com>
4887         The big Iterators rewrite :-)
4889         * iterators.cs: Rewrite this to use the anonymous methods framework.
4891         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4892         before the TypeContainers; see 2test-21.cs.
4894         * class.cs
4895         (TypeContainer.DefineType): Don't create a new EmitContext if we
4896         already have one (this only happens if we're an Iterator).
4897         (TypeContainer.Define): Also call Define() on all our iterators.
4898         (Method.CreateEmitContext): Added support for iterators.
4900         * anonymous.cs
4901         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4902         (AnonymousContainer.CreateMethodHost): Moved here from
4903         AnonymousMethod and made abstract.
4904         (AnonymousContainer.CreateScopeType): New abstract method.
4905         (AnonymousContainer.IsIterator): New public property.
4906         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4907         get the ScopeTypeBuilder rather than manually defining it here. 
4908         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4909         iterators here.
4911         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4912         before RootContext.DefineTypes().
4914         * codegen.cs (EmitContext.RemapToProxy): Removed.
4915         (EmitContext.CurrentAnonymousMethod): Changed type from
4916         AnonymousMethod -> AnonymousContainer.
4917         (EmitContext.ResolveTopBlock): Protect from being called twice.
4918         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4919         (EmitContext.EmitThis): Removed the iterators hacks; use the
4920         anonymous methods framework for that.
4922         * statement.cs
4923         (ToplevelBlock.Container): Make this a property, not a field.
4924         (ToplevelBlock.ReParent): New public method; move the
4925         ToplevelBlock into a new container.
4926         (Foreach.TemporaryVariable): Simplify.
4928 2005-06-05  Martin Baulig  <martin@ximian.com>
4930         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4931         (Block.AddTemporaryVariable): New public method; creates a new
4932         `LocalInfo' for a temporary variable.
4933         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4934         variables here.
4935         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4936         non-iterator variables.
4938 2005-06-05  Martin Baulig  <martin@ximian.com>
4940         * statement.cs (Foreach.TemporaryVariable): Create the
4941         LocalBuilder in the Emit phase and not in Resolve since in some
4942         situations, we don't have an ILGenerator during Resolve; see
4943         2test-19.cs for an example.
4945 2005-06-04  Martin Baulig  <martin@ximian.com>
4947         The big Foreach rewrite - Part II.
4949         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4950         with `PropertyInfo ienumerator_getcurrent'.
4952         * codegen.cs (VariableStorage): Removed.
4954         * statement.cs
4955         (Foreach): Derive from Statement, not ExceptionStatement.
4956         (Foreach.CollectionForeach): New nested class.  Moved all the code
4957         dealing with collection foreach here.
4958         (Foreach.ForeachHelperMethods): Removed.
4959         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4961 2005-05-23  Martin Baulig  <martin@ximian.com>
4963         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4964         don't need to.  Fix #75014.
4966 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4968         Improve user-defined conversion handling.
4969         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4970         applicable operators.
4971         (AddConversionOperators): New.  Helper for GetConversionOperators.
4972         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4973         there is only one most encompassed/encompassing type.
4974         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4975         "applicable operator" handling.
4976         (UserConversion): Move cache here from GetConversionOperators.
4977         Directly cache the chosen operator, rather than the whole
4978         MethodGroup.
4979         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4980         case.  Allow conversion of decimal to sbyte and byte too.
4981         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4982         New static methods.  Used to avoid allocating EmptyExpressions in
4983         convert.cs.
4985 2005-05-24  Duncan Mak  <duncan@novell.com>
4987         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4988         another class, used in Convert.ExplicitNumericConversion.
4989         (CastToDecimal): New class, similar to above, but casts to
4990         System.Decimal, used in Convert.ImplicitNumericConversion and also
4991         in explicit convesion from double/float to decimal.
4993         * convert.cs (ImplicitNumericConversion): Handle implicit
4994         conversions to System.Decimal.
4995         (ExplicitNumericConversion): handle explicit conversions to
4996         System.Decimal.
4998         This fixes #68711.
4999         
5000 2005-05-20  Miguel de Icaza  <miguel@novell.com>
5002         * typemanager.cs: Do not throw an exception in the TypeBuilder
5003         case, we take care of it on the TypeCode.
5005 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
5006         
5007         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5008         is back.
5009         
5010         * cs-parser.jay: Catch more lexical errors.
5011         
5012         * report.cs: Add one more Error method.
5013         
5014         * rootcontext.cs,
5015         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5017 2005-05-20  Martin Baulig  <martin@ximian.com>
5019         * class.cs (TypeContainer.CircularDepException): Removed.
5020         (TypeContainer.DefineType): Removed the `InTransit' stuff.
5021         (TypeContainer.CheckRecursiveDefinition): Check for circular class
5022         (CS0146) and interface (CS0529) dependencies here.
5024 2005-05-20  Martin Baulig  <martin@ximian.com>
5026         * expression.cs (New.DoResolve): Move the CS0712 check above the
5027         CS0144 check; otherwise it can never be reached.
5029 2005-05-20  Martin Baulig  <martin@ximian.com>
5031         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
5033 2005-05-20  Martin Baulig  <martin@ximian.com>
5035         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
5037         * typemanager.cs (TypeManager.IsAttributeType): New public method.
5039 2005-05-19  Martin Baulig  <martin@ximian.com>
5041         * delegate.cs
5042         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5043         to disable error reporting.
5045         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5046         here since we don't want to report an error; see the new test-336.cs.
5048 2005-05-19  Raja R Harinath  <rharinath@novell.com>
5050         * statement.cs (ToplevelBlock.GetParameterReference)
5051         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5052         Move here from class Block.
5053         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5054         * expression.cs (ParameterReference.DoResolveBase): Likewise.
5056 2005-05-18  Martin Baulig  <martin@ximian.com>
5058         Fix #74978.
5060         * flowanalysis.cs
5061         (FlowBranching.Reachability): Add non-static public And() and Or()
5062         methods.
5063         (FlowBranchingSwitch): New class; do the `break_origins' thing
5064         like in FlowBranchingLoop.
5065         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5066         reachability, not just locals and parameters.
5067         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5068         switch; MergeBreakOrigins() now takes care of that.
5070 2005-05-18  Martin Baulig  <martin@ximian.com>
5072         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5073         a loop and may leave it, reset the barrier; fixes #74974.
5075 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5077         Fix test-382.cs.  Emit values of decimal constants.
5078         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5079         Carved out of ...
5080         (TypeContainer.AddField): ... this.
5081         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5082         with initializers to include 'Const's.
5083         (ClassPart.RegisterFieldForInitialization): Forward to
5084         PartialContainer.
5085         * const.cs (Const.Const): Pass initializer to base class.
5086         (Const.Define): In case of decimal constants, register them for
5087         initialization in a static constructor.
5089 2005-05-14  Martin Baulig  <martin@ximian.com>
5091         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5092         do not call ResolveUnreachable() on unreachable statements in
5093         here, see the comment in the source code.
5095 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5097         Fix #74934.
5098         * expression.cs (BinaryResolveOperator): If one of the operands of
5099         an equality comparison is 'null' and the other is a pointer type,
5100         convert the null to a NullPointer.
5101         * convert.cs (ImplicitReferenceConversion): If the expression is a
5102         NullLiteral and the target type is a pointer type, return a
5103         NullPointer instead.
5104         (ImplicitConversionStandard): Likewise.
5106 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5107         
5108         * cs-parser.jay: Set readonly context based on special constructs.
5109         
5110         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5111         readonly variable error handling.
5112         
5113         * rootcontext.cs (EmitCode): Don't verify members when error
5114         occurred.
5115         
5116         * statement.cs (LocalInfo): Add reaodnly context information.
5117         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5119 2005-05-17  Martin Baulig  <martin@ximian.com>
5121         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5122         #70970. 
5124 2005-05-13  Martin Baulig  <martin@ximian.com>
5126         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5127         handle unreachable blocks.
5129 2005-05-13  Martin Baulig  <martin@ximian.com>
5131         * class.cs
5132         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5133         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5134         #74905. 
5136 2005-05-13  Martin Baulig  <martin@ximian.com>
5138         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5139         instance variable, not a local.  Fix #74873.
5140         (Block.ResolveUnreachable): Set it to true here.
5142 2005-05-12  Martin Baulig  <martin@ximian.com>
5144         * cs-parser.jay (property_declaration): Pass the `current_class',
5145         not the `current_container' to Property's .ctor.  Fixes #74912.
5147 2005-05-11  Martin Baulig  <martin@ximian.com>
5149         * typemanager.cs (Closure): Copy this from MCS and merge all the
5150         GMCS-specific changes into it.
5152 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5154         Fix #74920.
5155         * typemanager.cs (unmanaged_enclosing_types): New.
5156         (IsUnmanagedType): Avoid infloops by using
5157         'unmanaged_enclosing_types' to talk with recursive invocations.
5159 2005-05-11  Duncan Mak  <duncan@novell.com>
5161         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5162         continuing to process for 'arg'.
5163         (handle_preprocessing_directive): Check the argument of the #endif
5164         directive and report error CS1025 if there are any trailing
5165         characters.
5167         According to the C# spec, having even whitespace after the #endif
5168         directive is illegal; however, because we call arg.TrimEnd ()
5169         beforehand, we have the same behavior as csc, allowing whitespace
5170         after the directive.
5172         Fixes #74892.
5174 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5176         Fix #74863.
5177         
5178         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5179         (Constructor.GetObsoleteAttribute): Implemented correctly.
5181 2005-05-10  Martin Baulig  <martin@ximian.com>
5183         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5184         resolve the type; fixes #74864.
5185         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5186         in DoResolve(); fixes #74862.
5188 2005-05-10  Martin Baulig  <martin@ximian.com>
5190         * support.cs (ReflectionParameters.ParameterModifier): Use
5191         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5192         and `ParameterAttributes.In'.  Fixes #74884.
5194 2005-05-10  Martin Baulig  <martin@ximian.com>
5196         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5197         the cache if we're just looking for `MemberTypes.NestedType' in a
5198         generic instance.
5200         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5201         constraints if we're still resolving the type tree.
5202         (Expression.MemberLookup): If we're resolving the type tree, only
5203         look for `MemberTypes.NestedType' since we're only interested in
5204         getting types.
5206         * class.cs (TypeContainer.DefineType): Don't resolve the type
5207         parameters here; do this later in ResolveType() after the type
5208         tree has been resolved.
5209         (TypeContainer.ResolveType): New public method; this is called
5210         after the type tree is resolved and before the types are being
5211         populated.  We resolve the generic constraints here.
5212         (TypeContainer.DoDefineMember): Check the constraints on our base
5213         class and interfaces.
5215         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5216         set the `ResolvingTypeTree' flag on the EmitContext.
5218         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5220 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5222         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5223         
5224         * expression.cs (Argument.GetParameterModifier): Turned to property.
5225         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5226         
5227         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5228         its C# equivalent.
5229         
5230 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5232         Fix #74852.
5233         * decl.cs (MemberCache.AddMethods): Register override methods,
5234         rather than non-override methods.
5235         * typemanager.cs (RegisterOverride): New.
5236         (IsOverride): Update.
5238 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5240         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5242 2005-05-06  Martin Baulig  <martin@ximian.com>
5244         * attribute.cs
5245         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5246         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5248 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5250         Fix #73105.
5251         
5252         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5253         recursive declaration.
5254         
5255         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5256         
5257 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5259         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5260         
5261         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5263 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5265         Fix #74797.
5266         * decl.cs (DeclSpace.FamilyAccessible): 
5267         Use TypeManager.IsNestedFamilyAccessible.
5269         Fix reopened #64812.
5270         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5271         internal'.
5273 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5274             Abin Thomas  <projectmonokochi@rediffmail.com>
5275             Anoob V E  <projectmonokochi@rediffmail.com>
5276             Harilal P R  <projectmonokochi@rediffmail.com>
5278         Fix #64812.
5279         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5280         allow access to all static members.
5282 2005-05-04  Martin Baulig  <martin@ximian.com>
5284         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5286 2005-05-04  Martin Baulig  <martin@ximian.com>
5288         Fix #74655.
5290         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5291         section at the end; make things work if `default' is not the last
5292         section.        
5294 2005-05-04  Martin Baulig  <martin@ximian.com>
5296         Fix #70400.
5298         * statement.cs (Switch): Replaced the `got_default' field with a
5299         `default_section' one.
5300         (Switch.CheckSwitch): Set `default_section' here.
5301         (Switch.Resolve): If we're a constant switch and the constant is
5302         not found, use the default section.
5304 2005-05-03  Martin Baulig  <martin@ximian.com>
5306         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5308         * statement.cs (Foreach.ArrayForeach): New nested class.
5309         (Foreach.TemporaryVariable): New nested class.
5310         (Foreach.EmitArrayForeach): Removed; this is now in the new
5311         ArrayForeach class.
5313 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5315         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5316         more conservative.
5317         (VerifyPendingMethods): Revert change below.
5319         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5320         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5321         that used to trigger warning -28.  Remove warning -28.
5322         * expression.cs (Invocation.OverloadResolve): Use
5323         TypeManager.IsOverride to distinguish override methods.
5325         Fix #74773.
5326         * pending.cs (VerifyPendingMethods): If a base type implements the
5327         requested interface, don't bother checking individual methods of
5328         the base type.  As a side-effect, this prevents the creation of
5329         unnecessary proxies.
5331 2005-05-02  Martin Baulig  <martin@ximian.com>
5333         Fix #70182.
5335         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5336         Also `And' the locals if the old vector is null.
5337         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5338         null; in this case we basically reset all the variables.        
5340 2005-05-02  Martin Baulig  <martin@ximian.com>
5342         Fix #74529.
5344         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5345         Added `FlowBranching branching' argument; always `and' the
5346         variables instead of `or'ing them unless we're an infinite loop.
5348         * statement.cs (While.Resolve): Create a new sibling unless we're
5349         infinite.       
5351 2005-05-02  Martin Baulig  <martin@ximian.com>
5353         Fix #70140.
5355         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5356         arguments; use it instead of creating a new TopLevelBlock.
5357         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5358         our ConstructorInitializer.
5360         * statement.cs
5361         (TopLevelBlock.TopLevelBranching): New public property.
5362         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5363         and create our `TopLevelBranching'.
5365         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5366         anonymous method host, use `block.TopLevelBranching' rather than
5367         creating a new branching.
5369 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5371         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5372         a ScopeInfo, if any of the current children is a child of the new
5373         entry, move those children there.
5375 2005-04-30  Martin Baulig  <martin@ximian.com>
5377         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5378         at the beginning of a SwitchSection.  Fix #73335.
5380 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5382         Fix #74378
5383         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5384         
5385         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5386         (FieldExpr.DoResolve): Obsolete members are ignored for field
5387         initializers.
5388         
5389 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5391         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5392         of arrays detection.
5394         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5395         verification.
5396         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5398         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5399         arrays report.
5401 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5403         * cs-parser.jay: Use the prefered version of -unsafe in error
5404         message.
5406 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5408         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5409         circumstances.
5411 2005-04-20  John Luke  <john.luke@gmail.com>
5413         * driver.cs: fix typo in error message, --outout to --output
5415 2005-04-30  Martin Baulig  <martin@ximian.com>
5417         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5418         handle the .NET 2.x security attributes.
5420 2005-04-30  Martin Baulig  <martin@ximian.com>
5422         * typemanager.cs
5423         (TypeManager.ExpandInterfaces): Don't add things twice.
5425         * class.cs
5426         (TypeContainer.VerifyClsCompliance): Allow generic instances.
5428 2005-04-29  Martin Baulig  <martin@ximian.com>
5430         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5432         * anonymous.cs: Added support for anonymous generic methods.
5434 2005-04-29  Martin Baulig  <martin@ximian.com>
5436         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5437         generic instances.
5439 2005-04-29  Martin Baulig  <martin@ximian.com>
5441         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5443         * expression.cs (New.DoResolve): Fix the CS0304 check.
5445 2005-04-29  Martin Baulig  <martin@ximian.com>
5447         * typemanager.cs (TypeManager.GetFullName): Updated to the new
5448         naming schema.
5450         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5451         explicit interface implementation, compare the interface types.
5452         (MethodData.Define): Use the new naming scheme from the latest
5453         .NET 2.x beta2.
5454         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5456         * decl.cs (MemberName.GetMemberName): Removed.
5457         (MemberName.MethodName, FullName): New properties.
5459 2005-04-25  Raja R Harinath  <rharinath@novell.com>
5461         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5463 2005-04-22  Martin Baulig  <martin@ximian.com>
5465         * generic.cs (GenericMethod): Create the EmitContext in the
5466         `Define()'; in `Define(MethodBuilder)', create the type parameters
5467         before calling `Define()'.  Fixes #73933.
5469 2005-04-22  Martin Baulig  <martin@ximian.com>
5471         * generic.cs
5472         (Constraints.Resolve): Make things work wrt. the new type lookup system.
5473         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5475         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5476         ConstructedType, check its constraints.
5478 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5480         * codegen.cs (InRefOutArgumentResolving): New field.
5481         
5482         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5483         fields outside contructor.
5484         
5485         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5486         
5487 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5489         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5490         parameter code was not completed ever, so it was not as up-to-date
5491         as local variables.  Must finish it.
5493         The bug fix was to compare the Toplevel of the block, not the
5494         current block.  Thanks for Ben for pointing this out. 
5496 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5498         * decl.cs (AddMethods): Use the declaring type of the problem
5499         method to determine if we want to squash a warning.
5501 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5503         * attribute.cs: Removed debug output.
5505         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5506         
5507         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5508         Report.Stderr.
5509         
5510 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5512         Fix #74481.
5513         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5514         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5515         all null comparisons against reference types.
5517 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5519         Fix# 74565
5520         * class.cs (TypeContainer.CircularDepException) New nested
5521         exception class.
5522         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5523         (TypeContainer.DefineType): Removed error, reset InTransit before
5524         exit.
5525         (Class.DefineType): Throw exception when is in Transit.
5526         Catch exception and report error.
5527         (Struct.DefineType): Throw exception when is in Transit.
5528         Catch exception and report error.
5529         (Interface.DefineType): Throw exception when is in Transit.
5530         Catch exception and report error.
5532         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5533         handle nested exception handlers.
5535         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5536         a catch.
5538         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5539         InFinally and InCatch storage.
5541         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5542         (Catch.Resolve): Set and Restore ec.InCatch.
5543         (Try.Resolve): Set and Restore ec.InFinally.
5544         (Try.HasCatch): True when try has catch.
5546 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5548         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5549           for the same event member, so exclude such cases from warning 419.
5550           Fixed bug #74633.
5552 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5554         * expression.cs (Binary.ResolveOperator): Apply patch from John
5555         Luke to fix bug 59864: operators &, | and ^ on enumerations
5556         require that the same enum type on both sides.
5558         * driver.cs: Add warnings to old flag usage, this is to assist
5559         people who produce Makefiles and hope that the Makefiles will be
5560         used on Windows.
5562         * class.cs (TypeContainer.EmitType): Moved the definition of the
5563         special $PRIVATE$ field from the resolve phase to the Emit phase.
5564         During resolve we do not know if we are a struct with
5565         HasExplicitLayout, we know this only after the attributes for the
5566         type are emitted.
5568         Set the FieldOffset to zero on the dummy field that we create for
5569         the class.   Fixes 74590.
5571 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5573         Fix #73834.
5574         * ecore.cs (PropertyExpr.resolved): New.
5575         (DoResolve): Use it to handle a case of double resolution here.
5576         Handle a case of identical-name-and-type-name.
5577         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5578         resolution by storing the results of expression resolution back
5579         into the "probes" array.
5581 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5583         Fix cs0208-7.cs and cs0208-8.cs.
5584         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5585         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5586         error reporting to point out the reason a struct is not unmanaged.
5588 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5590         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5591           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5593 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5595         Fix #74528.
5596         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5597         IdenticalNameAndTypeName here.
5598         (EventExpr.InstanceResolve): Likewise.
5600 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5602         C# 2.0 DefaultCharSetAttribute implementation
5603         
5604         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5605         which allows us to set GlobalNamespace for every resolve.
5606         (Attribute.ResolveArguments): Cut from Resolve.
5607         (Attribute.GetCharSetValue): Returns CharSet named argument.
5608         (Attribute.DefinePInvokeMethod): Gets default charset from
5609         module settings.
5610         (GlobalAttribute.ResolveAsTypeStep): Override.
5611         (GlobalAttribute.ResolveArguments): Override.
5612         
5613         * class.cs (TypeAttr): Is protected.
5614         
5615         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5616         (ModuleClass.DefaultCharSetType): New memeber.
5617         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5618         
5619         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5620         charset from module.
5621         
5622         * delegate.cs (TypeAttr): Override.
5623         (Delegate.DefineType): Use this TypeAttr.
5624         
5625         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5626         at very early stage (before types are defined) to resolve model
5627         module attributes. It will probably not work with corlib but it
5628         should be ok.
5629         
5630         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5631         charset from module.
5632         
5633         * typemanager.cs (default_charset_type): New type.
5635 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5637         * decl.cs (MemberCache.AddMethods): Don't warn if
5638         System.Object.Finalize has buggy MethodAttributes.
5640         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5641         removed below.
5643 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5645         * doc.cs : detect ambiguous reference to overloaded members.
5646           Fixed bug #71603. MS 1.1 csc does not detect it.
5648 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5650         * doc.cs : delegates must not be referenced with parameters.
5651           Fixed bug #71605.
5653 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5655         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5657 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5659         * driver.cs (MainDriver): Stop processing if the CLS stage found
5660         errors. 
5662         (CompilerCallableEntryPoint.InvokeCompiler): Always
5663         reset after execution;   Take a TextWriter argument for the
5664         output.
5666         * report.cs: Use the error stream instead of hardcoding stderr. 
5668 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5670         * class.cs: Reduce code paths to test, too small of an
5671         optimization to make it worth the extra testing.  Always perform
5672         it. 
5674 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5676         Fix #74510.
5677         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5678         operators that had errors reported on them.
5680 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5682         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5683         argument types.
5684         (Attribute.Resolve): Add named argument type checking.
5685         
5686         * class.cs (FixedField.Define): Use IsPrimitiveType
5687         
5688         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5689         
5690         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5691         unsafe parameter types.
5692         
5693         * statement.cs (Using.ResolveExpression): Add better error description.
5694         
5695         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5696         
5697 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5699         Fix #74484.
5700         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5701         AttributeUsageAttribute in the emitcontext of the attribute class,
5702         not in the emitcontext of the attributable entity it was attached to.
5703         * cs-parser.jay: Use 'current_class', not 'current_container',
5704         when creating a GlobalAttribute.
5706 2005-04-08  Alp Toker  <alp@atoker.com>
5708         * pending.cs: The fix to #58413 failed to compile methods implementing
5709         interfaces with/without params modifiers and vice versa, even though
5710         params modifiers aren't part of the signature. Make the modifier check
5711         less strict as in csc.
5713 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5714             Anoob V E  <projectmonokochi@rediffmail.com>
5715             Harilal P R  <projectmonokochi@rediffmail.com>
5717         Fix #58413.
5718         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5719         modifiers of pending methods.
5720         (PendingImplementation.PendingImplementation): Initialize it.
5721         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5722         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5723         with ParameterData.  Add check for modifiers.
5724         * class.cs (MethodData.Define): Update to changes.
5726 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5728         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5730 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5732         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5733         property.
5734         
5735         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5736         
5737         * rootcontext.cs,
5738         * typemanager.cs: Registered RequiredAttributeAttribute.
5739         
5740 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5742         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5743         Warning CS0169 is back at level 3.
5744         (IMethodData.SetMemberIsUsed): New method.
5745         
5746         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5747         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5748         
5749         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5751         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5752         contants.
5753         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5754         is used.
5755         
5756         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5757         is used.
5758         
5759         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5760         to avoid the problems with nested types.
5762 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5763             Anoob V.E  <projectmonokochi@rediffmail.com>
5764             Harilal P.R  <projectmonokochi@rediffmail.com>
5765             Raja R Harinath  <rharinath@novell.com>
5767         Fix #73820.
5768         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5769         attribute.
5770         * typemanager (GetConstructor): Make public.
5772 2005-04-05  John Luke  <john.luke@gmail.com>
5773             Raja R Harinath  <rharinath@novell.com>
5775         Fix #62232.
5776         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5777         struct too.  Return false quicker in a few cases.
5778         (VerifyUnManaged): Use it.
5780 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5782         Fix #74041.
5783         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5784         not 'unreachable_seen'.
5786 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5788         * attribute.cs (Attribute.GetValue): Removed unused.
5789         
5790         * codegen.cs (CodeGen.TrimExt): Removed unused.
5791         
5792         * cs-parser.jay (output): Removed unused.
5793         
5794         * cs-tokenizer.cs (hex_digits): Removed unused.
5795         
5796         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5797         
5798         * expression.cs (Indirection.LoadExprValue): Removed unused.
5799         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5800         
5801         * iterators.cs (Iterator.param_types): Removed unused.
5802         
5803         * statement.cs (Goto.block): Removed unused.
5804         (ToplevelBlock.did): Removed unused.
5805         (Switch.ResolveConstantSwitch): Removed unused.
5807 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5809         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5810         resetting thingy.
5812 2005-04-19  Martin Baulig  <martin@ximian.com>
5814         Merged r42462 from MCS and made it work for GMCS.
5816         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5818         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5820 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5822         Fix #74232 and cs0208-3.cs.
5823         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5824         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5825         unmanaged type.  Don't use FieldBuilders when 't' is a
5826         TypeBuilder.  Use ModFlags and MemberType fields.
5827         * class.cs (MemberBase.member_type): Rename from MemberType.
5828         (MemberBase.MemberType): New property.  Determines member_type on
5829         demand.
5830         (MemberBase.DoDefine): Don't initialize MemberType here.
5831         (FieldMember.Define): Likewise.
5833 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5835         Fix #74241
5836         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5837         Attributes are emitted there.
5838         
5839 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5841         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5842         keyword in 'partial enum' too.
5843         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5844         is not allowed).
5845         Report from Kamil Skalski <nazgul@omega.pl>.
5847         Fix #74309.
5848         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5849         have partial containers too.
5851         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5852         in block' checks to Block.CheckInvariantMeaningInBlock.
5853         * statement.cs (Block.GetKnownVariableInfo): Make private.
5854         (Block.IsVariableUsedInChildBlock): Remove.
5855         (Block.IsVariableUsedInBlock): Likewise.
5856         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5857         conflicting declaration.
5858         (Block.AddVariable): Make error messages less long-winded and more
5859         specific.  Show location of conflicting declaration.
5860         * parameter.cs (Parameters.Location): New readonly property.
5862 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5864         Clean up semantics of invoking ResolveMemberAccess.
5865         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5866         can have an instance, ensure that we pass in a non-TypeExpression
5867         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5868         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5869         argument.  Update to changes and simplify.
5870         (FieldExpr.Emitinstance): Remove CS0120 check.
5871         (PropertyExpr.EmitInstance): Likewise.
5872         * expression.cs (Argument.Resolve): Likewise.
5873         (Invocation.DoResolve): Update to changes in semantics of
5874         InstanceExpression.
5876 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5878         Fix #74241
5879         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5880         customization.
5881         
5882         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5884 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5886         Fix difference in behaviour with commandline invocation.
5887         * driver.cs (Driver.Reset): New.
5888         (CompilerCallableEntryPoint): Call it.
5890         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5891         variable" warnings if the boolean expression failed to resolve.
5893 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5895         * attribute.cs: Fix the union of several permissions when some of them
5896         are unrestricted (so the result isn't an unrestricted permission set).
5897         Fix #74036.
5899 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5901         * ecore.cs (MemberExpr): New class.  Convert from interface
5902         IMemberExpr.
5903         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5904         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5905         error checks.
5906         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5907         (MethodGroupExpr.IsExplicitImpl): Remove.
5908         (Expression.GetFieldFromEvent): Remove.
5909         (SimpleName.MemberStaticCheck): Remove.
5910         (SimpleName.DoSimpleNameResolve): Update to changes.
5911         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5912         (MemberAccess.IdenticalNameAndTypeName): Remove.
5913         (MemberAccess.error176): Move to MemberExpr.
5914         (MemberAccess.DoResolve): Update to changes.
5915         (BaseAccess.DoResolve): Likewise.
5917 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5919         C# 2.0 Conditional attribute class implementation
5920         
5921         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5922         Analyzes class whether it has attribute which has ConditionalAttribute
5923         and its condition is not defined.
5924         
5925         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5926         (Class.IsExcluded): New method. Search for at least one defined
5927         condition in ConditionalAttribute of attribute class.
5929 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5931         * ecore.cs (PropertyExpr): Derive from Expression, not
5932         ExpressionStatement.
5933         (PropertyExpr.EmitStatement): Remove.
5935 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5937         Fix #74060.
5938         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5939         internal field "value__" of an enum be private.  The examples for
5940         "value__" that I found on MSDN all used FieldAttributes.Private.
5942         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5943         Don't mention IL method attribute names.
5945         Fix #47991.  Remove a TODO.
5946         * statement.cs (Block.Toplevel): Make into a field.
5947         (Block.Parameters): Move into ToplevelBlock.
5948         (Block.known_variables): Rename from child_variable_names.
5949         (Block.Block): Remove variants that take Parameters.  Initialize
5950         'Toplevel' with the immediately surrounding toplevel block.
5951         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5952         LocalInfo parameter.
5953         (Block.GetKnownVariableInfo): New.
5954         (Block.IsVariableNameUsedInChildBlock): Update.
5955         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5956         the block, even though it may not be in scope.
5957         (Block.AddVariable): Remove Parameters parameter.  Use
5958         Toplevel.Parameters instead.
5959         (Block.AddConstant): Remove Parameters parameter.
5960         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5961         (Block.IsParamaterReference): Likewise.
5962         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5963         (ToplevelBlock.Parameters): New.  Moved from Block.
5964         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5965         initialize Parameters to a non-null value.
5966         * cs-parser.jay: Update to changes.
5967         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5968         simple names that mean different things in the same block.  Use
5969         Block.IsVariableNameUsedInBlock.
5971 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5973         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5975 2005-03-26  Raja R Harinath  <harinath@acm.org>
5977         Fix #73038.
5978         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5979         fails to resolve, ensure that the LHS is still resolved as an
5980         lvalue.
5982 2005-03-25  Raja R Harinath  <harinath@acm.org>
5984         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5985         ec.ContainerType.
5986         (Enum.current_ec): Remove.
5987         (Enum.LookupEnumValue): Remove EmitContext argument.
5988         Just uses the one created during DefineType.
5989         (Enum.FindMembers): Update.
5990         * expression.cs (MemberAccess.DoResolve): Update.
5992 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5994         * assign.cs (Assign.DoResolve): Check for CS1717 when
5995         source and target are same (uses Equals).
5997         * expression.cs (LocalVariableReference, ParameterReference,
5998         This): Implemented Equals, GetHashCode.
6000         * statement.cs (Block.GetParameterReference): Removed useless
6001         local variable.
6003 2005-03-22  Raja R Harinath  <rharinath@novell.com>
6005         Fix cs0128.cs
6006         * statement.cs (Block.AddVariable): Ensure that we skip implicit
6007         blocks before deciding whether the error is cs0136 or cs0128.
6009         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6010         (using_alias_directive, using_namespace_directive): Pass
6011         MemberName, not an expression to Namespace.UsingAlias and
6012         Namespace.Using.
6013         (MakeName): Use the MemberName of the namespace.
6014         * namespace.cs (Namespace.MemberName): New.
6015         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6016         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6017         Likewise.
6018         * decl.cs (MemberName.Name): Make readonly.
6019         (MemberName.FromDotted): New "constructor".
6020         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6021         (MemberCore.Name): Compute from MemberName on demand.
6022         (MemberCore.SetMemberName): Provide a way to change the
6023         MemberName.
6024         (MemberCore.AddToContainer): Don't take a fullname parameter.
6025         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6026         fully qualified name of the container to the member name.
6027         (TypeContainer.AddToTypeContainer): Use a fully qualified name
6028         only if the type is a member of the root container.
6029         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6030         MemberName.Left rather than searching for an embedded ".".
6031         (PartialContainer.CreatePart): Update to changes in RootContext.
6032         (MemberBase.ShortName): Turn into a property.  Use
6033         MemberCore.SetMemberName.
6034         (MemberBase.ExplicitInterfaceName): Remove.
6035         (MemberBase.UpdateMemberName): Remove.
6036         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6037         (PropertyBase.SetMemberName): New override.
6038         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6039         (Tree.GetDecl): New.
6040         (Tree.AllDecls): Rename from Decls.
6041         * attribute.cs, enum.cs, report.cs: Update to changes.
6042         * driver.cs (MainDriver): Use MemberName.FromDotted on
6043         RootContext.MainClass.
6045 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6047         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6048         checks.
6050         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6052 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6054         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6055         property accessor modifiers.
6057         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6058         fixed buffer attribute (CS1716).
6059         (PropertyMethod.HasCustomAccessModifier): When property accessor
6060         has custom modifier.
6062         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6063         modifiers.
6064         (PropertyExpr.DoResolveLValue): Add CS0272.
6066 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6068         * convert.cs: When converting to a pointer, use the proper Conv.U
6069         or Conv.I depending on the source data type.
6071         * cs-tokenizer.cs: Make the size for large decimal constants,
6072         fixes #72957.
6074 2005-03-17  Martin Baulig  <martin@ximian.com>
6076         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6077         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6079 2005-03-17  Martin Baulig  <martin@ximian.com>
6081         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6082         to bool so we can return an error condition.
6083         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6084         returned an error.
6086 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6088         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6089         attributes.
6091 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6093         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6094         Refactor to avoid traversing the list of assemblies, and to avoid
6095         string concatenation.
6096         * typemanager.cs (guid_attr_type): Remove.
6097         (negative_hits, pointers, references): Remove hashes.
6098         (type_hash): New.
6099         (GetConstructedType): New.  Uses type_hash to handle constructed
6100         types (arrays, references, pointers).
6101         (GetReferenceType, GetPointerType): Use it.
6102         (GetNestedType): New.  Uses type_hash to handle nested types of
6103         reflected types.
6104         (LookupType, LookupTypeDirect): Remove.
6105         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6106         'types' hash and LookupTypeReflection directly.
6107         (params_string, params_object): Use GetConstructedType.
6108         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6109         top-level types.
6110         (Namespace.Lookup): Use cached_types.
6111         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6112         provided by old TypeManager.LookupType.
6113         * rootcontext.cs (MakeFQN): Remove.
6114         * decl.cs (DeclSpace.MakeFQN): Likewise.
6115         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6116         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6117         TypeManager.GetConstructedType.
6118         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6120 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
6122         * cs-parser.jay: Fix build.
6124 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
6126         * class.cs (TypeContainer.CircularDepException) New nested
6127         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6129         * cs-parser.jay: Reports CS1527 for any namespace element.
6131         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6132         Added CS0407.
6134         * expression.cs (ParameterReference.IsAssigned): Changed error to
6135         CS0269.
6136         (Error_WrongNumArguments): Moved CS0245 detection here.
6138         * statement.cs (Return.Resolve): Add CS1622 report.
6140 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
6142         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6144 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
6146         * attribute.cs expression.cs: Get rid of some allocations.
6148 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
6150         * doc.cs : just eliminate the latest change.
6152 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6154         * doc.cs : commented out the latest change. It breaks xml-030.cs
6156 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6158         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6159           fail. So invoke CreateType() in FindDocumentedType().
6161 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6163         * cs-tokenizer.cs : added IsKeyword().
6164         * doc.cs : Detect keyword incorrectly used as identifier.
6165           Allow identifiers prefixed by @.
6167 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6169         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6170         It caused exception in namespace resolving (again!).
6171         
6172         * class.cs (Class.ctor): Removed exit.
6173         (PropertyMethod.ctor): ditto.
6174         
6175         * codegen.cs (Codegen.Reset): Reset static data.
6176         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6177         
6178         * cs-tokenizer.cs (Cleanup): Removed.
6179         
6180         * driver.cs (GetSystemDir): Rewrote to one line command.
6181         It caused problem with unloaded dynamic modules.
6182         (UnixParseOption): Removed Exit.
6183         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6184         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6185         Now can be mcs used as library.
6186         
6187         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6188         empty location.
6189         
6190         * location.cs (Reset): Reset static data.
6191         
6192         * namespace.cs (Reset): Reset static data.
6193         
6194         * report.cs (Report.Reset): Reset static data.
6195         
6196         * rootcontext.cs (RootContext.Reset): Reset static data.
6197         
6198         * tree.cs (RootTypes.ctor): Use Location.Null
6199         
6200         * typemanager.cs (TypeManager.Reset): Reset static data.
6201         (CoreLookupType): Removed Exit.
6202         (TypeHandle.Reset): Reset static data.
6203         
6204 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6206         Fix #73516.
6207         * typemanager.cs (ComputeNamespaces): Import namespaces from
6208         referenced modules too.
6210 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6212         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6213         than '.'.
6215 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6217         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6218         enclosing DeclSpace.  This ensures that a name-lookup populates
6219         more caches and there are fewer 'TypeExpression's.  Carve out
6220         nested type lookup into ...
6221         (LookupNestedTypeInHierarchy): ... this.
6223 2005-04-15  Martin Baulig  <martin@ximian.com>
6225         Merged r41590 from MCS and make it work in the generics land.
6227         * generic.cs (TypeParameter.UpdateConstraints): Removed the
6228         `check' argument.
6230         * class.cs (PartialContainer.UpdateConstraints): Removed.
6231         (PartialContainer.CheckConstraints): Removed.
6232         (PartialContainer.SetParameterInfo): Store the constraints here.
6233         (PartialContainer.DefineTypeParameters): New public method;
6234         resolve the type parameter's constraints here.  Note that the
6235         PartialContainer doesn't have an EmitContext anymore, so we must
6236         do this in the ClassPart.
6238 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6240         Clean up a few partial-class semantics.  
6241         Fixes test-357.cs and cs1618-2.cs.
6242         * cs-parser.jay (struct_declaration): Use 'current_class' as
6243         parent of newly-created struct.  Remove call to Register ().
6244         Use 'pop_current_class' to complete handing the current struct.
6245         (interface_declaration): Likewise.
6246         (class_declaration): Likewise.
6247         (enum_declaration): Use 'current_class' as parent of newly created
6248         enum.
6249         (delegate_declaration): Likewise.
6250         (pop_current_class): New function.  This is used to handle closing
6251         up the 'current_class' and 'current_container', and pointing them
6252         to the enclosing class/container.
6253         (CSharpParser): Initialize 'current_class' too.
6254         * decl.cs (MemberCore): Add check for invariant: a partial
6255         container is not a parsed entity, and thus does not enclose any
6256         parsed members.
6257         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6258         (DeclSpace.BaseTypeExpr): Use it.
6259         (DeclSpace.LookupType): Add check for invariant.
6260         * class.cs (TypeContainer): Add check for invariant: a nested
6261         class should have the same NamespaceEntry as its enclosing class.
6262         (TypeContainer.EmitFieldInitializers): Make virtual.
6263         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6264         MemberCore.
6265         (TypeContainer.Register): Remove.
6266         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6267         null.  Use TypeResolveEmitContext for resolving base types and
6268         interfaces.  Move initialization of Parts.TypeBuilder here from
6269         ...
6270         (TypeContainer.DefineNestedTypes): ... here.
6271         (PartialContainer): Take a Namespace not a NamespaceEntry.
6272         (PartialContainer.Create): Don't use Register.  Call the
6273         appropriate Add... function directly.
6274         (ClassPart): Take both the PartialContainer and the enclosing
6275         class as constructor arguments.
6276         (ClassPart.EmitFieldInitializers): Override.
6277         (ClassPart.PartFindNestedTypes): Remove.
6278         (FieldBase.GetInitializerExpression): Resolve the initializer
6279         expression in the emit context of the enclosing class.
6280         * tree.cs (RootTypes): Remove Register ().
6281         
6282 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6284         * cs-parser.jay: Removed CS0134.
6285         
6286         * driver.cs: Removed CS1901.
6287         
6288         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6289         for predefined types.
6291 2005-03-07  Duncan Mak  <duncan@novell.com>
6293         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6294         well. Fixes bug #73454.
6296 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6298         * cs-tokenizer.cs (xtoken): Add CS1035.
6299         
6300         * class.cs (MethodData.Define): Add CS0683.
6301         (FieldMember.ctor): Add CS0681.
6303 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6305         * ecore.cs (SimpleName.DoResolve): Rename from
6306         SimpleName.DoResolveAllowStatic.
6307         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6308         Pass 'intermediate' flag to MemberStaticCheck.
6309         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6310         of "intermediate" lookups via MemberAccess.
6311         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6312         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6314 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6316         Fix #73394.
6317         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6318         slipped in because of variable names that are identical to a
6319         builtin type's BCL equivalent ('string String;', 'int Int32;').
6320         (PropertyExpr.EmitInstance): Likewise.
6322 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6324         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6325         
6326         * report.cs (warning_ignore_table): Made public.
6328 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6330         Fix #73282.
6331         * class.cs (MethodData.Emit): Pass 'container' to
6332         container.GetObsoleteAttribute instead of 'container.Parent'.
6334 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6336         * cs-parser.jay: Add 1534 error test.
6338         * iterators.cs (Yield.CheckContext): Add error 1629.
6339         (Iterator.ctor): Save unsafe modifier.
6340         (MoveNextMethod.DoEmit): Restore unsafe context.
6342         * namespace.cs (UsingAlias): Better error message.
6344 2005-03-03  Dan Winship  <danw@novell.com>
6346         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6347         the warning message [#73219]
6349 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6351         Fix compile with MCS 1.0.0.0.
6352         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6353         w_restore to not depend on string constant folding.
6355 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6357         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6358         CS0246 check to users who passed 'silent = false'.
6359         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6360         check.
6361         (SimpleName.SimpleNameResolve): Update.
6362         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6363         (MemberAccess.IdenticalNameAndTypeName): Update.
6364         * doc.cs (FindDocumentedTypeNonArray): Update.
6366 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6368         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6369         * parameters.cs (ComputeAndDefineParameters): Remove.
6370         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6371         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6372         Use GetParameterInfo.
6374 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6376         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6378 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6380         Unify DeclSpace.LookupType and DeclSpace.FindType.
6381         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6382         is in charge of defining nested types on demand.
6383         (DeclSpace.LookupType): Use it when the current_type is a
6384         TypeBuilder.  Use LookupTypeDirect for reflected types.
6385         (DeclSpace.FindType): Remove.
6386         (DeclSpace.LookupInterfaceOrClass): Likewise.
6387         (DeclSpace.DefineTypeAndParents): Likewise.
6388         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6389         DeclSpace.LookupType.
6390         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6391         * typemanager.cs (LookupType): Simplify.
6392         (AddUserType): Remove type from negative_hits.
6393         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6394         * class.cs (TypeContainer.FindMembers): Move handling of nested
6395         types ...
6396         (TypeContainer.FindMembers_NestedTypes): ... here.
6397         (TypeContainer.FindNestedType): Implement override.
6398         (ClassPart.FindNestedType): Delegate to PartialContainer.
6399         (ClassPart.PartFindNestedType): Looks up the nested types of the
6400         part alone.
6402 2005-04-14  Martin Baulig  <martin@ximian.com>
6404         * generic.cs (ConstructedType): Moved all the type lookup and
6405         nested class logic into SimpleName.
6406         (ConstructedType.ResolveConstructedType): Our underlying type is
6407         already fully resolved; all the type lookup stuff is in
6408         SimpleName.
6410         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6411         constructed types here instead of in ConstructedType.
6413         * decl.cs (MemberName.GetTypeExpression): Always create a
6414         SimpleName, not a ConstructedType.
6415         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6417 2005-03-02  Martin Baulig  <martin@ximian.com>
6419         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6420         static constructor in static classes.
6422 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6424         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6425         sizeParamIndex is not specified.
6427 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6429         Fix #73117
6430         * report.cs (WarningMessage.IsEnabled): Missing null check.
6432 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6434         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6435         in the fields and not in the properties.
6437 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6439         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6440         fields as well.
6442 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6444         * attribute.cs: Small refactoring (improved robustness).
6445         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6446         (ValidateGuid): Removed.
6447         (Resolve): Removed referenced to above mentioned.
6448         (GetAttributeUsage): Made private and changed to work without
6449         class assistance.
6450         (GetIndexerAttributeValue): Don't crash.
6451         (GetConditionalAttributeValue): Ditto.
6452         (GetClsCompliantAttributeValue): Ditto.
6453         (ExtractSecurityPermissionSet): All attributes exceptions are
6454         error 648.
6455         (GetPropertyValue): New helper.
6456         (GetMethodImplOptions): New method.
6457         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6458         some missing properties.
6459         
6460         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6461         (Method.ApplyAttributeBuilder): Updated.
6462         
6463         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6464         exception.
6466 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6468         Fix #73052.
6469         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6470         non-simple types (array, pointer, reference).
6472 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6474         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6476         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6477         for operators.
6478         (Method.CheckBase): Catch wrong destructor here.
6479         (MethodData.Define): Add errors 550, 668.
6481         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6483         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6485         * pending.cs (VerifyPendingMethods): Add error 551.
6487         * typemanager.cs (CSharpName): Next error report helper.
6489 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6491         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6492         attributes. Removed useless attribute double check.
6493         It saves almost 2MBs for corlib.
6495 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6497         Fix #72924.
6498         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6499         called twice in case of error.
6501 2005-02-23  Chris Toshok  <toshok@ximian.com>
6503         Fix compiler portions of #72827.
6504         * statement.cs (Block.Emit): call Begin/EndScope on the
6505         EmitContext instead of the ILGenerator.
6507         * codegen.cs (EmitContext.BeginScope): new method, call
6508         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6509         we have one.)
6510         (EmitContext.BeginScope): same, but EndScope and CloseScope
6512         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6513         offset and call the superclass's OpenScope(int) with it.
6514         (SymbolWriter.CloseScope): get the current il
6515         offset and call superclass's CloseScope(int) with it.
6517 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6519         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6520         CS1677 for out and ref as well.
6522         * class.cs (Method.Define): Add error CS1599 detection.
6523         
6524         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6525         
6526         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6527         
6528         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6529         
6530         * support.cs.cs (ModifierDesc): New helper method.
6532 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6533             Abin Thomas  <projectmonokochi@rediffmail.com>
6534             Anoob V E  <projectmonokochi@rediffmail.com>
6535             Harilal P R  <projectmonokochi@rediffmail.com>
6537         Fix #57851, #72718.
6538         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6539         MemberLookup (used for error reporting) actually returns a result.
6540         Fix error report number (122, not 112).
6542 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6543             Anoob V E  <projectmonokochi@rediffmail.com>
6544             Harilal P R  <projectmonokochi@rediffmail.com>
6546         Fix #71134.
6547         * pending.cs (PendingImplementation.GetAbstractMethods):
6548         Find NonPublic members too.
6550 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6552         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6553         Fixed error 217.
6554         
6555         * class.cs (MethodCore.CheckMethodAgainstBase):
6556         Add error 239 report.
6558 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6560         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6561         
6562         * class.cs (Operator.Define): Add error 217 report.
6563         
6564 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6566         Fix #68955.
6567         * expression.cs (Invocation.IsApplicable): Make public.
6568         (Invocation.IsParamsMethodApplicable): Likewise.
6569         * delegate.cs (Delegate.VerifyApplicability): Don't use
6570         Invocation.VerifyArgumentCompat for parameter applicability
6571         testing.  Use Invocation.IsApplicable and
6572         Invocation.IsParamsMethodApplicable.
6574 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6576         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6577         
6578         * class.cs (Operator.Define): Add error 217 report.
6579         
6580 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6582         * namespace.cs (UsingEntry.Resolve): Undo change below.
6584 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6586         Fix #72756.
6587         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6588         disable the error message when the extended MemberLookup also
6589         fails.
6590         (Expression.MemberLookupFinal): Update.
6591         (SimpleName.DoSimpleNameResolve): Update.
6592         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6593         Don't use MemberLookupFinal.
6594         (New.DoResolve): Update.
6595         (BaseAccess.CommonResolve): Update.
6597 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6599         Fix #72732.
6600         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6601         occured previously, don't resolve again.
6603 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6605         Fix #69949
6606         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6607         argument. Call ResolveAttributeUsage for unresolved.
6608         when types doesn't match ctor arguments.
6609         
6610         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6611         for nested attribute classes.
6612         (Class.attribute_usage): Removed.
6613         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6614         for attribute class.
6615         
6616         * ecore.cs (IsAttribute): Removed.
6617         
6618         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6619         
6620         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6621         now normal types.
6622         (attribute_types): Removed.
6623         (EmitCode): Global attributes are emited as the latest.
6625 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6627         * class.cs (EmitFieldInitializers): Don't emit field initializer
6628         for default values when optimilization is on.
6629         
6630         * constant.cs (Constant.IsDefaultValue): New property.
6631         
6632         * driver.cs: Add /optimize handling.
6633         
6634         * constant.cs,
6635         * ecore.cs,
6636         * literal.cs: Implement new IsDefaultValue property.
6637         
6638         * rootcontext.cs (Optimize): New field, holds /optimize option.
6640 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6642         Fix crasher in re-opened #72347.
6643         * namespace.cs (Namespace.Lookup): Return null if
6644         DeclSpace.DefineType returns null.
6646         Fix #72678.
6647         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6649 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6651         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6652         now returns null if it cannot resolve to an lvalue.
6653         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6654         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6655         returned null.  Remove check for SimpleName.
6656         (EventExpr.DoResolveLValue): New.
6657         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6658         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6659         error from ...
6660         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6661         avoid CS0131 error.
6662         (Unary.ResolveOperator): Move CS0211 check ...
6663         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6664         CS0131 error.
6665         (Unary.DoResolveLValue): Simplify.
6666         (AddressOf.DoResolveLValue): New.
6667         (ArrayAccess.DoResolveLValue): New.
6669 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6671         * attribute.cs (Attribute.Resolve): Add arguments casting for
6672         when types doesn't match ctor arguments.
6674 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6676         Fix parts of #63202.
6677         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6678         lookup of operator in base type.  Ensure that all checks happen
6679         when the operator resolves to an "op_..." method.
6681 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6683         Fix #71992.
6684         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6685         'ignore_cs0104' parameter.  Pass it to ...
6686         (NamespaceEntry.Lookup): ... this.
6687         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6688         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6689         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6690         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6691         Update.  Request that cs0104 errors be ignored.
6692         (ComposedCast.ResolveAsTypeStep): Update.
6694 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6696         Fix #59209.
6697         * expression.cs (Invocation.BetterFunction): Remove support for
6698         comparing virtual functions and their overrides.
6699         (Invocation.IsOverride): New.
6700         (Invocation.OverloadResolve): Don't consider 'override' functions
6701         during candidate selection.  Store them in a lookaside list.
6702         If the selected method is a 'virtual' function, use the list to
6703         find any overrides that are closer to the LHS type.
6705 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6707         * expression.cs (New.DoResolve): Add complex core type reduction.
6708         (New.Constantify): Converts complex core type syntax like 'new int ()'
6709         to simple constant.
6710         
6711 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6713         * decl.cs (EntryType.EntryType): New constructor to create an
6714         updated copy of a cache entry.
6715         (MemberCache.AddMethods): Use it.
6716         (MemberCache.ClearDeclaredOnly): Remove.
6717         (MemberCache.MemberCache): Update.
6719 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6721         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6722         variable.  This one is represents the actual low-level declaration
6723         of the method, as opposed to the semantic level `IsStatic'.   
6725         An anonymous method which is hosted into a static method might be
6726         actually an instance method.  IsStatic would reflect the
6727         container, while MethodIsStatic represents the actual code
6728         generated.
6730         * expression.cs (ParameterReference): Use the new MethodIsStatic
6731         instead of IsStatic.
6733         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6734         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6735         set on the current EmitContext. 
6737         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6738         resolve our casted expression as an LValue.  This triggers the
6739         proper LValue processing that is later required by Assign.
6741         This fixes 72347.
6743         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6745 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6747         C# 2.0 Fixed buffer implementation
6749         * anonymous.cs: Update after RegisterHelperClass renaming.
6751         * attribute.cs (AttributeTester.fixed_buffer_cache):
6752         Cache of external fixed buffers.
6753         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6754         implementation if field is fixed buffer else null.
6756         * class.cs
6757         (TypeContainer.AddField): Accept FieldMember instead of Field.
6758         (FieldBase.IsFieldClsCompliant): Extracted code from
6759         VerifyClsCompliance descendant customization.
6760         (FixedField): New class handles fixed buffer fields.
6761         (FixedFieldExternal): Keeps information about imported fixed
6762         buffer.
6763         (IFixedField): Make access to internal or external fixed buffer
6764         same.
6766         * cs-parser.jay: Add fixed buffer parsing.
6768         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6769         buffer.
6771         * expression.cs (Indirection): Extended implementation to accept
6772         fixed buffer field.
6773         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6774         (ElementAccess.MakePointerAccess): Get type as parameter.
6775         (DoResolve): Add fixed buffer field expression conversion.
6776         (DoResolveLValue): Ditto.
6777         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6778         (ArrayPtr): Derives from FixedBufferPtr.
6779         (ArrayPtr.Emit): Add extra emit for array elements.
6781         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6783         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6784         for compiler generated types.
6785         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6787         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6788         and consume less memory.
6789         (Fixed.Resolve): Add fixed buffer case.
6791         * typemanager.cs (compiler_generated_attr_ctor,
6792         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6793         (HasElementType): Add our own implementation to work on every
6794         runtime.
6796 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6798         * anonymous.cs (CaptureContext): Track whether `this' has been
6799         referenced.   
6801         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6802         only captured `this' if it was implicitly done (instance
6803         methods/variables were used). 
6805         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6806         `this' must be captured.
6808 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6810         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6811         is null it means that there has been no need to capture anything,
6812         so we just create a sibling.
6814         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6816         Just a partial fix.  The other half is fairly elusive.
6817         
6818 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6820         Fix #52586, cs0121-4.cs.
6821         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6822         and return a hashtable.
6823         (MemberCache.ClearDeclaredOnly): New.
6824         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6825         the method_hash of a base type too.
6826         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6827         type methods.  Overwrite entries with the same MethodHandle so
6828         that the ReflectedType is correct.  The process leaves in base
6829         virtual functions and their overrides as distinct entries.
6830         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6831         matters since it was boxed in a ArrayList before.
6832         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6833         modifier.
6834         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6835         case of a virtual function and its override (choose the overload
6836         as better).
6837         (Invocation.OverloadResolve): Avoid 'override' members during
6838         'applicable_type' calculation.
6840 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6842         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6843         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6844         GetTypeHandle.  It is possible for a reflected type to derive from
6845         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6846         System.Array during mscorlib compilation).
6847         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6848         contain a method_hash, don't create one either.  Don't create a
6849         deep copy of the base cache's method_hash.
6850         (MemberCache.SetupCache): Rename back from DeepCopy.
6851         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6852         already initialized.  If we see an override function, add its
6853         underlying base virtual function to the member_hash too.
6855 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6857         Combine two near-redundant caches.
6858         * typemanager.cs (method_params): Rename from method_internal_params.
6859         (TypeManager.GetParameterData): New.  Replace
6860         Invocation.GetParameterData.
6861         (TypeManager.LookupParametersByBuilder): Remove.
6862         * expression.cs (Invocation.method_parameter_cache): Remove.
6863         (Invocation.GetParameterData): Remove.
6864         Update to changes.
6865         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6866         Update to changes.
6868 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6870         Fix #72015.
6871         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6872         TypeManager.multicast_delegate_type is null, resolve it by looking
6873         up "System.MulticastDelegate".
6874         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6876 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6877             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6878             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6880         Fix cs0164.cs.
6881         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6882         (LabeledStatement.AddReference): New.  Set 'referenced'.
6883         (Goto.Resolve): Use it.
6885 2005-02-05  John Luke  <john.luke@gmail.com>
6887         * driver.cs: remove duplicate -doc line in Usage ()
6889 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6891         * location.cs (Location.AddFile): Fix CS2002 error report.
6893 2005-02-02  Martin Baulig  <martin@ximian.com>
6895         * delegate.cs (Delegate.DefineType): Report an internal error if
6896         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6897         details.        
6899 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6901         Fix a crasher in a variant of #31984.
6902         * const.cs (Constant.CheckBase): New override that defers the
6903         new-or-override check in case the base type hasn't been populated
6904         yet.
6905         (Constant.Define): Ensure the new-or-override check is performed.
6907 2005-02-01  Duncan Mak  <duncan@ximian.com>
6909         * const.cs (LookupConstantValue): Check that `ce' is not null
6910         before calling GetValue ().
6912 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6914         Fix test-334.cs (#69519).
6915         * cs-parser.jay (using_alias_directive): Pass in an expression to
6916         NamespaceEntry.UsingAlias.
6917         (using_namespace_directive): Pass in an expression to
6918         NamespaceEntry.Using.
6919         (namespace_name): Don't flatten to a string.
6920         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6921         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6922         ResolveAsTypeStep.
6923         (NamespaceEntry.UsingEntry): Likewise.
6924         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6925         changes.
6926         (NamespaceEntry.LookupForUsing): Remove.
6927         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6928         names.
6929         (NamespaceEntry.Lookup): Remove support for dotted names.
6931 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6933         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6934         split into two.
6935         (NamespaceEntry.ImplicitParent): Compute on demand.
6936         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6937         parallels the current.
6938         (NamespaceEntry.LookupForUsing): Use it.
6939         (NamespaceEntry.Lookup): If the current namespace-entry is
6940         implicit, don't search aliases and using tables.
6942 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6944         Fix #31984.
6945         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6946         BaseCache here.
6947         (TypeContainer.BaseCache): Compute on demand.
6948         (TypeContainer.FindMembers): Define constants and types if they're
6949         not already created.
6950         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6951         check.
6952         * const.cs (Constant.Define): Make idempotent.
6954 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6956         * pending.cs: Produce better code (no nops produced by using Ldarg
6957         + value).
6958         
6959         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6960         i - 1' it should be arg + 1.
6962         Fixes bug #71819.
6964 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6966         * attribute.cs (Attribute.CheckAttributeType): Make private
6967         non-virtual.
6968         (Attribute.ResolveType): Make virtual.
6969         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6970         handling of RootContext.Tree.Types.
6972 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6974         Update attribute-handling to use the SimpleName/MemberAccess
6975         mechanisms.
6976         * cs-parser.jay (attribute): Pass in an expression to the
6977         constructors of Attribute and GlobalAttribute.
6978         * attribute.cs (Attribute): Take an expression for the name.
6979         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6980         passed in attribute name expression.
6981         (Attribute.CheckAttributeType): Use it.
6982         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6983         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6984         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6985         argument to prevent error messages if the lookup fails.
6987 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6989         * expression.cs (Indirection): Implemented IVariable interface
6990         to support indirection in AddressOf operator.
6991         (PointerArithmetic.Emit): Add optimalization for case where
6992         result can be precomputed.
6994 2005-01-26  Martin Baulig  <martin@ximian.com>
6996         * class.cs (TypeContainer.AttributeTargets): Return the correct
6997         AttributeTargets depending on our `Kind' instead of throwing an
6998         exception; fixes #71632.
7000 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
7002         Fix #71257
7003         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7004         constant members.
7006 2005-03-17  Martin Baulig  <martin@ximian.com>
7008         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7009         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
7011 2005-03-17  Martin Baulig  <martin@ximian.com>
7013         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7014         to bool so we can return an error condition.
7015         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7016         returned an error.
7018 2005-03-17  Martin Baulig  <martin@ximian.com>
7020         * generic.cs (TypeMananager.IsIEnumerable): New public method.
7022         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
7023         converting from an array-type of T to `IEnumerable<T>'.
7025 2005-03-16  Martin Baulig  <martin@ximian.com>
7027         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
7028         (Nullable.LiftedUnaryMutator): New public class.
7030         * expression.cs (UnaryMutator.DoResolve): Added support for
7031         Nullable Types.
7033 2005-03-14  Martin Baulig  <martin@ximian.com>
7035         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
7037 2005-03-14  Martin Baulig  <martin@ximian.com>
7039         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
7040         the comparision operators `<', `>', `<=' and `>='.
7042 2005-03-13  Martin Baulig  <martin@ximian.com>
7044         * generic.cs
7045         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
7046         avoid confusion with the `NullLiteral'.
7047         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
7049 2005-03-13  Martin Baulig  <martin@ximian.com>
7051         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
7052         comparing arbitrary types with the null literal.
7054 2005-03-13  Martin Baulig  <martin@ximian.com>
7056         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
7057         boolean operators '&&', '||', '&' and '|'.
7058         (Nullable.OperatorTrueOrFalse): New public class.
7060         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
7061         instead of a `StaticCallExpr'; added support for nullables.
7063 2005-03-10  Martin Baulig  <martin@ximian.com>
7065         * expression.cs
7066         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7067         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
7069 2005-03-07  Martin Baulig  <martin@ximian.com>
7071         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7072         it work if `expr' is not an IMemoryLocation.
7073         (Nullable.Lifted): Implement IMemoryLocation.
7074         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7075         target type.
7077 2005-03-05  Martin Baulig  <martin@ximian.com>
7079         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7080         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7081         (Nullable): Added support for lifted unary and binary operators.
7083         * expression.cs (Unary.DoResolve): Added support for nullable types.
7084         (Binary.DoResolve): Likewise.
7085         (Conditional.DoResolve): Likewise.
7087 2005-03-02  Martin Baulig  <martin@ximian.com>
7089         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7091         * class.cs (ClassPart.SetParameterInfo): Override this.
7092         (PartialContainer.SetParameterInfo): Override this.
7093         (TypeContainer.CheckConstraints): New protected method.
7094         (PartialContainer.CheckConstraints): Override this and check
7095         whether the same contraints were specified in all parts of a
7096         partial generic type definition.
7097         (PartialContainer.UpdateConstraints): New public method.
7099         * generic.cs (TypeParameter.UpdateConstraints): New public method.
7101 2005-03-02  Martin Baulig  <martin@ximian.com>
7103         Committing a patch from Carlos Alberto Cortez to fix #72887.
7105         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7106         casts from `T []' to `int []'.
7108 2005-03-02  Martin Baulig  <martin@ximian.com>
7110         * generic.cs (TypeManager.IsEqual): Make this symmetric.
7112         * expression.cs (Binary.ResolveOperator): When resolving a
7113         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7114         `=='.  Fixes #71866.  See gen-127.cs.
7116 2005-03-02  Martin Baulig  <martin@ximian.com>
7118         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7119         static constructor in static classes.
7121 2005-03-02  Martin Baulig  <martin@ximian.com>
7123         * generic.cs
7124         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7125         (Nullable.LiftedConversion): Added support for user-defined
7126         conversions.
7128         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7130         * cs-parser.jay: Use ComposedCast everywhere instead of
7131         NullableType, so we don't need to check for NullableType
7132         everywhere.
7133         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7134         case where we'll be resolved into a `parenthesized_expression_0'
7135         afterwards.
7137         * convert.cs
7138         (Convert.UserDefinedConversion): Added nullable conversions.
7140 2005-02-28  Martin Baulig  <martin@ximian.com>
7142         * generic.cs (TypeManager.IsNullableType): New static method.
7143         (Nullable): New abstract class.
7144         (Nullable.NullLiteral): New public class.
7145         (Nullable.LiftedConversion): New public class.
7147         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7148         `builtin_types opt_nullable'.
7150         * convert.cs
7151         (Convert.ImplicitConversionStandard): Added nullable conversions.
7152         (Convert.ExplicitConversionStandard): Likewise.
7153         (Convert.ExplicitConversion): Likewise.
7155 2005-02-26  Martin Baulig  <martin@ximian.com>
7157         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7158         begin with a "?", for instance "?[]".  Don't do a type lookup if
7159         `dim' is empty.
7161 2005-02-25  Martin Baulig  <martin@ximian.com>
7163         The first part of Nullable Types :-)
7165         * generic.cs (NullableType): New public class.
7166         (NullCoalescingOperator): New public class.
7167         (TypeArguments.Resolve): Add a CS0306 check.
7169         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7170         (opt_nullable): New rule.
7171         (type): Added `opt_nullable' to `namespace_or_type_name',
7172         `builtin_types' and `pointer_type'.
7173         (array_type): Added `opt_nullable'.
7174         (opt_rank_specifier_or_nullable): New rule; this is the
7175         combination of `opt_rank_specifier' and `opt_nullable'.
7176         (opt_error): New rule; catch errors here.
7177         (nullable_type_or_conditional): New rule; we use this to check for
7178         nullable and still detect the conditional operator.
7179         (local_variable_type): Use `opt_rank_specifier_or_nullable'
7180         instead `opt_rank_specifier'.
7182         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7183         for nullables.
7185 2005-02-24  Martin Baulig  <martin@ximian.com>
7187         * README, README.Changes: Removed; they're old and obsolete.
7189 2005-02-22  Martin Baulig  <martin@ximian.com>
7191         * generic.cs (TypeParameter.Resolve): If resolving the constraints
7192         returned an error, set `constraints' to null to avoid a crash
7193         later on.
7194         (TypeParameter.ResolveType): Likewise.
7196 2005-02-22  Martin Baulig  <martin@ximian.com>
7198         * generic.cs
7199         (Constraints.ResolveTypes): Protect against being called twice.
7200         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7201         (TypeParameter.ResolveType): New public method; calls
7202         constraints.ResolveTypes().
7203         (TypeParameter.DefineType): Moved constraints.ResolveType() out
7204         into the new ResolveType().
7205         (GenericMethod.Define): Call ResolveType() on all our
7206         TypeParameter's.        
7208 2005-02-21  Martin Baulig  <martin@ximian.com>
7210         * generic.cs
7211         (TypeManager.generic_nullable_type): New static public field.
7212         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7214         * rootcontext.cs
7215         (RootContext.ResolveCore): Resolve "System.Nullable`1".
7217 2005-02-15  Martin Baulig  <martin@ximian.com>
7219         * generic.cs (ConstructedType.Constraints): Correctly check
7220         constraints if the argument type is a type parameter; fixes
7221         #72326. 
7223 2005-02-02  Martin Baulig  <martin@ximian.com>
7225         * delegate.cs (Delegate.DefineType): Report an internal error if
7226         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7227         details.        
7229 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7231         * pending.cs: Produce better code (no nops produced by using Ldarg
7232         + value).
7233         
7234         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7235         i - 1' it should be arg + 1.
7237         Fixes bug #71819.
7238         
7239 2005-01-26  Martin Baulig  <martin@ximian.com>
7241         * cs-parser.jay (indexer_declarator): Don't report an error if we
7242         have type parameters since we can be an explicit interface
7243         implementation; fixes #71449.
7245 2005-01-26  Martin Baulig  <martin@ximian.com>
7247         * class.cs (TypeContainer.AttributeTargets): Return the correct
7248         AttributeTargets depending on our `Kind' instead of throwing an
7249         exception; fixes #71632.
7251 2005-01-26  Martin Baulig  <martin@ximian.com>
7253         * delegate.cs (Delegate.DefineType): Correctly define our type
7254         parameters.  Fixes #71483.
7256 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7258         Fix #71602.
7259         * expression.cs (MemberAccess.DoResolve): Don't complain with
7260         cs0572 when the LHS of a member access has identical name and type
7261         name.
7263 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7265         Fix #71651, #71675
7266         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7267         CreatePermission.
7268         Create custom PermissionSet only for PermissionSetAttribute.
7270 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7272         Fix #71649
7273         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7274         delegates in static class.
7276 2005-01-24  Martin Baulig  <martin@ximian.com>
7278         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7279         merging an implicit block, just use its reachability.
7281         * statement.cs (Block.Resolve): Make the unreachable code check
7282         work wrt. implicit blocks; see test-337 from #63842.
7284 2005-01-21  Alp Toker  <alp@atoker.com>
7286         * cs-parser.jay: destructor_declaration's container is PartialContainer
7287         not Class when partial types are used, so use Kind prop instead of
7288         'is'.
7289         
7290 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7292         * cs-parser.jay: Improve error reporting when an interface
7293         declares new types.
7295 2005-01-20  Dick Porter  <dick@ximian.com>
7297         * support.cs: SeekableStreamReader fix from Sandor Dobos
7298         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7299         chars are read.  Fixes bug 70369.
7301 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7303         * cs-parser.jay (catch_clause): Simplify current_block handling
7304         somewhat.
7306 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7308         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7309         code with ImplicitStandardConversion to handle the implicit
7310         conversion of method groups into valid delegate invocations. 
7312         The problem is that in parameter handling we were using this code
7313         path.  Fixes bug #64698
7315 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7317         * cs-parser.jay: Fix several infelicities.
7318         - Avoid assigning to the parser value stack.  Code like 
7319           '$3 = null' is unclean.  Synthesize a value for the code block
7320           instead. 
7321         - Avoid using oob_stack for storing location information.  Use ...
7322         (_mark_): ... this.  New (empty) rule.  Saves the current location
7323         in $$.
7324         (foreach_statement): Avoid using oob_stack for current_block
7325         handling.  Use technique used in for_statement and
7326         using_statement.  Synthesize a value for the code block to store
7327         additional intermediate information.
7329 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7331         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7332         of a different type is only allowed to private fields of a
7333         containing type, not on fields of a base class.
7335         See test-174.cs and error cs0122-9.cs
7337 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7339         Fix test-335.cs (bug #58126).
7340         * cs-parser.jay (argument): Split out non-expression parts of the
7341         rule into 'non_simple_argument'.
7342         (invocation_expression): Support parenthesized invocations with
7343         multiple arguments, and with single non-simple arguments.
7345 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7347         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7348         places.
7350 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7352         Fix cs0038-1.cs, cs1640-6.cs.
7353         * ecore.cs (Expression.Resolve): Remove special-case for
7354         SimpleName in error-handling.
7355         (Expression.almostMatchedMembers): Relax access permission to
7356         protected.
7357         (Expression.MemberLookupFailed): Handle duplicates in
7358         almostMatchedMembers list.
7359         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7360         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7361         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7362         overload if the passed in MemberInfo is a MethodBase.
7364 2005-01-25  Martin Baulig  <martin@ximian.com>
7366         * doc.cs
7367         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7369 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7371         Fix #70749
7372         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7373         for non-CAS & merge permission sets properly.
7375 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7377         Improve standard-compliance of simple name and member access 
7378         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7379         * ecore.cs (FullNamedExpression): New abstract base class 
7380         for Namespaces and TypeExpressions.
7381         (ResolveFlags.SimpleName): Remove.
7382         (SimpleName): Remove support for dotted names.
7383         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7384         DeclSpace.FindType and DeclSpace.LookupType.
7385         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7386         (Expression.ExprClassName): Make member function.
7387         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7388         a namespace.  Remove creation of dotted "SimpleName"s.
7389         (MemberAccess.DoResolve): Likewise.
7390         * decl.cs (DeclSpace.Cache): Make private.
7391         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7392         (DeclSpace.FindType): Update.
7393         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7394         FullNamedExpression.
7395         * namespace.cs (Namespace): Derive from FullNamedExpression
7396         so that it can be part of expression resolution.
7397         (Namespace.Lookup): Return an FullNamedExpression.
7398         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7399         namespace.
7400         * rootcontext.cs (NamespaceLookup): Remove.
7401         (LookupType): Move to DeclSpace.
7402         * attribute.cs (CheckAttributeType): Update.
7403         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7404         (FindDocumentedTypeNonArray): Likewise.
7406 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7408         Fix cs0509.cs, cs1632.cs.
7409         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7410         is the same as IsInterface.
7411         (TypeContainer.GetClassBases): Likewise.
7412         * statement.cs (LabeledStatement.ig): New field.
7413         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7414         label.
7415         (LabeledStatement.DoEmit): Check that the label was created with
7416         the same ILGenerator.
7418 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7420         Fix #71058
7421         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7422         accessors to its properties.
7424         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7425         from accessors to property.
7426         
7427 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7429         Fix #70722
7430         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7431         only for overrides.
7432         
7433 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
7435         * attribute.cs: Check for null and empty strings.  
7437         I have lost another battle to Paolo.
7439 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
7441         Fix #70942
7442         * class.cs (PropertyMethod): Set Parent field in ctors.
7443         (SetMethod.InternalParameters): Add unsafe switch hack.
7444         Override MarkForDuplicationCheck where it is appropriate.
7446         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7447         It says whether container allows members with the same name.
7448         Base default is no.
7449         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7450         Removed is_method parameter.
7452 2005-01-06  Duncan Mak  <duncan@ximian.com>
7454         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7455         because the previous change led to incorrect reporting of CS1032
7456         ("Cannot define/undefine preprocessor symbols after first token in
7457         file"). Instead of using `tokens_seen' as the only flag that
7458         triggers CS1040, introduce `comments_seen'. This new flag is used
7459         to signify having seen comments on the current line, so it is
7460         unset after a newline.
7462 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7464         * doc.cs : When searching for a type, find nested type too.
7465           This fixes bug #71040.
7467 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7469         * doc.cs :
7470           - Warn missing member comment on those classes which also does not
7471             have doc comments. Fixed bug #71041.
7472           - Don't warn missing doc comment on default constructor.
7473             Fixed bug #71042.
7475 2005-01-06  Duncan Mak  <duncan@ximian.com>
7477         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7478         comments, set `tokens_seen' to true. This allows us to detect
7479         misplaced preprocessor directives (i.e. not at the beginning of
7480         the a line, nor after whitespaces). In that case, report error
7481         CS1040. This fixes bug #56460.
7483         * cs-parser.jay (interface_member_declaration): Add checks for
7484         IsExplicitImpl, and report CS0541 error if an interface member is
7485         defined as an explicit interface declaration.
7487 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7489         Fix #70817
7490         * class.cs (PropertyMethod): Set Parent field in ctors.
7491         (SetMethod.InternalParameters): Add unsafe switch hack.
7492         
7493         * decl.cs (MemberCore.Parent): Cannot be readonly.
7495 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7497         * decl.cs (DeclSpace.ResolveType): Remove.
7498         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7499         Merge in code from ...
7500         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7501         * class.cs, enum.cs: Update to changes.
7503 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7505         * anonymous.cs: Ensure that we init the scope of our parent if it
7506         has not been initialized yet.
7508 2004-12-30  Duncan Mak  <duncan@ximian.com>
7510         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7511         if field.FieldBuilder is null. Fixes #70758.
7513         * convert.cs: Fixed some typos and updated some of the comments.
7514         (ImplicitStandardConversionExists):
7515         (TryImplicitIntConversion): If `target_type' is an interface and
7516         the type of `ic' implements this interface, return true or a new
7517         BoxedCast instead of null. This fixes #70468.
7519 2004-12-29  Duncan Mak  <duncan@ximian.com>
7521         * expression.cs (Argument.Emit): Check that Expr is
7522         IMemoryLocation before casting to it, and report CS1510 otherwise.
7524         This fixes #70402.
7526 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7528         * statement.cs (Block.ThisVariable): remove the recursion here, to
7529         make the --profile more sane.
7531 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7533         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7534         assembly, by JB Evain.
7536 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7538         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7539           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7540         "parent" refers to enclosing type/class.  "base" refers to superclass.
7542 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7544         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7545         Ensure that we only have GlobalAttributes.
7546         * attribute.cs (Attribute.Emit): Make non-virtual.
7547         (GlobalAttribute.Emit): Remove.
7548         (Attribute.Resolve): Make virtual.
7549         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7550         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7551         the argument. Don't create one.
7552         (Attribute.GetObsoleteAttribute): Likewise.
7553         (Attribute.GetClsCompliantAttributeValue): Likewise.
7554         * class.cs, decl.cs: Update to changes.
7556 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7558         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7559         
7560         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7561         
7562         * statement.cs (Foreach.Resolve): Add error 186 report.
7564 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7566         * expression.cs (Conditional.DoResolve): Add warning 429.
7567         
7568         * statement.cs (If.Resolve): Add warning 665.
7570 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7572         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7573         except when in the parser, and in GlobalAttribute.
7574         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7575         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7576         RootContext.Tree.Types.NamespaceEntry once work is done.
7577         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7578         and resets RootContext.Tree.Types.NamespaceEntry.
7580 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7582         * cs-parser.jay: Don't create a block for every variable.
7584 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7586         * location.cs: Provide extra information.
7588         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7589         variables from the captured environment, it is the ldarg_0.
7591 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7593         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7594         find a conclusion.
7595         
7596         * class.cs: Changed warning level for 169 to avoid developer
7597         displeasure from warning flooding. It will be changed back when they
7598         fix most of current BCL warnings.
7599         
7600         * RootContext.cs: Pushed default WarningLevel to 3.
7601         
7602         * statement.cs: Removed unused variable.
7604 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7606         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7607         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7608         Add error 502 report.
7609         (StaticClass.DefineType): Add error 441 report.
7610         (Class.AllowedModifiersProp): New virtual property as temporary
7611         extension to AllowedModifiers.
7612         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7613         to share implementation with StaticClass and don't call virtual
7614         methods from ctor.
7615         
7616         * driver.cs (MainDriver): Add error 1558 test.
7618         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7619         report. Moved error 36 test here.
7621         * statement.cs (Throw.Resolve): Add error 724 report.
7623         * typemanager.cs: Add out_attribute_type core type.
7624         
7625 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7627         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7628         3018 report.
7629         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7631         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7632         3017 report.
7633         
7634         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7636         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7637         Add error 3023 report.
7638         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7640         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7641         implementation.
7643 2004-12-12  John Luke  <john.luke@gmail.com>
7645         * driver.cs (AddArgs): take -- into account when
7646         adding arguments, fixes bug 65710 
7648 2004-12-12  Martin Baulig  <martin@ximian.com>
7650         * expression.cs (Unary.TryReduceNegative): Added support for
7651         SByteConstant and ByteConstant.
7652         (Unary.Reduce): Check error values from TryReduceNegative().
7654 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7656         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7657         and report exception as error 182.
7659 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7661         * driver.cs (Main): Fix message when there are warnings.
7663 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7665         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7667 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7669         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7670         Reduced number of warnings.
7671         
7672         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7674 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7676         * driver.cs: Removed message.
7678         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7680 2004-12-08    <vargaz@freemail.hu>
7682         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7684 2004-12-08  Martin Baulig  <martin@ximian.com>
7686         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7687         instead of a CS3002 for properties and indexer.
7689 2004-12-08  Martin Baulig  <martin@ximian.com>
7691         * decl.cs (MemberName.ToString): Make this work again.
7693 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7695         * attribute.cs (Resolve): Add error 591 detection.
7697         * class.cs (FieldMember.Define): Add error 1547 detection.
7698         (Indexer.Define): Add error 620 detection.
7699         (Operator.Define): Add error 590 detection.
7701         * ecore.cs: Missing argument for error 79.
7703         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7704         detection.
7706 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7708         Fix #70106
7709         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7710         only.
7712 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7714         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7715           Some operator comments were suppressed.
7716         * doc.cs : Implicit/explicit operator name in doc comments are like
7717           "op_Explicit(type)~returnType", so added suffix handling.
7719 2005-01-21  Alp Toker  <alp@atoker.com>
7721         * cs-parser.jay: destructor_declaration's container is PartialContainer
7722         not Class when partial types are used, so use Kind prop instead of 'is'.
7724 2004-12-12  Martin Baulig  <martin@ximian.com>
7726         * expression.cs (Unary.TryReduceNegative): Added support for
7727         SByteConstant and ByteConstant.
7728         (Unary.Reduce): Check error values from TryReduceNegative().
7730 2004-12-11  Martin Baulig  <martin@ximian.com>
7732         * support.cs (ReflectionParameters.ParameterName): If we have a
7733         `gpd', call `ParameterName' on it.
7735         * parameter.cs (Parameter.GetParameterAttributes): New static method.
7737         * pending.cs (PendingImplementation.DefineProxy): Call
7738         DefineParameter() for all of the MethodBuilder's arguments.
7740 2004-12-09  Martin Baulig  <martin@ximian.com>
7742         * doc.cs (DocUtil): Make this a static class.
7744 2004-12-09  Martin Baulig  <martin@ximian.com>
7746         * expression.cs (Invocation.InferType): Moved the type inference
7747         implementation into TypeManager.
7749         * generics.cs (TypeManager): Moved the type inference
7750         implementation here.
7752 2004-12-09  Martin Baulig  <martin@ximian.com>
7754         * typemanager.cs (TypeManager): Make this a partial class.
7756         * generics.cs
7757         (TypeManager): Move the generics part of `TypeManager' here.
7759 2004-12-08  Martin Baulig  <martin@ximian.com>
7761         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7762         instead of a CS3002 for properties and indexer.  Added CS3024
7763         check for generic interfaces.
7765         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7766         instances are not CLS-compliant.
7768 2004-12-08  Martin Baulig  <martin@ximian.com>
7770         * cs-parser.jay
7771         (void_pointer_expression): New rule for `void*', `void**' etc.
7772         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
7774 2004-12-08  Martin Baulig  <martin@ximian.com>
7776         * expression.cs (Invocation.InferType): Removed the hack for
7777         MethodCore.MayUnify().  
7779         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7780         this actually work.
7782         * class.cs (MethodCore.MayUnify): Use
7783         TypeManager.MayBecomeEqualGenericTypes().       
7785 2004-12-08  Martin Baulig  <martin@ximian.com>
7787         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7788         parameter, box it.  Fixes #69233.
7790 2004-12-08  Martin Baulig  <martin@ximian.com>
7792         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7793         have the ctor constraint.  Fixes #68326.
7795 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7797         * cs-parser.jay : interface comment was not consumed because of
7798           extra opt_semicolon before doc handling.
7800 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7802         Fix test-327.cs, test-328.cs, and put in early infrastructure
7803         for eventually fixing #52697.
7804         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7805         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7806         from other methods.
7807         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7808         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7809         (VerifyUsing, error246): Update.
7810         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7811         'NamespaceEntry.LookupNamespaceOrType'.
7813 2004-12-07  Martin Baulig  <martin@ximian.com>
7815         * driver.cs: Call it "BETA SOFTWARE" :-)
7817 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7819         Fix crash on cs0657-17.cs.
7820         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7821         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7822         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7823         the case where the NamespaceEntry gets overwritten.
7825 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7827         Fixed #69195, #56821
7828         * ecore.cs (ResolveBoolean): Tiny refactoring.
7830         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7831         of right expression resolving when left is false constant and
7832         operator is LogicalAnd OR true constant and operator is LogicalOr.
7834         * statement.cs (ResolveUnreachable): Always reports warning.
7836 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7838         * class.cs: Distinguish between 1721 and 1722 (just a little help
7839         for the programmer).
7841 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7843         * delegate.cs: Only allow this on new versions of the language. 
7845 2004-12-02  Duncan Mak  <duncan@ximian.com>
7847         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7848         Expression class.
7849         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7850         here as a static method. Take an additional bool out parameter
7851         `must_do_cs1540_check' for signaling to InstanceResolve.
7852         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7853         member field from PropertyExpr class and made it an argument of
7854         the method instead.
7855         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7856         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7857         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7858         and `remove_accessor' as well as InstanceResolve: report CS0122
7859         where applicable.
7861         Fixes #70129.
7863 2004-12-07  Martin Baulig  <martin@ximian.com>
7865         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7866         and CS0692 where appropriate.
7868 2004-12-06  Martin Baulig  <martin@ximian.com>
7870         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7871         IsDuplicateImplementation() and improved it.
7873         * expression.cs (Invocation.InferTypeArguments): Added
7874         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7875         and removed the "ref" modifier from `infered_types'.
7877         * decl.cs (MemberName.ToString): Removed the exception.
7879 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7881         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7882           comments are allowed.
7884 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7886         * delegate.cs: Add checks for subtypes in paramaters and return values
7887         in VerifyMethod () to add support for Covariance/Contravariance
7888         in delegates.
7889         
7890 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7892         * report.cs: Remove extra closing parenthesis.
7894         * convert.cs (Error_CannotImplicitConversion): If the name of the
7895         types are the same, provide some extra information.
7897 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7899         Fix bug #70102
7900         * attribute.cs (Resolve): Improved implementation of params
7901         attribute arguments.
7903         * support.cs (ParameterData): Add HasParams to be faster.
7905 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7907         all things are for /doc support:
7909         * doc.cs: new file that supports XML documentation generation.
7910         * mcs.exe.sources: added doc.cs.
7911         * driver.cs:
7912           Handle /doc command line option.
7913           Report error 2006 instead of 5 for missing file name for /doc.
7914           Generate XML documentation when required, after type resolution.
7915         * cs-tokenizer.cs:
7916           Added support for picking up documentation (/// and /** ... */),
7917           including a new XmlCommentState enumeration.
7918         * cs-parser.jay:
7919           Added lines to fill Documentation element for field, constant,
7920           property, indexer, method, constructor, destructor, operator, event
7921           and class, struct, interface, delegate, enum.
7922           Added lines to warn incorrect comment.
7923         * rootcontext.cs :
7924           Added Documentation field (passed only when /doc was specified).
7925         * decl.cs:
7926           Added DocComment, DocCommentHeader, GenerateDocComment() and
7927           OnGenerateDocComment() and some supporting private members for
7928           /doc feature to MemberCore.
7929         * class.cs:
7930           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7931         * delegate.cs:
7932           Added overriden DocCommentHeader.
7933         * enum.cs:
7934           Added overriden DocCommentHeader and GenerateDocComment().
7936 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7938         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7939         unwrapping the enumeration values, chain to
7940         DoConstantNumericPromotions again, so we can promote things to the
7941         fundamental types (takes care of enums that are bytes, sbytes).
7943         Fixes bug #62054.
7945 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7947         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7948         Fix long-standing bug in type-lookup.  Use FindType instead of
7949         LookupType when ec.ResolvingTypeTree.
7950         (Attribute.ResolveType, Attribute.Resolve)
7951         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7952         Update to changes.
7953         (Attributes.Search): Remove internal version.  Update.
7954         (Attributes.SearchMulti): Update.
7955         (Attributes.GetClsCompliantAttribute): Remove.
7956         (Attributes.GetIndexerNameAttribute): Remove.
7957         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7958         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7959         * class.cs (Indexer.Define): Likewise.
7961 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7963         Fix bug #68790
7964         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7965         MarshallByReference members access.
7967         * expression.cs: Use CheckMarshallByRefAccess;
7968         Better error CS0197 message.
7970         * report.cs: Print whole related error message.
7972 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7974         * class (GetClassBases): Better error 60 report.
7975         (EventProperty): Disabled warning 67 detection.
7977 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7979         Fix bug #60324
7980         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7982         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7983         precise values.
7985 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7987         Fix bug #49488
7988         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7990         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7992 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7994         * attribute.cs (Attribute.Resolve): Refine error reporting and
7995         report a cs0117 if the identifier does not exist, to distinguish
7996         from 0617 which is a miss-use of the actual identifier.
7998         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7999         between cs0070 and cs0079.
8001         * class.cs (MemberBase.DoDefine): When reporting a wrong
8002         accessibility level, we use MethodCore to compare instead of
8003         Method (this was a regression in some refactoring effort).
8005         So now we correctly report cs0056 again.
8007         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8008         testing the target_type (which was known to be object_type) and
8009         not the source type (which is anonymous_method).
8011         Fixed reporting of error cs1660.
8013         * expression.cs (UserCast.Source): Expose the underlying cast.
8015         * statement.cs (Switch.SwitchGoverningType): Sort the list of
8016         allowed types to find a match to int32 first (most common).
8018         In addition, it ignores any ImplicitUserConversions that did an
8019         internal implicit conversion (as the switch statement allows only
8020         one integral conversion to exist).
8022         * class.cs (PartialContainer.Create): rename `name' to
8023         `member_name' for clarity.  Then replace the string calls with a
8024         call to MemberName.GetPartialName, as now using
8025         MemberName.ToString is an error (this is due to the side effects
8026         it had, that were fixed in the past).
8028         This will restore the error reporting on a number of partial class
8029         errors that were missusing this (and getting an exception as a
8030         results, which is now just a plain textual warning, because
8031         yyparse debug output would crash otherwise).
8033 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8035         * Makefile (PROGRAM_INSTALL_DIR): Remove.
8037 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8039         * rootcontext.cs (LookupType): Make sure to cache lookups that
8040         don't give us a negative result. This saves about 5% of corlib
8041         compilation time.
8043 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8045         * report.cs (AbstractMessage.Print): messages are sent to stderr
8047         * class.cs (TypeContainer.GetClassBases): It is an error to have a
8048         non-interface in the list of interfaces (at this point, either
8049         parent was properly set, or a base class is being listed in the
8050         interfaces section).
8052         This flags error 1722, and resolves the crash from bug 69259.
8054 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8056         * statement.cs (Using.EmitExpressionFinally): make this work right
8057         for valuetypes. Fixes 69926.
8059 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8061         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8062         converted to an enum" here, before we try to change the underlying
8063         type.  This code exists, but it is a different code path than the
8064         one used while encoding constants.
8066         (ImplicitReferenceConversionExists): In addition, resynchronized
8067         the code here, so it matches the same code in
8068         ImplicitReferenceConversionExists for the `from any class-type S
8069         to any interface-type T'.       
8071 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8073         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8075 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8077         * cs-parser.jay: Use verbosity accordingly. 
8079 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8081         * expression.cs (Unary.ResolveOperator): Do not report warning;
8082         AddressOf reads from variable.
8083         
8084         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8086 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8088         Fix bug #69462
8090         * attribute.cs (Attributable): Removed CheckTargets.
8091         (Attributes.Emit): Explicit attribute targets are tested here.
8093         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8094         not enabled for interfaces.
8096         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8097         (GetAssemblyName): Ouch next bug there.
8099 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8101         * expression.cs: Error 275 added.
8102         
8103 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8105         Fix bug #69177 (Implemented decimal constant support)
8107         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8108         (BinaryFold): Add DecimalConstant.
8110         * const.cs (Define): Decimal constant 
8111         (is not constant.
8112         (ChangeType): Add decimal type handling.
8113         (LookupConstantValue): Don't set value for decimal type but
8114         emit DecimalConstantAttribute. Needed for constant optimization.
8116         * constant.cs (ToDecimal): New method.
8117         (ConvertToDecimal): New method.
8118         (IntConstant): Implemented ConvertToDecimal.
8119         (DecimalConstant.Emit): Emit optimized version for decimals in
8120         int range.
8122         * expression.cs (ResolveOperator): Changed order of constant
8123         reduction to work correctly with native types which have
8124         overloaded operators.
8125         (ResolveMemberAccess): Extract constant value from attribute
8126         for decimal type.
8128         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8130         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8131         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8132         (ChangeType): Decimal is special.
8133         (TypeToCoreType): Add decimal type.
8135 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8137         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8138         decimal types.
8140 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8142         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8143         test cs1667-5.cs.
8145 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8147         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8149         * pending.cs (PendingImplementation): Grab only interfaces.
8151 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8153         * statement.cs (ForeachHelperMethods): Add location member and
8154         error 202 detection.
8156 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8158         * expression.cs (DoResolveBase): Fixed wrong warning for out
8159         variables.
8161 2004-12-04  Martin Baulig  <martin@ximian.com>
8163         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8164         to check whether the conversion is ok.
8166         * typemanager.cs (TypeManager.GetTypeArguments): Just return
8167         `Type.EmptyTypes' if we're not a generic TypeContainer.
8169 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8171         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8172         old bug: when converting from the null literal to a pointer,
8173         return an EmptyCast, not the NullLiteral.
8175         This fixes #69921, the recent null_type changes probably made this
8176         bug more prominent.
8178 2004-12-03  Martin Baulig  <martin@ximian.com>
8180         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8181         method as our child, call AnonymousMethod.Compatible() on it.
8183 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8185         * class.cs (FieldBase): Use an unused bit field from the field to
8186         encode the `has_offset' property from the FieldMember.  This saves
8187         a couple of Ks on bootstrap compilation.
8189         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8190         method as our child, return the AnonymousMethod resolved
8191         expression.
8193         * expression.cs (New.DoResolve): Allow return values from
8194         NewDelegate to also include AnonymousMethods.
8196         Fixes #70150.
8198 2004-11-29  Raja R Harinath  <rharinath@novell.com>
8200         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8201         cs1648 report.
8202         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8203         System.Runtime.InteropServices._Exception, since it's a base
8204         interface of the core type System.Exception in the net_2_0 profile.
8206 2004-11-27  Martin Baulig  <martin@ximian.com>
8208         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8210 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8212         * Makefile: Convert to use executable.make.
8213         * gmcs.exe.sources: New.
8215 2004-11-25  Martin Baulig  <martin@ximian.com>
8217         * expression.cs (Invocation.InferType): Added support for byref types.
8219 2004-11-25  Martin Baulig  <martin@ximian.com>
8221         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8222         in TypeManager.TypeToCoreType().
8224 2004-11-25  Martin Baulig  <martin@ximian.com>
8226         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8227         "Dispose" method from the `current_type'.
8228         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8229         DoDefineMembers() instead of using the MethodBuilder; this is
8230         required for generic iterators.
8232         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8234 2004-11-24  Martin Baulig  <martin@ximian.com>
8236         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8238 2004-11-20  Martin Baulig  <martin@ximian.com>
8240         * expression.cs (Invocation.InferType): Correctly infer generic
8241         instances; see gen-103.cs.
8242         (Invocation.InferTypeArguments): If a generic method doesn't have
8243         any unbound type parameters, we don't need to infer anything.
8245 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8247         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8249 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8251         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8252         (TypeHandle.GetMemberCache): New.
8253         (TypeHandle.TypeHandle): Update.
8254         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8255         (TypeManager.LookupParentInterfacesCache):
8256         Rename from LookupInterfaceCache.  Optimize slightly.
8257         (TypeManager.MemberLookup_FindMembers): Update.
8258         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8259         multi-type variant.
8260         (AddCacheContents): Rename from AddHashtable.
8261         * class.cs (TypeContainer.parent_container): Remove.
8262         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8263         (TypeContainer.DoDefineMembers): Don't initialize it.
8264         Update to name changes.
8265         
8266 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8268         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8269         that factors the code to check access modifiers on override.  
8271         (PropertyBase): Use the code here.
8273         Patch from Lluis S'anchez, fixes bug #69361.
8275 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8277         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8278         routine that is used to report the use of a captured variable
8279         whose address has been taken.
8281         There are two checks: one when variables are being captured and
8282         the other check is when the address of a variable is taken. 
8283         
8284         (because an anonymous methods might be resolved before *or* after
8285         the address has been taken) and 
8287         * expression.cs (Conditional.DoResolve): Remove the special
8288         casing that Martin added to trueExpr and falseExpr being both
8289         NullLiteral.  We get the right behavior now just by introducing
8290         the null_type into the compiler. 
8292         * convert.cs (ExplicitConversion): Change the code to use
8293         null_type instead of testing `expr is NullLiteral'.
8294         (ImplicitConversionStandard): use null_type too.
8295         (ImplicitReferenceConversionExists): use null_type too.
8296         (ImplicitReferenceConversion): use null_type too.
8298         * literal.cs: The type of `NullLiteral' is now null_type instead
8299         of object_type. 
8300         (Resolve): Set the type here.
8302         * typemanager.cs: Introduce null_type.
8304 2004-11-18  Martin Baulig  <martin@ximian.com>
8306         * rootcontext.cs
8307         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8309 2004-11-18  Martin Baulig  <martin@ximian.com>
8311         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8313 2004-11-18  Martin Baulig  <martin@ximian.com>
8315         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8316         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
8317         call ResolveConstructedType() on it to resolve it without checking
8318         constraints.
8319         (Constraints.ResolveTypes): Check them here.
8320         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8321         but don't check constraints.
8322         (ConstructedType.ResolveAsTypeTerminal): Override this and also
8323         check constraints here.
8324         (ConstructedType.ResolveConstructedType): New public method.  This
8325         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8326         resolve ourselves without checking constraints.
8328         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8330 2004-11-18  Martin Baulig  <martin@ximian.com>
8332         * decl.cs
8333         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8335         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8337 2004-11-18  Martin Baulig  <martin@ximian.com>
8339         * ecore.cs (TypeExpr.ResolveType): Removed.
8340         (Expression.ResolveAsTypeTerminal): We always return a fully
8341         resolved `TypeExpr', so we can just access its `Type'.
8343         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8345 2004-11-17  Martin Baulig  <martin@ximian.com>
8347         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8348         sure we don't return any unresolved TypeExpr's.
8349         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8350         a `TypeExpr'.
8351         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8353         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8354         unresolved `ConstructedType's.
8356 2004-11-17  Martin Baulig  <martin@ximian.com>
8358         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8360 2004-11-17  Martin Baulig  <martin@ximian.com>
8362         * ecore.cs
8363         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8365         * decl.cs (DeclSpace.ResolveType): Removed.
8366         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8368 2004-11-17  Martin Baulig  <martin@ximian.com>
8370         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8371         direction, like FindMembers() does.  Fixes #69546, testcase is in
8372         test-315.cs.    
8374 2004-11-16  Martin Baulig  <martin@ximian.com>
8376         This is based on a patch from Marek Safar, see bug #69082.
8377         Fixes bugs #63705 and #67130.
8379         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8380         method; create a MemberCache for an interface type and cache the
8381         result.
8383         * decl.cs (IMemberContainer.ParentContainer): Removed.
8384         (IMemberContainer.ParentCache): New property.
8385         (MemberCache.SetupCacheForInterface): Removed.
8386         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8387         to create a cache for an interface's "parent".
8389         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8390         interfaces too.
8392 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8394         * statement.cs: Avoid adding bools to a hashtable.
8396 2004-11-15  Martin Baulig  <martin@ximian.com>
8398         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8400 2004-11-11  Martin Baulig  <martin@ximian.com>
8402         * typemanager.cs (TypeManager.GetMethodName): New method.
8404         * class.cs (MethodData.Define): Include the generic arity in the
8405         name of an explicit interface; also add it to the method name.
8407         * pending.cs (PendingImplementation.InterfaceMethod): The method
8408         name now includes the generic arity.
8410 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8412         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8413         calling an unsafe method from a safe location.
8415 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8417         Fix #69167
8418         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8420 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8422         * namespace.cs (VerifyUsing): use GetPartialName instead of
8423         ToString. 
8425 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8427         * statement.cs (Return.Resolve): Fix regression in typo: if
8428         `in_exc', we have to request a NeedReturnLabel, this was a typo
8429         introduced in the anonymous method check-in.  Fixes #69131.
8431         * Indexers were using the ShortName when defining themselves,
8432         causing a regression in the compiler bootstrap when applying the
8433         patch from 2004-11-02 (first part), now they use their full name
8434         and the bug is gone.
8436 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8438         * driver.cs: Strip the path from the names of embedded resources. Fixes
8439         #68519.
8441 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8443         Fix error message regression: cs0104-2.cs.
8444         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8445         (AliasEntry.Resolve): Update.
8446         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8447         'silent' flag.
8448         (RootContext.LookupType): Update.
8450 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8452         * cs-parser.jay: Add support for handling accessor modifiers
8453         * class: Add support port accessor modifiers and error checking,
8454         define PropertyMethod.Define as virtual (not abstract anymore)
8455         * ecore.cs: Add checking for proeprties access with access modifiers
8456         * iterators.cs: Modify Accessor constructor call based in the modified
8457         constructor
8458 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8460         * expression.cs (StringConcat): Handle being called twice,
8461         as when we have a concat in a field init with more than two
8462         ctors in the class
8464 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8466         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8467         special case explicit implementations, we should always produce
8468         the .property or .event declaration.
8469         
8470         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8471         since it will not return correct data if people use this
8472         unresolved in the presence of using statements (see test-313).
8474         * class.cs (MethodData.Define): If we are an explicit interface
8475         implementation, set the method name to the full name of the
8476         interface plus the name of the method.  
8478         Notice that using the method.MethodName.GetFullName() does not
8479         work, as it will only contain the name as declared on the source
8480         file (it can be a shorthand in the presence of using statements)
8481         and not the fully qualifed type name, for example:
8483         using System;
8485         class D : ICloneable {
8486                 object ICloneable.Clone ()  {
8487                 }
8488         }
8490         Would produce a method called `ICloneable.Clone' instead of
8491         `System.ICloneable.Clone'.
8493         * namespace.cs (Alias.Resolve): Use GetPartialName.
8494         
8495 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8497         * cs-parser.jay: Add error 1055 report.
8499 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8501         * assign.cs (Assign.DoResolve): Only do the transform of
8502         assignment into a New if the types are compatible, if not, fall
8503         through and let the implicit code deal with the errors and with
8504         the necessary conversions. 
8506 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8508         * cs-parser.jay: Add error 1031 report.
8510         * cs-tokenizer.cs: Add location for error 1038.
8512 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8514         * cs-parser.jay: Add error 1016 report.
8516 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8518         * cs-parser.jay: Add errors 1575,1611 report.
8520 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8522         * cs-parser.jay: Add error 1001 report.
8524 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8526         Fix #68850
8527         * attribute.cs (GetMarshal): Add method argument for
8528         caller identification.
8530         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8531         agument for GetMarshal and RuntimeMissingSupport.
8533 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8535         * attribute.cs (ExtractSecurityPermissionSet): Removed
8536         TypeManager.code_access_permission_type.
8538         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8540 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8542         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8543         for obsolete use of a variable here.   Fixes regression on errors
8544         cs0619-25 and cs0619-26.
8546 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8548         Fix #62358, implemented security attribute encoding.
8550         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8551         Tests permitted SecurityAction for assembly or other types.
8552         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8553         data from SecurityPermissionAttribute to PermisionSet class.
8555         * class.cs (ApplyAttributeBuilder): Added special handling
8556         for System.Security.Permissions.SecurityAttribute based types.
8558         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8559         special handling for System.Security.Permissions.SecurityAttribute
8560         based types.
8562         * enum.cs (ApplyAttributeBuilder): Added special handling
8563         for System.Security.Permissions.SecurityAttribute based types.
8565         * parameter.cs (ApplyAttributeBuilder): Added special handling
8566         for System.Security.Permissions.SecurityAttribute based types.
8568         * rootcontext.cs: Next 2 core types.
8570         * typemanager.cs (TypeManager.security_permission_attr_type):
8571         Built in type for the SecurityPermission Attribute.
8572         (code_access_permission_type): Build in type.
8574 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8576         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8577         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8578         all of this information into
8579         EmitContext.EmitCapturedVariableInstance.
8580         
8581         * codegen.cs (EmitCapturedVariableInstance): move here the
8582         funcionality of emitting an ldarg.0 in the presence of a
8583         remapping.   This centralizes the instance emit code.
8585         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8586         then emit a load of this: it means that we have reached the
8587         topmost ScopeInfo: the one that contains the pointer to the
8588         instance of the class hosting the anonymous method.
8590         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8591         captures to the topmost CaptureContext.
8593 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8595         * expression.cs (LocalVariableReference): Move the knowledge about
8596         the iterators into codegen's EmitCapturedVariableInstance.
8598 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8600         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8601         all code paths return a value from an anonymous method (it is the
8602         same as the 161 error, but for anonymous methods).
8604 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8606         The introduction of anonymous methods in the compiler changed
8607         various ways of doing things in the compiler.  The most
8608         significant one is the hard split between the resolution phase
8609         and the emission phases of the compiler.
8611         For instance, routines that referenced local variables no
8612         longer can safely create temporary variables during the
8613         resolution phase: they must do so from the emission phase,
8614         since the variable might have been "captured", hence access to
8615         it can not be done with the local-variable operations from the runtime.
8616         
8617         * statement.cs 
8619         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8620         is a toplevel block.
8622         (ToplevelBlock): A new kind of Block, these are the blocks that
8623         are created by the parser for all toplevel method bodies.  These
8624         include methods, accessors and anonymous methods.
8626         These contain some extra information not found in regular blocks:
8627         A pointer to an optional CaptureContext (for tracking captured
8628         local variables and parameters).  A pointer to the parent
8629         ToplevelBlock.
8630         
8631         (Return.Resolve): Catch missmatches when returning a value from an
8632         anonymous method (error 1662).
8633         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8634         phase.
8636         (Break.Resolve): ditto.
8638         (SwitchLabel): instead of defining the labels during the
8639         resolution phase, we now turned the public ILLabel and ILLabelCode
8640         labels into methods called GetILLabelCode() and GetILLabel() that
8641         only define the label during the Emit phase.
8643         (GotoCase): Track the SwitchLabel instead of the computed label
8644         (its contained therein).  Emit the code by using
8645         SwitchLabel.GetILLabelCode ().
8647         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8648         whether the Local has been captured or not.
8650         (LocalInfo.IsCaptured): New property, used to tell whether the
8651         local has been captured.
8652         
8653         * anonymous.cs: Vastly updated to contain the anonymous method
8654         support.
8656         The main classes here are: CaptureContext which tracks any
8657         captured information for a toplevel block and ScopeInfo used to
8658         track the activation frames for various local variables.   
8660         Each toplevel block has an optional capture context associated
8661         with it.  When a method contains an anonymous method both the
8662         toplevel method and the anonymous method will create a capture
8663         context.   When variables or parameters are captured, they are
8664         recorded on the CaptureContext that owns them, for example:
8666         void Demo () {
8667              int a;
8668              MyDelegate d = delegate {
8669                  a = 1;
8670              }
8671         }
8673         Here `a' will be recorded as captured on the toplevel
8674         CapturedContext, the inner captured context will not have anything
8675         (it will only have data if local variables or parameters from it
8676         are captured in a nested anonymous method.
8678         The ScopeInfo is used to track the activation frames for local
8679         variables, for example:
8681         for (int i = 0; i < 10; i++)
8682                 for (int j = 0; j < 10; j++){
8683                    MyDelegate d = delegate {
8684                         call (i, j);
8685                    }
8686                 }
8688         At runtime this captures a single captured variable `i', but it
8689         captures 10 different versions of the variable `j'.  The variable
8690         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8691         recorded on a child.  
8693         The toplevel ScopeInfo will also track information like the `this'
8694         pointer if instance variables were referenced (this is necessary
8695         as the anonymous method lives inside a nested class in the host
8696         type of the method). 
8698         (AnonymousMethod): Expanded to track the Toplevel, implement
8699         `AnonymousMethod.Compatible' to tell whether an anonymous method
8700         can be converted to a target delegate type. 
8702         The routine now also produces the anonymous method content
8704         (AnonymousDelegate): A helper class that derives from
8705         DelegateCreation, this is used to generate the code necessary to
8706         produce the delegate for the anonymous method that was created. 
8708         * assign.cs: API adjustments for new changes in
8709         Convert.ImplicitStandardConversionExists.
8711         * class.cs: Adjustments to cope with the fact that now toplevel
8712         blocks are of type `ToplevelBlock'. 
8714         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8715         insteda of standard blocks.
8717         Flag errors if params arguments are passed to anonymous methods.
8719         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8720         `CurrentAnonymousMethod' which points to the current Anonymous
8721         Method.  The variable points to the AnonymousMethod class that
8722         holds the code being compiled.  It is set in the new EmitContext
8723         created for the anonymous method.
8725         (EmitContext.Phase): Introduce a variable and an enumeration to
8726         assist in enforcing some rules about when and where we are allowed
8727         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8728         only one that enfonces this right now).
8730         (EmitContext.HaveCaptureInfo): new helper method that returns
8731         whether we have a CapturedContext initialized.
8733         (EmitContext.CaptureVariable): New method used to register that a
8734         LocalInfo must be flagged for capturing. 
8736         (EmitContext.CapturedParameter): New method used to register that a
8737         parameters must be flagged for capturing. 
8738         
8739         (EmitContext.CapturedField): New method used to register that a
8740         field must be flagged for capturing. 
8742         (EmitContext.HaveCapturedVariables,
8743         EmitContext.HaveCapturedFields): Return whether there are captured
8744         variables or fields. 
8746         (EmitContext.EmitMethodHostInstance): This is used to emit the
8747         instance for the anonymous method.  The instance might be null
8748         (static methods), this (for anonymous methods that capture nothing
8749         and happen to live side-by-side with the current method body) or a
8750         more complicated expression if the method has a CaptureContext.
8752         (EmitContext.EmitTopBlock): Routine that drives the emission of
8753         code: it will first resolve the top block, then emit any metadata
8754         and then emit the code.  The split is done so that we can extract
8755         any anonymous methods and flag any captured variables/parameters.
8756         
8757         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8758         during this phase, the ILGenerator should not be used as labels
8759         and local variables declared here might not be accessible to any
8760         code that is part of an anonymous method.  
8762         Exceptions to this include the temporary variables that are
8763         created by some statements internally for holding temporary
8764         variables. 
8765         
8766         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8767         metadata for a cb
8769         (EmitContext.TemporaryReturn): This method is typically called
8770         from the Emit phase, and its the only place where we allow the
8771         ReturnLabel to be defined other than the EmitMeta.  The reason is
8772         that otherwise we would have to duplicate a lot of logic in the
8773         Resolve phases of various methods that today is on the Emit
8774         phase. 
8776         (EmitContext.NeedReturnLabel): This no longer creates the label,
8777         as the ILGenerator is not valid during the resolve phase.
8779         (EmitContext.EmitThis): Extended the knowledge in this class to
8780         work in anonymous methods in addition to iterators. 
8782         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8783         code is necessary on the stack to access the instance to a local
8784         variable (the variable will be accessed as a field).
8786         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8787         EmitContext.EmitAddressOfParameter): Routines to support
8788         parameters (not completed at this point). 
8789         
8790         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8791         will also remove the parameters.
8793         * convert.cs (Convert): Define a `ConstantEC' which points to a
8794         null.  This is just to prefity some code that uses
8795         ImplicitStandardConversion code and do not have an EmitContext
8796         handy.
8798         The idea is to flag explicitly that at that point in time, it is
8799         known that the conversion will not trigger the delegate checking
8800         code in implicit conversions (which requires a valid
8801         EmitContext). 
8803         Everywhere: pass new EmitContext parameter since
8804         ImplicitStandardConversionExists now requires it to check for
8805         anonymous method conversions. 
8807         (Convert.ImplicitStandardConversionExists): If the type of an
8808         expression is the anonymous_method_type, and the type is a
8809         delegate, we invoke the AnonymousMethod.Compatible method to check
8810         whether an implicit conversion is possible. 
8812         (Convert.ImplicitConversionStandard): Only do implicit method
8813         group conversions if the language level is not ISO_1.
8815         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8816         MethodInfo for the Invoke method.  used by Delegate and
8817         AnonymousDelegate.
8819         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8820         method conversions if the target type is a delegate.
8822         Removed extra debugging nops.
8824         (LocalVariableReference): Turn the `local_info' into a public
8825         field. 
8827         Add `prepared' field, the same hack used for FieldExprs to cope
8828         with composed assignments, as Local variables do not necessarily
8829         operate purely on the stack as they used to: they can be captured
8830         fields. 
8832         Add `temp' for a temporary result, like fields.
8834         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8836         It now copes with Local variables that are captured and emits the
8837         proper instance variable to load it from a field in the captured
8838         case. 
8840         (ParameterReference.DoResolveBase): During the resolve phase,
8841         capture parameters if we are in an anonymous method.
8843         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8844         anonymous method, use the EmitContext helper routines to emit the
8845         parameter reference.
8847         * iterators.cs: Set RemapToProxy to true/false during the
8848         EmitDispose class.
8850         * parameters.cs (GetParameterByName): New helper method. 
8852         * typemanager.cs (anonymous_method_type) a new type that
8853         represents an anonyous method.  This is always an internal type,
8854         used as a fencepost to test against the anonymous-methodness of an
8855         expression. 
8856         
8857 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8859         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8860         561 report.
8861         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8863 2004-11-10  Martin Baulig  <martin@ximian.com>
8865         * expression.cs (Invocation.BetterFunction): If two methods have
8866         equal parameter types, but only one of them is generic, the
8867         non-generic one wins.
8868         (New.DoResolve): Don't set `is_struct' to false if we're a generic
8869         instance; just use `Type.IsValueType' to determine whether
8870         something is a struct or not.
8871         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8872         so we can be called multiple times.
8874 2004-11-10  Martin Baulig  <martin@ximian.com>
8876         * generic.cs (TypeParameter.DefineConstraints): New public method.
8877         (TypeParameter.CheckAccessLevel): Override this and return true.
8878         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8879         override ResolveType() anymore.
8880         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8882 2004-11-10  Martin Baulig  <martin@ximian.com>
8884         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8885         call DeclSpace.ResolveNestedType() on it.
8887 2004-11-10  Martin Baulig  <martin@ximian.com>
8889         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8890         non-null, call ParameterModifier() on it.
8892 2004-11-10  Martin Baulig  <martin@ximian.com>
8894         * iterators.cs
8895         (Iterators): Added `current_type' and `this_type' fields.
8896         (Iterators.DefineIterator): Create a new EmitContext and store it
8897         in `ec'; compute `this_type'.
8899 2004-11-10  Martin Baulig  <martin@ximian.com>
8901         * typemanager.cs
8902         (TypeManager.IsPrivateAccessible): New public method.
8903         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8905 2004-11-10  Martin Baulig  <martin@ximian.com>
8907         * class.cs (TypeContainer.DefineType): Call
8908         TypeBuilder.DefineGenericParameters() before resolving the type
8909         parameters.
8910         (MethodData.parent_method): New protected field.
8911         (MethodData..ctor): Added `MethodInfo parent_method' argument.
8912         (MethodData.Define): Compute `parent_method'.
8914         * decl.cs
8915         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8916         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8917         (DeclSpace.ec): New protected field; store the EmitContext here.
8918         (DeclSpace.EmitContext): New public property.
8919         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8920         (DeclSpace.ResolveNestedType): New public method.
8921         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8922         (DeclSpace.NestedAccessible): Added `Type tb' argument.
8923         (DeclSpace.FamilyAccessible): Likewise.
8924         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8925         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8926         EmitContext.
8928         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8929         field.
8931         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8932         (Enum.Emit): Don't create a new EmitContext.
8934 2004-10-18  Martin Baulig  <martin@ximian.com>
8936         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8937         `Type' directly, but call ResolveType() on it.
8938         (Catch.Resolve): Likewise.
8939         (Foreach.Resolve): Likewise.
8941 2004-10-18  Martin Baulig  <martin@ximian.com>
8943         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8944         `Type' directly, but call ResolveType() on it.
8945         (Probe.DoResolve): Likewise.
8946         (ArrayCreation.LookupType): Likewise.
8947         (TypeOf.DoResolve): Likewise.
8948         (SizeOf.DoResolve): Likewise.
8950 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8952         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8953         the ResolveType.
8955 2004-10-17  John Luke  <john.luke@gmail.com>
8957         * class.cs (Operator.GetSignatureForError): use CSharpName
8959         * parameter.cs (Parameter.GetSignatureForError): Returns
8960         correct name even if was not defined.
8962 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8964         Fix #65816.
8965         * class.cs (TypeContainer.EmitContext): New property.
8966         (DefineNestedTypes): Create an emitcontext for each part.
8967         (MethodCore.DoDefineParameters): Use container's emitcontext.
8968         Pass type array to InternalParameters.
8969         (MemberBase.DoDefine): Use container's emitcontext.
8970         (FieldMember.Define): Likewise.
8971         (Event.Define): Likewise.
8972         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8973         Pass type array to InternalParameters.
8974         (SetIndexerMethod.GetParameterInfo): Likewise.
8975         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8976         * delegate.cs (Define): Pass emitcontext to
8977         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8978         array to InternalParameters.
8979         * expression.cs (ParameterReference.DoResolveBase): Pass
8980         emitcontext to GetParameterInfo.
8981         (ComposedCast.DoResolveAsTypeStep): Remove check on
8982         ec.ResolvingTypeTree.
8983         * parameter.cs (Parameter.Resolve): Change argument to
8984         EmitContext.  Use ResolveAsTypeTerminal.
8985         (Parameter.GetSignature): Change argument to EmitContext.
8986         (Parameters.ComputeSignature): Likewise.
8987         (Parameters.ComputeParameterTypes): Likewise.
8988         (Parameters.GetParameterInfo): Likewise.
8989         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8990         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8991         * support.cs (InternalParameters..ctor): Remove variant that takes
8992         a DeclSpace.
8993         * typemanager.cs (system_intptr_expr): New.
8994         (InitExpressionTypes): Initialize it.
8996 2004-10-12  Chris Toshok  <toshok@ximian.com>
8998         * cs-parser.jay: fix location for try_statement and catch_clause.
9000 2004-10-18  Martin Baulig  <martin@ximian.com>
9002         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9003         `Type' directly, but call ResolveType() on it.
9004         (MemberBase.DoDefine): Likewise.
9006         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9007         `Type' directly, but call ResolveType() on it.
9008         (ComposedCast.DoResolveAsTypeStep): Likewise.
9010         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9011         `Type' directly, but call ResolveType() on it.
9013 2004-10-17  John Luke  <john.luke@gmail.com>
9015         * class.cs (Operator.GetSignatureForError): use CSharpName
9017         * parameter.cs (Parameter.GetSignatureForError): Returns
9018         correct name even if was not defined.
9020 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9022         Fix #65816.
9023         * class.cs (TypeContainer.EmitContext): New property.
9024         (DefineNestedTypes): Create an emitcontext for each part.
9025         (MethodCore.DoDefineParameters): Use container's emitcontext.
9026         Pass type array to InternalParameters.
9027         (MemberBase.DoDefine): Use container's emitcontext.
9028         (FieldMember.Define): Likewise.
9029         (Event.Define): Likewise.
9030         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9031         Pass type array to InternalParameters.
9032         (SetIndexerMethod.GetParameterInfo): Likewise.
9033         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9034         * delegate.cs (Define): Pass emitcontext to
9035         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9036         array to InternalParameters.
9037         * expression.cs (ParameterReference.DoResolveBase): Pass
9038         emitcontext to GetParameterInfo.
9039         (ComposedCast.DoResolveAsTypeStep): Remove check on
9040         ec.ResolvingTypeTree.
9041         * parameter.cs (Parameter.Resolve): Change argument to
9042         EmitContext.  Use ResolveAsTypeTerminal.
9043         (Parameter.GetSignature): Change argument to EmitContext.
9044         (Parameters.ComputeSignature): Likewise.
9045         (Parameters.ComputeParameterTypes): Likewise.
9046         (Parameters.GetParameterInfo): Likewise.
9047         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9048         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9049         * support.cs (InternalParameters..ctor): Remove variant that takes
9050         a DeclSpace.
9051         * typemanager.cs (system_intptr_expr): New.
9052         (InitExpressionTypes): Initialize it.
9054 2004-10-12  Chris Toshok  <toshok@ximian.com>
9056         * cs-parser.jay: fix location for try_statement and catch_clause.
9058 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9060         More DeclSpace.ResolveType avoidance.
9061         * decl.cs (MemberCore.InUnsafe): New property.
9062         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9063         with newly created EmitContext.
9064         (FieldMember.Define): Likewise.
9065         * delegate.cs (Delegate.Define): Likewise.
9066         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9067         only if normal name-lookup fails.
9068         (TypeExpr.DoResolve): Enable error-checking.
9069         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9070         (SizeOf.DoResolve): Likewise.
9071         (ComposedCast.DoResolveAsTypeStep): Likewise.
9072         (StackAlloc.DoResolve): Likewise.
9073         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9074         (Block.Unsafe): New property.
9075         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9076         (Unsafe): Set 'unsafe' flag of contained block.
9077         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9078         (Fixed.Resolve): Likewise.
9079         (Catch.Resolve): Likewise.
9080         (Using.ResolveLocalVariableDecls): Likewise.
9081         (Foreach.Resolve): Likewise.
9083 2004-10-05  John Luke <john.luke@gmail.com>
9085         * cs-parser.jay: add location to error CS0175
9087 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9089         * ecore.cs (Expression.Constantity): Add support for turning null
9090         into a constant.
9092         * const.cs (Const.Define): Allow constants to be reference types
9093         as long as the value is Null.
9095 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9097         * namespace.cs (NamespaceEntry.Using): No matter which warning
9098         level is set, check if this namespace name has already been added.
9100 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9102         * expression.cs: reftype [!=]= null should always use br[true,false].
9103         # 67410
9105 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9107         Fix #67108
9108         * attribute.cs: Enum conversion moved to 
9109         GetAttributeArgumentExpression to be applied to the all
9110         expressions.
9112 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9114         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9115         * class.c (TypeContainer.DefineType): Flag error if
9116         base types aren't accessible due to access permissions.
9117         * decl.cs (DeclSpace.ResolveType): Move logic to
9118         Expression.ResolveAsTypeTerminal.
9119         (DeclSpace.ResolveTypeExpr): Thin layer over
9120         Expression.ResolveAsTypeTerminal.
9121         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9122         Refactor code into NestedAccess.  Use it.
9123         (DeclSpace.NestedAccess): New.
9124         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9125         argument to silence errors.  Check access permissions.
9126         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9127         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9128         (Cast.DoResolve): Likewise.
9129         (New.DoResolve): Likewise.
9130         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9131         (TypeOf.DoResolve): Likewise.
9133         * expression.cs (Invocation.BetterConversion): Return the Type of
9134         the better conversion.  Implement section 14.4.2.3 more faithfully.
9135         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9136         section 14.4.2.2 explicit.
9137         (Invocation.OverloadResolve): Update.
9138         (Invocation): Remove is_base field.
9139         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9140         (Invocation.Emit): Likewise.
9142 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9144         * cs-parser.jay: Reverted 642 warning fix.
9146 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9148         Fix bug #66615
9149         * decl.cs (FindMemberWithSameName): Indexer can have more than
9150         1 argument.
9152 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9154         * expression.cs (LocalVariableReference.DoResolveLValue):
9155         Do not report warning 219 for out values.
9156         (EmptyExpression.Null): New member to avoid extra allocations.
9158 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9160         * cs-parser.jay: Fix wrong warning 642 report.
9162         * cs-tokenizer.cs (CheckNextToken): New helper;
9163         Inspect next character if is same as expected.
9165 2004-09-23  Martin Baulig  <martin@ximian.com>
9167         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9168         (Convert.ImplicitReferenceConversionExists): Likewise.
9170 2004-11-09  Raja R Harinath  <rharinath@novell.com>
9172         * Makefile (DISTFILES): Comment out a few missing files.
9174 2004-10-29  Raja R Harinath  <rharinath@novell.com>
9176         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9177         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
9178         (gmcs.exe): Invoke bootstrap-libs.
9179         (clean-local): Clean the net_2_0_bootstrap profile too.
9180         (PROGRAM_INSTALL_DIR): New.
9181         (install-local): Use it.
9183 2004-10-13  Martin Baulig  <martin@ximian.com>
9185         * generic.cs (TypeManager.InflatedConstraints): New nested class.
9186         (TypeParameter.DefineType): If we're a method type parameter and
9187         that method is overriding something, "inflate" its constraints.
9189 2004-10-12  Martin Baulig  <martin@ximian.com>
9191         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9192         and have type arguments, create and resolve a ConstructedType.
9194 2004-10-12  Martin Baulig  <martin@ximian.com>
9196         * decl.cs (MemberCache.FindMemberToOverride): Use
9197         TypeManager.IsEqual() to compare the parameters and Type.Equals()
9198         to compare the invocationType.
9200         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9201         When comparing two type parameters, only do the signature-only
9202         comparision for method type parameters.
9204 2004-10-11  Martin Baulig  <martin@ximian.com>
9206         * report.cs: Don't make --fatal abort on warnings, we have
9207         -warnaserror for that.
9209 2004-10-11  Martin Baulig  <martin@ximian.com>
9211         * typemanager.cs
9212         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9213         (TypeManager.IsEqual): Call ourself recursively instead of using
9214         Type.IsEqual(). 
9216 2004-10-11  Martin Baulig  <martin@ximian.com>
9218         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9219         on our own type parameters, not on the ones we inherit from a containing
9220         class.
9222         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9223         the comparision.
9225         * generic.cs (TypeParameter.Define): We may only be called once.
9227         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9228         instead of TypeManager.IsEqual().
9230 2004-09-28  Martin Baulig  <martin@ximian.com>
9232         * generic.cs
9233         (GenericConstraints.EffectiveBaseClass): New public property.
9234         (TypeParameter.GenericConstraints): New public property.
9235         (ConstructedType.CheckConstraints): Improved.
9237         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9238         (Convert.TypeParameterConversion): New private method; use this in
9239         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9240         for all conversions related to type parameters.
9242 2004-09-24  Martin Baulig  <martin@ximian.com>
9244         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9245         type parameter conversions for type parameters which are known to
9246         be reference types.
9248 2004-09-24  Martin Baulig  <martin@ximian.com>
9250         * generic.cs (GenericConstraints): Added `IsReferenceType' and
9251         `IsValueType' properties.
9253         * support.cs (ReflectionConstraints): Use
9254         Type.GetGenericParameterConstraints() instead of the old hack.
9256 2004-09-24  Martin Baulig  <martin@ximian.com>
9258         * generic.cs (GenericConstraints): Moved here and made it an
9259         abstract class.
9261         * support.cs (GenericConstraints): Moved to generic.cs.
9263 2004-09-24  Martin Baulig  <martin@ximian.com>
9265         * support.cs
9266         (ReflectionConstraints): Un-nested this class and made it public.
9268         * typemanager.cs
9269         (TypeManager.GetTypeParameterConstraints): New public method.
9270         (TypeManager.HasConstructorConstraint): Use the attributes.
9272 2004-09-24  Martin Baulig  <martin@ximian.com>
9274         * support.cs (GenericConstraints): Replaced `HasConstructor',
9275         `IsReferenceType' and `IsValueType' with `Attributes'.
9276         (ReflectionParameters.ReflectionConstraints): Removed the Create()
9277         method and made the .ctor public.
9279         * generic.cs (Constraints.Attributes): New public property.
9280         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9281         `IsReferenceType' -> `HasReferenceTypeConstraint' and
9282         `IsValueType' -> `HasValueTypeConstraint'.
9284 2004-09-23  Martin Baulig  <martin@ximian.com>
9286         * generic.cs (Constraints): Reflect latest runtime changes.
9288 2004-09-23  Martin Baulig  <martin@ximian.com>
9290         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9291         (Convert.ImplicitReferenceConversionExists): Likewise.
9293 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9295         * class.cs (Operator.Define): Add error 448 and 559 report.
9296         
9297 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9299         * class.cs (MemberBase.IsTypePermitted): New protected
9300         method for checking error CS0610.
9302 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9304         * class.cs (TypeContainer.HasExplicitLayout): New property
9305         Returns whether container has StructLayout attribute set Explicit.
9306         (FieldMember): New abstract class for consts and fields.
9307         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9308         (Field): Reuse FieldMember.
9310         * const.cs (Const): Reuse FieldMember.
9312         * rootcontext.cs: EmitConstants call moved to class.
9314 2004-09-22  Martin Baulig  <martin@ximian.com>
9316         Marek and me just fixed one of our oldest bugs: #28562 :-)
9318         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9320         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9321         we're an EnumConstant, just return that.
9322         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9323         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9324         to get the value which'll actually be written into the attribute.
9325         However, we have to use GetValue() to access the attribute's value
9326         in the compiler.        
9328 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9330         * constant.cs (Constant.IsNegative): New abstract property
9331         IsNegative.
9333         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9334         (StackAlloc.DoResolve): Reused IsNegative.
9336 2004-09-22  Martin Baulig  <martin@ximian.com>
9338         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9339         public method; like LookupTypeContainer, but also works for
9340         generic instances.
9342         * report.cs (Report.SymbolRelatedToPreviousError): Use
9343         TypeManager.LookupGenericTypeContainer().       
9345 2004-09-22  Martin Baulig  <martin@ximian.com>
9347         Thanks to Peter Sestoft for this bug report.
9349         * expression.cs (Conditional): If both the `trueExpr' and the
9350         `falseExpr' is a NullLiteral, return a NullLiteral.
9352 2004-09-22  Martin Baulig  <martin@ximian.com>
9354         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9355         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9356         for the "get_Current" call.
9358 2004-09-21  Martin Baulig  <martin@ximian.com>
9360         * convert.cs (Convert.ImplicitReferenceConversion): When
9361         converting to an interface type, first check whether we're
9362         converting from a reference type.
9364 2004-09-14  Martin Baulig  <martin@ximian.com>
9366         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9368 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9370         Fixed bug #61902
9371         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9372         called and is obsolete then this member suppress message
9373         when call is inside next [Obsolete] method or type.
9375         * expression.cs: Use TestObsoleteMethodUsage member.
9377 2004-09-14  Martin Baulig  <martin@ximian.com>
9379         * genericparser.cs: Removed.
9381 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9383         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9385 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9387         * attribute.cs (Attribute.Resolve): Add error 653 report.
9389         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9390         report.
9391         (Method.ApplyAttributeBuilder): Add error 685 report.
9392         (Operator.Define): Add error 564 report.
9394         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9396         * expression.cs (Invocation.DoResolve): Add error
9397         245 and 250 report.
9399         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9400         error 674 report.
9402 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9404         * class.cs (ConstructorInitializer.Resolve):
9405         Wrong error number (515->516).
9407 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9409         * class.cs (Indexer.Define): Add error 631 report.
9411 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9413         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9415 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9417         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9419 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9421         * cs-parser.jay: Added error CS0241 report.
9423 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9425         * cs-parser.jay (fixed_statement): Introduce a scope for the
9426         declaration in the 'fixed' statement.
9428 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9430         * cs-parser.jay: Added CS0230 error report.
9432 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9434         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9436 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9438         * expression.cs (Argument.Resolve): Added error CS0192 and
9439         CS0199 report.
9441 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9443         C# 2.0 #pragma warning feature
9445         * cs-tokenizer.cs (PreProcessPragma): New method; 
9446         Handles #pragma directive.
9448         * report.cs (WarningRegions): New class; Support
9449         class for #pragma warning directive. It tests whether
9450         warning is enabled for a given line.
9452 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9454         * const.cs: Add more descriptive error report, tahnks to
9455         Sebastien. 
9457 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9459         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9461 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9463         * expression.cs: Apply patch from Ben: Remove dead code from
9464         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9465         as that code just threw an exception anwyays.
9467         * const.cs: Remove the call to the turnintoconstant, for details
9468         see bug: #63144
9469         
9470         * literal.cs: The type of the null-literal is the null type;  So
9471         we use a placeholder type (literal.cs:System.Null, defined here)
9472         for it.
9474         * expression.cs (Conditional.DoResolve): Remove some old code that
9475         is no longer needed, conversions have been fixed.
9477         (ArrayCreationExpression.DoResolve): Return false if we fail to
9478         resolve the inner expression.
9480 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9482         Fix test-290.cs.
9483         * cs-parser.jay (delegate_declaration): Record a delegate
9484         declaration as a type declaration.
9485         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9487 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9489         * parameter.cs: Do not crash if the type can not be resolved. 
9491         * expression.cs: Report errors with unsafe pointers, fixes #64896
9493 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9495         * expression.cs: Pointer arith always needs to do a conv.i
9496         if the operand is a long. fix 65320
9498 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9500         Fixed cs0619-37.cs, cs0619-38.cs
9502         * enum.cs (GetObsoleteAttribute): Removed.
9504         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9505         on Enum member is double staged. The first is tested member
9506         and then enum.
9508 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9510         Fixed #56986, #63631, #65231
9512         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9513         adds member to name container.
9514         (TypeContainer.AddToTypeContainer): New method, adds type to
9515         name container.
9516         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9517         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9518         AddOperator): Simplified by reusing AddToMemberContainer.
9519         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9520         instead of field.
9521         (Method.CheckForDuplications): Fixed implementation to test all
9522         possibilities.
9523         (MemberBase): Detection whether member is explicit interface
9524         implementation is now in constructor.
9525         (MemberBase.UpdateMemberName): Handles IndexerName.
9526         (Accessor): Changed to keep also location information.
9527         (AbstractPropertyEventMethod): Is derived from MemberCore.
9528         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9529         will be emited or not.
9530         (PropertyBase.AreAccessorsDuplicateImplementation):
9531         Tests whether accessors are not in collision with some method.
9532         (Operator): Is derived from MethodCore to simplify common
9533         operations.
9535         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9536         must be performed.
9537         (DeclSpace.AddToContainer): Adds the member to defined_names
9538         table. It tests for duplications and enclosing name conflicts.
9540         * enum.cs (EnumMember): Clean up to reuse the base structures
9542 2004-09-03  Martin Baulig  <martin@ximian.com>
9544         Merged latest changes into gmcs.  Please keep this comment in
9545         here, it makes it easier for me to see what changed in MCS since
9546         the last time I merged.
9548 2004-09-03  Martin Baulig  <martin@ximian.com>
9550         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9551         into TypeContainer, to make partial classes work again.
9553 2004-09-03  Martin Baulig  <martin@ximian.com>
9555         * rootcontext.cs (RootContext.V2): Removed.
9557 2004-03-23  Martin Baulig  <martin@ximian.com>
9559         * expression.cs (Invocation.OverloadResolve): Added `bool
9560         may_fail' argument and use it instead of the Location.IsNull() hack.
9562 2004-09-09  Martin Baulig  <martin@ximian.com>
9564         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9566 2004-09-09  Martin Baulig  <martin@ximian.com>
9568         * generic.cs (TypeParameter.DefineType): Added support for
9569         explicit interface methods.
9571 2004-09-09  Martin Baulig  <martin@ximian.com>
9573         * README.Changes: New document.  Started to list important changes
9574         between MCS and GMCS here.
9576 2004-09-08  Martin Baulig  <martin@ximian.com>
9578         * class.cs
9579         (TypeContainer.CheckRecursiveDefinition): New protected method.
9580         (TypeContainer.DefineType): Move the CS0146 check into
9581         CheckRecursiveDefinition().     
9583 2004-09-06  Martin Baulig  <martin@ximian.com>
9585         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9586         types for the constructor constraint.
9588 2004-09-03  Martin Baulig  <martin@ximian.com>
9590         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9591         into TypeContainer, to make partial classes work again.
9593 2004-09-03  Martin Baulig  <martin@ximian.com>
9595         * rootcontext.cs (RootContext.V2): Removed.
9597 2004-03-23  Martin Baulig  <martin@ximian.com>
9599         * expression.cs (Invocation.OverloadResolve): Added `bool
9600         may_fail' argument and use it instead of the Location.IsNull() hack.
9602 2004-09-03  Martin Baulig  <martin@ximian.com>
9604         Merged latest changes into gmcs.  Please keep this comment in
9605         here, it makes it easier for me to see what changed in MCS since
9606         the last time I merged.
9608 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9610         Fix #61128.
9611         * expression.cs (BetterConversion): Don't allow either conversion 
9612         to be null.  Remove redundant implicit conversion test when 'q ==
9613         null' -- when this function is invoked, we already know that the
9614         implicit conversion exists.
9615         (BetterFunction): Assume that 'best' is non-null.  Remove
9616         redundant reimplementation of IsApplicable when 'best' is null.
9617         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9618         number of arguments.
9619         (IsAncestralType): Extract from OverloadResolve.
9620         (OverloadResolve): Make robust to the MethodGroupExpr being
9621         unsorted.  Implement all the logic of Section 14.5.5.1, and
9622         support overloading of methods from multiple applicable types.
9623         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9625         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9626         (RealError, Warning): Append type of report to related symbol.
9628 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9630         * enum.cs: Fixed CLS-Compliance checks for enum members.
9631         Error tests cs3008-8.cs, cs3014-8.cs
9633 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9635         Fixed bug #62342, #63102
9636         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9637         like ImplementMethod.
9639 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9641         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9642         Fixed bug #65170.
9644 2004-09-02  Martin Baulig  <martin@ximian.com>
9646         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9647         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9648         on the MethodBase.
9650 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9652         C# 2.0 Static classes implemented
9654         * class.cs (TypeContainer): instance_constructors,
9655         initialized_fields, initialized_static_fields,
9656         default_constructor, base_inteface_types are protected to be
9657         accessible from StaticClass.
9658         (TypeContainer.DefineDefaultConstructor): New virtual method
9659         for custom default constructor generating
9660         (StaticClass): New class to handle "Static classes" feature.
9662         * cs-parser.jay: Handle static keyword on class like instance
9663         of StaticClass.
9665         * driver.cs: Added "/langversion" command line switch with two
9666         options (iso-1, default).
9668 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9670         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9672 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9674         * delegate.cs: Style.
9676 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9678         * delegate.cs: Add seperate instance expr field for miguel.
9680 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9682         * PointerArithmetic (Resolve): make sure we are not doing
9683         pointer arith on void*. Also, make sure we are resolved
9684         by not setting eclass until resolve.
9686         All callers: Make sure that PointerArithmetic gets resolved.
9688 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9690         * ArrayCreation (LookupType): If the type does not resolve 
9691         to an array, give an error.
9693 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9695         * statement.cs (Try.Resolve): Fixed bug #64222
9697 2004-08-27  Martin Baulig  <martin@ximian.com>
9699         * class.cs
9700         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9701         crash here.     
9703 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9705         * ecore.cs (Constantify): Get underlying type via
9706         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9707         Windows in special cases.
9709 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9711         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9712         for obtaining also private methods.
9713         (GetRemoveMethod): Used GetRemoveMethod (true)
9714         for obtaining also private methods.
9716 2004-09-02  Martin Baulig  <martin@ximian.com>
9718         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9719         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9720         on the MethodBase.
9722 2004-08-27  Martin Baulig  <martin@ximian.com>
9724         * class.cs
9725         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9726         crash here.     
9728 2004-08-25  Martin Baulig  <martin@ximian.com>
9730         * support.cs (ReflectionParameters..ctor): If this is a generic
9731         method, retrieve and store its type parameters.
9732         (InternalParameters..ctor): Added `TypeParameter[]' argument.
9733         (ReflectionParameters.GenericConstraints): The argument specifies
9734         the type parameter, not the method parameter.
9735         (InternalParameters.GenericConstraints): Likewise.
9737         * generic.cs (TypeParameter.DefineType): Correctly handle
9738         constraints wrt. generic methods in interfaces and their
9739         implementations.        
9741 2004-08-24  Martin Baulig  <martin@ximian.com>
9743         * generic.cs (TypeParameter.IsSubclassOf): New public method.
9744         (Constraints.IsSubclassOf): New internal method.
9746         * typemanager.cs (TypeManager.FindMembers): Added special support
9747         for GenericTypeParameterBuilder's.      
9748         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9749         type parameters.
9751 2004-08-24  Martin Baulig  <martin@ximian.com>
9753         * typemanager.cs
9754         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9755         this for accessibility checks.
9756         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9757         IsNestedFamilyAccessible.
9758         (TypeManager.IsSubclassOf): New method, do what the name actually
9759         says.   
9761 2004-08-24  Martin Baulig  <martin@ximian.com>
9763         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9764         as a SimpleName, include the generic arity.
9766 2004-08-24  Martin Baulig  <martin@ximian.com>
9768         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9769         MethodAttributes.HideBySig for operators.
9771 2004-08-23  Martin Baulig  <martin@ximian.com>
9773         Back to the old error reporting system :-)
9775         * report.cs (Message): Removed.
9776         (Report.MessageData, ErrorData, WarningData): Removed.
9777         (Report.Error, Warning): Back to the old system.
9779 2004-08-23  Martin Baulig  <martin@ximian.com>
9781         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9783         * class.cs (TypeContainer.ParentContainer): New public virtual
9784         method; replaces the explicit interface implementation.
9785         (ClassPart.ParentContainer): Override.
9787 2004-08-23  Martin Baulig  <martin@ximian.com>
9789         * statement.cs (Switch): Added support for constant switches; see
9790         #59428 or test-285.cs.
9792 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9794         Fixed bug #62740.
9795         * statement.cs (GetEnumeratorFilter): Removed useless
9796         logic because C# specs is strict. GetEnumerator must be
9797         public.
9799 2004-08-22  Martin Baulig  <martin@ximian.com>
9801         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9802         a switch and may break, reset the barrier.  Fixes #59867.
9804 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9806         CLS-Compliance speed up (~5% for corlib)
9808         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9809         New method. Tests container for CLS-Compliant names
9811         * class.cs (TypeContainer.VerifyClsName): New method.
9812         Checks whether container name is CLS Compliant.
9813         (Constructor): Implements IMethodData.
9815         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9816         low-case table for CLS Compliance test.
9817         (MemberCache.VerifyClsParameterConflict): New method.
9818         Checks method parameters for CS3006 error.
9820         * enum.cs (EnumMember): Is derived from MemberCore.
9821         (Enum.VerifyClsName): Optimized for better performance.
9823 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9825         * report.cs: Renamed Error_T to Error and changed all
9826         references.
9828 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9830         * class.cs (TypeContainer.IndexerArrayList): New inner class
9831         container for indexers.
9832         (TypeContainer.DefaultIndexerName): New constant for default
9833         indexer name. Replaced all "Item" with this constant.
9834         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9836         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9837         DefaultMemberAttribute constructor.
9839 2004-08-05  Martin Baulig  <martin@ximian.com>
9841         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9842         Fix bug #59429.
9844 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9846         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9847         multi platforms problem.
9849         * compiler.csproj: Included shared files.
9851 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9853         Fix bug 60333, 55971 in the more general way
9854         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9855         Added arg_type argument for constant conversion.
9856         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9858 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9860         Fix bug #59760
9861         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9862         OperatorArrayList, MethodCoreArrayList for typecontainer
9863         containers. Changed class member types to these new types.
9864         (MethodArrayList.DefineMembers): Added test for CS0659.
9866 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9868         * cfold.cs: Synchronize the folding with the code in expression.cs
9869         Binary.DoNumericPromotions for uint operands.
9871         * attribute.cs: Revert patch from Raja, it introduced a regression
9872         while building Blam-1.2.1 (hard to isolate a test case).
9874 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9876         Fix for #55382
9877         * class.cs:
9878         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9879         name collision.
9880         (MethodCore.parent_method): New member. The method we're overriding
9881         if this is an override method.
9882         (MethodCore.CheckBase): Moved from Method class and made common.
9883         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9884         private.
9885         (MethodCore.CheckForDuplications): New abstract method. For custom
9886         member duplication search in a container
9887         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9888         method and its return type.
9889         (Event.conflict_symbol): New member. Symbol with same name in the
9890         parent class.
9892         * decl.cs:
9893         (MemberCache.FindMemberWithSameName): New method. The method
9894         is looking for conflict with inherited symbols.
9896 2004-08-04  Martin Baulig  <martin@ximian.com>
9898         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9900         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9902 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9904         * report.cs (Message): New enum for better error, warning reference in
9905         the code.
9906         (MessageData): New inner abstract class. It generally handles printing of
9907         error and warning messages.
9908         Removed unused Error, Warning, Message methods.
9910 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9912         Fix for cs0592-8.cs test
9913         * attribute.cs
9914         (Attributable.ValidAttributeTargets): Made public.
9915         (Attribute.ExplicitTarget): New member for explicit target value.
9916         (Attribute.CheckTargets): Now we translate explicit attribute
9917         target to Target here.
9919 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9921         * ecore.cs (MethodGroupExpr): new IsBase property.
9923         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9925         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9926         rather than an instance expr.
9928         (DelegateCreation.Emit): Use the method group rather than
9929         the instance expression. Also, if you have base.Foo as the
9930         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9932         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9934         (NewDelegate.DoResolve): Only check for the existance of Invoke
9935         if the method is going to be needed. Use MethodGroupExpr.
9937         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9939         * expression.cs: For pointer arith., make sure to use
9940         the size of the type, not the size of the pointer to
9941         the type.
9943 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9945         Fix for #60722
9946         * class.cs (Class): Added error CS0502 test.
9948 2004-08-03  John Luke  <jluke@cfl.rr.com>
9949             Raja R Harinath  <rharinath@novell.com>
9951         Fix for #60997.
9952         * attribute.cs (Attribute.complained_before): New flag.
9953         (Attribute.ResolveType, Attribute.Resolve),
9954         (Attribute.DefinePInvokeMethod): Set it.
9955         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9956         
9957 2004-08-03  Martin Baulig  <martin@ximian.com>
9959         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9960         use a user-defined operator; we still need to do numeric
9961         promotions in case one argument is a builtin type and the other
9962         one has an implicit conversion to that type.  Fixes #62322.
9964 2004-08-18  Martin Baulig  <martin@ximian.com>
9966         * class.cs (Method.Define): Use the correct method name when
9967         creating the MethodBuilder for a generic method.
9969 2004-08-17  Martin Baulig  <martin@ximian.com>
9971         * generic.cs (Constraints): Support type parameter constraints.
9973 2004-08-16  Martin Baulig  <martin@ximian.com>
9975         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9976         (Token.GENERIC_DIMENSION): New token; this is returned if we
9977         encounter an unbound generic type in a typeof() expression.
9979         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9980         this token is only generated while parsing a typeof() expression.
9981         (typeof_expression): Removed the old unbound_type hack.
9983         * generic.cs (TypeArguments.IsUnbound): New public property.
9985         * decl.cs (MemberName): Added support for unbound types.
9987 2004-08-14  Martin Baulig  <martin@ximian.com>
9989         * typemanager.cs
9990         (TypeManager.IsEqualGenericInstance): New static method.
9991         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9992         just used to check accessibility, so follow the rules of 26.1.6.        
9994         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9995         ConstructedType instead of a TypeExpression if we have type arguments.
9997         * cs-parser.jay (typeof_expression): Support unbound generic types.
9999         * ecore.cs (UnboundTypeExpression): New public class.
10001 2004-08-12  Martin Baulig  <martin@ximian.com>
10003         * typemanager.cs (TypeManager.IsNestedChildOf): Use
10004         TypeManager.IsEqual() rather than `=='.
10006         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
10007         generic instances as well.
10009 2004-08-12  Martin Baulig  <martin@ximian.com>
10011         * expression.cs (Invocation.InferType): We can only infer method
10012         type parameters.  Fixes #62647.
10014 2004-08-11  Martin Baulig  <martin@ximian.com>
10016         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
10017         before resolving the base classes.
10019 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10021         * Makefile: install .mdb file too.
10023 2004-08-05  Martin Baulig  <martin@ximian.com>
10025         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
10026         initializer, the current type is just the TypeBuilder, not the
10027         instantiated generic type.
10028         (FieldExpr.IsFieldInitializer): New public property.
10030 2004-08-04  Martin Baulig  <martin@ximian.com>
10032         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10034         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10036 2004-08-03  Martin Baulig  <martin@ximian.com>
10038         * class.cs (MethodData.Define): If we're an explicit
10039         implementation, remove the generic arity from the type name.
10041 2004-08-03  Martin Baulig  <martin@ximian.com>
10043         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10044         use a user-defined operator; we still need to do numeric
10045         promotions in case one argument is a builtin type and the other
10046         one has an implicit conversion to that type.  Fixes #62322.
10048 2004-08-02  Martin Baulig  <martin@ximian.com>
10050         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
10051         `TypeExpr[]' array.
10052         (TypeContainer.GetClassBases): Return the unexpanded list of
10053         interfaces; we expand them later.
10054         (TypeContainer.DefineType): After creating the TypeBuilder, call
10055         TypeManager.ExpandInterfaces() to get an expanded and resolved
10056         list of interfaces.
10058         * ecore.cs (TypeExpr.GetInterfaces): Removed
10060         * generics.cs (Constraints.InterfaceConstraints): Remove.
10061         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10062         register the interface constraints.
10064         * typemanager.cs
10065         (TypeManager.AddUserType): Removed the `ifaces' argument.
10066         (TypeManager.AddTypeParameter): Likewise.
10067         (TypeManager.AddUserInterface): Removed, was unused.
10068         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10069         `TypeExpr[]' array for the interfaces.
10070         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10071         has been defined, returns a list of the resolved interfaces types.
10072         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10073         (TypeManager.GetExplicitInterfaces): Likewise.  
10075 2004-08-02  Martin Baulig  <martin@ximian.com>
10077         * expression.cs (Invocation.EmitCall): If we're invoking a method
10078         on a type parameter, use the new `Constrained' prefix opcode.
10080 2004-08-02  Martin Baulig  <martin@ximian.com>
10082         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10083         (LocalInfo.IsThis): New public property.
10084         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10086 2004-08-01  Martin Baulig  <martin@ximian.com>
10088         * class.cs (TypeContainer.GetClassBases): Don't set the default
10089         here since we may get called from GetPartialBases().
10090         (TypeContainer.DefineType): If GetClassBases() didn't return a
10091         parent, use the default one.
10093 2004-07-30  Martin Baulig  <martin@ximian.com>
10095         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10097         * class.cs (SourceMethod): New public class, derive from the
10098         symbol writer's ISourceMethod.
10099         (Method): Use the new symbol writer API.
10101         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10102         as argument and use the new symbol writer.
10104         * location.cs
10105         (SourceFile): Implement the symbol writer's ISourceFile.
10106         (Location.SymbolDocument): Removed.
10107         (Location.SourceFile): New public property.
10109         * symbolwriter.cs: Use the new symbol writer API.
10111 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10113         * Makefile (install-local): Remove.  Functionality moved to
10114         executable.make.
10116 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10118         * Makefile: Install mcs.exe.config file together with mcs.exe.
10119         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10120         correct runtime version.
10121         
10122 2004-07-25  Martin Baulig  <martin@ximian.com>
10124         * class.cs
10125         (TypeContainer.RegisterOrder): Removed, this was unused.
10126         (TypeContainer, interface_order): Removed.
10127         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10128         TypeContainer as argument since we can also be called with a
10129         `PartialContainer' for a partial class/struct/interface.
10130         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10131         of checking whether we're an `Interface' - we could be a
10132         `PartialContainer'.
10133         (PartialContainer.Register): Override; call
10134         AddClass()/AddStruct()/AddInterface() on our parent.
10136         * cs-parser.jay (interface_member_declaration): Add things to the
10137         `current_container', not the `current_class'.
10139         * rootcontext.cs (RegisterOrder): The overloaded version which
10140         takes an `Interface' was unused, removed.
10142         * typemanager.cs (TypeManager.LookupInterface): Return a
10143         `TypeContainer', not an `Interface'.
10144         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10145         contain a `PartialContainer' for an interface, so check it's
10146         `Kind' to figure out what it is.
10148 2004-07-25  Martin Baulig  <martin@ximian.com>
10150         * class.cs (Class.DefaultTypeAttributes): New public constant.
10151         (Struct.DefaultTypeAttributes): Likewise.
10152         (Interface.DefaultTypeAttributes): Likewise.
10153         (PartialContainer.TypeAttr): Override this and add the
10154         DefaultTypeAttributes.
10156 2004-07-25  Martin Baulig  <martin@ximian.com>
10158         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10159         we can just use the `Parent' field instead.
10161 2004-07-25  Martin Baulig  <martin@ximian.com>
10163         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10165 2004-07-25  Martin Baulig  <martin@ximian.com>
10167         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10168         our parts before defining any methods.
10169         (TypeContainer.VerifyImplements): Make this virtual.
10170         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10171         on our PartialContainer.
10173 2004-07-25  Martin Baulig  <martin@ximian.com>
10175         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10177         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10178         argument, we can just use the `Parent' field instead.
10180         * class.cs
10181         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10182         (MemberBase.DoDefine): Likewise.
10184 2004-07-24  Martin Baulig  <martin@ximian.com>
10186         * decl.cs (MemberCore.Parent): New public field.
10187         (DeclSpace.Parent): Moved to MemberCore.
10189         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10190         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10191         parent's .ctor.
10192         (FieldBase, Field, Operator): Likewise.
10193         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10194         (EventField, Event): Likewise.
10196 2004-07-23  Martin Baulig  <martin@ximian.com>
10198         * class.cs (PartialContainer): New public class.
10199         (ClassPart): New public class.
10200         (TypeContainer): Added support for partial classes.
10201         (TypeContainer.GetClassBases): Splitted some of the functionality
10202         out into GetNormalBases() and GetPartialBases().
10204         * cs-tokenizer.cs (Token.PARTIAL): New token.
10205         (Tokenizer.consume_identifier): Added some hacks to recognize
10206         `partial', but only if it's immediately followed by `class',
10207         `struct' or `interface'.
10209         * cs-parser.jay: Added support for partial clases.
10211 2004-07-23  Martin Baulig  <martin@ximian.com>
10213         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10214         a `DeclSpace' and also made it readonly.
10215         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10216         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10217         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10219         * cs-parser.jay: Pass the `current_class', not the
10220         `current_container' (at the moment, this is still the same thing)
10221         to a new Method, Property, Event, Indexer or Constructor.
10223 2004-07-23  Martin Baulig  <martin@ximian.com>
10225         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10226         and removed the `current_interface' one.
10227         (struct_declaration, class_declaration, interface_declaration):
10228         Set `current_class' to the newly created class/struct/interface;
10229         set their `Bases' and call Register() before parsing their body.
10231 2004-07-23  Martin Baulig  <martin@ximian.com>
10233         * class.cs (Kind): New public enum.
10234         (TypeContainer): Made this class abstract.
10235         (TypeContainer.Kind): New public readonly field.
10236         (TypeContainer.CheckDef): New public method; moved here from
10237         cs-parser.jay.
10238         (TypeContainer.Register): New public abstract method.
10239         (TypeContainer.GetPendingImplementations): New public abstract
10240         method.
10241         (TypeContainer.GetClassBases): Removed the `is_class' and
10242         `is_iface' parameters.
10243         (TypeContainer.DefineNestedTypes): Formerly known as
10244         DoDefineType().
10245         (ClassOrStruct): Made this class abstract.
10247         * tree.cs (RootTypes): New public type. 
10249 2004-07-20  Martin Baulig  <martin@ximian.com>
10251         * tree.cs (Tree.RecordNamespace): Removed.
10252         (Tree.Namespaces): Removed.
10254         * rootcontext.cs (RootContext.IsNamespace): Removed.
10256         * cs-parser.jay (namespace_declaration): Just create a new
10257         NamespaceEntry here.
10259 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
10261         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10262         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10263         entry to make sure it runs in the correct runtime version.
10264         
10265 2004-07-18  Martin Baulig  <martin@ximian.com>
10267         * generic.cs (ConstructedType.CheckConstraints): Improved
10268         constraints checking.
10270 2004-07-18  Martin Baulig  <martin@ximian.com>
10272         * expression.cs (Invocation.BetterMethod): Call
10273         TypeManager.TypeToCoreType() on all types and removed my previous
10274         hack; we're already doig the right thing here.
10276 2004-07-17  Martin Baulig  <martin@ximian.com>
10278         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10280 2004-07-16  Martin Baulig  <martin@ximian.com>
10282         * iterators.cs: Added generics support.
10284 2004-07-16  Martin Baulig  <martin@ximian.com>
10286         * iterators.cs: Rewrote this.  We're now using one single Proxy
10287         class for both the IEnumerable and the IEnumerator interface and
10288         `Iterator' derives from Class so we can use the high-level API.
10290         * class.cs (TypeContainer.AddIterator): New method.
10291         (TypeContainer.DoDefineType): New protected virtual method, which
10292         is called from DefineType().
10293         (TypeContainer.DoDefineMembers): Call DefineType() and
10294         DefineMembers() on all our iterators.
10295         (TypeContainer.Emit): Call Emit() on all our iterators.
10296         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10298         * codegen.cs (EmitContext.CurrentIterator): New public field.
10300 2004-07-15  Martin Baulig  <martin@ximian.com>
10302         * typemanager.cs
10303         (TypeManager.not_supported_exception_type): New type.   
10305 2004-07-14  Martin Baulig  <martin@ximian.com>
10307         * typemanager.cs
10308         (TypeManager.generic_ienumerable_type): New type.
10309         (TypeManager.generic_ienumerator_type): New type.
10311         * rootcontext.cs
10312         (RootContext.interfaces_first_stage): Added
10313         "System.Collections.Generic.IEnumerator`1" and
10314         "System.Collections.Generic.IEnumerable`1".     
10316 2004-07-14  Martin Baulig  <martin@ximian.com>
10318         * iterators.cs: Use real error numbers.
10320 2004-07-14  Martin Baulig  <martin@ximian.com>
10322         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10323         requires this to be a System.Collection.IEnumerable and not a
10324         class implementing that interface.
10325         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10327 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10329         * class.cs: Fixed previous fix, it broke some error tests.
10331 2004-07-12  Martin Baulig  <martin@ximian.com>
10333         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10334         Fixes #61293.
10336 2004-07-14  Martin Baulig  <martin@ximian.com>
10338         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10339         an exclamation mark (!) for the generic arity to reflect the
10340         latest spec changes; ie. use "System.Collections.Generic.IList`1".
10342 2004-07-13  Martin Baulig  <martin@ximian.com>
10344         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10345         specifiers being part of a type argument.
10347 2004-07-13  Martin Baulig  <martin@ximian.com>
10349         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10350         name for generic types.
10352 2004-07-13  Martin Baulig  <martin@ximian.com>
10354         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10355         bit to fix #60119.
10357 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10359         * assign.cs (LocalTemporary): Add new argument: is_address,If
10360         `is_address' is true, then the value that we store is the address
10361         to the real value, and not the value itself.
10362         
10363         * ecore.cs (PropertyExpr): use the new local temporary
10364         stuff to allow us to handle X.Y += z (where X is a struct)
10366 2004-07-08  Martin Baulig  <martin@ximian.com>
10368         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10369         not always return, just like we're doing in Using.Resolve().
10371 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10373         * cs-parser.jay (fixed_statement): flag this as Pinned.
10375 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10377         * typemanager.cs (TypeManager): Removed MakePinned method, this
10378         mechanism is replaced with the .NET 2.x compatible mechanism of
10379         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10381         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10382         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10383         `IsFixed' property which has a different meaning.
10385 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10387         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10388         visible from inside a nested class, not just the names of the
10389         immediately enclosing class.
10390         Fix for bug #60730.
10392 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10394         * expression.cs (BetterConversion): Remove buggy special-case
10395         handling of "implicit constant expression conversions".  At this
10396         point, we already know that the conversion is possible -- we're
10397         only checking to see which is better.
10399 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10401         * cs-parser.jay: Added error CS0210 test.
10403 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10405         * cs-parser.jay: Added error CS0134 test.
10407 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10409         Fix bug #52507
10410         * cs-parser.jay: Added error CS0145 test.
10412 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10414         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10416 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10417         
10418         * expression.cs (StackAlloc.Resolve): The argument may not
10419         be a constant; deal with this case.
10420         
10421 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10423         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10424         GetIndexerAttributeValue.
10425         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10427         * class.cs (Indexer.Define): Added error tests for CS0415,
10428         CS0609.
10430 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10432         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10433         property code.
10435 2004-06-23  Martin Baulig  <martin@ximian.com>
10437         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10438         neither return nor throw, reset the barrier as well.  Fixes #60457.
10440 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10442         * class.cs : EventAttributes is now set to None by default.
10443           This fixes bug #60459.
10445 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10447         Fix bug #60219
10448         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10449         Don't throw exception but return null (it's sufficient now).
10451 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10453         * typemanager.cs (GetArgumentTypes): Faster implementation.
10455 2004-06-18  Martin Baulig  <martin@ximian.com>
10457         * attribute.cs (Attribute.Resolve): Check whether we're an
10458         EmptyCast which a Constant child.  Fixes #60333.
10460 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10462         * statement.cs (EmitCollectionForeach): Account for the fact that
10463         not all valuetypes are in areas which we can take the address of.
10464         For these variables, we store to a temporary variable. Also, make
10465         sure that we dont emit a `callvirt' on a valuetype method.
10467 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10469         * expression.cs (StackAlloc.DoReSolve): Added test for
10470         negative parameter (CS0247).
10472 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10474         Fix bug #59792
10475         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10477 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10479         Fix bug #59781
10480         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10481         ulong.
10483 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10485         Fix bug #58254 & cs1555.cs, cs1556.cs
10486         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10488 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10490         * cs-parser.jay: Added error CS1669 test for indexers.
10492 2004-06-18  Martin Baulig  <martin@ximian.com>
10494         * generics.cs (GenericMethod.ctor): Don't take an Attributes
10495         argument.  Fixes #60441.
10497 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
10498         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10499         The name needs to have the actual name of the method in order
10500         for other tests (such as the one in OverloadResolve for Invoke
10501         on a delegate) to work. As well, it does not really help
10502         error reporting because the method group had multiple methods.
10503         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10504         Make profiling work.
10505         
10506 2004-06-13  Martin Baulig  <martin@ximian.com>
10508         * cs-parser.jay: Don't allow generic attributes.
10510 2004-06-13  Martin Baulig  <martin@ximian.com>
10512         * class.cs (MemberBase.DoDefineBase): New protected method.
10513         (MemberBase.DoDefine): Compute the `flags' in the new
10514         DoDefineBase() which must be called first.
10515         (Method.Define): Call DoDefineBase() first so we have the flags
10516         when defining the generic method.
10518         * cs-parser.jay (interface_method_declaration): Support generic methods.
10520 2004-06-13  Martin Baulig  <martin@ximian.com>
10522         * decl.cs (TypeName): Removed.
10523         (MemberName): Removed TypeName and MemberNow; now we just have
10524         MemberName.
10526         * cs-parser.jay: Don't distinguish between type arguments and type
10527         parameters in the grammar and simplified the rules a bit.  The
10528         reduce/reduce conflicts are now gone (except the one we inherited
10529         from mcs).
10531 2004-06-11  Martin Baulig  <martin@ximian.com>
10533         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10534         call this twice: for params and varargs methods.
10536 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10538         * class.cs:
10539         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10541 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10543         * attribute.cs (Attribute.GetValidTargets): Made public.
10545         * class.cs: 
10546         (AbstractPropertyEventMethod): New class for better code sharing.
10547         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10548         CS1667 report.
10549         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10551 2004-06-09  Martin Baulig  <martin@ximian.com>
10553         * cs-parser.jay: Removed a reduce/reduce conflict.
10555 2004-06-03  Martin Baulig  <martin@ximian.com>
10557         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10558         GetSimpleName() and return a SimpleName.
10560         * ecore.cs (SimpleName.Arguments): New public field.
10561         (SimpleName): Added overloaded ctor which takes an additional
10562         TypeArguments argument.
10563         (SimpleName.SimpleNameResolve): Added support for generic methods.
10564         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
10565         formerly in MemberAccess.DoResolve(), but we also need it in
10566         SimpleNameResolve().
10568         * expression.cs (MemberAccess.DoResolve): Use the new
10569         MethodGroupExpr.ResolveGeneric().       
10571 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10573         * decl.cs: If possible, use lookuptypedirect here. We can only do
10574         this if there is no `.' after the namespace. Avoids using
10575         LookupType, which does lots of slow processing.
10576         (FindNestedType) New method, does what it says :-).
10577         * namespace.cs: use LookupTypeDirect.
10578         * rootcontext.cs: use membercache, if possible.
10579         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10581 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10583         * expression.cs:
10584         According to the spec, 
10586         In a member access of the form E.I, if E is a single identifier,
10587         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10588         field, property, localvariable, or parameter with the same type as
10589         the meaning of E as a type-name (§3.8), then both possible
10590         meanings of E are permitted.
10592         We did not check that E as a simple-name had the same type as E as
10593         a type name.
10595         This trivial check gives us 5-7% on bootstrap time.
10597 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10599         * expression.cs (Invocation.OverloadResolve): Avoid the
10600         use of hashtables and boxing here by allocating on demand.
10602 2004-05-30  Martin Baulig  <martin@ximian.com>
10604         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10605         we're doing a silent lookup.  Don't try to lookup nested types in
10606         TypeManager.object_type (thanks to Ben Maurer).
10608 2004-05-30  Martin Baulig  <martin@ximian.com>
10610         Committing a patch from Ben Maurer.
10612         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10614 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10616         * convert.cs: add a trivial cache for overload operator resolution.
10618 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
10620         * attribute.cs
10621         (AttributeTester.GetObsoleteAttribute): Returns instance of
10622         ObsoleteAttribute when type is obsolete.
10624         * class.cs
10625         (TypeContainer.VerifyObsoleteAttribute): Override.
10626         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10627         (MethodCode.VerifyObsoleteAttribute): Override.
10628         (MemberBase.VerifyObsoleteAttribute): Override.
10630         * decl.cs
10631         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10632         and report proper error.
10634         *delegate.cs
10635         (Delegate.VerifyObsoleteAttribute): Override.
10637         * ecore.cs
10638         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10639         and report proper error.
10640         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10642         * enum.cs
10643         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10644         and enum member.
10646         * expression.cs
10647         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10648         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10649         Added test for ObsoleteAttribute.
10651         * statement.cs
10652         (Catch): Derived from Statement.
10654 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10656         * decl.cs: If possible, use lookuptypedirect here. We can only do
10657         this if there is no `.' after the namespace. Avoids using
10658         LookupType, which does lots of slow processing.
10659         (FindNestedType) New method, does what it says :-).
10660         * namespace.cs: use LookupTypeDirect.
10661         * rootcontext.cs: use membercache, if possible.
10662         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10664 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10666         * expression.cs:
10667         According to the spec, 
10669         In a member access of the form E.I, if E is a single identifier,
10670         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10671         field, property, localvariable, or parameter with the same type as
10672         the meaning of E as a type-name (§3.8), then both possible
10673         meanings of E are permitted.
10675         We did not check that E as a simple-name had the same type as E as
10676         a type name.
10678         This trivial check gives us 5-7% on bootstrap time.
10680 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10682         Fixed bug #59071 & cs0160.cs
10683         * statement.cs (Try.Resolve): Check here whether order of catch
10684         clauses matches their dependencies.
10686 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10688         Fixed bug #58624
10689         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10690         unsafe type.
10692 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10694         * expression.cs (Invocation.OverloadResolve): Avoid the
10695         use of hashtables and boxing here by allocating on demand.
10697 2004-05-30  Martin Baulig  <martin@ximian.com>
10699         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10700         we're doing a silent lookup.  Don't try to lookup nested types in
10701         TypeManager.object_type (thanks to Ben Maurer).
10703 2004-05-30  Martin Baulig  <martin@ximian.com>
10705         Committing a patch from Ben Maurer.
10707         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
10709 2004-05-29  Martin Baulig  <martin@ximian.com>
10711         * class.cs (IMethodData.ShouldIgnore): New method.
10713         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10714         `Location' argument, we don't need it anywhere.  Use
10715         `IMethodData.ShouldIgnore ()' instead of
10716         `MethodData.GetMethodFlags ()'.
10717         (TypeManager.AddMethod): Removed.
10718         (TypeManager.AddMethod2): Renamed to AddMethod.
10720 2004-05-29  Martin Baulig  <martin@ximian.com>
10722         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10724         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10725         converting from a class type S to an interface type and we already
10726         have an object on the stack, don't box it again.  Fixes #52578.
10728 2004-05-29  Martin Baulig  <martin@ximian.com>
10730         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10731         Added support for `params' parameters.  Fixes #59267.
10733 2004-05-29  Martin Baulig  <martin@ximian.com>
10735         * literal.cs (NullPointer): Provide a private .ctor which sets
10736         `type' to TypeManager.object_type.  Fixes #59048.
10738 2004-05-29  Martin Baulig  <martin@ximian.com>
10740         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10741         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10743         * ecore.cs (EventExpr.instance_expr): Make the field private.
10745 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10747         Fixed bug #50080 & cs0214-2.cs
10748         * expression.cs (Cast.DoResolve): Check unsafe context here.
10749         
10750         * statement.cs (Resolve.DoResolve): Likewise.
10752 2004-05-26  Martin Baulig  <martin@ximian.com>
10754         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10756         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10757         (RootContext.LookupType): Pass down the `silent' flag.
10759 2004-05-25  Martin Baulig  <martin@ximian.com>
10761         * expression.cs
10762         (MethodGroupExpr.IdenticalTypeName): New public property.
10763         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10764         expression actually refers to a type.
10766 2004-05-25  Martin Baulig  <martin@ximian.com>
10768         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10769         for #56176 and made it actually work.
10771 2004-05-25  Martin Baulig  <martin@ximian.com>
10773         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10774         (FieldExpr, PropertyExpr): Override and implement
10775         CacheTemporaries.  Fixes #52279.
10777 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10779         * location.cs: In the new compiler listing a file twice is a
10780         warning, not an error.
10782 2004-05-24  Martin Baulig  <martin@ximian.com>
10784         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10785         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10787 2004-05-24  Martin Baulig  <martin@ximian.com>
10789         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10790         walking the `using' list.  Fixes #53921.
10792 2004-05-24  Martin Baulig  <martin@ximian.com>
10794         * const.cs (Const.LookupConstantValue): Added support for
10795         EmptyCast's; fixes #55251.
10797 2004-05-24  Martin Baulig  <martin@ximian.com>
10799         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10800         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10801         which does the CS0135 check.  The reason is that we first need to
10802         check whether the variable actually exists.
10804 2004-05-24  Martin Baulig  <martin@ximian.com>
10806         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10807         than RootContext.LookupType() to find the explicit interface
10808         type.  Fixes #58584.
10810 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10812         * Makefile: Simplify.  Use executable.make.
10813         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10815 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10817         * decl.cs:
10818         * enum.cs:
10819         Use the invariant culture when doing String.Compare for CLS case
10820         sensitivity.
10821         
10822 2004-05-23  Martin Baulig  <martin@ximian.com>
10824         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10825         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10827         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10829 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10831         * class.cs (MemberBase.Define): Reuse MemberType member for 
10832         resolved type. Other methods can use it too.
10834 2004-05-23  Martin Baulig  <martin@ximian.com>
10836         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10837         the variable also exists in the current block (otherwise, we need
10838         to report a CS0103).  Fixes #58670.
10840 2004-05-23  Martin Baulig  <martin@ximian.com>
10842         * flowanalysis.cs (Reachability.Reachable): Compute this
10843         on-the-fly rather than storing it as a field.
10845 2004-05-23  Martin Baulig  <martin@ximian.com>
10847         * flowanalysis.cs (Reachability.And): Manually compute the
10848         resulting `barrier' from the reachability.      
10849        
10850 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10852         Fix bug #57835
10853         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10854         instance of ObsoleteAttribute when symbol is obsolete.
10856         * class.cs
10857         (IMethodData): Extended interface for ObsoleteAttribute support.
10859 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10861         * attribute.cs: Fix bug #55970
10863 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10865         Fix bug #52705
10866         * attribute.cs
10867         (GetObsoleteAttribute): New method. Creates the instance of
10868         ObsoleteAttribute.
10869         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10870         ObsoleteAttribute when member is obsolete.
10871         (AttributeTester.Report_ObsoleteMessage): Common method for
10872         Obsolete error/warning reporting.
10874         * class.cs
10875         (TypeContainer.base_classs_type): New member for storing parent type.
10877         * decl.cs
10878         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10879         for this MemberCore.
10881 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10883         * attribute.cs, const.cs: Fix bug #58590
10885 2004-05-21  Martin Baulig  <martin@ximian.com>
10887         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10888         out parameters if the end of the method is unreachable.  Fixes
10889         #58098. 
10891 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10893         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10894         Hari was right, why extra method.
10896 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10898         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10900 2004-05-20  Martin Baulig  <martin@ximian.com>
10902         * delegate.cs: Convert this file to Unix mode - like the original
10903         version in mcs is.
10905 2004-05-20  Martin Baulig  <martin@ximian.com>
10907         * attribute.cs: Convert this file to Unix mode - like the original
10908         version in mcs is.
10910 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10912        Fix bug #58688 (MCS does not report error when the same attribute
10913        is assigned twice)
10915        * attribute.cs (Attribute.Emit): Distinction between null and default.
10917 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10919        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10920        of a top-level attribute without an attribute target.
10921        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10922        Make non-static.
10923        (Attribute.Conditional_GetConditionName), 
10924        (Attribute.Obsolete_GetObsoleteMessage): Update.
10925        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10926        part of ScanForIndexerName.
10927        (Attribute.CanIgnoreInvalidAttribute): New function.
10928        (Attribute.ScanForIndexerName): Move to ...
10929        (Attributes.ScanForIndexerName): ... here.
10930        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10931        (Attributes.Search): New internal variant that can choose not to
10932        complain if types aren't resolved.  The original signature now
10933        complains.
10934        (Attributes.GetClsCompliantAttribute): Use internal variant, with
10935        complaints suppressed.
10936        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10937        only if it not useful.
10938        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10939        top-level for attributes that are shared between the assembly
10940        and a top-level class.
10941        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10942        * class.cs: Update to reflect changes.
10943        (DefineIndexers): Fuse loops.
10944        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10945        a couple more variants of attribute names.
10947 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10949         Fix bug #52585 (Implemented explicit attribute declaration)
10951         * attribute.cs:
10952         (Attributable.ValidAttributeTargets): New abstract method. It gets
10953         list of valid attribute targets for explicit target declaration.
10954         (Attribute.Target): It holds target itself.
10955         (AttributeSection): Removed.
10956         (Attribute.CheckTargets): New method. It checks whether attribute
10957         target is valid for the current element.
10959         * class.cs:
10960         (EventProperty): New class. For events that are declared like
10961         property (with add and remove accessors).
10962         (EventField): New class. For events that are declared like field.
10963         class.cs
10965         * cs-parser.jay: Implemented explicit attribute target declaration.
10967         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10968         Override ValidAttributeTargets.
10970         * parameter.cs:
10971         (ReturnParameter): Class for applying custom attributes on 
10972         the return type.
10973         (ParameterAtribute): New class. Class for applying custom
10974         attributes on the parameter type.
10976 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10978         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10979         definitions. 
10981         (Method): Allow UNSAFE here.
10983         * modifiers.cs: Support unsafe reporting.
10985 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10987         * decl.cs: Fix bug #58478.
10989 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10991         * statement.cs: When checking for unreachable code on an EmptyStatement,
10992         set the location. Fixes bug #58488.
10994 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10996         * driver.cs: Add -pkg handling.
10998         From Gonzalo: UseShelLExecute=false
11000 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11002         * attribute.cs:
11003         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11004         for attribute.
11005         (Attribute.IsClsCompliaceRequired): Moved to base for better
11006         accesibility.
11007         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11008         when attribute is AttributeUsageAttribute.
11009         (Attribute.GetValidTargets): Simplified.
11010         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11011         attribute for this type.
11012         (Attribute.ApplyAttributes): Method renamed to Emit and make
11013         non-static.
11014         (GlobalAttributeSection): New class for special handling of global
11015         attributes (assembly, module).
11016         (AttributeSection.Emit): New method.
11018         * class.cs: Implemented Attributable abstract methods.
11019         (MethodCore.LabelParameters): Moved to Parameter class.
11020         (Accessor): Is back simple class.
11021         (PropertyMethod): Implemented Attributable abstract class.
11022         (DelegateMethod): Implemented Attributable abstract class.
11023         (Event): New constructor for disctintion between normal Event
11024         and Event with accessors.
11026         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11028         * codegen.cs, const.cs, decl.cs, delegate.cs:
11029         (CommonAssemblyModulClass): Implemented Attributable abstract class
11030         and simplified.
11032         * enum.cs: Implement IAttributeSupport interface.
11033         (EnumMember): New class for emum members. Implemented Attributable
11034         abstract class
11036         * parameter.cs:
11037         (ParameterBase): Is abstract.
11038         (ReturnParameter): New class for easier [return:] attribute handling.
11040         * typemanager.cs: Removed builder_to_attr.
11042 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11044         Fix bug #57151.
11045         * attribute.cs (Attribute.GetPositionalValue): New function.
11046         * class.cs (TypeContainer.VerifyMembers): New function.
11047         (TypeContainer.Emit): Use it.
11048         (ClassOrStruct): New base class for Class and Struct.
11049         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11050         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11051         class.
11052         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11053         then each non-static field should have a FieldOffset attribute.
11054         Otherwise, none of the fields should have a FieldOffset attribute.
11055         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11056         and FieldOffset attributes.
11057         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11058         (TypeManager.field_offset_attribute_type): New core types.
11059         (TypeManager.InitCoreTypes): Initialize them.
11061 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11063         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11064         Return correct type.
11065         From bug #58270.
11067 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11069         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11070         be implicitly converted to ulong.
11071         
11072         * expression.cs: The logic for allowing operator &, | and ^ worked
11073         was wrong, it worked before because we did not report an error in
11074         an else branch.  Fixes 57895.
11076         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11077         allow volatile fields to be reference types.
11079 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11081         * driver.cs: Add support for /debug-
11083 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11085         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11086         Add a 'complain' parameter to silence errors.
11087         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11088         silently overlooked type-resolutions.
11089         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11090         to reflect changes.
11091         (Attributes.Search): New function.
11092         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11093         (Attributes.GetAttributeFullName): Remove hack.
11094         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11095         Update to reflect changes.
11096         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11097         Use Attributes.Search instead of nested loops.
11099 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11101         * decl.cs:
11102         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11103         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11104         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11106         * report.cs: (Report.Warning): Renamed to Warning_T because of
11107         parameter collision.
11109 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11111         * expression.cs (MemberAccess.ResolveMemberAccess):
11112         Exit with non-zero status after Report.Error.
11113         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11114         Likewise.
11115         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11117 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11119         * support.cs: Don't hang when the file is empty.
11121 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11123         * support.cs: In SeekableStreamReader, compute the preamble size of the
11124           underlying stream. Position changes should take into account that initial
11125           count of bytes.
11127 2004-05-03  Todd Berman  <tberman@sevenl.net>
11129         * driver.cs: remove unused GetSysVersion function.
11131 2004-05-03  Todd Berman  <tberman@sevenl.net>
11133         * driver.cs: Remove the hack from saturday, as well as the hack
11134         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11135         link_paths to get that bit proper.
11137 2004-05-01  Todd Berman  <tberman@sevenl.net>
11139         * driver.cs: Try a LoadFrom before a Load, this checks the current
11140         path. This is currently a bug in mono that is be fixed, however, this
11141         provides a workaround for now. This will be removed when the bug
11142         is fixed.
11144 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11146         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11147         incomplete key pairs (#57941).
11149 2004-05-01  Todd Berman  <tberman@sevenl.net>
11151         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11152         from the GAC
11154 2004-04-30  Jackson Harper  <jackson@ximian.com>
11156         * codegen.cs: Open keys readonly.
11157         
11158 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11160         * typemanager.cs: don't report cyclic struct layout when a struct
11161         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11162         which has 2 Pango.Rectangle fields.
11164 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11166         * expression.cs: Handle IntPtr comparisons with IL code
11167         rather than a method call.
11169 2004-04-29  Martin Baulig  <martin@ximian.com>
11171         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11172         the list of PropertyInfo's in class hierarchy and find the
11173         accessor.  Fixes #56013.
11175 2004-04-29  Martin Baulig  <martin@ximian.com>
11177         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11179 2004-04-29  Martin Baulig  <martin@ximian.com>
11181         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11183         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11185 2004-04-29  Martin Baulig  <martin@ximian.com>
11187         * class.cs (ConstructorInitializer.Resolve): Check whether the
11188         parent .ctor is accessible.  Fixes #52146.
11190 2004-04-29  Martin Baulig  <martin@ximian.com>
11192         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11194         * statement.cs (Using.EmitLocalVariableDecls): Use
11195         TypeManager.idisposable_type, not typeof (IDisposable).
11196         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11198 2004-04-29  Martin Baulig  <martin@ximian.com>
11200         * class.cs (Event.Define): Don't emit the field and don't set
11201         RTSpecialName and SpecialName for events on interfaces.  Fixes
11202         #57703. 
11204 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11206         Refactor Attribute.ApplyAttributes.
11207         * attribute.cs (Attributable): New base class for objects that can
11208         have Attributes applied on them.
11209         (Attribute): Make AttributeUsage fields public.
11210         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11211         (Attribute.IsInternalCall): New property.
11212         (Attribute.UsageAttr): Convert to a public read-only property.
11213         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11214         (Attribute.ResolveType, Attribute.Resolve)
11215         (Attribute.ScanForIndexerName): Update to reflect changes.
11216         (Attribute.CheckAttributeTarget): Re-format.
11217         (Attribute.ApplyAttributes): Refactor, to various
11218         Attributable.ApplyAttributeBuilder methods.
11219         * decl.cs (MemberCore): Make Attributable.
11220         * class.cs (Accessor): Make Attributable.
11221         (MethodData.ApplyAttributes): Use proper attribute types, not
11222         attribute names.
11223         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11224         (TypeContainer.ApplyAttributeBuilder)
11225         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11226         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11227         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11228         (Operator.ApplyAttributeBuilder): New factored-out methods.
11229         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11230         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11231         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11232         * parameter.cs (ParameterBase): New Attributable base class
11233         that can also represent Return types.
11234         (Parameter): Update to the changes.
11236 2004-04-29  Jackson Harper  <jackson@ximian.com>
11238         * driver.cs: Prefer the corlib system version when looking for
11239         assemblies in the GAC. This is still a hack, but its a better hack
11240         now.
11241         
11242 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11244         * decl.cs, enum.cs: Improved error 3005 reporting.
11245   
11246         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11247         (related_symbols): New private member for list of symbols
11248         related to reported error/warning.
11249         
11250         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11252 2004-04-29  Martin Baulig  <martin@ximian.com>
11254         * ecore.cs (Expression.Constantify): If we're an enum and
11255         TypeManager.TypeToCoreType() doesn't give us another type, use
11256         t.UnderlyingSystemType.  Fixes #56178.  
11258 2004-04-29  Martin Baulig  <martin@ximian.com>
11260         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11261         interfaces and for each interface, only add members directly
11262         declared in that interface.  Fixes #53255.
11264 2004-04-28  Martin Baulig  <martin@ximian.com>
11266         * expression.cs (ConditionalLogicalOperator): Use a temporary
11267         variable for `left' to avoid that we evaluate it more than once;
11268         bug #52588.
11270 2004-04-28  Martin Baulig  <martin@ximian.com>
11272         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11273         `void[]' (CS1547).
11275 2004-04-28  Martin Baulig  <martin@ximian.com>
11277         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11278         void (CS1547).
11280         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11281         whether the type is not void (CS1547).
11283 2004-04-28  Martin Baulig  <martin@ximian.com>
11285         * expression.cs (Unary.DoResolveLValue): Override this and report
11286         CS0131 for anything but Operator.Indirection.
11288 2004-04-28  Martin Baulig  <martin@ximian.com>
11290         Committing a patch from Ben Maurer; see bug #50820.
11292         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11293         check for classes.
11295         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11296         classes.        
11298 2004-04-28  Martin Baulig  <martin@ximian.com>
11300         Committing a patch from Ben Maurer; see bug #50820.
11302         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11303         check for classes.
11305         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11306         classes.        
11308 2004-04-28  Martin Baulig  <martin@ximian.com>
11310         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11311         (Block.AddLabel): Call DoLookupLabel() to only search in the
11312         current block.
11314 2004-04-28  Martin Baulig  <martin@ximian.com>
11316         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11317         comparing StringConstants and NullLiterals in Equality and Inequality.
11319 2004-04-28  Jackson Harper  <jackson@ximian.com>
11321         * driver.cs: Attempt to load referenced assemblies from the
11322         GAC. This is the quick and dirty version of this method that
11323         doesnt take into account versions and just takes the first
11324         canidate found. Will be good enough for now as we will not have more
11325         then one version installed into the GAC until I update this method.
11327 2004-04-28  Martin Baulig  <martin@ximian.com>
11329         * typemanager.cs (TypeManager.CheckStructCycles): New public
11330         static method to check for cycles in the struct layout.
11332         * rootcontext.cs (RootContext.PopulateTypes): Call
11333         TypeManager.CheckStructCycles() for each TypeContainer.
11334         [Note: We only need to visit each type once.]
11336 2004-04-28  Martin Baulig  <martin@ximian.com>
11338         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11340         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11341         success and added `out object value'.  Use a `bool resolved' field
11342         to check whether we've already been called rather than
11343         `ConstantValue != null' since this breaks for NullLiterals.
11345 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11347         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11348         setting of this flag, since the 'set' method may be non-public.
11350 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11352         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11353         check on current_vector.Block.
11355 2004-04-27  Martin Baulig  <martin@ximian.com>
11357         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11358         a field initializer.  Fixes #56459.
11360 2004-04-27  Martin Baulig  <martin@ximian.com>
11362         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11363         we're not attempting to use an indexer.  Fixes #52154.
11365 2004-04-27  Martin Baulig  <martin@ximian.com>
11367         * statement.cs (Return): Don't create a return label if we don't
11368         need it; reverts my change from January 20th.  Thanks to Ben
11369         Maurer for this.
11371 2004-04-27  Martin Baulig  <martin@ximian.com>
11373         According to the spec, `goto' can only leave a nested scope, but
11374         never enter it.
11376         * statement.cs (Block.LookupLabel): Only lookup in the current
11377         block, don't recurse into parent or child blocks.
11378         (Block.AddLabel): Check in parent and child blocks, report
11379         CS0140/CS0158 if we find a duplicate.
11380         (Block): Removed this indexer for label lookups.
11381         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11382         this already does the error reporting for us.
11384         * flowanalysis.cs
11385         (FlowBranching.UsageVector.Block): New public variable; may be null.
11386         (FlowBranching.CreateSibling): Added `Block' argument.
11387         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11388         label for the target of a `goto' and check whether we're not
11389         leaving a `finally'.
11391 2004-04-27  Martin Baulig  <martin@ximian.com>
11393         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11394         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11395         just for returns).
11397 2004-04-27  Martin Baulig  <martin@ximian.com>
11399         * statement.cs (Block.AddLabel): Also check for implicit blocks
11400         and added a CS0158 check.
11402 2004-04-27  Martin Baulig  <martin@ximian.com>
11404         * flowanalysis.cs (FlowBranchingLoop): New class.
11405         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11406         UsageVector's instead of an ArrayList.
11407         (FlowBranching.Label): Likewise.
11408         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11409         (FlowBranching.AddBreakVector): New method.
11411 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11413         * attribute.cs: Small regression fix: only convert the type if we
11414         the type is different, fixes System.Drawing build.
11416 2004-04-27  Martin Baulig  <martin@ximian.com>
11418         * attribute.cs (Attribute.Resolve): If we have a constant value
11419         for a named field or property, implicity convert it to the correct
11420         type.
11422 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11424         * statement.cs (Block.Block): Implicit blocks share
11425         'child_variable_names' fields with parent blocks.
11426         (Block.AddChildVariableNames): Remove.
11427         (Block.AddVariable): Mark variable as "used by a child block" in
11428         every surrounding block.
11429         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11430         been used in a child block, complain about violation of "Invariant
11431         meaning in blocks" rule.
11432         * cs-parser.jay (declare_local_variables): Don't use
11433         AddChildVariableNames.
11434         (foreach_statement): Don't create an implicit block: 'foreach'
11435         introduces a scope.
11437 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11439         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11440         converting from 0L to ulong.  Fixes 57522.
11442 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11444         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11445         derived class hides via 'new' keyword field from base class (test-242.cs).
11446         TODO: Handle this in the more general way.
11447         
11448         * class.cs (CheckBase): Ditto.
11450 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11452         * decl.cs (caching_flags): New member for storing cached values
11453         as bit flags.
11454         (MemberCore.Flags): New enum where bit flags for caching_flags
11455         are defined.
11456         (MemberCore.cls_compliance): Moved to caching_flags.
11457         (DeclSpace.Created): Moved to caching_flags.
11459         * class.cs: Use caching_flags instead of DeclSpace.Created
11460         
11461 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11463         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11464         if we are only a derived class, not a nested class.
11466         * typemanager.cs: Same as above, but do this at the MemberLookup
11467         level (used by field and methods, properties are handled in
11468         PropertyExpr).   Allow for the qualified access if we are a nested
11469         method. 
11471 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11473         * class.cs: Refactoring.
11474         (IMethodData): New inteface; Holds links to parent members
11475         to avoid member duplication (reduced memory allocation).
11476         (Method): Implemented IMethodData interface.
11477         (PropertyBase): New inner classes for get/set methods.
11478         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11479         (Event): New inner classes for add/remove methods.
11480         (Event.DelegateMethod): Implemented IMethodData interface.
11482         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11483         EmitContext (related to class.cs refactoring).
11485 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11487         * delegate.cs (Delegate.VerifyApplicability): If the number of
11488         arguments are the same as the number of parameters, first try to
11489         verify applicability ignoring  any 'params' modifier on the last
11490         parameter.
11491         Fixes #56442.
11493 2004-04-08  Martin Baulig  <martin@ximian.com>
11495         Merged latest changes into gmcs.  Please keep this comment in
11496         here, it makes it easier for me to see what changed in MCS since
11497         the last time I merged.
11499 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11501         * class.cs (TypeContainer.AddIndexer): Use
11502         'ExplicitInterfaceName' to determine if interface name was
11503         explicitly specified.  'InterfaceType' is not initialized at this time.
11504         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11505         Indexers array is already in the required order.  Initialize
11506         'IndexerName' only if there are normal indexers.
11507         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11508         (TypeContainer.Emit): Emit DefaultMember attribute only if
11509         IndexerName is initialized.
11510         Fixes #56300.
11512 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11514         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11515         Fixes #57007
11517 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11519         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11520         attributes.
11521         Fix for #56456.
11523         * attribute.cs (Attribute.Resolve): Check for duplicate named
11524         attributes.
11525         Fix for #56463.
11527 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11529         * iterators.cs (MarkYield): track whether we are in an exception,
11530         and generate code accordingly.  Use a temporary value to store the
11531         result for our state.
11533         I had ignored a bit the interaction of try/catch with iterators
11534         since their behavior was not entirely obvious, but now it is
11535         possible to verify that our behavior is the same as MS .NET 2.0
11537         Fixes 54814
11539 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11541         * iterators.cs: Avoid creating temporaries if there is no work to
11542         do. 
11544         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11545         Enumerations, use TypeManager.EnumToUnderlying and call
11546         recursively. 
11548         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11549         bug #57013
11551         (This.Emit): Use EmitContext.EmitThis to emit our
11552         instance variable.
11554         (This.EmitAssign): Ditto.
11556         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11557         codepaths, we will move all the functionality into
11558         Mono.CSharp.This 
11560         (FieldExpr.EmitAssign): Ditto.
11562         This fixes several hidden bugs that I uncovered while doing a code
11563         review of this today.
11565         * codegen.cs (EmitThis): reworked so the semantics are more clear
11566         and also support value types "this" instances.
11568         * iterators.cs: Changed so that for iterators in value types, we
11569         do not pass the value type as a parameter.  
11571         Initialization of the enumerator helpers is now done in the caller
11572         instead of passing the parameters to the constructors and having
11573         the constructor set the fields.
11575         The fields have now `assembly' visibility instead of private.
11577 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11579         * expression.cs (Argument.Resolve): Check if fields passed as ref
11580         or out are contained in a MarshalByRefObject.
11582         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11583         another compiler type.
11585 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11587         * class.cs (Indexer.Define): use the new name checking method.
11588         Also, return false on an error.
11589         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11590         (is_identifier_[start/part]_character): make static.
11592 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11594         * expression.cs (Binary.ResolveOperator): Do no append strings
11595         twice: since we can be invoked more than once (array evaluation)
11596         on the same concatenation, take care of this here.  Based on a fix
11597         from Ben (bug #56454)
11599 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11601         * codegen.cs: Fix another case where CS1548 must be reported (when 
11602         delay-sign isn't specified and no private is available #56564). Fix
11603         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11604         error when MCS is used on the MS runtime and we need to delay-sign 
11605         (which seems unsupported by AssemblyBuilder - see #56621).
11607 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11609         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11610         (TypeManager.ComputeNamespaces): Faster implementation for
11611         Microsoft runtime.
11613         * compiler.csproj: Updated AssemblyName to mcs.
11615 2004-05-11  Jackson Harper  <jackson@ximian.com>
11617         * Makefile: Preserve MONO_PATH
11618         
11619 2004-05-11  Jackson Harper  <jackson@ximian.com>
11621         * Makefile: Use mono and mcs to build gmcs
11622         
11623 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
11625         * codegen.cs: Add patch from Robert Shade
11626         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11627         sync with mcs.
11629 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
11631         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11632         incomplete key pairs (#57941).
11634 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11636         * codegen.cs: Fix another case where CS1548 must be reported (when 
11637         delay-sign isn't specified and no private is available #56564). Fix
11638         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11639         error when MCS is used on the MS runtime and we need to delay-sign 
11640         (which seems unsupported by AssemblyBuilder - see #56621).
11642 2004-04-29  Jackson Harper  <jackson@ximian.com>
11644         * Makefile: Set MONO_PATH to use the bootstrap corlib
11645         * driver.cs: Check the GAC for referenced assemblies.
11646                 
11647 2004-04-29  Martin Baulig  <martin@ximian.com>
11649         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11651 2004-04-07  Martin Baulig  <martin@ximian.com>
11653         * expression.cs (Binary.ResolveOperator): Added special case for
11654         Equality/Inequality between a type parameter and a null literal.
11656 2004-04-07  Martin Baulig  <martin@ximian.com>
11658         * convert.cs: Check null literal -> type parameter conversions.
11660 2004-04-07  Martin Baulig  <martin@ximian.com>
11662         * generic.cs (ConstructedType.CheckConstraints): Enforce the
11663         `class' and `struct' constraints.
11665 2004-04-07  Martin Baulig  <martin@ximian.com>
11667         * generic.cs (SpecialConstraint): New public enum.
11668         (Constraints.Resolve): Added support for the `class' and `struct'
11669         constraints.
11671         * cs-parser.jay (type_parameter_constraint): Added support for the
11672         `class' and `struct' constraints.
11674 2004-04-07  Martin Baulig  <martin@ximian.com>
11676         * support.cs (GenericConstraints): Replaced `Types' by
11677         `ClassConstraint' and `InterfaceConstraints'; added
11678         `HasClassConstraint'.   
11680 2004-04-07  Martin Baulig  <martin@ximian.com>
11682         * generic.cs
11683         (Constraints.InterfaceConstraints): New public property.
11684         (Constraints.Types): Make this property public
11685         (TypeParameter): Implement IMemberContainer.
11686         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11687         instead of a TypeBuilder/MethodBuilder; pass the interface
11688         constraints to TypeManager.AddTypeParameter().
11689         (TypeParameter.DefineType): Just take an EmitContext and no
11690         TypeBuilder/MethodBuilder.  Use the new public API.
11692         * typemanager.cs (TypeManager.AddTypeParameter): Added
11693         `TypeExpr[]' argument; add the interfaces to the
11694         `builder_to_ifaces' hash.
11695         (TypeManager.LookupMemberContainer): For
11696         GenericTypeParameterBuilders, get the TypeParameter from the
11697         `builder_to_type_param'.
11698         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11699         the TypeParameter and call FindMembers on it.
11701 2004-04-07  Martin Baulig  <martin@ximian.com>
11703         * class.cs
11704         (MethodCore.GenericMethod): Moved this field here from Method.
11705         (MethodCore.IsDuplicateImplementation): Take the number of type
11706         parameters into account if we're a generic method.
11708         * expression.cs (Invocation.InferTypeArguments): Don't return true
11709         if `arguments' is null; we still need to check whether we actually
11710         don't need to infer anything in this case.
11711         (MemberAccess): Merged the functionality from GenericMemberAccess
11712         into this class.
11714         * generic.cs (GenericMemberAccess): Removed.
11716 2004-04-05  Martin Baulig  <martin@ximian.com>
11718         * decl.cs (MemberCore): For generic classes, interfaces and
11719         structs, `Name' now includes the number of type parameters
11720         ("Stack!1.Node!1").
11721         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11722         encode the number of type arguments in the type name.
11724         * expression.cs (Expression.MemberLookup): Removed the
11725         `num_type_args' argument; we now encode the number of type
11726         arguments in the type name.
11728         * ecore.cs (SimpleName): Encode the number of type arguments in
11729         the type name itself.
11731         * generic.cs (ConstructedType): Likewise.
11733         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11734         `MemberName'; we now include the number of type parameters in the
11735         type name.
11737         * typemanager.cs (TypeManager.CheckGeneric): Removed.
11738         (TypeManager.MemberLookup): Removed the
11739         `num_type_args' argument; we now encode the number of type
11740         arguments in the type name.     
11742 2004-04-03  Martin Baulig  <martin@ximian.com>
11744         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11745         (MemberCore.MemberName): Moved here from MemberBase.
11746         (DeclSpace.SetParameterInfo): Just take the constraints as an
11747         ArrayList; we already have the type parameters in our
11748         `MemberName'; also do the CS0080 reporting here.
11750         * cs-parser.jay (struct_declaration): Use `member_name' instead of
11751         `IDENTIFIER opt_type_parameter_list'; when constructing our
11752         `MemberName', it'll already include our type parameters.
11753         (class_declaration, interface_declaration): Likewise.
11754         (delegate_declaration): Likewise.
11755         (MakeName): Take a MemberName and return a MemberName.
11756         The following two changes are required to avoid shift/reduce conflicts:
11757         (member_name): Don't include a TypeName anymore; ie. this is now
11758         just 'IDENTIFIER opt_type_parameter_list'.
11759         (property_declaration, event_declaration): Use a
11760         `namespace_or_type_name' instead of a `member_name'.            
11762 2004-04-03  Martin Baulig  <martin@ximian.com>
11764         * decl.cs (MemberName): Renamed to `TypeName' and created a new
11765         `MemberName' class.
11766         (TypeName): Formerly known as MemberName.
11768         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11769         instead of a `MemberName'.
11771         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11772         (member_name): New rule; create a MemberName.
11774 2004-04-02  Martin Baulig  <martin@ximian.com>
11776         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11777         (CS0305 and CS0308).
11779 2004-04-02  Martin Baulig  <martin@ximian.com>
11781         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11782         support for nested types.
11784 2004-04-02  Martin Baulig  <martin@ximian.com>
11786         * ecore.cs (IAlias): New public interface.
11787         (TypeExpr, TypeExpression): Implement IAlias.
11788         (TypeAliasExpression): New public class.
11790         * namespace.cs (Namespace): Implement IAlias.
11791         (Namespace.Lookup): Return an IAlias instead on an object.
11792         (Namespace.DefineName): Take an IAlias instead of an object.
11793         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11794         an object.
11795         (NamespaceEntry.UsingAlias): Take a Membername instead of an
11796         Expression.
11797         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11798         object.
11799         (NamespaceEntry.Lookup): Likewise.
11801         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11802         instead of a Type.      
11804         * decl.cs (DeclSpace): Implement IAlias.
11805         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11807         * generic.cs (ConstructedType): Improved error checking.
11809 2004-04-02  Martin Baulig  <martin@ximian.com>
11811         * convert.cs: Added type parameter conversions.
11813         * ecore.cs
11814         (UnboxCast.Emit): Emit an `unbox.any' for type params.
11815         (ClassCast.Emit): If the source type is a type parameter, box it.
11816         If the target type is a type parameter, emit an `unbox.any'
11817         instead of a `classcast'.1      
11819 2004-04-01  Martin Baulig  <martin@ximian.com>
11821         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11823 2004-04-01  Martin Baulig  <martin@ximian.com>
11825         * generic.cs (ConstructedType.CheckConstraints): Use
11826         Convert.ImplicitStandardConversionExists(); user-defined implicit
11827         conversions are not allowed according to the spec.
11829 2004-03-30  Martin Baulig  <martin@ximian.com>
11831         * expression.cs (New): Added support for type parameters.
11833         * typemanager.cs
11834         (TypeManager.activator_type): New public static field.
11835         (TypeManager.activator_create_instance): Likewise.
11837 2004-03-30  Martin Baulig  <martin@ximian.com>
11839         * typemanager.cs (TypeManager.HasConstructorConstraint): New
11840         public method.
11842 2004-03-30  Martin Baulig  <martin@ximian.com>
11844         * generic.cs (ConstructedType.CheckConstraints): Actually follow
11845         the spec here: the argument type must be convertible to the
11846         constraints.
11848 2004-03-30  Martin Baulig  <martin@ximian.com>
11850         * generic.cs
11851         (TypeParameter.Define, TypeParameter.DefineMethod): Call
11852         TypeManager.AddTypeParameter().
11853         (ConstructedType.CheckConstraints): Re-enable this and actually
11854         check whether we have a constructor constraint.
11856         * typemanager.cs
11857         (TypeManager.builder_to_type_param): New static field.
11858         (TypeManager.AddTypeParameter): New static method.
11859         (TypeManager.LookupTypeParameter): New public method.
11861 2004-03-30  Martin Baulig  <martin@ximian.com>
11863         * generic.cs (TypeParameter.DefineType): Return a boolean and use
11864         the new API to actually define the constructor constraint.
11866         * typemanager.cs
11867         (TypeManager.new_constraint_attr_type): New static field.
11868         (TypeManager.InitCoreTypes): Initialize it.
11870 2004-03-30  Martin Baulig  <martin@ximian.com>
11872         * generic.cs (Constraints): Completed error checking, use correct
11873         error numbers.
11875 2004-03-29  Martin Baulig  <martin@ximian.com>
11877         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11879         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11880         public version which takes a `ParameterData pd' instead of an
11881         `ArrayList args'.
11883 2004-03-29  Martin Baulig  <martin@ximian.com>
11885         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11886         not a MethodInfo.       
11888 2004-03-29  Martin Baulig  <martin@ximian.com>
11890         * expression.cs (Argument.ResolveMethodGroup): If we're a
11891         ConstructedType, call GetMemberAccess() on it.  
11893 2004-03-29  Martin Baulig  <martin@ximian.com>
11895         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11896         (MethodCore.CheckGenericOverride): When overriding a generic
11897         method, check whether the constraints match.
11899         * support.cs (GenericConstraints): New public interface.
11900         (ParameterData.GenericConstraints): New public method.
11902         * parameter.cs (Parameter.Resolve): Check whether we're a generic
11903         method parameter and compute our constraints if appropriate.
11904         (Parameter.GenericConstraints): New public property.
11906         * generic.cs (Constraints): Implement GenericConstraints.
11908 2004-03-29  Martin Baulig  <martin@ximian.com>
11910         * decl.cs (MemberCache.FindMemberToOverride): Use
11911         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11913 2004-03-29  Martin Baulig  <martin@ximian.com>
11915         * generic.cs (GenericMethod.Define): Resolve our type parameters.
11917 2004-03-29  Martin Baulig  <martin@ximian.com>
11919         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11920         not allowed on non-generic declarations").
11922 2004-03-29  Martin Baulig  <martin@ximian.com>
11924         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11925         public version of this method.
11927         * class.cs (MethodCore.IsDuplicateImplementation): Use
11928         Invocation.InferTypeArguments() to check this.
11930 2004-03-29  Martin Baulig  <martin@ximian.com>
11932         * convert.cs: Use TypeManager.IsDelegateType() instead of
11933         comparing types correctly.
11935 2004-03-29  Martin Baulig  <martin@ximian.com>
11937         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11938         types directly to make it work for generic instances.
11940         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11942 2004-03-29  Martin Baulig  <martin@ximian.com>
11944         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11945         support for arrays.     
11947 2004-03-24  Martin Baulig  <martin@ximian.com>
11949         * decl.cs (DeclSpace.FindType): Also use
11950         TypeManager.CheckGeneric() for types from the using clauses.
11952 2004-03-23  Martin Baulig  <martin@ximian.com>
11954         * expression.cs (Invocation.OverloadResolve): Added `bool
11955         may_fail' argument and use it instead of the Location.IsNull() hack.
11957 2004-03-23  Martin Baulig  <martin@ximian.com>
11959         * expression.cs (Invocation.InferType): Use correct type inference
11960         rules here.     
11962 2004-03-23  Martin Baulig  <martin@ximian.com>
11964         * ecore.cs (MethodGroupExpr.Name): Use
11965         TypeManager.CSharpSignature() instead of just the name.
11967         * expression.cs (Invocation.OverloadResolve): Provide better error
11968         reporting.
11969         (Invocation.DoResolve): OverloadResolve() never returns null
11970         without reporting an error, so removed the error -6 reporting here.
11972 2004-03-23  Martin Baulig  <martin@ximian.com>
11974         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11975         generic methods.
11977         * cs-parser.jay (delegate_declaration): Support generic delegates.
11979         * delegate.cs: Support generic delegates.
11981 2004-03-22  Martin Baulig  <martin@ximian.com>
11983         * expression.cs (Invocation.InferParamsTypeArguments): New static
11984         method; does type inference for params arguments.
11986 2004-03-21  Martin Baulig  <martin@ximian.com>
11988         * typemanager.cs (TypeManager.IsGenericMethod): New public static
11989         method; checks whether a method is a generic method.    
11991         * expression.cs (Invocation.InferTypeArguments): New static method;
11992         infer type arguments for generic method invocation.
11994         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11995         property; we set this to true if we're resolving a generic method
11996         invocation and the user specified type arguments, ie. we're not
11997         doing type inference.
11999 2004-03-20  Martin Baulig  <martin@ximian.com>
12001         * class.cs (MethodData.DeclaringType): New public property.
12002         (MethodData.Define): Set DeclaringType here.
12003         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
12004         instead of OperatorMethodBuilder.DeclaringType.
12006 2004-03-20  Martin Baulig  <martin@ximian.com>
12008         * cs-tokenizer.cs (xtoken): Return a special
12009         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
12011         * cs-parser.jay (default_value_expression): Switch to the new
12012         syntax (14.5.13).
12014 2004-03-19  Martin Baulig  <martin@ximian.com>
12016         * decl.cs (MemberName): New class.  We use this to "construct"
12017         namespace_or_type_name's.
12019         * generics.cs (TypeArguments.GetDeclarations): New public method;
12020         returns the type arguments as a string[] and reports a CS0081 if
12021         one of them is not an identifier.
12023         * class.cs (MemberBase): The .ctor now takes the name as a
12024         MemberName instead of a string.
12025         (MemberBase.ExplicitInterfaceName): Changed type from string to
12026         Expression.
12027         (MemberBase.DoDefine): If we're an explicit implementation, the
12028         InterfaceType may be a generic instance.
12030         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
12031         (namespace_name): Call MemberName.GetName () to transform the
12032         MemberName into a string and ensure we don't have any type
12033         arguments.
12034         (type_name): Call MemberName.GetTypeExpression() to transfrom the
12035         MemberName into an expression.
12036         (method_header): Use namespace_or_type_name instead of member_name.     
12038 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12040         * rootcontext.cs: Add new types to the boot resolution.
12042         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12043         MulticastDelegate is not allowed.
12045         * typemanager.cs: Add new types to lookup: System.TypedReference
12046         and ArgIterator.
12048         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12049         check for TypedReference or ArgIterator, they are not allowed. 
12051         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12052         makes us properly catch 1510 in some conditions (see bug 56016 for
12053         details). 
12055 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12057         * CryptoConvert.cs: update from corlib version
12058         with endian fixes.
12060 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12062         * class.cs (Indexer.Define): Check indexername declaration
12064 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12066         * attribute.cs (IsClsCompliant): Fixed problem with handling
12067         all three states (compliant, not-compliant, undetected).
12069 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12071         * attribute.cs (Attribute): Location is now public.
12072         (Resolve): Store resolved arguments (pos_values) in attribute class.
12073         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12074         (GetClsCompliantAttributeValue): New method that gets
12075         CLSCompliantAttribute value.
12076         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12077         if exists else null.
12078         (AttributeTester): New class for CLS-Compliant verification routines.
12080         * class.cs (Emit): Add CLS-Compliant verification.
12081         (Method.GetSignatureForError): Implemented.
12082         (Constructor.GetSignatureForError): Implemented
12083         (Constructor.HasCompliantArgs): Returns if constructor has
12084         CLS-Compliant arguments.
12085         (Constructor.Emit): Override.
12086         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12087         is needed to test only parameters.
12088         (FieldBase.GetSignatureForError): Implemented.
12089         (TypeContainer): New member for storing base interfaces.
12090         (TypeContainer.FindMembers): Search in base interfaces too.
12092         * codegen.cs (GetClsComplianceAttribute): New method that gets
12093         assembly or module CLSCompliantAttribute value.
12094         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12095         for assembly.
12096         (ModuleClass.Emit): Add error 3012 test.
12098         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12100         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12101         state for all decl types.
12102         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12103         if CLS-Compliant tests are required.
12104         (IsClsCompliaceRequired): New method. Analyze whether code
12105         must be CLS-Compliant.
12106         (IsExposedFromAssembly): New method. Returns true when MemberCore
12107         is exposed from assembly.
12108         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12109         value or gets cached value.
12110         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12111         is explicitly marked with CLSCompliantAttribute.
12112         (IsIdentifierClsCompliant): New abstract method. This method is
12113         used to testing error 3005.
12114         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12115         for identifier and parameters CLS-Compliant testing.
12116         (VerifyClsCompliance): New method. The main virtual method for
12117         CLS-Compliant verifications.
12118         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12119         null. I don't know why is null (too many public members !).
12120         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12121         and get value of first CLSCompliantAttribute that found.
12123         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12124         (VerifyClsCompliance): Override and add extra tests.
12126         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12127         clscheck- disable CLS-Compliant verification event if assembly is has
12128         CLSCompliantAttribute(true).
12130         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12131         ApllyAttribute is now called in emit section as in the other cases.
12132         Possible future Emit integration.
12133         (IsIdentifierClsCompliant): New override.
12134         (VerifyClsCompliance): New override.
12135         (GetEnumeratorName): Returns full enum name.
12137         * parameter.cs (GetSignatureForError): Implemented.
12139         * report.cs (WarningData): New struct for Warning message information.
12140         (LocationOfPreviousError): New method.
12141         (Warning): New method. Reports warning based on the warning table.
12142         (Error_T): New method. Reports error based on the error table.
12144         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12145         verifications are done here.
12147         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12149         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12150         CLSCompliantAttribute.
12151         (all_imported_types): New member holds all imported types from other
12152         assemblies.
12153         (LoadAllImportedTypes): New method fills static table with exported types
12154         from all referenced assemblies.
12155         (Modules): New property returns all assembly modules.
12157 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12159         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12160         throwing a parser error.
12162         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12163         which removes the hardcoded get_/set_ prefixes for properties, as
12164         IL allows for the properties to be named something else.  
12166         Bug #56013
12168         * expression.cs: Do not override operand before we know if it is
12169         non-null.  Fix 56207
12171 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12173         * typemanager.cs: support for pinned variables.
12175 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12177         * decl.cs, typemanager.cs: Avoid using an arraylist
12178         as a buffer if there is only one result set.
12180 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12182         * expression.cs: Make sure you cant call a static method
12183         with an instance expression, bug #56174.
12185 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12187         * class.cs (IsDuplicateImplementation): Improve error reporting to
12188         flag 663 (method only differs in parameter modifier).
12190         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12191         in preprocessor directives.
12193         * location.cs (LookupFile): Allow for the empty path.
12195         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12196         better approach for some of that patch, but its failing with the
12197         CharSet enumeration.  For now try/catch will do.
12199         * typemanager.cs: Do not crash if a struct does not have fields.
12200         Fixes 56150.
12202 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12204         * expression.cs: cs0213, cant fix a fixed expression.
12205         fixes 50231.
12207 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12209         * cs-parser.jay: detect invalid embeded statements gracefully.
12210         bug #51113.
12212 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12214         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12215         As a regex:
12216         s/
12217         the invocation type may not be a subclass of the tye of the item/
12218         The type of the item must be a subclass of the invocation item.
12219         /g
12221         Fixes bug #50820.
12223 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12225         * attribute.cs: Added methods to get a string and a bool from an
12226         attribute. Required to information from AssemblyKeyFileAttribute,
12227         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12228         * codegen.cs: Modified AssemblyName creation to include support for
12229         strongnames. Catch additional exceptions to report them as CS1548.
12230         * compiler.csproj: Updated include CryptoConvert.cs.
12231         * compiler.csproj.user: Removed file - user specific configuration.
12232         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12233         Mono.Security assembly. The original class is maintained and tested in
12234         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12235         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12236         like CSC 8.0 (C# v2) supports.
12237         * Makefile: Added CryptoConvert.cs to mcs sources.
12238         * rootcontext.cs: Added new options for strongnames.
12240 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12242         * driver.cs: For --expect-error, report error code `2'
12243         if the program compiled with no errors, error code `1' if
12244         it compiled with an error other than the one expected.
12246 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12248         * compiler.csproj: Updated for Visual Studio .NET 2003.
12249         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12250         * compiler.sln: Updated for Visual Studio .NET 2003.
12252 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12254         * expression.cs: Fix bug #47234. We basically need to apply the
12255         rule that we prefer the conversion of null to a reference type
12256         when faced with a conversion to 'object' (csc behaviour).
12258 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12260         * statement.cs: Shorter form for foreach, eliminates
12261         a local variable. r=Martin.
12263 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12265         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12266         checks if we can use brtrue/brfalse to test for 0.
12267         * expression.cs: use the above in the test for using brtrue/brfalse.
12268         cleanup code a bit.
12270 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12272         * expression.cs: Rewrite string concat stuff. Benefits:
12274         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12275         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12276         rather than a concat chain.
12278         * typemanager.cs: Add lookups for more concat overloads.
12280 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12282         * expression.cs: Emit shorter il code for array init.
12284         newarr
12285         dup
12286         // set 1
12288         // set 2
12290         newarr
12291         stloc.x
12293         ldloc.x
12294         // set 1
12296         ldloc.x
12297         // set 2
12299 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12301         * statement.cs: Before, two switch blocks would be merged if the
12302         total size of the blocks (end_item - begin_item + 1) was less than
12303         two times the combined sizes of the blocks.
12305         Now, it will only merge if after the merge at least half of the
12306         slots are filled.
12308         fixes 55885.
12310 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12312         * class.cs : csc build fix for GetMethods(). See bug #52503.
12314 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12316         * expression.cs: Make sure fp comparisons work with NaN.
12317         This fixes bug #54303. Mig approved this patch a long
12318         time ago, but we were not able to test b/c the runtime
12319         had a related bug.
12321 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12323         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12325 2004-03-19  Martin Baulig  <martin@ximian.com>
12327         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12328         two overloads may unify for some type parameter substitutions and
12329         report a CS0408 if appropriate.
12331 2004-03-19  Martin Baulig  <martin@ximian.com>
12333         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12334         error here and not in our caller.
12336 2004-03-19  Martin Baulig  <martin@ximian.com>
12338         * interface.cs: Completely killed this file.
12339         (Interface): We're now a TypeContainer and live in class.cs.
12341         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12342         argument; we're now also called for interfaces.
12343         (TypeContainer.DefineMembers): Allow this method being called
12344         multiple times.
12345         (TypeContainer.GetMethods): New public method; formerly known as
12346         Interface.GetMethod().  This is used by PendingImplementation.
12347         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12348         it's now private and non-static.
12349         (Interface): Moved this here; it's now implemented similar to
12350         Class and Struct.
12351         (Method, Property, Event, Indexer): Added `bool is_interface'
12352         argument to their .ctor's.
12353         (MemberBase.IsInterface): New public field.
12355         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12356         instances instead of InterfaceMethod, InterfaceProperty, etc.
12357         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12358         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12360 2004-03-19  Martin Baulig  <martin@ximian.com>
12362         * class.cs (MethodCore.IsDuplicateImplementation): New private
12363         method which does the CS0111 checking.
12364         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12365         Use IsDuplicateImplementation().
12367 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12369         * decl.cs (FindMemberToOverride): New method to find the correct
12370         method or property to override in the base class.
12371         * class.cs
12372             - Make Method/Property use the above method to find the
12373               version in the base class.
12374             - Remove the InheritableMemberSignatureCompare as it is now
12375               dead code.
12377         This patch makes large code bases much faster to compile, as it is
12378         O(n) rather than O(n^2) to do this validation.
12380         Also, it fixes bug 52458 which is that nested classes are not
12381         taken into account when finding the base class member.
12383         Reviewed/Approved by Martin.
12385 2004-03-17  Martin Baulig  <martin@ximian.com>
12387         * expression.cs (MemberAccess.DoResolve): Take the parent's number
12388         of type arguments into account; use the `real_num_type_args'
12389         approach like in DoResolveAsTypeStep().
12391         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12392         nested types.
12394 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12396         * interface.cs: In all interface classes removed redundant
12397         member initialization.
12399 2004-03-16  Martin Baulig  <martin@ximian.com>
12401         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12403 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12405         * decl.cs (DefineTypeAndParents): New helper method to define a
12406         type's containers before the type itself is defined;  This is a
12407         bug exposed by the recent changes to Windows.Forms when an
12408         implemented interface was defined inside a class that had not been
12409         built yet.   
12411         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12413         (Check): Loop correctly to report errors modifiers
12414         (UNSAFE was not in the loop, since it was the same as TOP).
12416         * interface.cs: Every interface member now takes a ModFlags,
12417         instead of a "is_new" bool, which we set on the base MemberCore. 
12419         Every place where we called "UnsafeOk" in the interface, now we
12420         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12421         the unsafe settings from the member declaration instead of the
12422         container interface. 
12424         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12426         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12427         `set_indexer_name' to the pending bits (one per type).
12429         We fixed a bug today that was picking the wrong method to
12430         override, since for properties the existing InterfaceMethod code
12431         basically ignored the method name.  Now we make sure that the
12432         method name is one of the valid indexer names.
12434 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12436         * support.cs (SeekableStreamReader): Keep track of stream byte
12437         positions and don't mix them with character offsets to the buffer.
12439         Patch from Gustavo Giráldez
12441 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12443         * interface.cs (InterfaceSetGetBase): Removed double member
12444         initialization, base class does it as well.
12446 2004-03-13  Martin Baulig  <martin@ximian.com>
12448         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12449         when compiling corlib.
12451 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12453         * convert.cs (ExplicitConversion): We were reporting an error on
12454         certain conversions (object_type source to a value type, when the
12455         expression was `null') before we had a chance to pass it through
12456         the user defined conversions.
12458         * driver.cs: Replace / and \ in resource specifications to dots.
12459         Fixes 50752
12461         * class.cs: Add check for duplicate operators.  Fixes 52477
12463 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12465         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12466         that are in the middle of the statements, not only at the end.
12467         Fixes #54987
12469         * class.cs (TypeContainer.AddField): No longer set the
12470         `HaveStaticConstructor' flag, now we call it
12471         `UserDefineStaticConstructor' to diferentiate the slightly
12472         semantic difference.
12474         The situation is that we were not adding BeforeFieldInit (from
12475         Modifiers.TypeAttr) to classes that could have it.
12476         BeforeFieldInit should be set to classes that have no static
12477         constructor. 
12479         See:
12481         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12483         And most importantly Zoltan's comment:
12485         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12487         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12488          before its static fields are used', i.e. initialization does not need
12489          to be triggered by the first access to the type. Setting this flag
12490          helps the JIT to compile better code, since it can run the static
12491          constructor at JIT time, and does not need to generate code to call it
12492          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12493          this flag for lots of classes like String. 
12494          
12495          csc sets this flag if the type does not have an explicit static 
12496          constructor. The reasoning seems to be that if there are only static
12497          initalizers for a type, and no static constructor, then the programmer
12498          does not care when this initialization happens, so beforefieldinit
12499          can be used.
12500          
12501          This bug prevents the AOT compiler from being usable, since it 
12502          generates so many calls to mono_runtime_class_init that the AOT code
12503          is much slower than the JITted code. The JITted code is faster, 
12504          because it does not generate these calls if the vtable is type is
12505          already initialized, which is true in the majority of cases. But the
12506          AOT compiler can't do this."
12508 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12510         * class.cs (MethodData.Emit): Refactor the code so symbolic
12511         information is generated for destructors;  For some reasons we
12512         were taking a code path that did not generate symbolic information
12513         before. 
12515 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12517         * class.cs: Create a Constructor.CheckBase method that
12518         takes care of all validation type code. The method
12519         contains some code that was moved from Define.
12521         It also includes new code that checks for duplicate ctors.
12522         This fixes bug #55148.
12524 2004-03-09  Joshua Tauberer <tauberer@for.net>
12526         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12527         a { ... }-style array creation invokes EmitStaticInitializers
12528         which is not good for reference-type arrays.  String, decimal
12529         and now null constants (NullCast) are not counted toward
12530         static initializers.
12532 2004-03-05  Martin Baulig  <martin@ximian.com>
12534         * location.cs (SourceFile.HasLineDirective): New public field;
12535         specifies whether the file contains or is referenced by a "#line"
12536         directive.
12537         (Location.DefineSymbolDocuments): Ignore source files which
12538         either contain or are referenced by a "#line" directive.        
12540 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12542         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12543         direct access to our parent, so check the method inline there.
12545 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12547         * expression.cs (Invocation.EmitCall): Miguel's last commit
12548         caused a regression. If you had:
12550             T t = null;
12551             t.Foo ();
12553         In Foo the implict this would be null.
12555 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12557         * expression.cs (Invocation.EmitCall): If the method is not
12558         virtual, do not emit a CallVirt to it, use Call.
12560         * typemanager.cs (GetFullNameSignature): Improve the method to
12561         cope with ".ctor" and replace it with the type name.
12563         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12564         as an argument the ConstructorBuilder where it is being defined,
12565         to catch the recursive constructor invocations.
12567 2004-03-16  Martin Baulig  <martin@ximian.com>
12569         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12570         ConstructedType, call ResolveType() on it to get the type rather
12571         than just using `expr.Type'.
12573 2004-03-16  Martin Baulig  <martin@ximian.com>
12575         * generics.cs (ConstructedType.GetMemberAccess): Take the
12576         EmitContext instead on the TypeExpr and use
12577         ec.TypeContainer.CurrentType/ec.ContainerType.
12579 2004-03-16  Martin Baulig  <martin@ximian.com>
12581         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12582         parameters before aliases.
12584 2004-03-16  Martin Baulig  <martin@ximian.com>
12586         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12587         New oublic function; checks whether two generic instances may become
12588         equal under some instantiations (26.3.1).
12590         * class.cs (TypeContainer.Define): Call
12591         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12592         error.
12594 2004-03-16  Martin Baulig  <martin@ximian.com>
12596         * class.cs (TypeContainer.GetClassBases): Moved
12597         Error_TypeParameterAsBase() here and also check whether the base
12598         class is not an attribute.
12600 2004-03-16  Martin Baulig  <martin@ximian.com>
12602         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12604 2004-03-16  Martin Baulig  <martin@ximian.com>
12606         * class.cs (Error_TypeParameterAsBase): Use correct error number
12607         here (CS0689).  
12609 2004-03-16  Martin Baulig  <martin@ximian.com>
12611         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12612         for generics.
12614         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12615         error reporting.
12617 2004-03-15  Martin Baulig  <martin@ximian.com>
12619         * typemanager.cs (TypeManager.GetFullName): New public method.
12620         (TypeManager.MemberLookup): Added `int_num_type_arguments'
12621         argument; only return members with the correct number of type
12622         arguments.
12623         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12624         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12625         whether the number of type arguments matches.
12627         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12628         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12630         * expression.cs (MemberAccess): Added public `NumTypeArguments'
12631         field; it's set by the protected .ctor when we're actually a
12632         GenericMemberAccess.
12633         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12634         arguments and pass it to MemberLookupFinal ().
12636         * ecore.cs (Expression.MemberLookup): Added `int
12637         num_type_arguments' argument; only return members with the correct
12638         number of type arguments.
12639         (Expression.MemberLookupFailed): Check whether the MemberLookup
12640         failed because we did not have the correct number of type
12641         arguments; report CS0305 in this case.
12643         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12644         `e.ResolveAsTypeTerminal()' already did so.
12646 2004-03-15  Martin Baulig  <martin@ximian.com>
12648         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12649         we're a ConstructedType; in this case, the caller must report an
12650         error (for instance CS0131).
12652         * generic.cs (TypeArguments): Added Location argument to the .ctor.
12653         (TypeArguments.Resolve): Actually report errors here.
12655 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12657         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12658         `set_indexer_name' to the pending bits (one per type).
12660         We fixed a bug today that was picking the wrong method to
12661         override, since for properties the existing InterfaceMethod code
12662         basically ignored the method name.  Now we make sure that the
12663         method name is one of the valid indexer names.
12665 2004-03-15  Martin Baulig  <martin@ximian.com>
12667         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12668         for generic instances.
12670 2004-03-13  Martin Baulig  <martin@ximian.com>
12672         * class.cs (TypeContainer.DefineType): Call
12673         TypeManager.AddUserType() immediately after creating the
12674         TypeBuilder; pass all type parameters when creating the
12675         CurrentType.
12677         * decl.cs (DeclSpace.FindNestedType): New public method.
12678         (DeclSpace.FindType): Added `int num_type_args' argument; only
12679         return types with the correct number of type parameters.
12680         (DeclSpace.CountTypeParams): New public property.
12682         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12683         the number of type parameters; defaults to zero.
12685         * generic.cs (TypeArguments.Count): New public property.
12686         (ConstructedType.DoResolveAsTypeStep): First call
12687         ds.FindNestedType() to find out whether we're nested in the
12688         current generic type; in this case, we inherit all type parameters
12689         from the current class.
12691         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12692         num_type_args' argument.
12693         (RootContext.LookupType): Added overloaded version which takes the
12694         number of type arguments; only return types with the correct
12695         number of type arguments.
12697         * typemanager.cs (TypeManager.CheckGeneric): New public function;
12698         checks whether `Type t' has `int num_type_args'.
12700 2004-03-13  Martin Baulig  <martin@ximian.com>
12702         * generic.cs (GenericMethod.DefineType): New method; calls
12703         DefineType() on all the type parameters.
12705         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12706         (MethodData.Define): If we're a generic method, call
12707         GenericMethod.DefineType() to define the type parameters.       
12709 2004-03-10  Martin Baulig  <martin@ximian.com>
12711         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12712         instead of IsAssignableFrom.    
12714 2004-03-10  Martin Baulig  <martin@ximian.com>
12716         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12718         * support.cs (ParameterData.HasArrayParameter): New property.
12719         (ReflectionParameters.ctor): Take a MethodBase instead of a
12720         ParameterInfo[].  If we have any type parameters, get the generic
12721         method definition and ask it whether we have variable arguments.
12723 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12725         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12726         routines to check if a type is an enumerable/enumerator allow
12727         classes that implement the IEnumerable or IEnumerator interfaces.
12729         * class.cs (Property, Operator): Implement IIteratorContainer, and
12730         implement SetYields.
12732         (Property.Define): Do the block swapping for get_methods in the
12733         context of iterators.   We need to check if Properties also
12734         include indexers or not.
12736         (Operator): Assign the Block before invoking the
12737         OperatorMethod.Define, so we can trigger the Iterator code
12738         replacement. 
12740         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12741         Property and Operator classes are not created when we parse the
12742         declarator but until we have the block completed, so we use a
12743         singleton SimpleIteratorContainer.Simple to flag whether the
12744         SetYields has been invoked.
12746         We propagate this setting then to the Property or the Operator to
12747         allow the `yield' to function.
12749 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12751         * codegen.cs: Implemented attribute support for modules.
12752         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12753         Assembly/Module functionality.
12755         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12756         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12757         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12759 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12761         * interface.cs (FindMembers): The operation is performed on all base
12762         interfaces and not only on the first. It is required for future CLS Compliance patch.
12764 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12766         * statement.cs, codegen.cs:
12767         This patch deals with patterns such as:
12769         public class List : IEnumerable {
12771                 public MyEnumerator GetEnumerator () {
12772                         return new MyEnumerator(this);
12773                 }
12775                 IEnumerator IEnumerable.GetEnumerator () {
12776                         ...
12777                 }
12778                 
12779                 public struct MyEnumerator : IEnumerator {
12780                         ...
12781                 }
12782         }
12784         Before, there were a few things we did wrong:
12785         1) we would emit callvirt on a struct, which is illegal
12786         2) we emited ldarg when we needed to emit ldarga
12787         3) we would mistakenly call the interface methods on an enumerator
12788         type that derived from IEnumerator and was in another assembly. For example:
12790         public class MyEnumerator : IEnumerator
12792         Would have the interface methods called, even if there were public impls of the
12793         method. In a struct, this lead to invalid IL code.
12795 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12797         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12798           renamed to Emit.
12800         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12802 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12804         * cs-parser.jay: Fix small regression: we were not testing V2
12805         compiler features correctly.
12807         * interface.cs: If the emit context is null, then create one
12809 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12811         * decl.cs (GetSignatureForError): New virtual method to get full name
12812           for error messages.
12814         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12815           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12817         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12818           Duplicated members and code in these classes has been removed.
12819           Better encapsulation in these classes.
12821 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12823         * assign.cs (Assign.DoResolve): When dealing with compound
12824         assignments, there is a new rule in ECMA C# 2.4 (might have been
12825         there before, but it is documented here) that states that in:
12827         a op= b;
12829         If b is of type int, and the `op' is a shift-operator, then the
12830         above is evaluated as:
12832         a = (int) a op b 
12834         * expression.cs (Binary.ResolveOperator): Instead of testing for
12835         int/uint/long/ulong, try to implicitly convert to any of those
12836         types and use that in pointer arithmetic.
12838         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12839         method to print information for from the type, not from the
12840         null-method we were given.
12842 2004-02-01  Duncan Mak  <duncan@ximian.com>
12844         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12845         parsing for cmd, fixes bug #53694.
12847 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12849         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12850         in the member name duplication tests. Property and operator name duplication
12851         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12853 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12855         * interface.cs (PopulateMethod): Fixed crash when interface method
12856         returns not existing type (error test cs0246-3.cs).
12858 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12860         * cs-parser.jay (interface_accessors): Re-write actions to also
12861         store attributes attached to get and set methods. Fix spelling
12862         while at it.
12864         (inteface_property_declaration): Modify accordingly.
12866         (InterfaceAccessorInfo): New helper class to store information to pass
12867         around between rules that use interface_accessors.
12869         * interface.cs (Emit): Apply attributes on the get and set
12870         accessors of properties and indexers too.
12872         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12873         right MethodBuilder when applying attributes to the get and set accessors.
12875 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12877         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12879 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12881         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12883 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12885         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12886         changes that treat `yield' specially when present before `break'
12887         or `return' tokens.
12889         * cs-tokenizer.cs: yield is no longer a keyword.
12891 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12893         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12894         setting for default constructors.
12895         For default constructors are almost every time set wrong Modifier. The
12896         generated IL code has been alright. But inside mcs this values was
12897         wrong and this was reason why several of my CLS Compliance tests
12898         failed.
12900 2004-02-27  Martin Baulig  <martin@ximian.com>
12902         * generics.cs (ConstructedType.ResolveType): Make the nested type
12903         stuff actually work.
12905 2004-02-25  Martin Baulig  <martin@ximian.com>
12907         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12908         property; returns the type parameters just from the current type,
12909         ie. with the ones from outer classes.
12910         (DeclSpace.LookupGeneric): First search in the current class, then
12911         in outer classes.
12912         (DeclSpace.initialize_type_params): When hiding a type parameter
12913         from an outer class, put it into the `type_param_list' anyways.
12915         * expression.cs (MemberAccess.expr): Made this field protected.
12917         * class.cs (TypeContainer.Define): The `CurrentType' just contains
12918         the type parameters from the current class.
12920         * generic.cs (ConstructedType.ResolveType): Support nested generic
12921         types by taking the type parameters which we inherit from outer
12922         classes into account.
12923         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12924         support for nested generic types.
12926 2004-02-23  Martin Baulig  <martin@ximian.com>
12928         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12929         field and check whether we're nested inside a generic type.
12930         (DeclSpace.ResolveType): If we're resolving to a generic type
12931         definition, create a ConstructedType and return its resolved type.
12932         (DeclSpace.initialize_type_params): New private method;
12933         initializes the `type_param_list' field from the type parameters
12934         from this and all enclosing classes.
12935         (DeclSpace.TypeParameters): Call initialize_type_params() unless
12936         we're already initialized.
12938 2004-02-23  Martin Baulig  <martin@ximian.com>
12940         * class.cs (Method.Define): Create the generic method before
12941         calling DoDefine().
12942         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12943         the TypeContainer one); we use this for generic methods.
12945         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12946         parent's TypeBuilder.
12948 2004-02-18  Martin Baulig  <martin@ximian.com>
12950         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12951         to check for equality.
12953 2004-02-05  Martin Baulig  <martin@ximian.com>
12955         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12956         `ec.TypeContainer.CurrentType', use it instead of
12957         `ec.ContainerType' to check whether we're in the type's ctor.
12959 2004-01-29  Martin Baulig  <martin@ximian.com>
12961         * expression.cs (Invocation.DoResolve): If we're a
12962         `ConstructedType', then we're actually a generic method, so
12963         rewrite the expr as a GenericMemberAccess.
12965         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12966         here; manually parse it into a string.
12968 2004-01-28  Martin Baulig  <martin@ximian.com>
12970         * typemanager.cs (TypeManager.IsEqual): New static method.
12971         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12972         check for equality instead of using `=='.
12974 2004-01-26  Martin Baulig  <martin@ximian.com>
12976         * decl.cs (DeclSpace.CurrentType): New public field.
12978         * expression.cs (This.ResolveBase): If we have an
12979         `ec.TypeContainer.CurrentType', use it instead of
12980         `ec.ContainerType'.
12982         * class.cs (TypeContainer.DefineType): If we're a generic type,
12983         create the `CurrentType' (unresolved).
12984         (TypeContainer.GenericType): New private field.
12985         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12986         it and store it in `GenericType' before creating the MemberCache.
12987         (TypeContainer.GetMembers): If we have a `GenericType', call
12988         TypeManager.FindMembers() on it.
12990         * interface.cs (Interface.GenericType): New private field.
12991         (Interface.DefineType): If we're a generic type, create the
12992         `CurrentType' (unresolved).
12993         (Interface.DefineMembers): If we have a `CurrentType', resolve it
12994         and store it in `GenericType' before creating the MemberCache.
12995         (Interface.GetMembers): If we have a `GenericType', call
12996         TypeManager.FindMembers() on it.
12998 2004-01-22  Martin Baulig  <martin@ximian.com>
13000         * cs-parser.jay (namespace_or_type_name): Return an Expression,
13001         not a QualifiedIdentifier.  This is what `type_name_expression'
13002         was previously doing.
13003         (type_name_expression): Removed; the code is now in
13004         `namespace_or_type_name'.
13005         (qualified_identifier): Removed, use `namespace_or_type_name'
13006         instead.
13007         (QualifiedIdentifier): Removed this class.      
13009 2004-01-22  Martin Baulig  <martin@ximian.com>
13011         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13012         not a string as alias name.
13014 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
13016         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13017         #52730 bug, and instead compute correctly the need to use a
13018         temporary variable when requesting an address based on the
13019         static/instace modified of the field and the constructor.
13021 2004-01-21  Martin Baulig  <martin@ximian.com>
13023         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13024         class and namespace before looking up aliases.  Fixes #52517.
13026 2004-01-21  Martin Baulig  <martin@ximian.com>
13028         * flowanalysis.cs (UsageVector.Merge): Allow variables being
13029         assinged in a 'try'; fixes exception4.cs.
13031 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13032         * class.cs : Implemented parameter-less constructor for TypeContainer
13034         * decl.cs: Attributes are now stored here. New property OptAttributes
13036         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13038         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13040 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13042         * typemanager.cs (CSharpSignature): Now reports also inner class name.
13043           (CSharpSignature): New method for indexer and property signature.
13045 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13047         * pending.cs (IsVirtualFilter): Faster implementation.
13049 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13051         * typemanager.cs: Avoid inclusion of same assembly more than once.
13053 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13055         * cs-parser.jay: Fixed problem where the last assembly attribute
13056           has been applied also to following declaration (class, struct, etc.)
13057           
13058 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13060         * class.cs: Added error CS0538, CS0539 reporting.
13061         Fixed crash on Microsoft runtime when field type is void.
13063         * cs-parser.jay: Added error CS0537 reporting.
13065         * pending.cs: Added error CS0535 reporting.
13066         Improved error report for errors CS0536, CS0534.
13068 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13070         Merge a few bits from the Anonymous Method MCS tree.
13072         * statement.cs (ToplevelBlock): New class for toplevel methods,
13073         will hold anonymous methods, lifted variables.
13075         * cs-parser.jay: Create toplevel blocks for delegates and for
13076         regular blocks of code. 
13078 2004-01-20  Martin Baulig  <martin@ximian.com>
13080         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13081         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13082         and `NeedExplicitReturn'; added `IsLastStatement'.
13083         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13084         have a `ReturnLabel' or we're not unreachable.
13086         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13087         child's reachability; don't just override ours with it.  Fixes
13088         #58058 (lluis's example).
13089         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13090         InFinally(), InLoop(), InSwitch() and
13091         BreakCrossesTryCatchBoundary() methods.
13093         * statement.cs (Return): Do all error checking in Resolve().
13094         Unless we are the last statement in a top-level block, always
13095         create a return label and jump to it.
13096         (Break, Continue): Do all error checking in Resolve(); also make
13097         sure we aren't leaving a `finally'.
13098         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13099         statement in a top-level block.
13100         (Block.Flags): Added `IsDestructor'.
13101         (Block.IsDestructor): New public property.
13103 2004-01-20  Martin Baulig  <martin@ximian.com>
13105         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13107 2004-01-20  Martin Baulig  <martin@ximian.com>
13109         * statement.cs (Statement.ResolveUnreachable): New public method.
13110         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13111         (Block.Resolve): Resolve unreachable statements.
13113 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13115         * expression.cs: We need to fix the case where we do
13116         not have a temp variable here.
13118         * assign.cs: Only expression compound assignments need
13119         temporary variables.
13121 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13123         * flowanalysis.cs: Reduce memory allocation in a few ways:
13124           - A block with no variables should not allocate a bit
13125             vector for itself.
13126           - A method with no out parameters does not need any tracking
13127             for assignment of the parameters, so we need not allocate
13128             any data for it.
13129           - The arrays:
13130                 public readonly Type[] VariableTypes;
13131                 public readonly string[] VariableNames;
13132             Are redundant. The data is already stored in the variable
13133             map, so we need not allocate another array for it.
13134           - We need to add alot of checks for if (params | locals) == null
13135             due to the first two changes.
13137 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13139         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13140         implement IMemoryLocation, we store a copy on a local variable and
13141         take the address of it.  Patch from Benjamin Jemlich
13143         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13144         to use a special "type_name_expression" rule which reduces the
13145         number of "QualifiedIdentifier" classes created, and instead
13146         directly creates MemberAccess expressions.
13148 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13150         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13151         that fixes #52853.  Null literal assignment to ValueType
13153         * class.cs (MethodData.Emit): Instead of checking the name of the
13154         method to determine if its a destructor, create a new derived
13155         class from Method called Destructor, and test for that.  
13157         * cs-parser.jay: Create a Destructor object instead of a Method.  
13159         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13161         Fixes: 52933
13163 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13165         * expression.cs (Binary.ResolveOperator): Perform an implicit
13166         conversion from MethodGroups to their delegate types on the
13167         Addition operation.
13169         * delegate.cs: Introduce a new class DelegateCreation that is the
13170         base class for `NewDelegate' and `ImplicitDelegateCreation',
13171         factor some code in here.
13173         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13174         conversion from MethodGroups to compatible delegate types. 
13176         * ecore.cs (Expression.Resolve): Do not flag error 654
13177         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13178         we allow conversions from MethodGroups to delegate types now.
13180         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13181         assignments in v2 either.
13183 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13185         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13186         static read-only fields in ctors.
13188         Applied patch from Benjamin Jemlich 
13190         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13192 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13194         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13195         here to return true, as they can be used like this:
13197                 (XXX) int.MEMBER ()
13199         Fixed 49836 and all the other dups
13201 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13203         * driver.cs: Implement /win32res and /win32icon.
13205 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13207         * cs-parser.jay: Add a rule to improve error handling for the
13208         common mistake of placing modifiers after the type.
13210 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13212         * cs-parser.jay (interface_event_declaration): Catch
13213         initialization of events on interfaces, and report cs0068
13215         * cs-parser.jay (interface_event_declaration): Catch
13216         initialization of events. 
13218         * ecore.cs: Better report missing constructors.
13220         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13221         the error reporting done in the wrong place.  Fix.
13223         * expression.cs (Binary.ResolveOperator): Catch the 
13224         operator + (E x, E y) error earlier, and later allow for implicit
13225         conversions in operator +/- (E e, U x) from U to the underlying
13226         type of E.
13228         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13229         52596, if the container class is abstract, the default constructor
13230         is protected otherwise its public (before, we were always public).
13232         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13233         fixed statement.
13235         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13236         Jemlich that fixes bug #52597, MCS was generating invalid code for
13237         idisposable structs.   Thanks to Ben for following up with this
13238         bug as well.
13240 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13242         * driver.cs: Allow assemblies without code to be generated, fixes
13243         52230.
13245 2004-01-07  Nick Drochak <ndrochak@gol.com>
13247         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13249 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13251         * cs-parser.jay: Add rules to improve error reporting if fields or
13252         methods are declared at the namespace level (error 116)
13254         * Add rules to catch event add/remove
13256 2004-01-04  David Sheldon <dave-mono@earth.li>
13258   * expression.cs: Added matching ")" to error message for 
13259   CS0077
13261 2004-01-03 Todd Berman <tberman@gentoo.org>
13263         * ecore.cs, attribute.cs:
13264         Applying fix from #52429.
13266 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13268         * ecore.cs, expression.cs, statement.cs:
13269         Total rewrite of how we handle branching. We
13270         now handle complex boolean expressions with fewer
13271         jumps. As well if (x == 0) no longer emits a ceq.
13273         if (x is Foo) is much faster now, because we generate
13274         better code.
13276         Overall, we get a pretty big improvement on our benchmark
13277         tests. The code we generate is smaller and more readable.
13279         I did a full two-stage bootstrap. The patch was reviewed
13280         by Martin and Miguel.
13282 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13284         * cs-parser.jay: Make primary_expression not take a QI.
13285         we dont need this because the member_access rule covers
13286         us here. So we replace the rule with just IDENTIFIER.
13288         This has two good effects. First, we remove a s/r conflict.
13289         Second, we allocate many fewer QualifiedIdentifier objects.
13291 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13293         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13294         set the correct information via SRE. This prevents
13295         hanging on the MS runtime. Fixes #29374.
13297 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13299         * convert.cs: correctly handle conversions to value types
13300         from Enum and ValueType as unboxing conversions.
13302         Fixes bug #52569. Patch by Benjamin Jemlich.
13304 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13306         * expression.cs (BetterConversion): Prefer int -> uint
13307         over int -> ulong (csc's behaviour). This fixed bug #52046.
13309 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13311         * decl.cs (MemberCache.FindMembers): now returns a
13312         MemberInfo [].
13314         * typemanager.cs: In general, go with with ^^.
13315         (CopyNewMethods): take an IList.
13316         (RealMemberLookup): Only allocate an arraylist
13317         if we copy from two sets of methods.
13319         This change basically does two things:
13320         1) Fewer array lists allocated due to CopyNewMethods.
13321         2) the explicit cast in MemberList costed ALOT.
13323 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13325         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13326         a hashtable to avoid needless string allocations when an identifier is
13327         used more than once (the common case).
13329 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13331         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13332         is broken, it will not return anything. So, we
13333         have to use the information we have in mcs to
13334         do the task.
13336         * typemanager.cs: Add a cache for GetInterfaces,
13337         since this will now be used more often (due to ^^)
13339         (GetExplicitInterfaces) New method that gets the
13340         declared, not effective, interfaces on a type
13341         builder (eg, if you have interface IFoo, interface
13342         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13343         { IBar }.
13345         This patch makes MCS able to bootstrap itself on
13346         Windows again.
13348 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13350         * expression.cs: Remove the Nop's that Miguel put
13351         in by mistake.
13353 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13355         * report.cs, codegen.cs: Give the real stack trace to
13356         the error when an exception is thrown.
13358 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13360         * decl.cs: only allocate hashtables for ifaces if 
13361         it is an iface!
13363 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13365         * expression.cs: fix the error from cs0121-2.cs
13366         (a parent interface has two child interfaces that
13367         have a function with the same name and 0 params
13368         and the function is called through the parent).
13370 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13372         * class.cs, rootcontext.cs, typmanager.cs: do not
13373         leak pointers.
13375 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13377         * codegen.cs: remove stack for the ec flow branching.
13378         It is already a linked list, so no need.
13380 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13382         * Makefile: Allow custom profiler here.
13384 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13386         * typemanager.cs (LookupType):
13387           - Use a static char [], because split takes
13388             a param array for args, so it was allocating
13389             every time.
13390           - Do not store true in a hashtable, it boxes.
13392 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13394         * flowanalysis.cs: bytify common enums.
13396 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13398         * modifiers.cs: Add a new set of flags for the
13399         flags allowed on explicit interface impls.
13400         * cs-parser.jay: catch the use of modifiers in
13401         interfaces correctly.
13402         * class.cs: catch private void IFoo.Blah ().
13404         All related to bug #50572.
13406 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13408         * decl.cs: Rewrite the consistant accessability checking.
13409         Accessability is not linear, it must be implemented in
13410         a tableish way. Fixes #49704.
13412 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13414         * expression.cs: Handle negation in a checked context.
13415         We must use subtraction from zero. Fixes #38674.
13417 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13419         * class.cs: Ignore static void main in DLLs.
13420         * rootcontext.cs: Handle the target type here,
13421         since we are have to access it from class.cs
13422         * driver.cs: account for the above.
13424 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13426         * report.cs: Give line numbers and files if available.
13428 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13430         * driver.cs: Implement /addmodule.
13432         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13433         ModuleBuilders.
13435 2003-12-20  Martin Baulig  <martin@ximian.com>
13437         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13438         (FieldBase.IsAssigned): Removed this field.
13439         (FieldBase.SetAssigned): New public method.
13440         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13442 2003-12-20  Martin Baulig  <martin@ximian.com>
13444         * expression.cs (LocalVariableReference.DoResolve): Don't set
13445         `vi.Used' if we're called from DoResolveLValue().
13447         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13448         returns the usage vector it just merged into the current one -
13449         pass this one to UsageWarning().
13450         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13451         of the `EmitContext', don't call this recursively on our children.
13453 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13455         * driver.cs: Implement /target:module.
13457 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13459         * support.cs (CharArrayHashtable): New helper class.
13461         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13462         char arrays, not strings, so we can avoid creating a string in
13463         consume_identifier if the identifier is a keyword.
13465 2003-12-16  Martin Baulig  <martin@ximian.com>
13467         * statement.cs (LocalInfo.Assigned): Removed this property.
13468         (LocalInfo.Flags): Removed `Assigned'.
13469         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13470         and uses flow analysis.
13471         (Block.UsageWarning): Made this method private.
13472         (Block.Resolve): Call UsageWarning() if appropriate.
13474         * expression.cs (LocalVariableReference.DoResolve): Always set
13475         LocalInfo.Used here.
13477 2003-12-13  Martin Baulig  <martin@ximian.com>
13479         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13480         any value here; we're now using flow analysis to figure out
13481         whether a statement/block returns a value.
13483 2003-12-13  Martin Baulig  <martin@ximian.com>
13485         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13486         working again.
13487         (FlowBranching.MergeFinally): Don't call
13488         `branching.CheckOutParameters()' here, this is called in
13489         MergeTopBlock().
13490         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13491         when adding the `finally' vector.       
13493 2003-12-13  Martin Baulig  <martin@ximian.com>
13495         * flowanalysis.cs
13496         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13497         actually work and also fix #48962.
13499 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13501         * decl.cs: Do not check System.Object for nested types,
13502         since we know it does not have any. Big bang for buck:
13504         BEFORE:
13505            Run 1:   8.35 seconds
13506            Run 2:   8.32 seconds
13507            corlib:  17.99 seconds
13508         AFTER:
13509            Run 1:   8.17 seconds
13510            Run 2:   8.17 seconds
13511            corlib:  17.39 seconds
13513 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13515         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13516         time we are returning 0 members, so we save alot here.
13518 2003-12-11  Martin Baulig  <martin@ximian.com>
13520         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13521         `MergeChild()', also just take the `FlowBranching' as argument;
13522         call Merge() on it and return the result.
13523         (FlowBranching.Merge): We don't need to do anything if we just
13524         have one sibling.
13526 2003-12-11  Martin Baulig  <martin@ximian.com>
13528         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13529         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13530         Maurer for this idea.
13532 2003-12-11  Martin Baulig  <martin@ximian.com>
13534         * flowanalysis.cs (MergeResult): This class is now gone; we now
13535         use the `UsageVector' for this.  The reason for this is that if a
13536         branching just has one sibling, we don't need to "merge" them at
13537         all - that's the next step to do.
13538         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13539         `MergeResult'.
13541 2003-12-11  Martin Baulig  <martin@ximian.com>
13543         Reworked flow analyis and made it more precise and bug-free.  The
13544         most important change is that we're now using a special `Reachability'
13545         class instead of having "magic" meanings of `FlowReturns'.  I'll
13546         do some more cleanups and optimizations and also add some more
13547         documentation this week.
13549         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13550         largely reworked this class.
13551         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13552         the new `Reachability' class instead of having "magic" values here.
13553         (FlowBranching): We're now using an instance of `Reachability'
13554         instead of having separate `Returns', `Breaks' etc. fields.
13556         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13557         based on flow analysis; ignore the return value of block.Emit ().
13559 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13561         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13562         if they are private.
13564 2003-12-09  Martin Baulig  <martin@ximian.com>
13566         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13567         call them directly on the UsageVector.
13569 2003-12-09  Martin Baulig  <martin@ximian.com>
13571         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13572         Changed return type from `FlowReturns' to `Reachability'.
13574 2003-12-09  Martin Baulig  <martin@ximian.com>
13576         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13577         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13578         `Reachable' fields with a single `Reachability' one.
13580 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13582         * class.cs (FindMembers): Remove foreach's.
13584         Bootstrap times:
13586         BEFORE
13587                 Run 1:   8.74 seconds
13588                 Run 2:   8.71 seconds
13590         AFTER
13591                 Run 1:   8.64 seconds
13592                 Run 2:   8.58 seconds
13595 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13597         * cs-parser.jay:
13598         * gen-treedump.cs:
13599         * statement.cs:
13600         This patch does a few things:
13601                 1. EmptyStatement is now a singleton, so it is never reallocated.
13602                 2. All blah is EmptyStatement constructs have been changed to
13603                    blah == EmptyStatement.Value, which is much faster and valid
13604                    now that EmptyStatement is a singleton.
13605                 3. When resolving a block, rather than allocating a new array for
13606                    the non-empty statements, empty statements are replaced with
13607                    EmptyStatement.Value
13608                 4. Some recursive functions have been made non-recursive.
13609         Mainly the performance impact is from (3), however (1) and (2) are needed for
13610         this to work. (4) does not make a big difference in normal situations, however
13611         it makes the profile look saner.
13613         Bootstrap times:
13615         BEFORE
13616         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13617         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13618         Total memory allocated: 56397 KB
13620         AFTER
13621         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13622         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13623         Total memory allocated: 55666 KB
13625 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13627         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13628         than the hashtable in a hashtable version
13630         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13631         we always end up concating a string. This results in a huge perf
13632         loss, because many strings have to be tracked by the GC. In this
13633         patch, we first use a hashtable that works with two keys, so that
13634         the strings do not need to be concat'ed.
13636         Bootstrap times:
13637         BEFORE
13638                 Run 1:   8.74 seconds
13639                 Run 2:   8.71 seconds
13641         AFTER
13642                 Run 1:   8.65 seconds
13643                 Run 2:   8.56 seconds
13645 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13647         * Makefile: Add a new target `do-time' that does a quick and simple
13648         profile, leaving easy to parse output.
13650 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13652         * codegen.cs (Init): Create the dynamic assembly with 
13653         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13655 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13657         * support.cs: Make the PtrHashtable use only one
13658         instance of its comparer.
13660 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13662         * typemanager.cs: Fix lookup of GetNamespaces.
13664 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13666         * expression.cs: Removed redundant line.
13668         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13669         ArrayLists, use for loops with bounds.  
13671         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13672         arraylist.
13674         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13675         arraylists, use for loop with bounds.
13677         The above three changes give us a 0.071 second performance
13678         improvement out of 3.294 seconds down to 3.223.  On my machine
13679         the above changes reduced the memory usage by 1,387 KB during
13680         compiler bootstrap.
13682         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13683         QualifiedIdentifiers.  Before we created a new string through
13684         concatenation, and mostly later on, the result would be
13685         manipulated by DecomposeQI through string manipulation.
13687         This reduced the compiler memory usage for bootstrapping from
13688         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13689         compile times in 0.05 seconds.
13691 2003-11-28  Dick Porter  <dick@ximian.com>
13693         * support.cs: Do string compares with the Invariant culture.
13695         * rootcontext.cs: 
13696         * gen-treedump.cs: 
13697         * expression.cs: 
13698         * driver.cs: 
13699         * decl.cs: 
13700         * codegen.cs: 
13701         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13702         the comparison is done with the Invariant culture.
13704 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13706         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13707         GetEnumerator method.
13709         (ProbeCollectionType): Iterate starting at the most specific type
13710         upwards looking for a GetEnumerator
13712         * expression.cs: Shift count can be up to 31 for int/uint and 63
13713         for long/ulong.
13715 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13717         * statement.cs (Block.LookupLabel): Also look for the label on the
13718         children blocks.  Use a hash table to keep track of visited
13719         nodes. 
13721         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13722         we actually did transform the other operand, otherwise fall back
13723         to the common codepath that casts to long.
13725         * cs-tokenizer.cs: Use the same code pattern as the int case.
13726         Maybe I should do the parsing myself, and avoid depending on the
13727         Parse routines to get this done.
13729 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13731         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13732         which fixes bug 51347.  This time test it.
13734         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13735         attributes for example can not tell the difference between these.
13736         The difference was only a syntax feature of the language. 
13738         * attribute.cs: Apply attributes to delegates.
13740         * delegate.cs: Call the apply attributes method.
13742 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13744         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13745         comparing 0 vs Byte.MinValue, not the value
13747         (ImplicitConversionRequired): When reporting a conversion error,
13748         use error 31 to print out the constant error instead of the
13749         simpler 29.
13751         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13752         which fixes bug 51347.
13754 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13756         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13757         which fixes the -warnaserror command line option.
13759 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13761         * cfold.cs (DoNumericPromotions): During constant folding of
13762         additions on UIntConstant, special case intconstants with
13763         IntConstants like we do on the expression binary operator. 
13765 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13767         * convert.cs (ImplicitReferenceConversion): We were missing a case
13768         (System.Enum are not value types or class types, so we need to
13769         classify them separatedly).
13771         * driver.cs: We do not support error 2007.
13773 2003-11-12 Jackson Harper <jackson@ximian.com>
13775         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13776         system directory. Also use the full file name so users can
13777         libraries names mscorlib-o-tron.dll in a non system dir.
13778         
13779 2004-01-04  David Sheldon <dave-mono@earth.li>
13781         * expression.cs: Added matching ")" to error message for CS0077.
13783 2003-12-19  Martin Baulig  <martin@ximian.com>
13785         * typemanager.cs (TypeManager.IsEqualGenericType): New public
13786         static method; see documentation in the method.
13787         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13789         * convert.cs (Convert.ImplicitReferenceConversion,
13790         Convert.ImplicitReferenceConversionExists): Add support for
13791         generic type declarations; see gen-36.cs.
13793 2003-12-19  Martin Baulig  <martin@ximian.com>
13795         * pending.cs (Pending.InterfaceMethod): Use
13796         `Type.IsAssignableFrom()' instead of `=='.
13798 2003-12-18  Martin Baulig  <martin@ximian.com>
13800         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13801         byref types first.
13803         * convert.cs (Convert.ImplicitStandardConversionExists): Use
13804         `expr_type.Equals (target_type)' instead of `=='.
13806 2003-12-08  Martin Baulig  <martin@ximian.com>
13808         * generics.cs (Constraints.Types): Removed.
13809         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13810         to Type's.
13811         (Constraints.ResolveTypes): New public method; resolves the
13812         TypeExpr's to Type's.
13813         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13814         longer takes the constraints.
13815         (TypeParameter.DefineMethod): Likewise.
13816         (TypeParameter.DefineType): New public method.  Calls
13817         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13818         the constraints.
13820 2003-12-08  Martin Baulig  <martin@ximian.com>
13822         * convert.cs (Convert.ImplicitConversionStandard): Use
13823         `expr_type.Equals (target_type)' instead of `=='.
13825 2003-12-08  Martin Baulig  <martin@ximian.com>
13827         * typemanager.cs (TypeManager.GetReferenceType): Call
13828         `Type.MakeByRefType ()'.
13830 2003-12-08  Martin Baulig  <martin@ximian.com>
13832         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13833         just has some special meaning in some situations.  For instance,
13834         it is allowed to use `where' as the name of a variable etc.
13836 2003-12-04  Martin Baulig  <martin@ximian.com>
13838         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13839         `Type.MakeArrayType()' for array types.
13841 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
13843         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13844         debugging message.
13846         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
13847         corlib to compile.
13849 2003-11-16  Martin Baulig  <martin@ximian.com>
13851         * codegen.cs (EmitContext.IsGeneric): Removed.
13853         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13854         ResolveGeneric() on the DeclSpace.
13856 2003-11-16  Martin Baulig  <martin@ximian.com>
13858         * generic.cs (TypeArguments.Resolve):
13859         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13860         `ResolveType()' on it to get the Type.
13862 2003-11-15  Martin Baulig  <martin@ximian.com>
13864         * generic.cs (ConstructedType.GetInterfaces): Override this.
13866 2003-11-14  Martin Baulig  <martin@ximian.com>
13868         * interface.cs (Interface.DefineType): Define all type parameters
13869         before adding the interfaces we inherit.
13871 2003-11-11  Martin Baulig  <martin@ximian.com>
13873         * generic.cs (ConstructedType.ResolveType): Always call
13874         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13876 2003-11-10  Martin Baulig  <martin@ximian.com>
13878         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13879         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13880         calling `ResolveType()' on them, directly assign their `Type'.
13882 2003-11-08  Martin Baulig  <martin@ximian.com>
13884         * generic.cs (ConstructedType): Override `IsClass' etc.
13886 2003-11-08  Martin Baulig  <martin@ximian.com>
13888         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13889         return value and the `out parent' parameter.
13890         (TypeContainer.DefineType): Moved the CS0644 check into
13891         GetClassBases().  Don't pass the interface types to the
13892         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13893         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13895         * ecore.cs (TypeExpr.IsAttribute): New property.
13896         (TypeExpr.GetInterfaces): New method.
13898         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13899         TypeExpr instead of a Type.
13900         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13901         (Interface.DefineType): Don't pass the interface types to the
13902         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13903         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13905         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13906         instead of a `Type[]'.
13907         (TypeManager.RegisterBuilder): Likewise.
13908         (TypeManager.AddUserInterface): Likewise.
13909         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13910         `Type[]' and also return a `TypeExpr[]'.
13911         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13913 2003-11-08  Martin Baulig  <martin@ximian.com>
13915         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13916         Expression.     
13918 2003-11-08  Martin Baulig  <martin@ximian.com>
13920         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13921         TypeManager.ResolveExpressionTypes().
13923         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13924         instead of an Expression.
13925         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13926         (TypeExpression): New public class; formerly known as `TypeExpr'.
13928         * expression.cs (ComposedCast): Derive from TypeExpr.
13930         * typemanager.cs (TypeManager.system_*_expr): These are now
13931         TypExpr's instead of Expression's.
13932         (TypeManager.ResolveExpressionTypes): New public static function;
13933         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13934         of them.        
13936 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13938         * expression.cs (New.DoResolve): Do not dereference value that
13939         might be a null return.
13941         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13942         sure that the constant value has the right type.  Fixes an
13943         unreported bug, similar to 50425.
13945         * const.cs (Const.LookupConstantValue): Call
13946         ImplicitStandardConversionExists before doing a conversion to
13947         avoid havng the TypeManager.ChangeType do conversions.
13949         Reduced the number of casts used
13951         (Const.ChangeType): New routine to enable reuse of the constant
13952         type changing code from statement.
13954         * typemanager.cs (ChangeType): Move common initialization to
13955         static global variables.
13957         Fixes #50425.
13959         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13960         every value type to go through, even if it was void.  Fix that. 
13962         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13963         character of the define, and the is_identifier_part_character for
13964         the rest of the string.
13966 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13968         * expression.cs (UnaryMutator.EmitCode): When I updated
13969         LocalVariableReference.DoResolve, I overdid it, and dropped an
13970         optimization done on local variable references.
13972 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13974         * ecore.cs: Convert the return from Ldlen into an int.
13976 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13978         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13979         the accessibility, this is a special case for toplevel non-public
13980         classes (internal for instance).
13982 2003-10-20  Nick Drochak <ndrochak@gol.com>
13984         * ecore.cs: Fix typo and build.  Needed another right paren.
13986 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13988         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13989         `internal' case regular and protected, but not allowing protected
13990         to be evaluated later.  Bug 49840
13992 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13994         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13995         to kb.Nlast, and not the kb.nFirst to isolate the switch
13996         statement.
13998         Extract the underlying type, so enumerations of long/ulong are
13999         treated like long/ulong.
14001 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
14003         * expression.cs (New): Overload the meaning of RequestedType to
14004         track the possible creation of the NewDelegate type, since
14005         DoResolve is invoked more than once for new constructors on field
14006         initialization.
14008         See bugs: #48800 and #37014
14010         * cs-parser.jay (declare_local_constants): Take an arraylist
14011         instead of a single constant.
14013         (local_constant_declaration): It should take a
14014         constant_declarators, not a constant_declarator.  Fixes 49487
14016         * convert.cs: Fix error report.
14018 2003-10-13 Jackson Harper <jackson@ximian.com>
14020         * typemanager.cs (TypeToCoreType): Add float and double this fixes
14021         bug #49611
14022         
14023 2003-11-03  Martin Baulig  <martin@ximian.com>
14025         * expression.cs (ArrayAccess.GetStoreOpcode): Added
14026         `out bool has_type_arg'; if set, we need to pass the type to
14027         ig.Emit().
14028         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
14029         Stelem_Any/Ldelem_Any for generic parameters.   
14031 2003-11-02  Martin Baulig  <martin@ximian.com>
14033         * expression.cs (Invocation.EmitCall): Use
14034         `TypeManager.IsValueType()' to check whether it's a value type.
14035         Don't set `struct_call' when calling a method on a type parameter.
14037 2003-11-02  Martin Baulig  <martin@ximian.com>
14039         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
14040         and removed the TypeBuilder argument.
14042         * typemanager.cs (TypeManager.IsValueType): Return
14043         `t.IsGenericParameter || t.IsValueType'.
14045 2003-10-25  Martin Baulig  <martin@ximian.com>
14047         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
14048         call ConstructedType.Resolve() on it.
14050         * generic.cs (ConstructedType.Resolve): Set `type' on success.
14052 2003-10-25  Martin Baulig  <martin@ximian.com>
14054         * class.cs (TypeContainer.GetClassBases): Changed
14055         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
14056         CS8214 reporting here.
14057         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
14058         instead of a `Type' for our parent.  In case of a recursive
14059         declaration (see tests/gen-23.cs for an example), our parent is a
14060         ConstructedType and it doesn't have its type set.  So, first
14061         create our own TypeBuilder, then call constructed.Resolve() to get
14062         the parent's type and finally TypeBuilder.SetParent() it.
14064         * ecore.cs (TypeExpr.Name): New public virtual property.
14066         * generic.cs
14067         (ConstructedType): We're now a TypeExpr and not just an Expression.
14068         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14069         arguments here; this is done later.
14070         (ConstructedType.Resolve): New public method to resolve the type
14071         arguments and bind them.
14073 2003-10-21  Martin Baulig  <martin@ximian.com>
14075         * convert.cs: Use `TypeManager.IsValueType' instead of
14076         'type.IsValueType' everywhere.
14078         * typemanager.cs (TypeManager.IsValueType): Return true for type
14079         parameters.  The reason for this is that we need to box a type
14080         parameter when converting it to a reference type.
14082         * cs-parser.jay: Added support for default value expressions.
14084         * generics.cs (DefaultValueExpression): New public class.       
14086 2003-10-17  Martin Baulig  <martin@ximian.com>
14088         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14089         TypeContainer so we can also use this for Interfaces.
14090         (TypeParameter.Resolve): Likewise.
14092         * interface.cs (Interface.DefineType): Added support for generic
14093         interfaces.
14095         * cs-parser.jay: Added support for generic structs and interfaces.
14097 2003-10-17  Martin Baulig  <martin@ximian.com>
14099         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14100         call generic methods :-)
14102 2003-10-16  Martin Baulig  <martin@ximian.com>
14104         * cs-parser.jay (namespace_or_type_name): Only create a
14105         GenericMemberAccess if we actually have type arguments.
14107 2003-10-13  Martin Baulig  <martin@ximian.com>
14109         * class.cs (Method.Define): If we're a generic method, call
14110         TypeBuilder.DefineGenericMethod () before resolving
14111         the parameters.
14112         (MethodData): Added .ctor which takes an additional MethodBuilder
14113         argument; this is used for generic methods.
14114         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14115         we already have a MethodBuilder.
14117 2003-10-10  Martin Baulig  <martin@ximian.com>
14119         * class.cs (Method): Added .ctor which takes a `GenericMethod'
14120         instead of a `DeclSpace'.  This is used for generic methods.
14122         * cs-parser.jay (method_header): Added support for generic
14123         methods; create a `GenericMethod' instance and pass it to the
14124         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14125         parameters and locals.
14127         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14128         since we already have the location.  Check whether we're a generic
14129         type declaration or a generic method and create the correct type
14130         parameter.
14132         * generic.cs (TypeParameter.DefineMethod): New public method.
14133         (GenericMethod): New public class; derives from DeclSpace and is
14134         used for generic methods.       
14136 2003-10-09  Martin Baulig  <martin@ximian.com>
14138         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14139         to the .ctor.
14140         (MethodCore.DoDefineParameters): Removed the TypeContainer
14141         argument; use the DeclSpace which was passed to the .ctor instead.
14142         (MethodCore.CheckParameter): Take a DeclSpace instead of a
14143         TypeContainer; we only need a DeclSpace here.
14145 2003-10-09  Martin Baulig  <martin@ximian.com>
14147         * class.cs (MethodData): Added additional `DeclSpace ds' argument
14148         to the .ctor.
14149         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14150         EmitContext's .ctor.    
14152 2003-10-09  Martin Baulig  <martin@ximian.com>
14154         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14155         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14156         AsAccessible(), moved them as well.
14158         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14160 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
14162         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14163         generation for >=, as spotted by Paolo, bug 48679.  
14164         Patch from David Waite.
14166         * cs-tokenizer.cs: Add handling for #pragma.
14168         * cs-parser.jay: Allow for both yield and yield return in the
14169         syntax.  The anti-cobolization of C# fight will go on!
14171         * class.cs (TypeBuilder.DefineType): Catch error condition here
14172         (Parent.DefineType erroring out and returning null).
14174         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14175         coping with enumerations variables, we were mistakenly processing
14176         them as a regular value type instead of built-in types.  Fixes the
14177         bug #48063
14179         * typemanager.cs (IsBuiltinOrEnum): New method.
14181 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
14183         * cs-parser.jay: Upgrade: yield now needs the return clause.
14185 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14187         * cs-parser.jay : Renamed yyName to yyNames related to jay.
14189 2003-09-29  Martin Baulig  <martin@ximian.com>
14191         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14192         inflated generic methods.
14194         * generics.cs (ConstructedType): Distinguish between open and
14195         closed constructed types; correctly resolve the arguments.
14197 2003-09-22  Martin Baulig  <martin@ximian.com>
14199         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14200         all type arguments meet their constraints.
14202 2003-09-19  Martin Baulig  <martin@ximian.com>
14204         * decl.cs (MemberCache.SetupCacheForInterface): Take a
14205         `MemberCache parent' argument.  Normally, an interface doesn't
14206         have a parent type except System.Object, but we use this in gmcs
14207         for generic type parameters.
14209 2003-09-18  Martin Baulig  <martin@ximian.com>
14211         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14212         on `type.IsInterface'; don't check whether the type has a parent
14213         to determine whether it's an interface.
14215 2003-09-17  Martin Baulig  <martin@ximian.com>
14217         * generic.cs (ConstructedType.ToString): Always use `name' as the
14218         type name.
14220 2003-09-15  Martin Baulig  <martin@ximian.com>
14222         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14224         * generic.cs (Constraints.Resolve): New public method; this is
14225         called to resolve the constraint types and to check whether all
14226         the constraints are correct.
14227         (Constraints.Types): New public property.
14228         (TypeParameter.Resolve): New public method; resolves all the
14229         type's constraints.
14231         * class.cs (TypeContainer.DefineType): Call
14232         TypeParameter.Resolve() before actually defining the type.
14234 2003-09-15  Martin Baulig  <martin@ximian.com>
14236         * class.cs (TypeContainer.DefineType): Added an error flag to
14237         avoid reporting duplicate CS0146's ("class definition is
14238         circular.").
14240         * driver.cs (Driver.MainDriver): Abort if
14241         RootContext.ResolveTree() reported any errors.
14243 2003-09-07  Martin Baulig  <martin@ximian.com>
14245         * report.cs (Error, Warning): Added overloaded versions which take
14246         a `params object[] args' and call String.Format().
14248 2003-09-07  Martin Baulig  <martin@ximian.com>
14250         * decl.cs (DeclSpace..ctor): Don't call
14251         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14252         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
14253         (DeclSpace.RecordDecl): New method.
14255         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14257 2003-09-02  Ravi Pratap  <ravi@ximian.com>
14259         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14260         value attributes to be applied to ParameterBuilders.
14262         * class.cs (MethodCore.LabelParameters): Make static and more
14263         generic so that it can be used from other places - like interface
14264         methods, for instance.
14266         * interface.cs (Interface.Emit): Call LabelParameters before
14267         emitting attributes on the InterfaceMethod.
14269 2003-09-07  Martin Baulig  <martin@ximian.com>
14271         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14272         if the number of type parameters doesn't match.
14274 2003-09-04  Martin Baulig  <martin@ximian.com>
14276         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14277         for arrays of generic type params (ie. `!0[]').
14279 2003-09-04  Martin Baulig  <martin@ximian.com>
14281         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14282         for the moment.
14284 2003-09-04  Martin Baulig  <martin@ximian.com>
14286         * decl.cs (DeclSpace.LookupGeneric): New method.
14287         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14288         moment.
14290         * generic.cs (TypeParameterExpr): Take a TypeParameter as
14291         argument, not just a string.
14292         (TypeParameter.Define): New public method; this is called to
14293         actually define the generic parameter; after this, you can use the
14294         new `Type' property to get the type.
14296 2003-09-04  Martin Baulig  <martin@ximian.com>
14298         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14299         is now an ArrayList; initialize the result of the `TypeParameters'
14300         property here.
14301         (DeclSpace.GetGenericData): Removed.
14302         (DeclSpace.LookupGeneric): Temporarily removed; we need to
14303         implement this in a different way.
14304         (DeclSpace.GetTypeParameters): Removed; there's now a
14305         `TypeParameters' property.
14306         (DeclSpace.TypeParameters): New public property.
14308         * generic.cs (Constraints): Make this class public.
14309         (TypeParameter): New public class.
14311 2003-09-04  Martin Baulig  <martin@ximian.com>
14313         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14314         generic parameters.
14316         * class.cs (TypeContainer.DefineType): Call
14317         TypeBuilder.DefineGenericParameter () on all generic parameters if
14318         this is a generic type.
14320 2003-08-28  Martin Baulig  <martin@ximian.com>
14322         * sample-stack.il: Compile this with ilasm: "ilasm /dll
14323         sample-stack.il".
14325         * sample-hello.cs: Compile this with gmcs: "gmcs
14326         /r:sample-stack.dll sample-hello.cs".
14328 2003-08-28  Martin Baulig  <martin@ximian.com>
14330         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14331         the parameters to the generic type.
14333 2003-08-28  Martin Baulig  <martin@ximian.com>
14335         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14337 2003-08-28  Martin Baulig  <martin@ximian.com>
14339         * cs-parser.jay (opt_type_argument_list): Use
14340         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14341         (primary_expression): Replace `qualified_identifier' with `type_name'.
14342         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14344         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14345         parser to check whether it is syntactically a type parameter list;
14346         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14347         this case.
14349 2003-08-26  Martin Baulig  <martin@ximian.com>
14351         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14352         resolving aliases; fixes #47927.
14354 2003-08-26  Martin Baulig  <martin@ximian.com>
14356         * statement.cs (Using.DoResolve): This is internally emitting a
14357         try/finally clause, so we need to set ec.NeedExplicitReturn if we
14358         do not always return.  Fixes #47681.
14360 2003-08-26  Martin Baulig  <martin@ximian.com>
14362         * decl.cs (MemberCore): Moved WarningNotHiding(),
14363         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14364         into MemberBase.
14365         (AdditionResult): Make this nested in DeclSpace.
14366         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14367         argument; call NamespaceEntry.Define() unless we're nested in a
14368         class or struct.
14370         * namespace.cs (Namespace.DefineName): New public function.  This
14371         is called from DeclSpace's .ctor to add 
14372         (Namespace.Lookup): Include DeclSpaces in the lookup.
14374         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14376         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14378 2003-08-25  Martin Baulig  <martin@ximian.com>
14380         * convert.cs (Convert.ExplicitReferenceConversion): When
14381         converting from an interface type to a class, unbox if the target
14382         type is a struct type.  Fixes #47822.
14384 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14386         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14387         #47854.
14389 2003-08-22  Martin Baulig  <martin@ximian.com>
14391         * class.cs (TypeManager.DefineType): When defining a nested type,
14392         call DefineType() on our parent; fixes #47801.
14394 2003-08-22  Martin Baulig  <martin@ximian.com>
14396         * class.cs (MethodData.Define): While checking if a method is an
14397         interface implementation, improve the test a bit more to fix #47654.
14399 2003-08-22  Martin Baulig  <martin@ximian.com>
14401         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14402         correctly; fixes #47722.
14404 2003-08-22  Martin Baulig  <martin@ximian.com>
14406         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14407         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14409         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14411 2003-08-22  Martin Baulig  <martin@ximian.com>
14413         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14414         can only be assigned in static constructors.  Fixes #47161.
14416 2003-08-22  Martin Baulig  <martin@ximian.com>
14418         Rewrote and improved the flow analysis code.
14420         * flowbranching.cs (FlowBranching): Make this class abstract.
14421         (FlowBranching.CreateBranching): New static function to create a
14422         new flow branching.
14423         (FlowBranchingBlock, FlowBranchingException): New classes.
14424         (FlowBranching.UsageVector.Type): New public readonly field.
14425         (FlowBranching.UsageVector.Breaks): Removed the setter.
14426         (FlowBranching.UsageVector.Returns): Removed the setter.
14427         (FlowBranching.UsageVector): Added Break(), Return(),
14428         NeverReachable() and Throw() methods to modify the reachability.
14429         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14430         done by FlowBranching.Merge().
14431         (FlowBranching.UsageVector.MergeChild): New method; merges the
14432         merge result into the current vector.
14433         (FlowBranching.Merge): New abstract method to merge a branching.
14435 2003-08-12  Martin Baulig  <martin@ximian.com>
14437         * expression.cs (Indirection.CacheTemporaries): Create the
14438         LocalTemporary with the pointer type, not its element type.
14440 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14442         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14443         token was a keyword or not.
14445         Add `error' options where an IDENTIFIER was expected;  Provide
14446         CheckToken and CheckIdentifierToken convenience error reporting
14447         functions. 
14449         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14451         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14452         NameSpaceEntry NameSpaceEntry.
14454         (LookupInterfaceOrClass): Avoid creating a full qualified name
14455         from namespace and name: avoid doing lookups when we know the
14456         namespace is non-existant.   Use new Tree.LookupByNamespace which
14457         looks up DeclSpaces based on their namespace, name pair.
14459         * driver.cs: Provide a new `parser verbose' to display the
14460         exception thrown during parsing.  This is turned off by default
14461         now, so the output of a failure from mcs is more graceful.
14463         * namespace.cs: Track all the namespaces defined in a hashtable
14464         for quick lookup.
14466         (IsNamespace): New method
14468 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14470         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14471         we know that we need to concatenate (full typename can never be
14472         null). 
14474         * class.cs: ditto.
14476         * statement.cs: Use a bitfield;  Do not initialize to null things
14477         which are done by the constructor by default.
14479         * cs-parser.jay: bug fix, parameter was 4, not 3.
14481         * expression.cs: Just use the property;
14483         * statement.cs: No need for GetVariableInfo method.
14485 2003-08-08  Martin Baulig  <martin@ximian.com>
14487         * flowanalysis.cs (FlowReturns): This is now nested in the
14488         `FlowBranching' class.
14489         (MyBitVector): Moved this here from statement.cs.
14490         (FlowBranching.SiblingType): New enum type.
14491         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14493 2003-08-07  Martin Baulig  <martin@ximian.com>
14495         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14496         `FlowBranching' class and called `BranchingType'.
14498 2003-08-07  Martin Baulig  <martin@ximian.com>
14500         * flowanalysis.cs: Moved all the control flow analysis code into
14501         its own file.
14503 2003-08-07  Martin Baulig  <martin@ximian.com>
14505         * assign.cs (Assign.DoResolve): `target' must either be an
14506         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14507         #37319.
14509 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14511         * expression.cs (BinaryMethod): This kind of expression is created by the
14512         Binary class if it determines that the operator has to be handled
14513         by a method.
14515         (BinaryDelegate): This kind of expression is created if we are
14516         dealing with a + or - operator on delegates.
14518         (Binary): remove method, argumetns, and DelegateOperator: when
14519         dealing with methods, 
14521         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14523         * statement.cs (Block): use bitfields for the three extra booleans
14524         we had in use.   Remove unused topblock parameter.
14526         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14528         * assign.cs: Drop extra unneeded tests.
14530 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14532         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14534         * statement.cs (Foreach): Use VariableStorage instead of
14535         LocalBuilders.   
14537         * codegen.cs (VariableStorage): New class used by clients that
14538         require a variable stored: locals or fields for variables that
14539         need to live across yield.
14541         Maybe provide a convenience api for EmitThis+EmitLoad?
14543         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14544         these bad boys.
14546 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14548         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14549         RemapParameterLValue): New methods that are used to turn a
14550         precomputed FieldInfo into an expression like this:
14552                 instance.FieldInfo
14554         The idea is to use this instead of making LocalVariableReference
14555         have more than one meaning.
14557         * cs-parser.jay: Add error production to BASE.
14559         * ecore.cs: Deal with TypeManager.GetField returning null, which
14560         is now a valid return value.
14562         (FieldExprNoAddress): New expression for Fields whose address can
14563         not be taken.
14565         * expression.cs (LocalVariableReference): During the resolve
14566         phases, create new expressions if we are in a remapping context.
14567         Remove code that dealt with remapping here.
14569         (ParameterReference): same.
14571         (ProxyInstance): New expression, like the `This' expression, but
14572         it is born fully resolved.  We know what we are doing, so remove
14573         the errors that are targeted to user-provided uses of `this'.
14575         * statement.cs (Foreach): our variable is now stored as an
14576         Expression;  During resolution, follow the protocol, dont just
14577         assume it will return this.
14579 2003-08-06  Martin Baulig  <martin@ximian.com>
14581         * support.cs (SeekableStreamReader.cs): New public class.
14583         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14584         SeekableStreamReader instead of the normal StreamReader.
14586 2003-08-04  Martin Baulig  <martin@ximian.com>
14588         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14589         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14590         deambiguate casts and delegate invocations.
14591         (parenthesized_expression): Use the new tokens to ensure this is
14592         not a cast of method invocation.
14594         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14595         when reading a `)' and Deambiguate_CloseParens () was previously
14596         called.
14598         * expression.cs (ParenthesizedExpression): New class.  This is
14599         just used for the CS0075 test.
14600         (Binary.DoResolve): Check for CS0075.   
14602 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14604         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14605         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14606         reference comparison.
14608         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14609         examine the ReturnType for equality - this is necessary in the
14610         cases of implicit and explicit operators whose signature also
14611         includes the return type.
14613 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14615         * namespace.cs: Cache the result of the namespace computation,
14616         instead of computing it every time.
14618 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14620         * decl.cs: Use a global arraylist that we reuse over invocations
14621         to avoid excesive memory consumption.  Reduces memory usage on an
14622         mcs compile by one meg (45 average).
14624         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14625         private, work around that.
14627 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14629         * literal.cs (IntLiteral): Define Zero and One static literals. 
14631         * cs-parser.jay (integer_literal): use static literals to reduce
14632         memory usage for the most used literals (0, 1 and -1).  211kb
14633         reduced in memory usage.
14635         Replace all calls to `new ArrayList' with `new
14636         ArrayList(4)' which is a good average number for most allocations,
14637         and also requires only 16 bytes of memory for its buffer by
14638         default. 
14640         This reduced MCS memory usage in seven megabytes for the RSS after
14641         bootstrapping.
14643 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14645         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14646         handle params methods the correct way by forming only one
14647         applicable set with params and normal methods in them. Earlier we
14648         were looking at params methods only if we found no normal methods
14649         which was not the correct thing to do.
14651         (Invocation.BetterFunction): Take separate arguments indicating
14652         when candidate and the best method are params methods in their
14653         expanded form.
14655         This fixes bugs #43367 and #46199.
14657         * attribute.cs: Documentation updates.
14659         (CheckAttribute): Rename to CheckAttributeTarget.
14660         (GetValidPlaces): Rename to GetValidTargets.
14662         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14663         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14665         Fixes bug #44468.
14667 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
14669         * codegen.cs: Compute IsGeneric correctly.
14671         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14672         resolution. 
14674         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14675         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
14676         regressions, and I was chasing more bugs than I required.
14678         * interface.cs: Use expressions for base type names (like classes
14679         and structs have been doing for a while now), and resolve that.
14680         This patch should probably go into head as well.
14682         This makes it one less user of FindType.
14684 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14686         This compiler can not self host currently.  Need to fix that.
14687         
14688         * Makefile: compile to `gmcs.exe'
14690         * driver.cs: Turn on v2 by default on gmcs.
14692         * generic.cs (ConstructedType): Does no longer take a container
14693         type argument;  That will be taken care of later.
14695         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14696         Use SimpleName to resolve for now, so we can continue the work on
14697         the parser, until we get Type.GetType that understands generics.
14699         (ConstructedType.ToString): Implement
14701         (TypeArguments.Resolve): Resolve the child expressions as types. 
14702         
14703         * cs-parser.jay: Rename interface_constraints to
14704         type_parameter_constraints
14706         (namespace_or_type_name): Only use constructed types for the basic
14707         construction, we will deal with identifier<...> later.
14709         (type/type_name): No longer call DecomposeQI, as
14710         namespace_or_type_name is always decoded now.
14711         
14712 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14714         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14715         closely: we eliminate methods in base types when we have an
14716         applicable method in a top-level type.
14718         Please see section 14.5.5.1 for an exact description of what goes
14719         on. 
14721         This fixes bug #45127 and a host of other related to corlib compilation.
14723         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14724         array is the method corresponding to the top-level type (this is
14725         because of the changes made to icall.c) so we change this
14726         accordingly.
14728         (MethodGroupExpr.Name): This too.
14730         * typemanager.cs (GetElementType): New method which does the right
14731         thing when compiling corlib. 
14733         * everywhere: Make use of the above in the relevant places.
14735 2003-07-22  Martin Baulig  <martin@ximian.com>
14737         * cs-parser.jay (invocation_expression): Moved
14738         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14739         `cast_expression', but create a InvocationOrCast which later
14740         resolves to either an Invocation or a Cast.
14742         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14743         method; call this before EmitStatement() to make sure that this
14744         expression can be used as a statement.
14746         * expression.cs (InvocationOrCast): New class; resolves to either
14747         an Invocation or a Cast.
14749         * statement.cs (StatementExpression): Call ResolveStatement() on
14750         the ExpressionStatement before emitting it.
14752 2003-07-21  Martin Baulig  <martin@ximian.com>
14754         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14755         `ref' and `out' attributes match; fixes #46220.
14756         (MemberAccess.ResolveMemberAccess): You can't reference a type
14757         through an expression; fixes #33180.
14758         (Indexers.GetIndexersForType): Don't return the indexers from
14759         interfaces the class implements; fixes #46502.
14761 2003-07-21  Martin Baulig  <martin@ximian.com>
14763         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14764         CS0661 checks; fixes bug #30442.
14766 2003-07-21  Martin Baulig  <martin@ximian.com>
14768         * decl.cs (AdditionResult): Added `Error'.
14770         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14772         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14773         cs0031.cs actually work.
14775  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14777         * cs-parser.jay (namespace_name): do not use
14778         namespace_or_type_name, use qualified_identifier, because
14779         namespace_or_type_name will soon return a composed expression
14780         instead of a string.
14782         (namespace_or_type_name): Instead of returning a string, now this
14783         production returns an expression.
14785         * codegen.cs (EmitContext): Setup IsGeneric property based on
14786         whether our DeclSpace is generic, our the method is generic.
14788         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14789         the method is generic.
14791         * cs-parser.jay (type_arguments, opt_type_argument_list,
14792         type_parameters, type_parameter_list, opt_type_parameter_list,
14793         type_parameter,, opt_type_parameter_constraints_clauses,
14794         type_parameter_constraints_clauses,
14795         type_parameter_constraint_clause, type_parameter_constraint,
14796         interface_constraints): Add new production
14798         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14799         DeclSpace is generic or not.
14801         (DeclSpace.SetParameterInfo): New routine, used to set the
14802         parameter info for a type.
14804         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14805         returns a GenericTypeExpr
14807         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14808         generic, lookup the generic argument.
14810         * attribute.cs: Do not allow TypeParameterExpressions in
14811         Attributes.
14813         * class.cs: Do not allow the Main method to be defined in a
14814         Generic container.
14816         * expression.cs (SizeOf): Do not allow generic types to be used as
14817         arguments to sizeof.
14819         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14820         it: whether a type is generic or not.  Only works for types we are
14821         currently building for now.
14822         
14823 2003-07-20  Martin Baulig  <martin@ximian.com>
14825         * namespace.cs: Fixed that bug which caused a crash when compiling
14826         the debugger's GUI.
14828 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14830         * typemanager.cs (LookupTypeReflection): Never expose types which
14831         are NotPublic, NestedPrivate, NestedAssembly, or
14832         NestedFamANDAssem.  We used to return these, and later do a check
14833         that would report a meaningful error, but the problem is that we
14834         would not get the real match, if there was a name override.
14836 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14838         * namespace.cs (Namespace, Name): Do not compute the namespace
14839         name dynamically, compute it in the constructor.  This reduced
14840         memory usage by 1697 KB.
14842         * driver.cs: Use --pause to pause at the end.
14844 2003-07-17  Peter Williams  <peter@newton.cx>
14846         * Makefile: Change the name of the test target so that it doesn't
14847         conflict with the recursive test target.
14849 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14851         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14852         AddressOf): Do not use EmitThis, that was wrong, use the actual
14853         this pointer.
14855 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14857         * class.cs (MethodData.Define): While checking if a method is an
14858         interface implementation, improve the test: If we are not public
14859         (use new test here: use the computed MethodAttributes directly,
14860         instead of the parsed modifier flags) check if the `implementing'
14861         method comes from an interface or not.
14863         * pending.cs (VerifyPendingMethods): Slightly better error
14864         message.
14866         * makefile: add test target that does the mcs bootstrap.
14868 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14870         * interface.cs (Define): Do nothing here since there are no
14871         members to populate etc. Move the attribute emission out of here
14872         since this was just totally the wrong place to put it. Attribute
14873         application happens during the 'Emit' phase, not in the 'Define'
14874         phase.
14876         (Emit): Add this method and move the attribute emission here
14878         * rootcontext.cs (EmitCode): Call the Emit method on interface
14879         types too.
14881 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14883         * expression.cs (OverloadResolve): Report error only if Location
14884         is not 'Null' which means that there was a probe going on.
14886 2003-07-14  Martin Baulig  <martin@ximian.com>
14888         * expression.cs (ConditionalLogicalOperator): New public class to
14889         implement user defined conditional logical operators.
14890         This is section 14.11.2 in the spec and bug #40505.
14892 2003-07-14  Martin Baulig  <martin@ximian.com>
14894         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14896 2003-07-14  Martin Baulig  <martin@ximian.com>
14898         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14900         * ecore.cs (IVariable.VerifyFixed): New interface method.
14902         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14903         operator, check whether the variable is actually fixed.  Fixes bug
14904         #36055.  Set a variable definitely assigned when taking its
14905         address as required by the spec.
14907         * statement.cs (LocalInfo.IsFixed): New field.
14908         (LocalInfo.MakePinned): Set `IsFixed' to true.
14910 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14912         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14913         for .ctors, ensure that we only ask for members declared in the
14914         attribute type (BindingFlags.DeclaredOnly).
14916         Fixes bug #43632.
14918         * expression.cs (Error_WrongNumArguments): Report error 1501
14919         correctly the way CSC does.
14921 2003-07-13  Martin Baulig  <martin@ximian.com>
14923         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14924         lookup on the fully qualified name, to make things like "X.X" work
14925         where "X.X" is a fully qualified type name, but we also have a
14926         namespace "X" in the using list.  Fixes #41975.
14928 2003-07-13  Martin Baulig  <martin@ximian.com>
14930         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14931         function. If we're a CompoundAssign, we need to create an embedded
14932         CompoundAssign, not an embedded Assign.
14933         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14934         Fixes #45854.
14936 2003-07-13  Martin Baulig  <martin@ximian.com>
14938         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14939         work to fix bug #46088.
14941 2003-07-13  Ravi Pratap <ravi@ximian.com>
14943         * class.cs (Operator.Emit): Do not emit attributes here - it is
14944         taken care of by the Method class that we delegate too. This takes
14945         care of bug #45876.
14947 2003-07-10  Martin Baulig  <martin@ximian.com>
14949         * expression.cs (TypeOfVoid): New class.
14950         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14952 2003-07-10  Martin Baulig  <martin@ximian.com>
14954         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14955         bug #35957.
14957 2003-07-10  Martin Baulig  <martin@ximian.com>
14959         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14960         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14962         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14964         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14966 2003-07-10  Martin Baulig  <martin@ximian.com>
14968         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14969         of decimal.  Fixes #42850.
14971         NOTE: I also fixed the created byte blob, but this doesn't work on
14972         the MS runtime and csc never produces any byte blobs for decimal
14973         arrays.
14975 2003-07-10  Martin Baulig  <martin@ximian.com>
14977         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14978         structs; fixes #32068.
14979         (Block.AddChildVariableNames): Fixed #44302.
14981 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14983         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14985 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14987         * attribute.cs: And this test is onger needed.
14989 2003-07-08  Martin Baulig  <martin@ximian.com>
14991         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14992         inaccessible types.  Fixes #36313.
14994         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14996         * namespace.cs (NamespaceEntry): Create implicit entries for all
14997         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14998         implicit entries for N1.N2 and N1.
15000 2003-07-08  Martin Baulig  <martin@ximian.com>
15002         Rewrote the handling of namespaces to fix a lot of the issues
15003         wrt. `using' aliases etc.
15005         * namespace.cs (Namespace): Splitted this class into a
15006         per-assembly `Namespace' and a per-file `NamespaceEntry'.
15008         * typemanager.cs (TypeManager.IsNamespace): Removed.
15009         (TypeManager.ComputeNamespaces): Only compute namespaces from
15010         loaded assemblies here, not the namespaces from the assembly we're
15011         currently compiling.
15013 2003-07-08  Martin Baulig  <martin@ximian.com>
15015         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
15017 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15019         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
15020         already fixed it.  
15022         I thought about the memory savings here, but LookupTypeReflection
15023         is used under already very constrained scenarios.  Compiling
15024         corlib or mcs only exposes one hit, so it would not really reduce
15025         any memory consumption.
15027 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15029         * typemanager.cs: fixes bug #45889 by only adding public types from
15030         other assemblies to the list of known types.
15032 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
15034         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
15035         on the type we resolved.
15037 2003-07-05  Martin Baulig  <martin@ximian.com>
15039         * pending.cs (PendingImplementation.ParentImplements): Don't
15040         create the proxy if the parent is abstract.
15042         * class.cs (TypeContainer.DefineIndexers): Process explicit
15043         interface implementations first.  Fixes #37714.
15045 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
15047         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
15048         defined recursively;  but since we modify the input parameters
15049         (left is set to `this' temporarily), we reset this value if the
15050         left_is_explicit is false, which gives the original semantics to
15051         the code.  
15053         * literal.cs (NullPointer): new class used to represent a null
15054         literal in a pointer context.
15056         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
15057         type is a pointer, use a NullPointer object instead of a
15058         NullLiteral.   Closes 43687
15060         (ExplicitConversion): Convert pointer values using
15061         the conv opcode to the proper type.
15063         * ecore.cs (New): change ValueTypeVariable property into a method,
15064         that returns whether the valuetype is suitable for being used.
15066         * expression.cs (Binary.DoNumericPromotions): Only return if we
15067         the int constant was a valid uint, and we can return both left and
15068         right as uints.  If not, we continue processing, to trigger the
15069         type conversion.  This fixes 39018.
15071         * statement.cs (Block.EmitMeta): During constant resolution, set
15072         the CurrentBlock property on the emitcontext, so that we resolve
15073         constants propertly.
15075 2003-07-02  Martin Baulig  <martin@ximian.com>
15077         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15078         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15080         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15081         than emitting it here.
15083         * statement.cs: Fixed some more flow analysis bugs.
15085 2003-07-02  Martin Baulig  <martin@ximian.com>
15087         * class.cs (MethodData.Define): When implementing interface
15088         methods, set Final unless we're Virtual.
15090         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15091         check work for interface methods.
15093 2003-07-01  Martin Baulig  <martin@ximian.com>
15095         * ecore.cs (EmitContext.This): Replaced this property with a
15096         GetThis() method which takes a Location argument.  This ensures
15097         that we get the correct error location for a CS0188.
15099 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
15101         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15102         ImplicitStandardConversion.
15104         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15106 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
15108         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15109         optimization.
15111 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
15113         * class.cs (Constructor.Define): Turn off initlocals for unsafe
15114         constructors.
15116         (MethodData.Define): Turn off initlocals for unsafe methods.
15118 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
15120         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15121         complete;  Fixes #37521.
15123         * delegate.cs: Use Modifiers.TypeAttr to compute the
15124         TypeAttributes, instead of rolling our own.  This makes the flags
15125         correct for the delegates.
15127 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
15129         * class.cs (Constructor.Define): Set the private flag for static
15130         constructors as well.
15132         * cs-parser.jay (statement_expression): Set the return value to
15133         null, to avoid a crash when we catch an error.
15135 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
15137         * cs-parser.jay: Applied patch from Jackson that adds support for
15138         extern and unsafe modifiers to destructor declarations.
15140         * expression.cs: Report error 21 if the user is trying to index a
15141         System.Array.
15143         * driver.cs: Add an error message, suggested by the bug report.
15145         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15146         if we do not have a ": this ()" constructor initializer.  Fixes 45149
15148 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
15150         * namespace.cs: Add some information to reduce FAQs.
15152 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
15154         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15155         underlying enumeration types.  Fixes #43915.
15157         * expression.cs: Treat ushort/short as legal values to be used in
15158         bitwise operations.
15160 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15162         * delegate.cs: transfer custom attributes for paramenters from
15163         the delegate declaration to Invoke and BeginInvoke.
15165 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15167         * attribute.cs: handle custom marshalers and emit marshal info
15168         for fields, too.
15170 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
15172         * makefile.gnu: Added anonymous.cs to the compiler sources.
15174 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
15176         * iterators.cs: Change the name of the proxy class to include two
15177         underscores.
15179         * cs-parser.jay: Update grammar to include anonymous methods.
15181         * anonymous.cs: new file.
15183 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
15185         * class.cs (Field.Define): Add missing test for pointers and
15186         safety. 
15188 2003-05-27  Ravi Pratap  <ravi@ximian.com>
15190         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15191         we use the stobj opcode.
15193         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15194         since it wasn't the correct fix. 
15196         It still is puzzling that we are required to use stobj for IntPtr
15197         which seems to be a ValueType.
15199 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
15201         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15202         during regular simple name resolution.   Now, the trick is that
15203         instead of returning for processing the simplename, we do a
15204         TypeManager.LookupType (ie, a rooted lookup as opposed to a
15205         contextual lookup type).   If a match is found, return that, if
15206         not, return for further composition.
15208         This fixes long-standing 30485.
15210         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15211         using the address to initialize an object, do an Stobj instead of
15212         using the regular Stelem.
15214         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15215         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15216         Because if we are a BaseIndexerAccess that value will be true.
15217         Fixes 43643.
15219         * statement.cs (GotoCase.Resolve): Return after reporting an
15220         error, do not attempt to continue. 
15222         * expression.cs (PointerArithmetic.Emit): If our operand is a
15223         long, convert our constants to match the operand before
15224         multiplying.  Convert to I type before adding.   Fixes 43670.
15226 2003-05-14  Ravi Pratap  <ravi@ximian.com>
15228         * enum.cs (ImplicitConversionExists) : Rename to
15229         ImplicitEnumConversionExists to remove ambiguity. 
15231         * ecore.cs (NullCast): New type of cast expression class which
15232         basically is very similar to EmptyCast with the difference being
15233         it still is a constant since it is used only to cast a null to
15234         something else
15235         (eg. (string) null)
15237         * convert.cs (ImplicitReferenceConversion): When casting a null
15238         literal, we return a NullCast.
15240         * literal.cs (NullLiteralTyped): Remove - I don't see why this
15241         should be around anymore.
15243         The renaming (reported was slightly wrong). Corrections:
15245         ConvertImplicitStandard -> ImplicitConversionStandard
15246         ConvertExplicitStandard -> ExplicitConversionStandard
15248         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15249         before passing them in !
15251         * convert.cs (ImplicitConversionStandard): When comparing for
15252         equal expr and target types, ensure that expr is not a
15253         NullLiteral.
15255         In general, we must not be checking (expr_type ==
15256         target_type) in the top level conversion methods
15257         (ImplicitConversion, ExplicitConversion etc). This checking is
15258         done in the methods that they delegate to.
15260 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
15262         * convert.cs: Move Error_CannotConvertType,
15263         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15264         ImplicitNumericConversion, ImplicitConversionExists,
15265         ImplicitUserConversionExists, StandardConversionExists,
15266         FindMostEncompassedType, FindMostSpecificSource,
15267         FindMostSpecificTarget, ImplicitUserConversion,
15268         ExplicitUserConversion, GetConversionOperators,
15269         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15270         TryImplicitIntConversion, Error_CannotConvertImplicit,
15271         ConvertImplicitRequired, ConvertNumericExplicit,
15272         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15273         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15274         its own file.
15276         Perform the following renames:
15278         StandardConversionExists -> ImplicitStandardConversionExists
15279         ConvertImplicit -> ImplicitConversion
15280         ConvertImplicitStandard -> ImplicitStandardConversion
15281         TryImplicitIntConversion -> ImplicitIntConversion
15282         ConvertImplicitRequired -> ImplicitConversionRequired
15283         ConvertNumericExplicit -> ExplicitNumericConversion
15284         ConvertReferenceExplicit -> ExplicitReferenceConversion
15285         ConvertExplicit -> ExplicitConversion
15286         ConvertExplicitStandard -> ExplicitStandardConversion
15288 2003-05-19  Martin Baulig  <martin@ximian.com>
15290         * statement.cs (TypeInfo.StructInfo): Made this type protected.
15291         (TypeInfo): Added support for structs having structs as fields.
15293         * ecore.cs (FieldExpr): Implement IVariable.
15294         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15295         VariableInfo for the field.
15297 2003-05-18  Martin Baulig  <martin@ximian.com>
15299         * expression.cs (This.DoResolve): Report a CS0027 if we're
15300         emitting a field initializer.
15302 2003-05-18  Martin Baulig  <martin@ximian.com>
15304         * expression.cs (This.ResolveBase): New public function.
15305         (This.DoResolve): Check for CS0188.
15307         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15308         This.Resolve().
15310         * ecore.cs (MethodGroupExpr.DoResolve): Set the
15311         `instance_expression' to null if we don't have any non-static
15312         methods.
15314 2003-05-18  Martin Baulig  <martin@ximian.com>
15316         Reworked the way how local variables and parameters are handled by
15317         the flow analysis code.
15319         * statement.cs (TypeInfo, VariableMap): New public classes.
15320         (VariableInfo): New public class.  This is now responsible for
15321         checking whether a variable has been assigned.  It is used for
15322         parameters and local variables.
15323         (Block.EmitMeta): Take the InternalParameters as argument; compute
15324         the layout of the flow vectors here.
15325         (Block.LocalMap, Block.ParameterMap): New public properties.
15326         (FlowBranching): The .ctor doesn't get the InternalParameters
15327         anymore since Block.EmitMeta() now computes the layout of the flow
15328         vector.
15329         (MyStructInfo): This class is now known as `StructInfo' and nested
15330         in `TypeInfo'; we don't access this directly anymore.
15332         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15333         property and removed IsAssigned(), IsFieldAssigned(),
15334         SetAssigned() and SetFieldAssigned(); we now call them on the
15335         VariableInfo so we don't need to duplicate this code everywhere.
15337         * expression.cs (ParameterReference): Added `Block block' argument
15338         to the .ctor.
15339         (LocalVariableReference, ParameterReference, This): The new
15340         VariableInfo class is now responsible for all the definite
15341         assignment stuff.
15343         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15344         IsParameterAssigned, SetParameterAssigned): Removed.
15346 2003-05-18  Martin Baulig  <martin@ximian.com>
15348         * typemanager.cs (InitCoreTypes): Try calling
15349         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15350         the 3-args-version.  Corlib now also needs our `void_type'.
15351         (GetMethod): Added overloaded version which takes an optional
15352         `bool report_errors' to allow lookups of optional methods.
15354 2003-05-12  Martin Baulig  <martin@ximian.com>
15356         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15357         only used for locals and not for parameters.
15359 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
15361         * support.cs (InternalParameters.ParameterType): Return the
15362         ExternalType of the parameter.
15364         * parameter.cs (Parameter.ExternalType): drop the two arguments,
15365         they were unused.
15367 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
15369         * class.cs (MethodData.Define): Do not set the `newslot' on
15370         interface members, if they are also flagged as "override".
15372         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15373         better code for ++i and i++.  This only works for static fields
15374         and local variables.
15376         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15377         want to pull the DeclSpace out of the builder_to_declspace instead
15378         of the TypeBuilder (like in TypeContainer.FindMembers).
15380         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15381         instead of LookupTypeContainer.  Fixes the crash on .NET for
15382         looking up interface members.
15384         * const.cs: Create our own emit context during the Definition
15385         stage, so that constants are evaluated in the proper context, when
15386         a recursive definition happens.
15388 2003-05-11  Martin Baulig  <martin@ximian.com>
15390         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15391         new block for a switch section.
15392         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15393         the adding/lookup in the switch block.  Fixes #39828.
15395 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15397         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15398         functionality: I needed to convert the data after I had performed
15399         the add/sub operation into the operands type size.
15401         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15402         pass the type for the box operation, otherwise the resulting
15403         object would have been of type object.
15405         (BoxedCast): Add constructor to specify the type to box as.
15407 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15409         * iterators.cs: I was reusing the `count' variable inadvertently,
15410         take steps to not allow this to happen.
15412 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15414         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15415         by creating an array at the point where the params starts and
15416         putting all those arguments there, then adjusting the size of the
15417         array.
15419 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15421         * expression.cs (New.AddressOf): Implement interface
15422         IMemoryLocation.  This is used when the `new' operator is used in
15423         the context of an invocation to a method on a value type.
15425         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15426         example. 
15428         * namespace.cs: Also check the using aliases here.
15430         * driver.cs: Move the test for using validity after the types have
15431         been entered, so we do a single pass that also includes the using
15432         aliases. 
15434         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15435         in the regular case.   CreateSiblingForFinally is doing extra
15436         error checking.
15438         * attribute.cs (GetAttributeArgumentExpression): Store the result
15439         on an out value, and use the return value to indicate failure
15440         instead of using null (which is a valid return for Constant.GetValue).
15442         * statement.cs: Perform the analysis flow for the increment
15443         portion after the statement, because this will be the real flow of
15444         execution.  Fixes #42385
15446         * codegen.cs (EmitContext.EmitArgument,
15447         EmitContext.EmitStoreArgument): New helper functions when the
15448         RemapToProxy flag is set.
15450         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15451         function.
15453         Add support for remapping parameters. 
15455         * iterators.cs: Propagate parameter values;  Store parameter
15456         values in the proxy classes.
15458 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15460         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15461         need a proxy reference;  I do not know what I was thinking
15463         * cs-parser.jay (constructor_initializer): catch another error,
15464         and display nice message.
15466         (field_declaration): catch void field declaration
15467         to flag a better error. 
15469         * class.cs (MemberBase.CheckBase): Report an error instead of a
15470         warning if a new protected member is declared in a struct. 
15471         (Field.Define): catch the error of readonly/volatile.
15473         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15475         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15476         volatile variable is taken
15478 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15480         * statement.cs (Fixed.Resolve): Report an error if we are not in
15481         an unsafe context.
15483 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15485         * typemanager.cs: reuse the code that handles type clashes for
15486         delegates and enumerations.
15488         * class.cs (Report28): Always report.
15490         * expression.cs (EncodeAsAttribute): Allow nulls here.
15492 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15494         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15495         the functionality for testing whether an expression is valid for
15496         an attribute here.  Also handle the case of arrays of elements
15497         being stored. 
15499         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15500         encoding a linear array into an array of objects that are suitable
15501         to be passed to an CustomAttributeBuilder.
15503         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15505         * ecore.cs: (FieldExpr): Handle field remapping here.
15507         * iteratators.cs: Pass the instance variable (if the method is an
15508         instance method) to the constructors, so we can access the field
15509         variables on the class.
15511         TODO: Test this with structs.  I think the THIS variable on
15512         structs might have to be a pointer, and not a refenrece
15514 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15516         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15517         local variables to fields in a proxy class.
15519         * iterators.cs (PopulateProxy): Rename our internal fields to
15520         <XXX>.  
15521         Create a <THIS> field if we are an instance method, so we can
15522         reference our parent container variables.
15523         (MapVariable): Called back from the EmitContext code to enter a
15524         new variable to field mapping into the proxy class (we just create
15525         a FieldBuilder).
15527         * expression.cs
15528         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15529         for using the remapped locals to fields.
15531         I placed the code here, because that gives the same semantics to
15532         local variables, and only changes the Emit code.
15534         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15535         statements inside iterators.
15536         (VariableInfo): Add a FieldBuilder for the cases when we are
15537         remapping local variables to fields in a proxy class
15539         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15540         current_block != null.
15542         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15543         not cope with strings, as it has been moved to the
15544         TableSwitchEmit.  Fixed bug in switch generation.
15546         * expression.cs (New.DoResolve): Provide more context for the user
15547         when reporting an error.
15549         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15550         pointers. 
15552         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15553         check the permissions for it.  Note than in a type-resolution
15554         context the check was already present in DeclSpace.ResolveType,
15555         but was missing from the MemberAccess.
15557         (ArrayCreation.CheckIndices): warn if the user has
15558         more nested levels of expressions, but there are no more
15559         dimensions specified.  Avoids crash on bug 41906.
15561 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15563         * statement.cs (Block): replace Implicit bool, for a generic
15564         flags.   
15565         New flag: `Unchecked'.  This is used during the EmitMeta phase
15566         (which is out-of-line with the regular Resolve/Emit process for a
15567         statement, as this is done ahead of time, but still gets a chance
15568         to call constant resolve).
15570         (Block.Flags): new enum for adding a new flag.
15572         (Block.EmitMeta): track the state of unchecked.
15574         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15575         to enable constant resolution to work there as well.
15577 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15579         * typemanager.cs (ienumerable_type): Also look up
15580         System.Collections.IEnumerable. 
15582 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15584         TODO: Test more than one conditional per method.
15586         * class.cs (Indexer.Define): Report the location where the user is
15587         referencing the unsupported feature.
15589         (MethodData): Overload the use of `conditionals' to
15590         minimize the creation of needless ArrayLists.   This saves roughly
15591         212kb on my machine.
15593         (Method): Implement the new IIteratorContainer interface.
15594         (Method.SetYields): Implement the method by setting the ModFlags
15595         to contain METHOD_YIELDS.
15597         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15598         which just got set to null.
15600         * iterators.cs: New file.
15602         (Yield, YieldBreak): New statements.
15604         * statement.cs (Return.Resolve): Flag an error if we are used in
15605         an iterator method.
15607         * codegen.cs (InIterator): New flag set if the code is being
15608         compiled in an iterator method.
15610         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15611         internal modifier, and we just use it to avoid adding extra
15612         fields, as this is seldom used.  
15614         * cs-parser.jay: Add yield_statement (yield and yield break).
15616         * driver.cs: New flag -v2 to turn on version 2 features. 
15618         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15619         hashtable when v2 is enabled.
15621 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15623         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15624         there is already a namespace defined with this name.
15626         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15627         people upgraded their corlibs.
15629         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15630         always use fully qualified types, no need to use the compiler
15631         front end.
15633         (TypeManager.IsNamespace): Use binarysearch.
15635         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15636         AddDelegate): I did not quite use the new IsValid API properly: I
15637         have to pass the short-name and the fullname.  I was passing only
15638         the basename instead of the fullname sometimes. 
15640         (TypeContainer.DefineType): call NamespaceClash.
15642         * interface.cs (Interface.DefineType): use NamespaceClash before
15643         defining the type.
15645         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15646         defining the type.
15648         * enum.cs: (Enum.DefineType): use NamespaceClash before
15649         defining the type.
15651         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15652         speed increase.  First, use the negative_hits cache when we get a
15653         negative.  Second, add the type with its full original name
15654         instead of the new . and + encoded name (reflection uses + to
15655         separate type from a nested type).  Use LookupTypeReflection
15656         directly which bypasses the type->name hashtable (that we already
15657         know does not contain the type.
15659         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15660         location/container type. 
15662         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15664 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15666         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15668         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15669         method is being referenced in the method group from a static
15670         context, and report error 120 if so.
15672         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15673         Error118. 
15675         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15676         is created, we create the A namespace).
15678         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15679         Fixes #41591
15681 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15683         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15684         invocation to ModuleBuilder.GetType with the same values will
15685         return a new type instance, so we need to cache its return
15686         values. 
15688         * expression.cs (Binary.ResolveOperator): Only allow the compare
15689         operators on enums if they are of the same type.
15691         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15692         types of ValueType on their own case.  Before we were giving them
15693         the same treatment as objects.
15695         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15696         fullname.  Short name is used to compare against container name.
15697         Fullname is used to check against defined namespace names.
15699         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15700         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15702         (Method.CheckBase): Call parent.
15703         (MemberBase.CheckBase): Check for protected members on sealed
15704         classes.
15705         (PropertyBase.CheckBase): Call parent.
15706         (Field.Define): Call parent.
15708         * report.cs: Negative error codes are now mapped to 8000 - code,
15709         so that the display is render more nicely.
15711         * typemanager.cs: Do not use try/catch, instead report a regular
15712         error. 
15714         (GetPointerType, GetReferenceType): These methods provide
15715         mechanisms to obtain the T* and T& from a T.  We had the code
15716         previously scattered around the code base, and it also used
15717         TypeManager.LookupType that would go through plenty of caches.
15718         This one goes directly to the type source.
15720         In some places we did the Type.GetType followed by
15721         ModuleBuilder.GetType, but not in others, so this unifies the
15722         processing as well.
15724         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15725         statements now that we have namespace information.
15727         * typemanager.cs (IsNamespace): New method, returns whether the
15728         string presented is a namespace or not.
15730         (ComputeNamespaces): New public entry point, computes the list of
15731         available namespaces, using the GetNamespaces API call in Mono, or
15732         the slower version in MS.NET.   
15734         Now before we start the semantic analysis phase, we have a
15735         complete list of namespaces including everything that the user has
15736         provided.
15738         Deleted old code to cache namespaces in .nsc files.
15740 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15742         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15743         class/struct location definition Location for the implicit
15744         constructor location.
15746         (Operator.Define): Use the location of the operator for the
15747         implicit Method definition.
15749         (Constructor.Emit): use the constructor location for the implicit
15750         base initializer constructor.
15752         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15753         and the Expression class now contains two new methods:
15755         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15756         isolate type lookup from the rest of the resolution process.
15758         Since we use Expressions to hold type definitions due to the way
15759         we parse the input we have historically overloaded Resolve to
15760         perform the Type lookups if a special flag is passed.  Now this is
15761         eliminated and two methods take their place. 
15763         The differences in the two methods between xStep and xTerminal is
15764         that xStep is involved in our current lookup system that uses
15765         SimpleNames to compose a name, while xTerminal is used just to
15766         catch the case where the simplename lookup failed.
15768 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15770         * expression.cs (ResolveMemberAccess): Remove redundant code.
15771         TypeExpr expressions are always born fully resolved.
15773         * interface.cs (PopulateMethod): Do not lookup the types twice.
15774         We were doing it once during SemanticAnalysis and once during
15775         PopulateMethod.
15777         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15778         in local variable type definitions, were being returned as a
15779         SimpleName (we decomposed everything into a string), that is
15780         because primary_expression was being used instead of a type in the
15781         grammar (reduce/reduce conflicts).
15783         The part that was wrong is that we converted the expression into a
15784         string (an oversimplification in one hand, compounded with primary
15785         expressions doing string concatenation).
15787         So things like:
15789         A.B.C [] x;
15791         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15792         using clauses from working on this particular context.  And a type
15793         was being matched directly against "A.B.C[]".
15795         We now use the correct approach, and allow for ComposedCast to be
15796         part of the unary expression.  So the "A.B.C []" become a composed
15797         cast of "A.B.C" (as a nested group of MemberAccess with a
15798         SimpleName at the end) plus the rank composition "[]". 
15800         Also fixes 35567
15802 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15804         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15805         for the access level checking.
15807         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15808         `TypeContainer container', because I kept getting confused when I
15809         was debugging this code.
15811         * expression.cs (Indexers): Instead of tracking getters/setters,
15812         we now track them in parallel.  We create one arraylist less, but
15813         most importantly it is possible now for the LValue code to find a
15814         matching get for a set.
15816         (IndexerAccess.DoResolveLValue): Update the code.
15817         GetIndexersForType has been modified already to extract all the
15818         indexers from a type.  The code assumed it did not.
15820         Also make the code set the correct return type for the indexer.
15821         This was fixed a long time ago for properties, but was missing for
15822         indexers.  It used to be void_type.
15824         (Binary.Emit): Test first for doubles instead of
15825         floats, as they are more common.
15827         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15828         when dealing with floats and the <=, >= operators.  This fixes bug
15829         #39314 
15831         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15832         to load the array value by emitting a load on the foreach variable
15833         type.  This was incorrect.  
15835         We now emit the code to load an element using the the array
15836         variable type, and then we emit the conversion operator.
15838         Fixed #40176
15840 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15842         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15844 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15846         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15847         test for protection before we test for signatures. 
15849         (MethodSignature.ToString): implement.
15851         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15852         to the case where we reduced into a LongConstant.
15854         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15855         depend on whether the information is acurrate, because the
15856         Microsoft runtime will always claim that the array type is public,
15857         regardless of the real state.
15859         If the type is a pointer, another problem happens: the type is
15860         reported as non-public in Microsoft.  
15862         In both cases we have to call CheckAccessLevel recursively with
15863         the underlying type as the argument to be tested.
15865 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15867         * assign.cs (Assign.Emit): If we are dealing with a compound
15868         assignment expression, we should use the code path that stores the
15869         intermediate result in a temporary value.  This fixes #40903.
15871         *expression.cs (Indirection.ToString): Provide ToString method for
15872         debugging. 
15874 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15876         * class.cs: Null out fields holding references to Block objects so
15877         they can be garbage collected.
15879         * expression.cs (OverloadResolve): Remove unused local.
15881 2003-04-07  Martin Baulig  <martin@ximian.com>
15883         * codegen.cs (EmitContext.CurrentFile): New public field.
15884         (EmitContext.Mark): Use the CurrentFile to check whether the
15885         location is in the correct file.
15886         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15888 2003-04-07  Martin Baulig  <martin@ximian.com>
15890         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15892         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15893         location.  [FIXME: The location argument which gets passed to this
15894         method is sometimes wrong!]
15896 2003-04-07  Nick Drochak <ndrochak@gol.com>
15898         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15900 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15902         * expression.cs (Indirection.EmitAssign): We were using the
15903         temporary, but returning immediately instead of continuing the
15904         EmitAssing flow.
15906 2003-04-06  Martin Baulig  <martin@ximian.com>
15908         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15909         if it's a nested child, but also deriving from the outer class.
15910         See test 190.cs.
15912         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15913         nested child, but also deriving from the outer class.  See
15914         test-190.cs.
15915         (FilterWithClosure): We may access private members of the outer
15916         class if we're a nested child and deriving from the outer class.
15917         (RealMemberLookup): Only set `closure_private_ok' if the
15918         `original_bf' contained BindingFlags.NonPublic.
15920 2003-04-05  Martin Baulig  <martin@ximian.com>
15922         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15923         probe if its a type parameter, and if so, flag an error.
15925         * decl.cs: Move here the SetParameterInfo code from class.cs.
15926         Handle IsGeneric here.
15928         Handle a variety of errors in the parameter info definition.
15930         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15931         type parameters here.
15933         * cs-parser.jay (class_declaration): report errors for parameters
15934         here as well.
15936 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
15938         * generic.cs: New file, contains support code for generics.
15940         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15941         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15943         Update parser for the above removals.
15945         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
15946         now taken care of in the parser.
15948 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15950         * class.cs (Event.Define): Do not allow abstract events to have
15951         initializers. 
15953 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15955         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15956         block in event declarations.
15958         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15959         value type, get its address.
15961         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15962         leaving a class on the stack instead of a boolean value (int
15963         0/1).  Change the code so we compare against null, and then the
15964         result against zero.
15966         * class.cs (TypeContainer.GetClassBases): We were checking for the
15967         parent class being sealed too late.
15969         * expression.cs (Binary.Emit): For <= and >= when dealing with
15970         floating point values, use cgt.un and clt.un instead of cgt and
15971         clt alone.
15973 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15975         * statement.cs: Apply the same optimization as MS: skip the 
15976         GetEnumerator returning an IEnumerator, and use the one returning a 
15977         CharEnumerator instead. This allows us to avoid the try-finally block 
15978         and the boxing.
15980 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15982         * cs-parser.jay: Attributes cannot be applied to
15983                          namespaces. Fixes #40473
15985 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15987         * class.cs:
15988         (Add*): check if the name is valid using the full name for constants,
15989         fields, properties and events.
15991 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15993         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15994         char constants to be part of the enumeration.
15996         * expression.cs (Conditional.DoResolve): Add support for operator
15997         true. Implements the missing functionality from 14.12
15999         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
16000         operator true/false as required by the spec.
16002         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
16003         implicit conversion to boolean.
16005         * statement.cs (Statement.ResolveBoolean): A boolean expression is
16006         also one where the type implements `operator true'. 
16008         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
16009         get an expression that will invoke operator true based on an
16010         expression.  
16012         (GetConversionOperators): Removed the hack that called op_True
16013         here.  
16015         (Expression.ResolveBoolean): Move this from Statement.
16017 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
16019         * ecore.cs (FieldExpr): do not allow initialization of initonly
16020         fields on derived classes
16022 2003-03-13  Martin Baulig  <martin@ximian.com>
16024         * statement.cs (Block.Emit): Call ig.BeginScope() and
16025         ig.EndScope() when compiling with debugging info; call
16026         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
16028 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
16030         * expression.cs (Indexers): Do not construct immediately, allow
16031         for new members to be appended as we go.  Fixes 38143
16033 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16035         * expression.cs: save/restore context when resolving an unchecked
16036         expression.
16038 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
16040         * cfold.cs: Catch division by zero in modulus operator during
16041         constant folding.
16043 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
16045         * interface.cs (Interface.DefineMembers): Avoid defining members
16046         twice. 
16048 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
16050         * driver.cs: handle the +/- options for -noconfig
16052         * statement.cs (Unckeched.Resolve): Also track the state of
16053         unchecked in the Resolve phase.
16055 2003-02-27  Martin Baulig  <martin@ximian.com>
16057         * ecore.cs (Expression.MemberLookup): Don't create a
16058         MethodGroupExpr for something which is not a method.  Fixes #38291.
16060 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
16062         * class.cs (MemberBase.CheckParameters): Also check that the type
16063         is unmanaged if it is a pointer.
16065         * expression.cs (SizeOf.Resolve): Add location information.
16067         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16068         a managed type is declared.
16070         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16071         parameter modifiers as well.  Fixes bug 38606
16073         * class.cs: Very sad.  Am backing out the speed up changes
16074         introduced by the ArrayList -> Array in the TypeContainer, as they
16075         were not actually that much faster, and introduced a bug (no error
16076         reports on duplicated methods).
16078         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16079         source first, this will guarantee that we have a valid expression
16080         before calling in lower levels functions that will require a
16081         resolved object.  Then use this original_source in the
16082         target.ResolveLValue instead of the original source that was
16083         passed to us.
16085         Another change.  Use target.Resolve instead of LValueResolve.
16086         Although we are resolving for LValues, we will let the Assign code
16087         take care of that (it will be called again from Resolve).  This
16088         basically allows code like this:
16090         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16091         class Y { void A (X x) { x [0] += o; }
16093         The problem was that the indexer was trying to resolve for
16094         set_Item (idx, object o) and never finding one.  The real set_Item
16095         was set_Item (idx, X).  By delaying the process we get the right
16096         semantics. 
16098         Fixes bug 36505
16100 2003-02-23  Martin Baulig  <martin@ximian.com>
16102         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16103         while calling DoEmit ().
16105         * codegen.cs (EmitContext.Mark): Don't mark locations in other
16106         source files; if you use the #line directive inside a method, the
16107         compiler stops emitting line numbers for the debugger until it
16108         reaches the end of the method or another #line directive which
16109         restores the original file.
16111 2003-02-23  Martin Baulig  <martin@ximian.com>
16113         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16115 2003-02-23  Martin Baulig  <martin@ximian.com>
16117         * statement.cs (Block.AddChildVariableNames): We need to call this
16118         recursively, not just for our immediate children.
16120 2003-02-23  Martin Baulig  <martin@ximian.com>
16122         * class.cs (Event.Define): Always make the field private, like csc does.
16124         * typemanager.cs (TypeManager.RealMemberLookup): Make events
16125         actually work, fixes bug #37521.
16127 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
16129         * delegate.cs: When creating the various temporary "Parameters"
16130         classes, make sure that we call the ComputeAndDefineParameterTypes
16131         on those new parameters (just like we do with the formal ones), to
16132         allow them to be resolved in the context of the DeclSpace.
16134         This fixes the bug that Dick observed in Bugzilla #38530.
16136 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
16138         * expression.cs (ResolveMemberAccess): When resolving a constant,
16139         do not attempt to pull a constant if the value was not able to
16140         generate a valid constant.
16142         * const.cs (LookupConstantValue): Do not report more errors than required.
16144 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16146         * expression.cs: fixes bug #38328.
16148 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16150         * class.cs: Changed all the various members that can be part of a
16151         class from being an ArrayList to be an Array of the right type.
16152         During the DefineType type_list, interface_list, delegate_list and
16153         enum_list are turned into types, interfaces, delegates and enums
16154         arrays.  
16156         And during the member population, indexer_list, event_list,
16157         constant_list, field_list, instance_constructor_list, method_list,
16158         operator_list and property_list are turned into their real arrays.
16160         Although we could probably perform this operation earlier, for
16161         good error reporting we need to keep the lists and remove the
16162         lists for longer than required.
16164         This optimization was triggered by Paolo profiling the compiler
16165         speed on the output of `gen-sample-program.pl' perl script. 
16167         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16168         not crash in methods like MemberLookupFailed that use this field.  
16170         This problem arises when the compiler fails to resolve a type
16171         during interface type definition for example.
16173 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
16175         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16176         inherit from System.Object, so we have to stop at null, not only
16177         when reaching System.Object.
16179 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
16181         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16182         DeclaredOnly because the parent indexer might have had a different
16183         name, but did not loop until the top of the hierarchy was reached.
16185         The problem this one fixes is 35492: when a class implemented an
16186         indexer from an interface, we were getting the interface method
16187         (which was abstract) and we were flagging an error (can not invoke
16188         abstract method).
16190         This also keeps bug 33089 functioning, and test-148 functioning.
16192         * typemanager.cs (IsSpecialMethod): The correct way of figuring
16193         out if a method is special is to see if it is declared in a
16194         property or event, or whether it is one of the predefined operator
16195         names.   This should fix correctly #36804.
16197 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
16199         The goal here is to remove the dependency on EmptyCast.Peel ().
16200         Killing it completely.
16202         The problem is that currently in a number of places where
16203         constants are expected, we have to "probe" for an EmptyCast, and
16204         Peel, which is not the correct thing to do, as this will be
16205         repetitive and will likely lead to errors. 
16207         The idea is to remove any EmptyCasts that are used in casts that
16208         can be reduced to constants, so we only have to cope with
16209         constants. 
16211         This bug hunt was triggered by Bug 37363 and the desire to remove
16212         the duplicate pattern where we were "peeling" emptycasts to check
16213         whether they were constants.  Now constants will always be
16214         constants.
16216         * ecore.cs: Use an enumconstant here instead of wrapping with
16217         EmptyCast.  
16219         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16220         throwing me off.  By handling this we can get rid of a few hacks.
16222         * statement.cs (Switch): Removed Peel() code.
16224 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
16226         * class.cs: Location information for error 508
16228         * expression.cs (New.DoResolve): Add a guard against double
16229         resolution of an expression.  
16231         The New DoResolve might be called twice when initializing field
16232         expressions (see EmitFieldInitializers, the call to
16233         GetInitializerExpression will perform a resolve on the expression,
16234         and later the assign will trigger another resolution
16236         This leads to bugs (#37014)
16238         * delegate.cs: The signature for EndInvoke should contain any ref
16239         or out parameters as well.  We were not doing this in the past. 
16241         * class.cs (Field.Define): Do not overwrite the type definition
16242         inside the `volatile' group.  Turns out that volatile enumerations
16243         were changing the type here to perform a validity test, which
16244         broke conversions. 
16246 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
16248         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16249         and structs, we do not want to load the instance variable
16251         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16252         enum_type has to be handled like an object reference (implicit
16253         conversions exists from this to object), but the regular IsClass
16254         and IsValueType tests will never return true for this one.
16256         Also we use TypeManager.IsValueType instead of type.IsValueType,
16257         just for consistency with the rest of the code (this is only
16258         needed if we ever use the construct exposed by test-180.cs inside
16259         corlib, which we dont today).
16261 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
16263         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16264         just InternalCall.
16266 2003-02-09  Martin Baulig  <martin@ximian.com>
16268         * namespace.cs (Namespace..ctor): Added SourceFile argument.
16269         (Namespace.DefineNamespaces): New static public method; this is
16270         called when we're compiling with debugging to add all namespaces
16271         to the symbol file.
16273         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16274         pass it to the Namespace's .ctor.
16276         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16277         and MethodBase arguments; pass the namespace ID to the symwriter;
16278         pass the MethodBase instead of the token to the symwriter.
16279         (SymbolWriter.DefineNamespace): New method to add a namespace to
16280         the symbol file.
16282 2003-02-09  Martin Baulig  <martin@ximian.com>
16284         * symbolwriter.cs: New file.  This is a wrapper around
16285         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
16286         methods here in near future.
16288 2003-02-09  Martin Baulig  <martin@ximian.com>
16290         * codegen.cs (EmitContext.Mark): Just pass the arguments to
16291         ILGenerator.MarkSequencePoint() which are actually used by the
16292         symbol writer.
16294 2003-02-09  Martin Baulig  <martin@ximian.com>
16296         * location.cs (SourceFile): New public sealed class.  This
16297         contains the name and an index which is used in the location's token.
16298         (Location): Reserve an appropriate number of bits in the token for
16299         the source file instead of walking over that list, this gives us a
16300         really huge performance improvement when compiling with debugging.
16302         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16303         `SourceFile' argument instead of a string.
16304         (Driver.ProcessFile): Add all the files via Location.AddFile(),
16305         but don't parse/tokenize here, we need to generate the list of all
16306         source files before we do that.
16307         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
16308         the files.
16310         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16311         instead of a string.
16313         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16314         of a string.
16316 2003-02-09  Martin Baulig  <martin@ximian.com>
16318         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16319         filename on `#line default'.
16321 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16323         * statement.cs: don't clear the pinned var when the fixed statement
16324         returns from the method (fixes bug#37752).
16326 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16328         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
16329         to IsValueType.
16331 2003-02-07  Martin Baulig  <martin@ximian.com>
16333         * driver.cs: Removed the `--debug-args' command line argument.
16335         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16336         automatically by the AsssemblyBuilder.
16337         (CodeGen.InitializeSymbolWriter): We don't need to call any
16338         initialization function on the symbol writer anymore.  This method
16339         doesn't take any arguments.
16341 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
16343         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16344         from referenced assemblies as well.
16346 2003-02-02  Martin Baulig  <martin@ximian.com>
16348         * class.cs (MethodData.Emit): Generate debugging info for external methods.
16350 2003-02-02  Martin Baulig  <martin@ximian.com>
16352         * class.cs (Constructor.Emit): Open the symbol writer before
16353         emitting the constructor initializer.
16354         (ConstructorInitializer.Emit): Call ec.Mark() to allow
16355         single-stepping through constructor initializers.
16357 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
16359         * class.cs: Handle error 549: do not allow virtual methods in
16360         sealed classes. 
16362 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16364         * decl.cs: Check access levels when resolving types
16366 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16368         * statement.cs: Add parameters and locals set in catch blocks that might 
16369         return to set vector
16371 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
16373         * class.cs (Operator): Set the SpecialName flags for operators.
16375         * expression.cs (Invocation.DoResolve): Only block calls to
16376         accessors and operators on SpecialName methods.
16378         (Cast.TryReduce): Handle conversions from char constants.
16381 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16383         * statement.cs: small memory and time optimization in FlowBranching.
16385 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
16387         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16388         problem that the last fix but in the other sid (Set).
16390         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16391         access when there is no indexer in the hierarchy.
16393 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16395         * class.cs: Combine some if statements.
16397 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16399         * driver.cs: fixed bug #37187.
16401 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
16403         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16404         any indexer, it's needed to build a list with all the indexers in the
16405         hierarchy (AllGetters), else we have problems. Fixes #35653.
16407 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16409         * class.cs (MethodData.Define): It is wrong for an interface
16410         implementation to be static in both cases: explicit and implicit.
16411         We were only handling this in one case.
16413         Improve the if situation there to not have negations.
16415         * class.cs (Field.Define): Turns out that we do not need to check
16416         the unsafe bit on field definition, only on usage.  Remove the test.
16418 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16420         * driver.cs: use assembly.Location instead of Codebase (the latest
16421         patch made mcs fail when using MS assemblies).
16423 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16425         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16426         get the path to *corlib.dll.
16428 2003-01-21  Nick Drochak <ndrochak@gol.com>
16430         * cs-tokenizer.cs:
16431         * pending.cs:
16432         * typemanager.cs: Remove compiler warnings
16434 2003-01-20  Duncan Mak  <duncan@ximian.com>
16436         * AssemblyInfo.cs: Bump the version number to 0.19.
16438 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16440         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16442 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16444         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16446 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16448         * cs-parser.jay: Small fix: we were not comparing the constructor
16449         name correctly.   Thanks to Zoltan for the initial pointer.
16451 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16453         * cs-tokenizer.cs: Set file name when specified with #line
16455 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16457         * cs-parser.jay: Only perform the constructor checks here if we
16458         are named like the class;  This will help provider a better
16459         error.  The constructor path is taken when a type definition is
16460         not found, but most likely the user forgot to add the type, so
16461         report that rather than the constructor error.
16463 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16465         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16466         allocations.
16468 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16470         * cs-parser.jay: Add cleanup call.
16472 2003-01-13  Duncan Mak  <duncan@ximian.com>
16474         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16475         consistent with other methods.
16477 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16479         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16481 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16483         * attribute.cs: only set GuidAttr to true when we have a
16484         GuidAttribute.
16486 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16488         * ecore.cs:
16489         * expression.cs:
16490         * typemanager.cs: fixes to allow mcs compile corlib with the new
16491         Type.IsSubclassOf fix.
16493 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16495         * expression.cs (LocalVariableReference.DoResolve): Classify a
16496         constant as a value, not as a variable.   Also, set the type for
16497         the variable.
16499         * cs-parser.jay (fixed_statement): take a type instead of a
16500         pointer_type, so we can produce a better error message later.
16502         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16503         as an error.  
16505         (For.DoEmit): Make inifinite loops have a
16506         non-conditional branch back.
16508         (Fixed.DoEmit): First populate the pinned variables, then emit the
16509         statement, then clear the variables.  Before I was emitting the
16510         code once for each fixed piece.
16513 2003-01-08  Martin Baulig  <martin@ximian.com>
16515         * statement.cs (FlowBranching.MergeChild): A break in a
16516         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16518 2003-01-08  Martin Baulig  <martin@ximian.com>
16520         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16521         lives in the same number space than `param_map'.  Fixes #36154.
16523 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16525         * cs-parser.jay (constructor_declaration): Set the
16526         Constructor.ModFlags before probing for it.  This makes the
16527         compiler report 514, 515 and 132 (the code was there, but got
16528         broken). 
16530         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16531         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16532         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16534 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16536         * enum.cs: create the enum static fields using the enum type.
16538 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16540         * class.cs: don't try to create the ParamBuilder for the return
16541         type if it's not needed (and handle it breaking for the ms runtime
16542         anyway).
16544 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16546         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16548 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16550         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16551         the command.   This showed up while compiling the JANET source
16552         code, which used \r as its only newline separator.
16554 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16556         * class.cs (Method.Define): If we are an operator (because it
16557         reuses our code), then set the SpecialName and HideBySig.  #36128
16559 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16561         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16562         exception, report error 120 `object reference required'.
16564         * driver.cs: Add --pause option, used during to measure the size
16565         of the process as it goes with --timestamp.
16567         * expression.cs (Invocation.DoResolve): Do not allow methods with
16568         SpecialName to be invoked.
16570 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16572         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16573         number before adding it.
16575 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16577         * ecore.cs (StandardImplicitConversion): When in an unsafe
16578         context, we allow conversion between void * to any other pointer
16579         type. This fixes bug #35973.
16581 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16583         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16584         is not thrown when extensionless outputs are used 
16586 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16588         * rootcontext.cs: fixed compilation of corlib.
16590 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16592         * attribute.cs (Attributes.Contains): Add new method.
16594         * class.cs (MethodCore.LabelParameters): if the parameter is an
16595         `out' parameter, check that no attribute `[In]' has been passed.
16597         * enum.cs: Handle the `value__' name in an enumeration.
16599 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16601         * decl.cs: Added special case to allow overrides on "protected
16602         internal" methods
16604 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16606         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16607         since it makes much more sense.
16609         (Attributes.ctor): Don't require a Location parameter.
16611         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16613         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16614         since we already have that information per attribute.
16616         * everywhere : make appropriate changes.
16618         * class.cs (LabelParameters): Write the code which actually
16619         applies attributes to the return type. We can't do this on the MS
16620         .NET runtime so we flag a warning in the case an exception is
16621         thrown.
16623 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16625         * const.cs: Handle implicit null conversions here too.
16627 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16629         * class.cs (MethodCore.LabelParameters): Remove the extra
16630         Type [] parameter since it is completely unnecessary. Instead
16631         pass in the method's attributes so that we can extract
16632         the "return" attribute.
16634 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16636         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16637         of ignoring it and letting the compile continue.
16639         * typemanager.cs (ChangeType): use an extra argument to return an
16640         error condition instead of throwing an exception.
16642 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16644         * expression.cs (Unary.TryReduce): mimic the code for the regular
16645         code path.  Perform an implicit cast in the cases where we can
16646         implicitly convert to one of the integral types, and then reduce
16647         based on that constant.   This fixes bug #35483.
16649 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16651         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16653 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16655         * namespace.cs: fixed bug #35489.
16657 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16659         * class.cs: Remove some dead code.
16661         * cs-parser.jay: Estimate the number of methods needed
16662         (RootContext.MethodCount);
16664         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16665         numbers instead of StringBuilders.
16667         * support.cs (PtrHashtable): Add constructor with initial size;
16668         We can now reduce reallocations of the method table.
16670 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16672         * attribute.cs (ApplyAttributes): Keep track of the emitted
16673         attributes on a per-target basis. This fixes bug #35413.
16675 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16677         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16678         default to the Windows 1252 encoding.
16680         (UnixParseOption): Support version, thanks to Alp for the missing
16681         pointer. 
16683         * AssemblyInfo.cs: Add nice assembly information.
16685         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16686         (bug 35169).
16688         * cs-parser.jay: Allow a trailing comma before the close bracked
16689         in the attribute_section production.
16691         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16692         address of the instance was being taken, I will take this out,
16693         because we take the address of the object immediately here.
16695 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16697         * typemanager.cs (AreMultipleAllowed): Take care of the most
16698         obvious case where attribute type is not in the current assembly -
16699         stupid me ;-)
16701 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16703         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16704         definitions, instead of doing that afterwards.  
16706         Also we use a nice little hack, depending on the constructor, we
16707         know if we are a "composed" name or a simple name.  Hence, we
16708         avoid the IndexOf test, and we avoid 
16710         * codegen.cs: Add code to assist in a bug reporter to track down
16711         the source of a compiler crash. 
16713 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16715         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16716         types have been emitted for a given element and flag an error
16717         if something which does not have AllowMultiple set is used more
16718         than once.
16720         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16721         attribute types and their corresponding AllowMultiple properties
16723         (AreMultipleAllowed): Check the property for a given type.
16725         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16726         property in the case we have a TypeContainer.
16728         (Attributes.AddAttribute): Detect duplicates and just skip on
16729         adding them. This trivial fix catches a pretty gross error in our
16730         attribute emission - global attributes were being emitted twice!
16732         Bugzilla bug #33187 is now fixed.
16734 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16736         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16737         instead of pp_and).
16739         * expression.cs (Binary.ResolveOperator): I can only use the
16740         Concat (string, string, string) and Concat (string, string,
16741         string, string) if the child is actually a concatenation of
16742         strings. 
16744 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16746         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16747         context where we need a 2-character lookahead.
16749         * pending.cs (PendingImplementation): Rework so we can keep track
16750         of interface types all the time, and flag those which were
16751         implemented by parents as optional.
16753 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16755         * expression.cs (Binary.ResolveOperator): Use
16756         String.Concat(string,string,string) or
16757         String.Concat(string,string,string,string) when possible. 
16759         * typemanager: More helper methods.
16762 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16764         * pending.cs: remove the bogus return from GetMissingInterfaces()
16765         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16767 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16769         * namespace.cs: avoid duplicated 'using xxx' being added to
16770         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16771         when we get more than one 'using' statement for the same namespace.
16772         Report a CS0105 warning for it.
16774 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16776         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16777         of calling getChar/putback, uses internal knowledge of it.    
16779         (xtoken): Reorder tokenizer so most common patterns are checked
16780         first.  This reduces the compilation time in another 5% (from 8.11s
16781         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16783         The parsing time is 22% of the compilation in mcs, and from that
16784         64% is spent on the tokenization process.  
16786         I tried using a binary search for keywords, but this is slower
16787         than the hashtable.  Another option would be to do a couple of
16788         things:
16790                 * Not use a StringBuilder, instead use an array of chars,
16791                   with a set value.  Notice that this way we could catch
16792                   the 645 error without having to do it *afterwards*.
16794                 * We could write a hand-parser to avoid the hashtable
16795                   compares altogether.
16797         The identifier consumption process takes 37% of the tokenization
16798         time.  Another 15% is spent on is_number.  56% of the time spent
16799         on is_number is spent on Int64.Parse:
16801                 * We could probably choose based on the string length to
16802                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16803                   computations. 
16805         Another 3% is spend on wrapping `xtoken' in the `token' function.
16807         Handle 0xa0 as whitespace (#34752)
16809 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16811         * typemanager.cs (IsCLRType): New routine to tell whether a type
16812         is one of the builtin types.  
16814         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16815         typecode in more places instead of doing pointer comparissions.
16816         We could leverage some knowledge about the way the typecodes are
16817         laid out.
16819         New code to cache namespaces in assemblies, it is currently not
16820         invoked, to be used soon.
16822         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16824         * expression.cs (Binary.ResolveOperator): specially handle
16825         strings, and do not perform user-defined operator overloading for
16826         built-in types.
16828 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16830         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16831         internalcall as it is a pretty simple operation;  Avoid whenever
16832         possible to call Char.IsLetter.
16834         (consume_identifier): Cut by half the number of
16835         hashtable calls by merging the is_keyword and GetKeyword behavior.
16837         Do not short-circuit, because if we do, we
16838         report errors (ie, #if false && true would produce an invalid
16839         directive error);
16842 2002-11-24  Martin Baulig  <martin@ximian.com>
16844         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16845         check constant ranges and report a CS0221.  Fixes #33186.
16847 2002-11-24  Martin Baulig  <martin@ximian.com>
16849         * cs-parser.jay: Make this work for uninitialized variable
16850         declarations in the `for' initializer.  Fixes #32416.
16852 2002-11-24  Martin Baulig  <martin@ximian.com>
16854         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16855         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16857 2002-11-24  Martin Baulig  <martin@ximian.com>
16859         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16860         argument; if true, we also check for user-defined conversions.
16861         This is only needed if both arguments are of a user-defined type.
16862         Fixes #30443, added test-175.cs.
16863         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16865         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16867 2002-11-24  Martin Baulig  <martin@ximian.com>
16869         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16870         function to get the store opcode.
16871         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16872         only emit the Ldelema if the store opcode is Stobj.  You must run
16873         both test-34 and test-167 to test this.  Fixes #34529.
16875 2002-11-23  Martin Baulig  <martin@ximian.com>
16877         * ecore.cs (Expression.MemberLookup): Added additional
16878         `qualifier_type' argument which is used when we're being called
16879         from MemberAccess.DoResolve() and null if we're called from a
16880         SimpleName lookup.
16881         (Expression.MemberLookupFailed): New method to report errors; this
16882         does the CS1540 check and reports the correct error message.
16884         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16885         argument for the CS1540 check and redone the way how we're dealing
16886         with private members.  See the comment in the source code for details.
16887         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16888         `closure_start_type' to `closure_qualifier_type' and check whether
16889         it's not null.  It was not this filter being broken, it was just
16890         being called with the wrong arguments.
16892         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16893         and pass it the correct `qualifier_type'; this also does the error
16894         handling for us.
16896 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16898         * expression.cs (Invocation.EmitParams): If the we are dealing
16899         with a non-built-in value type, load its address as well.
16901         (ArrayCreation): Use a a pretty constant instead
16902         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16903         static initializers.  
16905         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16906         because they are not really value types, just glorified integers. 
16908         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16910         * ecore.cs: Remove redundant code for enumerations, make them use
16911         the same code path as everything else, fixes the casting issue
16912         with enumerations in Windows.Forms.
16914         * attribute.cs: Do only cast to string if it is a string, the
16915         validation happens later.
16917         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16918         people upgrade their corlibs.
16920         * ecore.cs: Oops, enumerations were not following the entire code path
16922 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16924         * typemanager.cs (FilterWithClosure): Commented out the test for
16925         1540 in typemanager.cs, as it has problems when accessing
16926         protected methods from a parent class (see test-174.cs). 
16928         * attribute.cs (Attribute.ValidateGuid): new method.
16929         (Attribute.Resolve): Use above.
16931 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16933         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16935         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16936         handling for enumerations, as we only needed the TypeContainer
16937         functionality to begin with (this is required for the fix below to
16938         work for enums that reference constants in a container class for
16939         example). 
16941         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16943         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16944         a valid TypeBuilder to perform lookups on.o
16946         * class.cs (InheritableMemberSignatureCompare): Use true in the
16947         call to GetGetMethod and GetSetMethod, because we are comparing
16948         the signature, and we need to get the methods *even* if they are
16949         private. 
16951         (PropertyBase.CheckBase): ditto.
16953         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16954         GotoCase.Resolve): Use Peel on EmpytCasts.
16956         * ecore.cs (EmptyCast): drop child, add Peel method.
16958 2002-11-17  Martin Baulig  <martin@ximian.com>
16960         * ecore.cs (EmptyCast.Child): New public property.
16962         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16963         label resolved to an EmptyCast.  Fixes #34162.
16964         (GotoCase.Resolve): Likewise.
16965         (Block.EmitMeta): Likewise.
16967 2002-11-17  Martin Baulig  <martin@ximian.com>
16969         * expression.cs (Invocation.BetterConversion): Prefer int over
16970         uint; short over ushort; long over ulong for integer literals.
16971         Use ImplicitConversionExists instead of StandardConversionExists
16972         since we also need to check for user-defined implicit conversions.
16973         Fixes #34165.  Added test-173.cs.
16975 2002-11-16  Martin Baulig  <martin@ximian.com>
16977         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16978         with the `true' and `false' literals.  Fixes #33151.
16980 2002-11-16  Martin Baulig  <martin@ximian.com>
16982         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16983         October 22nd; don't do the cs1540 check for static members.
16985         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16986         now using our own filter here and doing the cs1540 check again.
16988 2002-11-16  Martin Baulig  <martin@ximian.com>
16990         * support.cs (InternalParameters): Don't crash if we don't have
16991         any fixed parameters.  Fixes #33532.
16993 2002-11-16  Martin Baulig  <martin@ximian.com>
16995         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16996         when looking up static methods to make this work on Windows.
16997         Fixes #33773.
16999 2002-11-16  Martin Baulig  <martin@ximian.com>
17001         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
17002         a setter rather than using PropertyInfo.CanWrite.
17004 2002-11-15  Nick Drochak  <ndrochak@gol.com>
17006         * class.cs: Allow acces to block member by subclasses. Fixes build
17007         breaker.
17009 2002-11-14  Martin Baulig  <martin@ximian.com>
17011         * class.cs (Constructor.Emit): Added the extern/block check.
17012         Fixes bug #33678.
17014 2002-11-14  Martin Baulig  <martin@ximian.com>
17016         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
17017         iteration while looking for indexers, this is needed because the
17018         indexer may have a different name in our base classes.  Fixed the
17019         error reporting (no indexers at all, not get accessor, no
17020         overloaded match).  Fixes bug #33089.
17021         (IndexerAccess.DoResolveLValue): Likewise.
17023 2002-11-14  Martin Baulig  <martin@ximian.com>
17025         * class.cs (PropertyBase.CheckBase): Make this work for multiple
17026         indexers.  Fixes the first part of bug #33089.
17027         (MethodSignature.InheritableMemberSignatureCompare): Added support
17028         for properties.
17030 2002-11-13  Ravi Pratap  <ravi@ximian.com>
17032         * attribute.cs (Attribute.Resolve): Catch the
17033         NullReferenceException and report it since it isn't supposed to
17034         happen. 
17036 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
17038         * expression.cs (Binary.EmitBranchable): Also handle the cases for
17039         LogicalOr and LogicalAnd that can benefit from recursively
17040         handling EmitBranchable.  The code now should be nice for Paolo.
17042 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
17044         * typemanager.cs (LookupType): Added a negative-hit hashtable for
17045         the Type lookups, as we perform quite a number of lookups on
17046         non-Types.  This can be removed once we can deterministically tell
17047         whether we have a type or a namespace in advance.
17049         But this might require special hacks from our corlib.
17051         * TODO: updated.
17053         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
17054         and double which avoids a conversion from an integer to a double.
17056         * expression.cs: tiny optimization, avoid calling IsConstant,
17057         because it effectively performs the lookup twice.
17059 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
17061         But a bogus return here to keep the semantics of the old code
17062         until the Mono runtime is fixed.
17064         * pending.cs (GetMissingInterfaces): New method used to remove all
17065         the interfaces that are already implemented by our parent
17066         classes from the list of pending methods. 
17068         * interface.cs: Add checks for calls after ResolveTypeExpr.
17070 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
17072         * class.cs (Class.Emit): Report warning 67: event not used if the
17073         warning level is beyond 3.
17075         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17076         being a NullLiteral.
17078         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17079         specifiers. 
17081         * class.cs (TypeContainer.GetClassBases): Cover a missing code
17082         path that might fail if a type can not be resolved.
17084         * expression.cs (Binary.Emit): Emit unsigned versions of the
17085         operators. 
17087         * driver.cs: use error 5.
17089 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17091         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17093 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
17095         * cs-parser.jay (switch_section): A beautiful patch from Martin
17096         Baulig that fixed 33094.
17098 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
17100         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17101         Check whether the base is abstract and report an error if so.
17103         * expression.cs (IndexerAccess.DoResolveLValue,
17104         IndexerAccess.DoResolve): ditto. 
17106         (Invocation.DoResolve): ditto.
17108         (Invocation.FullMethodDesc): Improve the report string.
17110         * statement.cs (Block): Eliminate IsVariableDefined as it is
17111         basically just a wrapper for GetVariableInfo.
17113         * ecore.cs (SimpleName): Use new 
17115         * support.cs (ReflectionParamter.ParameterType): We unwrap the
17116         type, as we return the actual parameter ref/unref state on a
17117         different call.
17119 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
17121         * support.cs: Return proper flags REF/OUT fixing the previous
17122         commit.  
17124         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
17125         not used to mean `ref' but `ref or out' in ParameterReference
17127         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17128         full type signature instead of calling TypeManger.CSharpName
17129         ourselves. 
17131         * support.cs (InternalParameters.ParameterDesc): Do not compare
17132         directly to the modflags, because REF/OUT will actually be bitsets
17133         if set. 
17135         * delegate.cs (VerifyMethod): Check also the modifiers.
17137         * cs-tokenizer.cs: Fix bug where floating point values with an
17138         exponent where a sign was missing was ignored.
17140         * driver.cs: Allow multiple assemblies to be specified in a single
17141         /r: argument
17143 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
17145         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
17146         because identifiers after a parenthesis would end up in this kind
17147         of production, and we needed to desamiguate it for having casts
17148         like:
17150                 (UserDefinedType *) xxx
17152 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
17154         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17155         we should set on the Bindingflags.NonPublic, but not turn on
17156         private_ok.  private_ok controls whether a Private member is
17157         returned (this is chekced on the filter routine), while the
17158         BindingFlags.NonPublic just controls whether private/protected
17159         will be allowed.   This fixes the problem part of the problem of
17160         private properties being allowed to be used in derived classes.
17162         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17163         so we can call the children DoResolveLValue method (this will
17164         properly signal errors on lvalue assignments to base properties)
17166         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17167         getter are null, and we have a property info, we know that this
17168         happened because the lookup failed, so we report an error 122 for
17169         protection level violation.
17171         We also silently return if setter and getter are null in the
17172         resolve functions, this condition only happens if we have flagged
17173         the error before.  This is the other half of the problem. 
17175         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17176         not have accessibility information, that is why we were returning
17177         true in the filter function in typemanager.cs.
17179         To properly report 122 (property is inaccessible because of its
17180         protection level) correctly, we report this error in ResolveAccess
17181         by failing if both the setter and the getter are lacking (ie, the
17182         lookup failed). 
17184         DoResolve and DoLResolve have been modified to check for both
17185         setter/getter being null and returning silently, the reason being
17186         that I did not want to put the knowledge about this error in upper
17187         layers, like:
17189         int old = Report.Errors;
17190         x = new PropertyExpr (...);
17191         if (old != Report.Errors)
17192                 return null;
17193         else
17194                 return x;
17196         So the property expr is returned, but it is invalid, so the error
17197         will be flagged during the resolve process. 
17199         * class.cs: Remove InheritablePropertySignatureCompare from the
17200         class, as we no longer depend on the property signature to compute
17201         whether it is possible to implement a method or not.
17203         The reason is that calling PropertyInfo.GetGetMethod will return
17204         null (in .NET, in Mono it works, and we should change this), in
17205         cases where the Get Method does not exist in that particular
17206         class.
17208         So this code:
17210         class X { public virtual int A { get { return 1; } } }
17211         class Y : X { }
17212         class Z : Y { public override int A { get { return 2; } } }
17214         Would fail in Z because the parent (Y) would not have the property
17215         defined.  So we avoid this completely now (because the alternative
17216         fix was ugly and slow), and we now depend exclusively on the
17217         method names.
17219         (PropertyBase.CheckBase): Use a method-base mechanism to find our
17220         reference method, instead of using the property.
17222         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17223         routines are gone now.
17225         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17226         names, they were incorrectly named.
17228         * cs-tokenizer.cs: Return are more gentle token on failure. 
17230         * pending.cs (PendingImplementation.InterfaceMethod): This routine
17231         had an out-of-sync index variable, which caused it to remove from
17232         the list of pending methods the wrong method sometimes.
17234 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
17236         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17237         CanWrite, because those refer to this particular instance of the
17238         property, and do not take into account the fact that we can
17239         override single members of a property.
17241         Constructor requires an EmitContext.  The resolution process does
17242         not happen here, but we need to compute the accessors before,
17243         because the resolution does not always happen for properties.
17245         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17246         subclass, before we did not update this flag, but we did update
17247         bindingflags. 
17249         (GetAccessors): Drop this routine, as it did not work in the
17250         presence of partially overwritten set/get methods. 
17252         Notice that this broke the cs1540 detection, but that will require
17253         more thinking. 
17255 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17257         * class.cs:
17258         * codegen.cs:
17259         * driver.cs: issue a warning instead of an error if we don't support
17260         debugging for the platform. Also ignore a couple of errors that may
17261         arise when trying to write the symbols. Undo my previous patch.
17263 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17265         * driver.cs: ignore /debug switch except for Unix platforms.
17267 2002-10-23  Nick Drochak  <ndrochak@gol.com>
17269         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17271 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
17273         * driver.cs: Do not make mcs-debug conditional, so we do not break
17274         builds that use it.
17276         * statement.cs (UsageVector.MergeChildren): I would like Martin to
17277         review this patch.  But basically after all the children variables
17278         have been merged, the value of "Breaks" was not being set to
17279         new_breaks for Switch blocks.  I think that it should be set after
17280         it has executed.  Currently I set this to the value of new_breaks,
17281         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17282         conservative, but I do not understand this code very well.
17284         I did not break anything in the build, so that is good ;-)
17286         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17288 2002-10-20  Mark Crichton  <crichton@gimp.org>
17290         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
17292 2002-10-20  Nick Drochak  <ndrochak@gol.com>
17294         * cfold.cs: Fixed compile blocker.
17296 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
17298         * driver.cs: I was chekcing the key, not the file.
17300 2002-10-19  Ravi Pratap  <ravi@ximian.com>
17302         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17303         message that we were generating - we just need to silently return
17304         a null.
17306 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
17308         * class.cs (Event.Define): Change my previous commit, as this
17309         breaks the debugger.  This is a temporary hack, as it seems like
17310         the compiler is generating events incorrectly to begin with.
17312         * expression.cs (Binary.ResolveOperator): Added support for 
17313         "U operator - (E x, E y)"
17315         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17316         y)".
17318         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17319         init-only variables, but this path did not take into account that
17320         there might be also instance readonly variables.  Correct this
17321         problem. 
17323         This fixes bug 32253
17325         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17326         delegates as well.
17328         * driver.cs: Change the extension for modules to `netmodule'
17330         * cs-parser.jay: Improved slightly the location tracking for
17331         the debugger symbols.
17333         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17334         modifiers that were specified instead of the hardcoded value
17335         (FamAndAssem).  This was basically ignoring the static modifier,
17336         and others.  Fixes 32429.
17338         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17339         fixed a bug in the process (32476)
17341         * expression.cs (ArrayAccess.EmitAssign): Patch from
17342         hwang_rob@yahoo.ca that fixes bug 31834.3
17344 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
17346         * driver.cs: Make the module extension .netmodule.
17348 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
17350         * driver.cs: Report an error if the resource file is not found
17351         instead of crashing.
17353         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17354         false, like Emit does.
17356 2002-10-16  Nick Drochak  <ndrochak@gol.com>
17358         * typemanager.cs: Remove unused private member.  Also reported mcs
17359         bug to report this as a warning like csc.
17361 2002-10-15  Martin Baulig  <martin@gnome.org>
17363         * statement.cs (Statement.Emit): Made this a virtual method; emits
17364         the line number info and calls DoEmit().
17365         (Statement.DoEmit): New protected abstract method, formerly knows
17366         as Statement.Emit().
17368         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17370 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
17372         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17373         have fixed a remaining problem: not every AddXXXX was adding a
17374         fully qualified name.  
17376         Now everyone registers a fully qualified name in the DeclSpace as
17377         being defined instead of the partial name.  
17379         Downsides: we are slower than we need to be due to the excess
17380         copies and the names being registered this way.  
17382         The reason for this is that we currently depend (on the corlib
17383         bootstrap for instance) that types are fully qualified, because
17384         we dump all the types in the namespace, and we should really have
17385         types inserted into the proper namespace, so we can only store the
17386         basenames in the defined_names array.
17388 2002-10-10  Martin Baulig  <martin@gnome.org>
17390         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17391         from bug #31834, see the bug report for a testcase which is
17392         miscompiled.
17394 2002-10-10  Martin Baulig  <martin@gnome.org>
17396         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17397         flow analysis code for this.
17399         * statement.cs (Do, While, For): Tell the flow analysis code about
17400         infinite loops.
17401         (FlowBranching.UsageVector): Added support for infinite loops.
17402         (Block.Resolve): Moved the dead code elimination here and use flow
17403         analysis to do it.
17405 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
17407         * class.cs (Field.Define): Catch cycles on struct type
17408         definitions. 
17410         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17411         fields if the fields are static.  We only need to check instance
17412         fields. 
17414         * expression.cs (As.DoResolve): Test for reference type.
17416         * statement.cs (Using.ResolveExpression): Use
17417         ConvertImplicitRequired, not ConvertImplicit which reports an
17418         error on failture
17419         (Using.ResolveLocalVariableDecls): ditto.
17421         * expression.cs (Binary.ResolveOperator): Report errors in a few
17422         places where we had to.
17424         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17426 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17428         * expression.cs: Use StoreFromPtr instead of extracting the type
17429         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17431         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17432         an enumeration value to a System.Enum, but System.Enum is not a
17433         value type, but an class type, so we need to box.
17435         (Expression.ConvertExplicit): One codepath could return
17436         errors but not flag them.  Fix this.  Fixes #31853
17438         * parameter.cs (Resolve): Do not allow void as a parameter type.
17440 2002-10-06  Martin Baulig  <martin@gnome.org>
17442         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17443         if it's a class type and not a struct.  Fixes #31815.
17445 2002-10-06  Martin Baulig  <martin@gnome.org>
17447         * statement.cs: Reworked the flow analysis code a bit to make it
17448         usable for dead code elimination.
17450 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17452         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17454 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17456         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17457         to fix the test 165, will investigate deeper.
17459 2002-10-04  Martin Baulig  <martin@gnome.org>
17461         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17462         finally blocks actually work.
17463         (Try.Resolve): We don't need to create a sibling for `finally' if
17464         there is no finally block.
17466 2002-10-04  Martin Baulig  <martin@gnome.org>
17468         * class.cs (Constructor.Define): The default accessibility for a
17469         non-default constructor is private, not public.
17471 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17473         * class.cs (Constructor): Make AllowedModifiers public, add
17474         EXTERN.
17476         * cs-parser.jay: Perform the modifiers test here, as the
17477         constructor for the Constructor class usually receives a zero
17478         because of the way we create it (first we create, later we
17479         customize, and we were never checking the modifiers).
17481         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17482         is a version of LookupTypeReflection that includes the type-name
17483         cache.  This can be used as a fast path for functions that know
17484         the fully qualified name and are only calling into *.GetType() to
17485         obtain a composed type.
17487         This is also used by TypeManager.LookupType during its type
17488         composition.
17490         (LookupType): We now also track the real type name, as sometimes
17491         we can get a quey for the real type name from things like
17492         ComposedCast.  This fixes bug 31422.
17494         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17495         complete type fullname, it does not have to go through the type
17496         resolution system to obtain the composed version of the type (for
17497         obtaining arrays or pointers).
17499         (Conditional.Emit): Use the EmitBoolExpression to
17500         generate nicer code, as requested by Paolo.
17502         (ArrayCreation.CheckIndices): Use the patch from
17503         hwang_rob@yahoo.ca to validate the array initializers. 
17505 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17507         * class.cs (ConstructorInitializer.Emit): simplify code by using
17508         Invocation.EmitCall, and at the same time, fix the bugs in calling
17509         parent constructors that took variable arguments. 
17511         * ecore.cs (Expression.ConvertNumericExplicit,
17512         Expression.ImplicitNumericConversion): Remove the code that
17513         manually wrapped decimal (InternalTypeConstructor call is now gone
17514         as well).
17516         * expression.cs (Cast.TryReduce): Also handle decimal types when
17517         trying to perform a constant fold on the type.
17519         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17521         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17522         that only turned off an error report, and did nothing else. 
17524 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17526         * driver.cs: Handle and ignore /fullpaths
17528 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17530         * expression.cs (Binary.ResolveOperator): Catch the case where
17531         DoNumericPromotions returns true, 
17533         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17535 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17537         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17538         report error 70.
17540 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17542         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17543         conversion exists, but it is also required that the conversion be
17544         performed.  This manifested in "(Type64Enum) 2".  
17546         * class.cs (TypeManager.AddMethod): The fix is not to change
17547         AddEnum, because that one was using a fully qualified name (every
17548         DeclSpace derivative does), but to change the AddMethod routine
17549         that was using an un-namespaced name.  This now correctly reports
17550         the duplicated name.
17552         Revert patch until I can properly fix it.  The issue
17553         is that we have a shared Type space across all namespaces
17554         currently, which is wrong.
17556         Options include making the Namespace a DeclSpace, and merge
17557         current_namespace/current_container in the parser.
17559 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17561         * cs-parser.jay: Improve error reporting when we get a different
17562         kind of expression in local_variable_type and
17563         local_variable_pointer_type. 
17565         Propagate this to avoid missleading errors being reported.
17567         * ecore.cs (ImplicitReferenceConversion): treat
17568         TypeManager.value_type as a target just like object_type.   As
17569         code like this:
17571         ValueType v = 1;
17573         Is valid, and needs to result in the int 1 being boxed before it
17574         is assigned to the value type v.
17576         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17577         to validate the enumeration name.
17579         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17580         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17581         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17583         * ecore.cs (TryImplicitIntConversion): When doing an
17584         implicit-enumeration-conversion, check if the type is 64-bits and
17585         perform a conversion before passing to EnumConstant.
17587 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17589         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17590         report ambiguous type references.  Unlike the MS version, we
17591         report what the ambiguity is.   Innovation at work ;-)
17593         (DeclSpace.FindType): Require a location argument to
17594         display when we display an ambiguous error.
17596         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17598         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17600         * expression.cs (EmitDynamicInitializers): Apply patch from
17601         hwang_rob@yahoo.ca that fixes the order in which we emit our
17602         initializers. 
17604 2002-09-21  Martin Baulig  <martin@gnome.org>
17606         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17607         delegate takes no arguments.
17609 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17611         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17612         from integers.
17614         * expression.cs: Extract the underlying type.
17616         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17618         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17620 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17622         * class.cs (TypeContainer.DefineType): We can not use the nice
17623         PackingSize with the size set to 1 DefineType method, because it
17624         will not allow us to define the interfaces that the struct
17625         implements.
17627         This completes the fixing of bug 27287
17629         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17630         means also structs.  This fixes part of the problem. 
17631         (Expresion.ImplicitReferenceConversionExists): ditto.
17633         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17634         error if there were no errors reported during the type lookup
17635         process, to avoid duplicates or redundant errors.  Without this
17636         you would get an ambiguous errors plus a type not found.  We have
17637         beaten the user enough with the first error.  
17639         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17640         reference. 
17642         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17643         during the resolution process, stop the lookup, this avoids
17644         repeated error reports (same error twice).
17646         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17648         * typemanager.cs (LookupType): Redo the type lookup code to match
17649         the needs of System.Reflection.  
17651         The issue is that System.Reflection requires references to nested
17652         types to begin with a "+" sign instead of a dot.  So toplevel
17653         types look like: "NameSpace.TopLevelClass", and nested ones look
17654         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17655         levels. 
17657 2002-09-19  Martin Baulig  <martin@gnome.org>
17659         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17660         says that a method always returns or always throws an exception,
17661         don't report the CS0161.
17663         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17664         set `Returns = new_returns'.
17666 2002-09-19  Martin Baulig  <martin@gnome.org>
17668         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17669         to an enum constant, check for a CS0176.
17671 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17673         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17674         for operators that must be in pairs and report errors.
17676         * ecore.cs (SimpleName.DoResolveType): During the initial type
17677         resolution process, when we define types recursively, we must
17678         check first for types in our current scope before we perform
17679         lookups in the enclosing scopes.
17681         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17683         (Invocation.VerifyArgumentsCompat): Call
17684         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17685         I thought we were supposed to always call this, but there are a
17686         few places in the code where we dont do it.
17688 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17690         * driver.cs: Add support in -linkres and -resource to specify the
17691         name of the identifier.
17693 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17695         * ecore.cs (StandardConversionExists): Sync with the conversion
17696         code: allow anything-* to void* conversions.
17698         (FindMostSpecificSource): Use an Expression argument
17699         instead of a Type, because we might be handed over a Literal which
17700         gets a few more implicit conversions that plain types do not.  So
17701         this information was being lost.
17703         Also, we drop the temporary type-holder expression when not
17704         required.
17706 2002-09-17  Martin Baulig  <martin@gnome.org>
17708         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17709         this is an explicit interface implementation.
17711 2002-09-17  Martin Baulig  <martin@gnome.org>
17713         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17714         different `IndexerName' attributes.
17716         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17717         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17718         virtual CommonResolve().
17720 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17722         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17723         and convert that to the UnderlyingType.
17725         * statement.cs (Foreach.Resolve): Indexers are just like variables
17726         or PropertyAccesses.
17728         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17729         inside quoted strings, we were not doing this before.
17731 2002-09-16  Martin Baulig  <martin@gnome.org>
17733         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17734         resolve it.  This is needed for the definite assignment check of the
17735         instance expression, fixes bug #29846.
17736         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17738 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17740         * parameter.cs: Fix compile error.  Cannot reference static member
17741         from an instance object.  Is this an mcs bug?
17743 2002-09-14  Martin Baulig  <martin@gnome.org>
17745         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17746         multiple times.  Fixes bug #30295, added test-166.cs.
17748 2002-09-14  Martin Baulig  <martin@gnome.org>
17750         * statement.cs (Block.Emit): Don't emit unreachable code.
17751         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17752         `break' statements.
17753         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17755 2002-09-14  Martin Baulig  <martin@gnome.org>
17757         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17758         is set.
17760 2002-09-14  Martin Baulig  <martin@gnome.org>
17762         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17763         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17764         be false on the ms runtime.
17766 2002-09-13  Martin Baulig  <martin@gnome.org>
17768         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17769         the CS0038 error message.
17771 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17773         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17774         constant inside, return it.
17776 2002-09-12  Martin Baulig  <martin@gnome.org>
17778         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17779         implicit conversion can be done between enum types.
17781         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17782         check whether an implicit conversion to the current enum's UnderlyingType
17783         exists and report an error if not.
17785         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17786         without debugging support.
17788         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17789         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17791 2002-09-12  Martin Baulig  <martin@gnome.org>
17793         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17795         * ecore.cs (IMemberExpr.DeclaringType): New property.
17796         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17797         nonstatic member of an outer type (CS0038).
17799 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17801         * driver.cs: Activate the using-error detector at warning level
17802         4 (at least for MS-compatible APIs).
17804         * namespace.cs (VerifyUsing): Small buglett fix.
17806         * pending.cs (PendingImplementation): pass the container pointer. 
17808         * interface.cs (GetMethods): Allow for recursive definition.  Long
17809         term, I would like to move every type to support recursive
17810         definitions, not the current ordering mechanism that we have right
17811         now.
17813         The situation is this: Attributes are handled before interfaces,
17814         so we can apply attributes to interfaces.  But some attributes
17815         implement interfaces, we will now handle the simple cases
17816         (recursive definitions will just get an error).  
17818         * parameter.cs: Only invalidate types at the end if we fail to
17819         lookup all types.  
17821 2002-09-09  Martin Baulig  <martin@gnome.org>
17823         * ecore.cs (PropertyExpr.Emit): Also check for
17824         TypeManager.system_int_array_get_length so this'll also work when
17825         compiling corlib.  Fixes #30003.
17827 2002-09-09  Martin Baulig  <martin@gnome.org>
17829         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17830         and throw an exception if we can't get the type's size.  Fixed #30040,
17831         added test-165.cs.
17833 2002-09-09  Martin Baulig  <martin@gnome.org>
17835         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17837         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17838         context.  Fixes bug #30027.
17840         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17841         virtual functions.  Fixes bug #30043, added test-164.cs.
17843 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17845         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17847 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17849         * driver.cs: Use an object to get the windows codepage since it's not a
17850         static property.
17852 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17854         * statement.cs (For.Emit): for infinite loops (test == null)
17855         return whether there is a break inside, not always "true".
17857         * namespace.cs (UsingEntry): New struct to hold the name of the
17858         using definition, the location where it is defined, and whether it
17859         has been used in a successful type lookup.
17861         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17862         strings.
17864         * decl.cs: ditto.
17866 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17868         * attribute.cs : Fix incorrect code which relied on catching
17869         a NullReferenceException to detect a null being passed in
17870         where an object was expected.
17872 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17874         * statement.cs (Try): flag the catch variable as assigned
17876         * expression.cs (Cast): Simplified by using ResolveType instead of
17877         manually resolving.
17879         * statement.cs (Catch): Fix bug by using ResolveType.
17881 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17883         * expression.cs (BetterConversion): Special case for when we have
17884         a NullLiteral as the argument and we have to choose between string
17885         and object types - we choose string the way csc does.
17887         * attribute.cs (Attribute.Resolve): Catch the
17888         NullReferenceException and report error #182 since the Mono
17889         runtime no more has the bug and having this exception raised means
17890         we tried to select a constructor which takes an object and is
17891         passed a null.
17893 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17895         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17896         message (1502, 1503) when we can't locate a method after overload
17897         resolution. This is much more informative and closes the bug
17898         Miguel reported.
17900         * interface.cs (PopulateMethod): Return if there are no argument
17901         types. Fixes a NullReferenceException bug.
17903         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17904         expressions too. Previously we were checking only in one place for
17905         positional arguments leaving out named arguments.
17907         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17908         type to the enum type is not allowed. Remove code corresponding to
17909         that.
17911         (ConvertNumericExplicit): Allow explicit conversions from
17912         the underlying type to enum type. This precisely follows the spec
17913         and closes a bug filed by Gonzalo.
17915 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17917         * compiler.csproj:
17918         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17920 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17922         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17923         it was important that we stored the right value after the
17924         reduction in `converted'.
17926 2002-09-04  Martin Baulig  <martin@gnome.org>
17928         * location.cs (Location.SymbolDocument): Use full pathnames for the
17929         source files.
17931 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17933         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17934         of the expression resolve mechanism, because that will catch the
17935         SimpleName error failures.
17937         (Conditional): If we can not resolve the
17938         expression, return, do not crash.
17940 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17942         * cs-tokenizer.cs:
17943         (location): display token name instead of its number.
17945 2002-08-28  Martin Baulig  <martin@gnome.org>
17947         * expression.cs (Binary.ResolveOperator): Don't silently return
17948         but return an error if an operator cannot be applied between two
17949         enum types.
17951 2002-08-28  Martin Baulig  <martin@gnome.org>
17953         * class.cs (Constructor.Define): Set the permission attributes
17954         correctly instead of making all constructors public.
17956 2002-08-28  Martin Baulig  <martin@gnome.org>
17958         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17959         for private members before reporting a CS0103; if we find anything,
17960         it's a CS0122.
17962 2002-08-28  Martin Baulig  <martin@gnome.org>
17964         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17965         to check whether `closure_start_type == closure_invocation_type',
17966         we also need to check whether `m.DeclaringType == closure_invocation_type'
17967         before bypassing the permission checks.  We might be accessing
17968         protected/private members from the base class.
17969         (TypeManager.RealMemberLookup): Only set private_ok if private
17970         members were requested via BindingFlags.NonPublic.
17972         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17974         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17975         MethodGroupExpr.IsExplicitImpl if appropriate.
17976         (Invocation.DoResolve): Don't report the CS0120 for explicit
17977         interface implementations.
17979 2002-08-27  Martin Baulig  <martin@gnome.org>
17981         * expression.cs (Invocation.DoResolve): If this is a static
17982         method and we don't have an InstanceExpression, we must report
17983         a CS0120.
17985 2002-08-25  Martin Baulig  <martin@gnome.org>
17987         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17988         `==' between a valuetype and an object.
17990 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17992         * ecore.cs (TypeExpr): Provide a ToString method.
17994 2002-08-24  Martin Baulig  <martin@gnome.org>
17996         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17997         now called proggie.dbg and it's a binary file.
17999 2002-08-23  Martin Baulig  <martin@gnome.org>
18001         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
18003 2002-08-23  Martin Baulig  <martin@gnome.org>
18005         * struct.cs (MyStructInfo.ctor): Make this work with empty
18006         structs; it's not allowed to use foreach() on null.
18008 2002-08-23  Martin Baulig  <martin@gnome.org>
18010         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
18011         writer the full pathname of the generated assembly.
18013 2002-08-23  Martin Baulig  <martin@gnome.org>
18015         * statements.cs (FlowBranching.UsageVector.MergeChildren):
18016         A `finally' block never returns or breaks; improved handling of
18017         unreachable code.
18019 2002-08-23  Martin Baulig  <martin@gnome.org>
18021         * statement.cs (Throw.Resolve): Allow `throw null'.
18023 2002-08-23  Martin Baulig  <martin@gnome.org>
18025         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
18026         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
18027         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
18028         MemberLookup would return a wrong event if this is an explicit
18029         interface implementation and the class has an event with the same
18030         name.
18032 2002-08-23  Martin Baulig  <martin@gnome.org>
18034         * statement.cs (Block.AddChildVariableNames): New public method.
18035         (Block.AddChildVariableName): Likewise.
18036         (Block.IsVariableNameUsedInChildBlock): Likewise.
18037         (Block.AddVariable): Check whether a variable name has already
18038         been used in a child block.
18040         * cs-parser.jay (declare_local_variables): Mark all variable names
18041         from the current block as being used in a child block in the
18042         implicit block.
18044 2002-08-23  Martin Baulig  <martin@gnome.org>
18046         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
18047         find the symbol writer.
18049         * driver.cs: csc also allows the arguments to /define being
18050         separated by commas, not only by semicolons.
18052 2002-08-23  Martin Baulig  <martin@gnome.org>
18054         * interface.cs (Interface.GetMembers): Added static check for events.
18056 2002-08-15  Martin Baulig  <martin@gnome.org>
18058         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
18059         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
18061         * ecore.cs (Expression.MemberLookup): Added documentation and explained
18062         why the MethodData.EmitDestructor() change was necessary.
18064 2002-08-20  Martin Baulig  <martin@gnome.org>
18066         * class.cs (TypeContainer.FindMembers): Added static check for events.
18068         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18070         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18071         use Type.GetEvents(), not Type.FindMembers().
18073 2002-08-20  Martin Baulig  <martin@gnome.org>
18075         * decl.cs (MemberCache): Added a special method cache which will
18076         be used for method-only searched.  This ensures that a method
18077         search will return a MethodInfo with the correct ReflectedType for
18078         inherited methods.      
18080 2002-08-20  Martin Baulig  <martin@gnome.org>
18082         * decl.cs (DeclSpace.FindMembers): Made this public.
18084 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18086         * delegate.cs: fixed build on windows.
18087         [FIXME:  Filed as bug #29150: MCS must report these errors.]
18089 2002-08-19  Ravi Pratap  <ravi@ximian.com>
18091         * ecore.cs (StandardConversionExists): Return a false
18092         if we are trying to convert the void type to anything else
18093         since that is not allowed.
18095         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18096         we flag error 70 in the event an event is trying to be accessed
18097         directly from outside the declaring type.
18099 2002-08-20  Martin Baulig  <martin@gnome.org>
18101         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18102         MemberCache from typemanager.cs to decl.cs.
18104 2002-08-19  Martin Baulig  <martin@gnome.org>
18106         * class.cs (TypeContainer): Implement IMemberContainer.
18107         (TypeContainer.DefineMembers): Create the MemberCache.
18108         (TypeContainer.FindMembers): Do better BindingFlags checking; only
18109         return public members if BindingFlags.Public was given, check
18110         whether members are static.
18112 2002-08-16  Martin Baulig  <martin@gnome.org>
18114         * decl.cs (DeclSpace.Define): Splitted this in Define and
18115         DefineMembers.  DefineMembers is called first and initializes the
18116         MemberCache.
18118         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
18119         DefineMembers() on all our DeclSpaces.
18121         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18122         but call DefineMembers() on all nested interfaces.  We call their
18123         Define() in our new Define() function.
18125         * interface.cs (Interface): Implement IMemberContainer.
18126         (Interface.Define): Moved all code except the attribute stuf to
18127         DefineMembers().
18128         (Interface.DefineMembers): Initialize the member cache.
18130         * typemanager.cs (IMemberFinder): Removed this interface, we don't
18131         need this anymore since we can use MemberCache.FindMembers directly.
18133 2002-08-19  Martin Baulig  <martin@gnome.org>
18135         * typemanager.cs (MemberCache): When creating the cache for an
18136         interface type, add all inherited members.
18137         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18138         to `out bool used_cache' and documented it.
18139         (TypeManager.MemberLookup): If we already used the cache in the first
18140         iteration, we don't need to do the interfaces check.
18142 2002-08-19  Martin Baulig  <martin@gnome.org>
18144         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
18145         here from IMemberFinder and don't implement this interface anymore.
18146         (DeclSpace.MemberCache): Moved here from IMemberFinder.
18148         * typemanager.cs (IMemberFinder): This interface is now only used by
18149         classes which actually support the member cache.
18150         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18151         since we only put DeclSpaces into this Hashtable.
18152         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18153         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18155 2002-08-16  Martin Baulig  <martin@gnome.org>
18157         * typemanager.cs (ICachingMemberFinder): Removed.
18158         (IMemberFinder.MemberCache): New property.
18159         (TypeManager.FindMembers): Merged this with RealFindMembers().
18160         This function will never be called from TypeManager.MemberLookup()
18161         so we can't use the cache here, just the IMemberFinder.
18162         (TypeManager.MemberLookup_FindMembers): Check whether the
18163         IMemberFinder has a MemberCache and call the cache's FindMembers
18164         function.
18165         (MemberCache): Rewrote larger parts of this yet another time and
18166         cleaned it up a bit.
18168 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
18170         * driver.cs (LoadArgs): Support quoting.
18172         (Usage): Show the CSC-like command line arguments.
18174         Improved a few error messages.
18176 2002-08-15  Martin Baulig  <martin@gnome.org>
18178         * typemanager.cs (IMemberContainer.Type): New property.
18179         (IMemberContainer.IsInterface): New property.
18181         The following changes are conditional to BROKEN_RUNTIME, which is
18182         defined at the top of the file.
18184         * typemanager.cs (MemberCache.MemberCache): Don't add the base
18185         class'es members, but add all members from TypeHandle.ObjectType
18186         if we're an interface.
18187         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18188         is the current type.
18189         (MemberCache.CacheEntry.Container): Removed this field.
18190         (TypeHandle.GetMembers): Include inherited members.
18192 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18194         * typemanager.cs: fixed compilation and added a comment on a field that
18195         is never used.
18197 2002-08-15  Martin Baulig  <martin@gnome.org>
18199         * class.cs (ConstructorInitializer.Resolve): In the
18200         Expression.MemberLookup call, use the queried_type as
18201         invocation_type.
18203         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18204         declared' attribute, it's always true.
18205         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18206         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18207         temporary wrapper for FindMembers which tells MemberLookup whether
18208         members from the base classes are included in the return value.
18209         This will go away soon.
18210         (TypeManager.MemberLookup): Use this temporary hack here; once the
18211         new MemberCache is completed, we don't need to do the DeclaredOnly
18212         looping here anymore since the MemberCache will take care of this.
18213         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18214         (MemberCache): When creating the MemberCache for a class, get
18215         members from the current class and all its base classes.
18216         (MemberCache.CacheEntry.Container): New field.  This is a
18217         temporary hack until the Mono runtime is fixed to distinguish
18218         between ReflectedType and DeclaringType.  It allows us to use MCS
18219         with both the MS runtime and the unfixed Mono runtime without
18220         problems and without accecting performance.
18221         (MemberCache.SearchMembers): The DeclaredOnly looping from
18222         TypeManager.MemberLookup is now done here.      
18224 2002-08-14  Martin Baulig  <martin@gnome.org>
18226         * statement.cs (MyStructInfo.MyStructInfo): Don't call
18227         Type.GetFields on dynamic types but get the fields from the
18228         corresponding TypeContainer.
18229         (MyStructInfo.GetStructInfo): Added check for enum types.
18231         * typemanager.cs (MemberList.IsSynchronized): Implemented.
18232         (MemberList.SyncRoot): Implemented.
18233         (TypeManager.FilterWithClosure): No need to check permissions if
18234         closure_start_type == closure_invocation_type, don't crash if
18235         closure_invocation_type is null.
18237 2002-08-13  Martin Baulig  <martin@gnome.org>
18239         Rewrote TypeContainer.FindMembers to use a member cache.  This
18240         gives us a speed increase of about 35% for the self-hosting MCS
18241         build and of about 15-20% for the class libs (both on GNU/Linux).
18243         * report.cs (Timer): New class to get enhanced profiling.  This
18244         whole class is "TIMER" conditional since it remarkably slows down
18245         compilation speed.
18247         * class.cs (MemberList): New class.  This is an IList wrapper
18248         which we're now using instead of passing MemberInfo[]'s around to
18249         avoid copying this array unnecessarily.
18250         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18251         (ICachingMemberFinder, IMemberContainer): New interface.
18252         (TypeManager.FilterWithClosure): If `criteria' is null, the name
18253         has already been checked, otherwise use it for the name comparision.
18254         (TypeManager.FindMembers): Renamed to RealMemberFinder and
18255         provided wrapper which tries to use ICachingMemberFinder.FindMembers
18256         if possible.  Returns a MemberList, not a MemberInfo [].
18257         (TypeHandle): New class, implements IMemberContainer.  We create
18258         one instance of this class per type, it contains a MemberCache
18259         which is used to do the member lookups.
18260         (MemberCache): New class.  Each instance of this class contains
18261         all members of a type and a name-based hash table.
18262         (MemberCache.FindMembers): This is our new member lookup
18263         function.  First, it looks up all members of the requested name in
18264         the hash table.  Then, it walks this list and sorts out all
18265         applicable members and returns them.
18267 2002-08-13  Martin Baulig  <martin@gnome.org>
18269         In addition to a nice code cleanup, this gives us a performance
18270         increase of about 1.4% on GNU/Linux - not much, but it's already
18271         half a second for the self-hosting MCS compilation.
18273         * typemanager.cs (IMemberFinder): New interface.  It is used by
18274         TypeManager.FindMembers to call FindMembers on a TypeContainer,
18275         Enum, Delegate or Interface.
18276         (TypeManager.finder_to_member_finder): New PtrHashtable.
18277         (TypeManager.finder_to_container): Removed.
18278         (TypeManager.finder_to_delegate): Removed.
18279         (TypeManager.finder_to_interface): Removed.
18280         (TypeManager.finder_to_enum): Removed.
18282         * interface.cs (Interface): Implement IMemberFinder.
18284         * delegate.cs (Delegate): Implement IMemberFinder.
18286         * enum.cs (Enum): Implement IMemberFinder.
18288         * class.cs (TypeContainer): Implement IMemberFinder.
18290 2002-08-12  Martin Baulig  <martin@gnome.org>
18292         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18294 2002-08-12  Martin Baulig  <martin@gnome.org>
18296         * ecore.cs (ITypeExpression): New interface for expressions which
18297         resolve to a type.
18298         (TypeExpression): Renamed to TypeLookupExpression.
18299         (Expression.DoResolve): If we're doing a types-only lookup, the
18300         expression must implement the ITypeExpression interface and we
18301         call DoResolveType() on it.
18302         (SimpleName): Implement the new ITypeExpression interface.
18303         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18304         hack, the situation that we're only looking up types can't happen
18305         anymore when this method is called.  Moved the type lookup code to
18306         DoResolveType() and call it.
18307         (SimpleName.DoResolveType): This ITypeExpression interface method
18308         is now doing the types-only lookup.
18309         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18310         (ResolveFlags): Added MaskExprClass.
18312         * expression.cs (MemberAccess): Implement the ITypeExpression
18313         interface.
18314         (MemberAccess.DoResolve): Added support for a types-only lookup
18315         when we're called via ITypeExpression.DoResolveType().
18316         (ComposedCast): Implement the ITypeExpression interface.
18318         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
18319         Expression.Resolve() with ResolveFlags.Type instead.
18321 2002-08-12  Martin Baulig  <martin@gnome.org>
18323         * interface.cs (Interface.Define): Apply attributes.
18325         * attribute.cs (Attribute.ApplyAttributes): Added support for
18326         interface attributes.
18328 2002-08-11  Martin Baulig  <martin@gnome.org>
18330         * statement.cs (Block.Emit): Only check the "this" variable if we
18331         do not always throw an exception.
18333         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18334         whether the property has a set accessor.
18336 2002-08-11  Martin Baulig  <martin@gnome.org>
18338         Added control flow analysis support for structs.
18340         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18341         with control flow analysis turned off.
18342         (IVariable): New interface.
18343         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18344         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18345         (FieldExpr.DoResolve): Resolve the instance expression with flow
18346         analysis turned off and do the definite assignment check after the
18347         resolving when we know what the expression will resolve to.
18349         * expression.cs (LocalVariableReference, ParameterReference):
18350         Implement the new IVariable interface, only call the flow analysis
18351         code if ec.DoFlowAnalysis is true.
18352         (This): Added constructor which takes a Block argument.  Implement
18353         the new IVariable interface.
18354         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18355         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18356         This does the definite assignment checks for struct members.
18358         * class.cs (Constructor.Emit): If this is a non-static `struct'
18359         constructor which doesn't have any initializer, call
18360         Block.AddThisVariable() to tell the flow analysis code that all
18361         struct elements must be initialized before control returns from
18362         the constructor.
18364         * statement.cs (MyStructInfo): New public class.
18365         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18366         argument to this indexer.  If non-zero, check an individual struct
18367         member, not the whole struct.
18368         (FlowBranching.CheckOutParameters): Check struct members.
18369         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18370         overloaded versions of these methods which take an additional
18371         `int field_idx' argument to check struct members.
18372         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18373         overloaded versions of these methods which take an additional
18374         `string field_name' argument to check struct member.s
18375         (VariableInfo): Implement the IVariable interface.
18376         (VariableInfo.StructInfo): New public property.  Returns the
18377         MyStructInfo instance of the variable if it's a struct or null.
18378         (Block.AddThisVariable): New public method.  This is called from
18379         Constructor.Emit() for non-static `struct' constructor which do
18380         not have any initializer.  It creates a special variable for the
18381         "this" instance variable which will be checked by the flow
18382         analysis code to ensure that all of the struct's fields are
18383         initialized before control returns from the constructor.
18384         (UsageVector): Added support for struct members.  If a
18385         variable/parameter is a struct with N members, we reserve a slot
18386         in the usage vector for each member.  A struct is considered fully
18387         initialized if either the struct itself (slot 0) or all its
18388         members are initialized.
18390 2002-08-08  Martin Baulig  <martin@gnome.org>
18392         * driver.cs (Driver.MainDriver): Only report an error CS5001
18393         if there were no compilation errors.
18395         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18396         `UnsafeContext' property to determine whether the parent is in
18397         unsafe context rather than checking the parent's ModFlags:
18398         classes nested in an unsafe class are unsafe as well.
18400 2002-08-08  Martin Baulig  <martin@gnome.org>
18402         * statement.cs (UsageVector.MergeChildren): Distinguish between
18403         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18404         we return.  Added test17() and test18() to test-154.cs.
18406 2002-08-08  Martin Baulig  <martin@gnome.org>
18408         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18409         Family access, make sure the invoking type isn't a subclass of the
18410         queried type (that'd be a CS1540).
18412         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18413         this method which takes an additional `Type invocation_type'.
18415         * expression.cs (BaseAccess.DoResolve): Use the base type as
18416         invocation and query type.
18417         (MemberAccess.DoResolve): If the lookup failed and we're about to
18418         report a CS0122, try a lookup with the ec.ContainerType - if this
18419         succeeds, we must report a CS1540.
18421 2002-08-08  Martin Baulig  <martin@gnome.org>
18423         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18424         (MethodGroupExpr): Implement the IMemberExpr interface.
18426         * expression (MemberAccess.ResolveMemberAccess): No need to have
18427         any special code for MethodGroupExprs anymore, they're now
18428         IMemberExprs.   
18430 2002-08-08  Martin Baulig  <martin@gnome.org>
18432         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18433         Family, FamANDAssem and FamORAssem permissions.
18434         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18436 2002-08-08  Martin Baulig  <martin@gnome.org>
18438         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18439         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18440         or loop block.
18442 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18444         * driver.cs: implemented /resource option to embed managed resources.
18446 2002-08-07  Martin Baulig  <martin@gnome.org>
18448         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18449         (FieldBase.HasFieldInitializer): New public property.
18450         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18451         returns the field initializer and makes sure it is only resolved once.
18452         (TypeContainer.EmitFieldInitializers): Call
18453         FieldBase.GetInitializerExpression to get the initializer, this ensures
18454         that it isn't resolved multiple times.
18456         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18457         the resolving process (SimpleName/MemberLookup) that we're currently
18458         emitting a field initializer (which must not access any instance members,
18459         this is an error CS0236).
18461         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18462         argument, if the `IsFieldInitializer' flag is set, we must report and
18463         error CS0236 and not an error CS0120.   
18465 2002-08-07  Martin Baulig  <martin@gnome.org>
18467         * ecore.cs (IMemberExpr): New public interface.
18468         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18469         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18470         if the expression is an IMemberExpr.
18472         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18473         to be null, implicitly default to `this' if we're non-static in
18474         this case.  Simplified the code a lot by using the new IMemberExpr
18475         interface.  Also fixed bug #28176 here.
18477 2002-08-06  Martin Baulig  <martin@gnome.org>
18479         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18480         ParameterReferences during semantic analysis so that we can do a
18481         type-only search when resolving Cast, TypeOf and SizeOf.
18482         (block): Pass the `current_local_parameters' to the Block's
18483         constructor.
18485         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18486         argument to the constructor.
18487         (ConstructorInitializer.Resolve): Create a temporary implicit
18488         block with the parameters.
18490         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18491         references here if we aren't doing a type-only search.
18493         * statement.cs (Block): Added constructor which takes a
18494         `Parameters parameters' argument.
18495         (Block.Parameters): New public property.
18497         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18498         to `Parameters' and made it public readonly.
18500 2002-08-06  Martin Baulig  <martin@gnome.org>
18502         * ecore.cs (Expression.Warning): Made this public as well.
18504         * report.cs (Report.Debug): Print the contents of collections.
18506 2002-08-06  Martin Baulig  <martin@gnome.org>
18508         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18509         used to tell Resolve() which kinds of expressions it may return.
18510         (Expression.Resolve): Added overloaded version of this method which
18511         takes a `ResolveFlags flags' argument.  This can be used to tell
18512         Resolve() which kinds of expressions it may return.  Reports a
18513         CS0118 on error.
18514         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18515         ResolveFlags.SimpleName.
18516         (Expression.Error118): Added overloaded version of this method which
18517         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18518         which kinds of expressions are allowed.
18520         * expression.cs (Argument.ResolveMethodGroup): New public method.
18521         Resolves an argument, but allows a MethodGroup to be returned.
18522         This is used when invoking a delegate.
18524         * TODO: Updated a bit.
18526 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18528         Fixed compilation with csc.
18530         * ecore.cs: Expression.Error made public. Is this correct? Should
18531         Warning be made public too?
18533         * expression.cs: use ea.Location instead of ea.loc.
18534         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18536 2002-08-06  Martin Baulig  <martin@gnome.org>
18538         * ecore.cs (Expression.loc): Moved the location here instead of
18539         duplicating it in all derived classes.
18540         (Expression.Location): New public property.
18541         (Expression.Error, Expression.Warning): Made them non-static and
18542         removed the location argument.
18543         (Expression.Warning): Added overloaded version which takes an
18544         `int level' argument.
18545         (Expression.Error118): Make this non-static and removed the
18546         expression and location arguments.
18547         (TypeExpr): Added location argument to the constructor.
18549         * expression.cs (StaticCallExpr): Added location argument to
18550         the constructor.
18551         (Indirection, PointerArithmetic): Likewise.
18552         (CheckedExpr, UnCheckedExpr): Likewise.
18553         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18554         (StringPtr): Likewise.
18557 2002-08-05  Martin Baulig  <martin@gnome.org>
18559         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18561         * assign.cs (Assign.DoResolve): Check whether the source
18562         expression is a value or variable.
18564         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18565         while resolving the corresponding blocks.
18567         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18568         an error, don't silently return null.
18570         * statement.cs (Block.AddVariable): Do the error reporting here
18571         and distinguish between CS0128 and CS0136.
18572         (Block.DoResolve): Report all unused labels (warning CS0164).
18573         (LabeledStatement): Pass the location to the constructor.
18574         (LabeledStatement.HasBeenReferenced): New property.
18575         (LabeledStatement.Resolve): Set it to true here.
18577         * statement.cs (Return.Emit): Return success even after reporting
18578         a type mismatch error (CS0126 or CS0127), this is what csc does and
18579         it avoids confusing the users with any consecutive errors.
18581 2002-08-05  Martin Baulig  <martin@gnome.org>
18583         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18585         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18587         * expression.cs (MemberAccess.DoResolve): Silently return if an
18588         error has already been reported.
18590         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18591         error has already been reported.
18593 2002-08-05  Martin Baulig  <martin@gnome.org>
18595         * statement.cs (UsageVector): Only initialize the `parameters'
18596         vector if we actually have any "out" parameters.
18598 2002-08-05  Martin Baulig  <martin@gnome.org>
18600         * expression.cs (Binary.ResolveOperator): When combining delegates,
18601         they must have the same type.
18603 2002-08-05  Martin Baulig  <martin@gnome.org>
18605         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18606         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18607         work with the ms runtime and we also don't need it: if we're a
18608         PropertyBuilder and not in the `indexer_arguments' hash, then we
18609         are a property and not an indexer.
18611         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18612         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18613         since the latter one doesn't work with the ms runtime.
18615 2002-08-03  Martin Baulig  <martin@gnome.org>
18617         Fixed bugs #27998 and #22735.
18619         * class.cs (Method.IsOperator): New public field.
18620         (Method.CheckBase): Report CS0111 if there's already a method
18621         with the same parameters in the current class.  Report CS0508 when
18622         attempting to change the return type of an inherited method.
18623         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18624         and it's not marked abstract or extern.
18625         (PropertyBase): New abstract base class for Property and Indexer.
18626         (PropertyBase.CheckBase): Moved here from Property and made it work
18627         for indexers.
18628         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18629         the same so we can reuse it there.
18630         (Property, Indexer): Derive from PropertyBase.
18631         (MethodSignature.inheritable_property_signature_filter): New delegate
18632         to find properties and indexers.
18634         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18635         argument and improved error reporting.
18637         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18638         EmptyReadOnlyParameters and made it a property.
18640         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18641         version of this method which takes a `PropertyInfo indexer'.
18642         (TypeManager.RegisterIndexer): New method.
18644         * class.cs: Added myself as author of this file :-)
18646 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18648         * class.cs: fixed compilation on windoze.
18650 2002-08-03  Martin Baulig  <martin@gnome.org>
18652         * interface.cs (Interface.GetInterfaceBases): Check whether all
18653         base interfaces are at least as accessible than the current one.
18655         * class.cs (TypeContainer.GetClassBases): Check whether base types
18656         are at least as accessible than the current type.
18657         (TypeContainer.AsAccessible): Implemented and made non-static.
18658         (MemberBase.CheckParameters): Report errors if the accessibility
18659         checks fail.
18661         * delegate.cs (Delegate.Delegate): The default visibility is
18662         internal for top-level types and private for nested types.
18663         (Delegate.Define): Report errors if the accessibility checks fail.
18665         * enum.cs (Enum.Enum): The default visibility is internal for
18666         top-level types and private for nested types.
18667         (Enum.DefineType): Compute the correct visibility.
18669         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18670         function which takes a `bool is_toplevel' instead of a TypeContainer.
18672         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18673         builtin type.
18675 2002-08-02  Martin Baulig  <martin@gnome.org>
18677         * expression.cs (LocalVariableReferenc): Added constructor which
18678         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18679         (LocalVariableReference.IsReadOnly): New property.
18680         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18681         variable is readonly, use our own readonly flag to do this; you can
18682         use the new constructor to get a writable reference to a read-only
18683         variable.
18685         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18686         reference to the local variable.
18688 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18690         * rootcontext.cs (ResolveCore): Also include System.Exception
18692         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18693         we reach an EmptyStatement.
18695         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18696         is also fine.
18698         * expression.cs (Binary.ResolveOperator): Check error result in
18699         two places.
18701         use brtrue/brfalse directly and avoid compares to null.
18703 2002-08-02  Martin Baulig  <martin@gnome.org>
18705         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18706         Fixes bug #28407, added test-155.cs.
18708 2002-08-01  Martin Baulig  <martin@gnome.org>
18710         * class.cs (Event.EmitDefaultMethod): Make this work with static
18711         events.  Fixes #28311, added verify-3.cs.
18713 2002-08-01  Martin Baulig  <martin@gnome.org>
18715         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18716         `is_disposable' fields.
18717         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18718         `hm.is_disposable' if we're using the collection pattern.
18719         (Foreach.EmitCollectionForeach): Use the correct type for the
18720         enumerator's local variable, only emit the try/finally block if
18721         necessary (fixes #27713).
18723 2002-08-01  Martin Baulig  <martin@gnome.org>
18725         * ecore.cs (Expression.report118): Renamed to Error118 and made
18726         it public static.
18728         * statement.cs (Throw.Resolve): Check whether the expression is of
18729         the correct type (CS0118) and whether the type derives from
18730         System.Exception (CS0155).
18731         (Catch.Resolve): New method.  Do the type lookup here and check
18732         whether it derives from System.Exception (CS0155).
18733         (Catch.CatchType, Catch.IsGeneral): New public properties.
18735         * typemanager.cs (TypeManager.exception_type): Added.
18737 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18739         * driver.cs: Updated About function.
18741 2002-07-31  Martin Baulig  <martin@gnome.org>
18743         Implemented Control Flow Analysis.
18745         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18746         (EmitContext.CurrentBranching): Added.
18747         (EmitContext.StartFlowBranching): Added.
18748         (EmitContext.EndFlowBranching): Added.
18749         (EmitContext.KillFlowBranching): Added.
18750         (EmitContext.IsVariableAssigned): Added.
18751         (EmitContext.SetVariableAssigned): Added.
18752         (EmitContext.IsParameterAssigned): Added.
18753         (EmitContext.SetParameterAssigned): Added.
18754         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18755         Added control flow analysis stuff here.
18757         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18758         resolve the expression as lvalue.
18759         (LocalVariableReference.DoResolve): Check whether the variable has
18760         already been assigned.
18761         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18762         the parameter as assigned here.
18763         (ParameterReference.DoResolve): Check whether the parameter has already
18764         been assigned.
18765         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18766         expression as lvalue.
18768         * statement.cs (FlowBranching): New class for the flow analysis code.
18769         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18770         (LabeledStatement.IsDefined): New public property.
18771         (LabeledStatement.AddUsageVector): New public method to tell flow
18772         analyis that the label may be reached via a forward jump.
18773         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18774         flow analysis.
18775         (VariableInfo.Number): New public field.  This is used by flow analysis
18776         to number all locals of a block.
18777         (Block.CountVariables): New public property.  This is the number of
18778         local variables in this block (including the locals from all parent
18779         blocks).
18780         (Block.EmitMeta): Number all the variables.
18782         * statement.cs: Added flow analysis support to all classes.
18784 2002-07-31  Martin Baulig  <martin@gnome.org>
18786         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18787         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18788         then use this argument.
18790         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18792         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18793         use this to specify /define options.
18795 2002-07-29  Martin Baulig  <martin@gnome.org>
18797         * statement.cs (Fixed): Moved all code that does variable lookups
18798         and resolvings from Emit to Resolve.
18800         * statement.cs (For): Moved all code that does variable lookups
18801         and resolvings from Emit to Resolve.
18803         * statement.cs (Using): Moved all code that does variable lookups
18804         and resolvings from Emit to Resolve.
18806 2002-07-29  Martin Baulig  <martin@gnome.org>
18808         * attribute.cs (Attribute.Resolve): Explicitly catch a
18809         System.NullReferenceException when creating the
18810         CustromAttributeBuilder and report a different warning message.
18812 2002-07-29  Martin Baulig  <martin@gnome.org>
18814         * support.cs (ParameterData.ParameterName): Added method to
18815         get the name of a parameter.
18817         * typemanager.cs (TypeManager.IsValueType): New public method.
18819 2002-07-29  Martin Baulig  <martin@gnome.org>
18821         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18822         is a flag which specifies that it's either ref or out.
18823         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18824         the out parameter to `out Parameter.Modifier mod', also set the
18825         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18827         * support.cs (InternalParameters.ParameterModifier): Distinguish
18828         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18829         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18831         * expression.cs (Argument.GetParameterModifier): Distinguish
18832         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18833         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18835 2002-07-29  Martin Baulig  <martin@gnome.org>
18837         * expression.cs (ParameterReference.ParameterReference): Added
18838         `Location loc' argument to the constructor.
18840         * cs-parser.jay: Pass location to ParameterReference.
18842 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18844         * statement.cs (Try): Initialize the location.
18846         * cs-parser.jay: pass location to Try.
18848         * expression.cs (Unary.Reduce): Change the prototype to return
18849         whether a constant fold could be performed or not.  The result is
18850         returned in an out parameters.  In the case of Indirection and
18851         AddressOf, we want to perform the full tests.
18853 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18855         * statement.cs (Statement.Emit): Flag dead code.
18857 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18859         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18861 2002-07-27  Martin Baulig  <martin@gnome.org>
18863         * class.cs (MethodData.Define): Put back call to
18864         TypeManager.AddMethod(), accidentally commented this out.
18866         * report.cs (Debug): New public method to print debugging information,
18867         this is `[Conditional ("DEBUG")]'.
18869 2002-07-26  Martin Baulig  <martin@gnome.org>
18871         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18872         (switch_statement): Push the current_block to the switch_stack and
18873         pop it again when we're done with the switch.
18874         (switch_section): The new block is a child of the current_block.
18875         Fixes bug #24007, added test-152.cs.
18877 2002-07-27  Martin Baulig  <martin@gnome.org>
18879         * expression.cs (Invocation.EmitArguments): When calling a varargs
18880         function with only its fixed arguments, we need to pass an empty
18881         array.
18883 2002-07-27  Martin Baulig  <martin@gnome.org>
18885         Mono 0.13 has been released.
18887 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18889         * driver.cs: Rename --resource to --linkres, because that is what
18890         we do currently, we dont support --resource yet.
18892         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18894 2002-07-25  Martin Baulig  <martin@gnome.org>
18896         * class.cs (MethodData): New public class.  This is a `method builder'
18897         class for a method or one accessor of a Property/Indexer/Event.
18898         (MethodData.GetMethodFlags): Moved here from MemberBase.
18899         (MethodData.ApplyAttributes): Likewise.
18900         (MethodData.ApplyObsoleteAttribute): Likewise.
18901         (MethodData.ApplyConditionalAttribute): Likewise.
18902         (MethodData.ApplyDllImportAttribute): Likewise.
18903         (MethodData.CheckAbstractAndExternal): Likewise.
18904         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18905         (MethodData.Emit): Formerly known as Method.Emit().
18906         (MemberBase): Moved everything which was specific to a single
18907         accessor/method to MethodData.
18908         (Method): Create a new MethodData and call Define() and Emit() on it.
18909         (Property, Indexer, Event): Create a new MethodData objects for each
18910         accessor and call Define() and Emit() on them.
18912 2002-07-25  Martin Baulig  <martin@gnome.org>
18914         Made MethodCore derive from MemberBase to reuse the code from there.
18915         MemberBase now also checks for attributes.
18917         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18918         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18919         as virtual.
18920         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18921         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18922         (MemberBase.ApplyAttributes): New virtual method; applies the
18923         attributes to a method or accessor.
18924         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18925         (MemberBase.ApplyConditionalAttribute): Likewise.
18926         (MemberBase.ApplyDllImportAttribute): Likewise.
18927         (MemberBase.CheckAbstractAndExternal): Likewise.
18928         (MethodCore.ParameterTypes): This is now a property instead of a
18929         method, it's initialized from DoDefineParameters().
18930         (MethodCore.ParameterInfo): Removed the set accessor.
18931         (MethodCore.DoDefineParameters): New protected virtual method to
18932         initialize ParameterTypes and ParameterInfo.
18933         (Method.GetReturnType): We can now simply return the MemberType.
18934         (Method.GetMethodFlags): Override the MemberBase version and add
18935         the conditional flags.
18936         (Method.CheckBase): Moved some code from Define() here, call
18937         DoDefineParameters() here.
18938         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18939         here to avoid some larger code duplication.
18940         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18941         ensure that abstract and external accessors don't declare a body.
18943         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18944         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18945         lookup in the attribute's parent classes, so we need to abort as soon
18946         as we found the first match.
18947         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18948         the attribute has no arguments.
18950         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18951         of a Method.
18953 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18955         * cs-parser.jay: reverted previous patch.
18957 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18959         * cs-parser.jay: fixed bug #22119.
18961 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18963         * attribute.cs: fixed compilation. The error was:
18964         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18965         be assigned to before control leaves the current method."
18966         [FIXME:  Filed as bug #28186: MCS must report this error.]
18968 2002-07-25  Martin Baulig  <martin@gnome.org>
18970         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18971         method to pull the condition name ouf of a Conditional attribute.
18972         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18973         the obsolete message and error flag out of an Obsolete attribute.
18975         * class.cs (Method.GetMethodFlags): New public method to get the
18976         TypeManager.MethodFlags for this method.
18977         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18978         private methods.
18979         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18980         if we're overriding a virtual function, set the new private variable
18981         `parent_method'; call the new TypeManager.AddMethod().
18983         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18984         the MethodBuilder and the Method in a PtrHashtable.
18985         (TypeManager.builder_to_method): Added for this purpose.
18986         (TypeManager.MethodFlags): Added IsObsoleteError.
18987         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18988         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18989         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18990         the message from the attribute.
18992 2002-07-24  Martin Baulig  <martin@gnome.org>
18994         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18995         preprocessor directives, ensure that the argument to #define/#undef is
18996         exactly one identifier and that it's actually an identifier.
18998         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18999         did not work ....
19001 2002-07-24  Martin Baulig  <martin@gnome.org>
19003         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
19004         initialize it to TypeManager.object_type in the constructor.
19005         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
19006         of the `hm.get_current' method if we're using the collection pattern.
19007         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
19008         for the explicit conversion to make it work when we're using the collection
19009         pattern and the `Current' property has a different return type than `object'.
19010         Fixes #27713.
19012 2002-07-24  Martin Baulig  <martin@gnome.org>
19014         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
19015         does not match, but don't report any errors.  This method is called in
19016         order for all methods in a MethodGroupExpr until a matching method is
19017         found, so we don't want to bail out if the first method doesn't match.
19018         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
19019         matches, report the 123.  Fixes #28070.
19021 2002-07-24  Martin Baulig  <martin@gnome.org>
19023         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
19024         TypeManager.TypeToCoreType() to the top of the method so the
19025         following equality checks will work.  Fixes #28107.
19027 2002-07-24  Martin Baulig  <martin@gnome.org>
19029         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
19030         operand is of type uint, and the other operand is of type sbyte,
19031         short or int, the operands are converted to type long." -
19032         Actually do what this comment already told us.  Fixes bug #28106,
19033         added test-150.cs.
19035 2002-07-24  Martin Baulig  <martin@gnome.org>
19037         * class.cs (MethodBase): New abstract class.  This is now a base
19038         class for Property, Indexer and Event to avoid some code duplication
19039         in their Define() and DefineMethods() methods.
19040         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
19041         generic methods for Define() and DefineMethods().
19042         (FieldBase): Derive from MemberBase, not MemberCore.
19043         (Property): Derive from MemberBase, not MemberCore.
19044         (Property.DefineMethod): Moved all the code from this method to the
19045         new MethodBase.DefineAccessor(), just call it with appropriate
19046         argumetnts.
19047         (Property.Define): Call the new Property.DoDefine(), this does some
19048         sanity checks and we don't need to duplicate the code everywhere.
19049         (Event): Derive from MemberBase, not MemberCore.
19050         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
19051         accessors, this will also make them work with interface events.
19052         (Indexer): Derive from MemberBase, not MemberCore.
19053         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
19054         (Indexer.Define): Use the new MethodBase functions.
19056         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
19057         argument to the constructor.
19058         (Interface.FindMembers): Added support for interface events.
19059         (Interface.PopluateEvent): Implemented.
19061         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
19063 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
19065         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19066         but this is required to check for a method name being the same as
19067         the containing class.  
19069         Handle this now.
19071 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19073         * interface.cs: initialize variable.
19075 2002-07-23  Martin Baulig  <martin@gnome.org>
19077         Implemented the IndexerName attribute in interfaces.
19079         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19080         name if this is an explicit interface implementation.
19081         (Indexer.InterfaceIndexerName): New public variable.  If we're
19082         implementing an interface indexer, this is the IndexerName in that
19083         interface.  Otherwise, it's the IndexerName.
19084         (Indexer.DefineMethod): If we're implementing interface indexer,
19085         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
19086         and Pending.ImplementIndexer methods.
19087         (Indexer.Define): Also define the PropertyBuilder if we're
19088         implementing an interface indexer and this is neither an explicit
19089         interface implementation nor do the IndexerName match the one in
19090         the interface.
19092         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19093         If a method is defined here, then we always need to create a proxy
19094         for it.  This is used when implementing interface indexers.
19095         (Pending.IsInterfaceIndexer): New public method.
19096         (Pending.ImplementIndexer): New public method.
19097         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19098         This is used when implementing interface indexers to define a proxy
19099         if necessary.
19100         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19101         define a proxy if necessary.
19103         * interface.cs (Interface.IndexerName): New public variable.
19104         (Interface.PopulateIndexer): Set the IndexerName.
19105         (Interface.DefineIndexers): New private method.  Populate all the
19106         indexers and make sure their IndexerNames match.
19108         * typemanager.cs (IndexerPropertyName): Added support for interface
19109         indexers.
19111 2002-07-22  Martin Baulig  <martin@gnome.org>
19113         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19114         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19115         ret if HasReturnLabel.
19116         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19117         variables.
19119         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19120         and set the ec.LoopBeginTryCatchLevel.
19121         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19122         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19123         the current ec.TryCatchLevel, the branch goes out of an exception
19124         block.  In this case, we need to use Leave and not Br.
19126 2002-07-22  Martin Baulig  <martin@gnome.org>
19128         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19129         block unless the block does not always return or it is contained in
19130         another try { ... } catch { ... } block.  Fixes bug #26506.
19131         Added verify-1.cs to the test suite.
19133 2002-07-22  Martin Baulig  <martin@gnome.org>
19135         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19136         then we do not always return.  Fixes bug #24985.
19138 2002-07-22  Martin Baulig  <martin@gnome.org>
19140         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19141         lookup on a per-class level; ie. walk up the class hierarchy until we
19142         found at least one applicable method, then choose the best among them.
19143         Fixes bug #24463 and test-29.cs.
19145 2002-07-22  Martin Baulig  <martin@gnome.org>
19147         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19148         return types of the methods.  The return type is not part of the
19149         signature and we must not check it to make the `new' modifier work.
19150         Fixes bug #27999, also added test-147.cs.
19151         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19153         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19154         on the method's return type.
19156 2002-07-21  Martin Baulig  <martin@gnome.org>
19158         * assign.cs: Make this work if the rightmost source is a constant and
19159         we need to do an implicit type conversion.  Also adding a few more tests
19160         to test-38.cs which should have caught this.
19162         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19163         target in the makefile for this.  The makefile.gnu is primarily intended
19164         for end-users who don't want to debug the compiler.
19166 2002-07-21  Martin Baulig  <martin@gnome.org>
19168         * assign.cs: Improved the Assign class so it can now handle embedded
19169         assignments (X = Y = Z = something).  As a side-effect this'll now also
19170         consume less local variables.  test-38.cs now passes with MCS, added
19171         a few new test cases to that test.
19173 2002-07-20  Martin Baulig  <martin@gnome.org>
19175         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19176         instructions.  Fixes bug #27977, also added test-146.cs.
19178 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19180         * cs-tokenizer.cs: fixed getHex ().
19182 2002-07-19  Martin Baulig  <martin@gnome.org>
19184         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19185         not Type.GetType() to lookup the array type.  This is needed when
19186         we're constructing an array of a user-defined type.
19187         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19188         single-dimensional arrays, but also for single-dimensial arrays of
19189         type decimal.
19191 2002-07-19  Martin Baulig  <martin@gnome.org>
19193         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19194         this function is called, it's not allowed to share LocalBuilders
19195         among ILGenerators.
19197 2002-07-19  Martin Baulig  <martin@gnome.org>
19199         * expression.cs (Argument.Resolve): Report an error 118 when trying
19200         to pass a type as argument.
19202 2002-07-18  Martin Baulig  <martin@gnome.org>
19204         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19205         Conv_R_Un for the signed `long' type.
19207 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
19209         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19210         `expr' for the temporary result, as that will fail if we do
19211         multiple resolves on the same expression.
19213 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
19215         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19216         ec.TypeContainer for looking up aliases. 
19218         * class.cs (TypeContainer): Remove LookupAlias from here.
19220         * decl.cs (DeclSpace); Move here.
19222 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
19224         * class.cs (FindMembers): Only call filter if the constructor
19225         bulider is not null.
19227         Also handle delegates in `NestedTypes' now.  Now we will perform
19228         type lookups using the standard resolution process.  This also
19229         fixes a bug.
19231         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19232         This uses Expressions (the limited kind that can be parsed by the
19233         tree) instead of strings.
19235         * expression.cs (ComposedCast.ToString): Implement, used to flag
19236         errors since now we have to render expressions.
19238         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
19239         FormArrayType. 
19241         * ecore.cs (SimpleName.ToString): ditto.
19243         * cs-parser.jay: Instead of using strings to assemble types, use
19244         Expressions to assemble the type (using SimpleName, ComposedCast,
19245         MemberAccess).  This should fix the type lookups in declarations,
19246         because we were using a different code path for this.
19248         * statement.cs (Block.Resolve): Continue processing statements
19249         even when there is an error.
19251 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
19253         * class.cs (Event.Define): Also remove the `remove' method from
19254         the list of pending items.
19256         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19257         generate more compact code. 
19259 2002-07-17  Martin Baulig  <martin@gnome.org>
19261         * const.cs (Const.LookupConstantValue): Add support for constant
19262         `unchecked' and `checked' expressions.
19263         Also adding test case test-140.cs for this.
19265 2002-07-17  Martin Baulig  <martin@gnome.org>
19267         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19268         check whether mi.ReturnType implements the IEnumerator interface; the
19269         `==' and the IsAssignableFrom() will fail in this situation.
19271 2002-07-16  Ravi Pratap  <ravi@ximian.com>
19273         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
19274         here too.
19276 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19278         * expression.cs: fixed bug #27811.
19280 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
19282         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19283         Molaro: when we are a ref, the value already contains a pointer
19284         value, do not take the address of it.
19286 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19287         * removed mb-parser.jay and mb-tokenizer.cs
19289 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19291         * expression.cs: check against the building corlib void type.
19293 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19295         * ecore.cs: fix for valuetype static readonly fields: when 
19296         initializing them, we need their address, not the address of a copy.
19298 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19300         * typemanager.cs: register also enum_type in corlib.
19302 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19304         * class.cs: allow calling this (but not base) initializers in structs.
19306 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19308         * ecore.cs: make sure we compare against the building base types
19309         in GetTypeSize ().
19311 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19313         * typemanager.cs: fix TypeToCoreType() to handle void and object
19314         (corlib gets no more typerefs after this change).
19316 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
19318         * expression.cs (ArrayCreation.EmitArrayArguments): use
19319         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19321         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19322         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
19323         array indexes, the runtime actually forbids them.
19325         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19326         for array arguments here.
19328         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19329         instead of the default for ValueTypes.
19331         (New.DoEmit): Use IsValueType instead of
19332         IsSubclassOf (value_type)
19333         (New.DoResolve): ditto.
19334         (Invocation.EmitCall): ditto.
19336         * assign.cs (Assign): ditto.
19338         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19339         Statements *are* currently doing part of their resolution during
19340         Emit.  
19342         Expressions do always resolve during resolve, but statements are
19343         only required to propagate resolution to their children.
19345 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
19347         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19349         (LoadAssembly): Do not add the dll if it is already specified
19351         (MainDriver): Add the System directory to the link path at the end,
19352         after all the other -L arguments. 
19354         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19355         wrong opcode for loading bytes and bools (ldelem.i1 instead of
19356         ldelem.u1) and using the opposite for sbytes.
19358         This fixes Digger, and we can finally run it.
19360         * driver.cs (UnixParseOption): Move the option parsing here.  
19361         (CSCParseOption): Implement CSC-like parsing of options.
19363         We now support both modes of operation, the old Unix way, and the
19364         new CSC-like way.  This should help those who wanted to make cross
19365         platform makefiles.
19367         The only thing broken is that /r:, /reference: and /lib: are not
19368         implemented, because I want to make those have the same semantics
19369         as the CSC compiler has, and kill once and for all the confussion
19370         around this.   Will be doing this tomorrow.
19372         * statement.cs (Unsafe.Resolve): The state is checked during
19373         resolve, not emit, so we have to set the flags for IsUnsfe here.
19375 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19377         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19378         not catch the Error_ObjectRefRequired in SimpleName (as it is
19379         possible to have a class/instance variable name that later gets
19380         deambiguated), we have to check this here.      
19382 2002-07-10  Ravi Pratap  <ravi@ximian.com>
19384         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19385         make static and put into Expression.
19387         (Event.Define): Register the private field of the event with the 
19388         TypeManager so that GetFieldFromEvent can get at it.
19390         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19391         keep track of the private field associated with an event which
19392         has no accessors.
19394         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19395         private field.
19397         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19399 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
19401         * expression.cs (Binary.EmitBranchable): this routine emits the
19402         Binary expression in a branchable context.  This basically means:
19403         we need to branch somewhere, not just get the value on the stack.
19405         This works together with Statement.EmitBoolExpression.
19407         * statement.cs (Statement.EmitBoolExpression): Use
19408         EmitBranchable. 
19410 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19412         * statement.cs (For): Reduce the number of jumps in loops.
19414         (For): Implement loop inversion for the For statement.
19416         (Break): We can be breaking out of a Try/Catch controlled section
19417         (foreach might have an implicit try/catch clause), so we need to
19418         use Leave instead of Br.
19420         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19421         now).  If the instace expression supports IMemoryLocation, we use
19422         the AddressOf method from the IMemoryLocation to extract the
19423         address instead of emitting the instance.
19425         This showed up with `This', as we were emitting the instance
19426         always (Emit) instead of the Address of This.  Particularly
19427         interesting when This is a value type, as we dont want the Emit
19428         effect (which was to load the object).
19430 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19432         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19434         * statement.cs (Checked): Set the CheckedState during the resolve
19435         process too, as the ConvCast operations track the checked state on
19436         the resolve process, and not emit.
19438         * cs-parser.jay (namespace_member_declaration): Flag that we have
19439         found a declaration when we do.  This is used to flag error 1529
19441         * driver.cs: Report ok when we display the help only.
19443 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19445         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19447 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19449         * cs-tokenizer.cs (define): We also have to track locally the
19450         defines.  AllDefines is just used for the Conditional Attribute,
19451         but we also need the local defines for the current source code. 
19453 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19455         * statement.cs (While, For, Do): These loops can exit through a
19456         Break statement, use this information to tell whether the
19457         statement is the last piece of code.
19459         (Break): Flag that we break.
19461         * codegen.cs (EmitContexts): New `Breaks' state variable.
19463 2002-07-03  Martin Baulig  <martin@gnome.org>
19465         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19466         modifiers in method declarations in structs.  Otherwise, you won't
19467         be able to override things like Object.Equals().
19469 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19471         * class.cs (Method, Property, Indexer): Do not allow the public
19472         modifier to be used in explicit interface implementations.
19474         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19475         override modifiers in method declarations in structs
19477 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19479         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19480         integer or real overflow, report an error
19482 2002-07-02  Martin Baulig  <martin@gnome.org>
19484         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19485         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19486         to tell the runtime about our newly created System.Object and
19487         System.ValueType types.
19489 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19491         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19492         struct instead of Ldarg/Starg.
19494 2002-07-02  Martin Baulig  <martin@gnome.org>
19496         * expression.cs (Indirection.Indirection): Call
19497         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19499 2002-07-02  Martin Baulig  <martin@gnome.org>
19501         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19502         ValueType, call TypeManager.TypeToCoreType() on it.
19503         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19504         the OpCodes.Newarr argument.
19506 2002-07-02  Martin Baulig  <martin@gnome.org>
19508         * expression.cs (Invocation.EmitCall): When compiling corlib,
19509         replace all calls to the system's System.Array type to calls to
19510         the newly created one.
19512         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19513         System.Array methods.
19514         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19515         from the system's System.Array type which must be replaced.
19517 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19519         * typemanager.cs: load unverifiable_code_ctor so we can build
19520         corlib using the correct type. Avoid using GetTypeCode() with
19521         TypeBuilders.
19522         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19523         TypeManager.object_type to allow building corlib.
19525 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19527         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19529 2002-07-01  Martin Baulig  <martin@gnome.org>
19531         * class.cs: Make the last change actually work, we need to check
19532         whether `ifaces != null' to avoid a crash.
19534 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19536         * class.cs: when we build structs without fields that implement
19537         interfaces, we need to add the interfaces separately, since there is
19538         no API to both set the size and add the interfaces at type creation
19539         time.
19541 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19543         * expression.cs: the dimension arguments to the array constructors
19544         need to be converted if they are a long.
19546 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19548         * class.cs: don't emit ldarg.0 if there is no parent constructor
19549         (fixes showstopper for corlib).
19551 2002-06-29  Martin Baulig  <martin@gnome.org>
19553         MCS now compiles corlib on GNU/Linux :-)
19555         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19556         ie. check for MethodImplOptions.InternalCall.
19558         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19559         and TypeManager.attribute_type are null, so we must explicitly check
19560         whether parent is not null to find out whether it's an attribute type.
19561         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19562         and SetBuilder, not only if the property is neither abstract nor external.
19563         This is necessary to set the MethodImplOptions on the accessor methods.
19564         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19565         SetBuilder, see Property.Emit().
19567         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19568         populate "System.Object", "System.ValueType" and "System.Attribute" since
19569         they've already been populated from BootCorlib_PopulateCoreTypes().
19571 2002-06-29  Martin Baulig  <martin@gnome.org>
19573         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19574         is the NullLiteral, we also need to make sure that target_type is not
19575         an enum type.   
19577 2002-06-29  Martin Baulig  <martin@gnome.org>
19579         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19580         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19581         before calling BootstrapCorlib_ResolveDelegate ().
19583 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19585         * statement.cs: fixed build-breaker. All tests passed ok.
19587 2002-06-27  Martin Baulig  <martin@gnome.org>
19589         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19590         for System.Decimal when compiling corlib.
19592 2002-06-27  Martin Baulig  <martin@gnome.org>
19594         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19595         switch blocks which contain nothing but a default clause.
19597 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19599        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19601 2002-06-27  Martin Baulig  <martin@gnome.org>
19603         * ecore.cs (PropertyExpr.PropertyExpr): Call
19604         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19606         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19607         is already a TypeBuilder.
19609 2002-06-27  Martin Baulig  <martin@gnome.org>
19611         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19612         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19613         the "from an array-type to System.Array" case.  This makes it work
19614         when compiling corlib.
19616 2002-06-27  Martin Baulig  <martin@gnome.org>
19618         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19619         non-static PropertyExpr, set its InstanceExpression.  This makes
19620         the `ICollection.Count' property work in System/Array.cs.
19622 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19624         * driver.cs: Made error handling more consistent.  Errors now
19625         tracked by Report class, so many methods which used to return int
19626         now return void.  Main() now prints success/failure and 
19627         errors/warnings message.
19629         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19630         the magic number return values (123 and 124).  Now, if the
19631         expected error occurs, the compiler exits with success (exit value
19632         0).  If the compilation completes without seeing that particular
19633         error, the compiler exits with failure (exit value 1).  The
19634         makefile in mcs/errors has been changed to handle the new behaviour.
19636         * report.cs: Made 'expected error' number a property and renamed
19637         it from 'Probe' to 'ExpectedError'.
19639         * genericparser.cs: Removed error handling support, since it is
19640         now all done by Report class.
19642         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19643         class, so parse() no longer returns an int.
19645         * namespace.cs: Use Report.Error instead of GenericParser.error
19647 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19649         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19650         TypeContainer.AddOperator): At the front of the list put the
19651         explicit implementations, so they get resolved/defined first. 
19653 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19655         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19656         interface type is implemented by this TypeContainer.  Used during
19657         explicit interface implementation.
19659         (Property.Define, Indexer.Define, Method.Define): Validate that
19660         the given interface in the explicit implementation is one of the
19661         base classes for the containing type.
19663         Also if we are explicitly implementing an interface, but there is
19664         no match in the pending implementation table, report an error.
19666         (Property.Define): Only define the property if we are
19667         not explicitly implementing a property from an interface.  Use the
19668         correct name also for those properties (the same CSC uses,
19669         although that is really not needed).
19671         (Property.Emit): Do not emit attributes for explicitly implemented
19672         properties, as there is no TypeBuilder.
19674         (Indexer.Emit): ditto.
19676         Hiding then means that we do not really *implement* a pending
19677         implementation, which makes code fail.
19679 2002-06-22  Martin Baulig  <martin@gnome.org>
19681         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19682         the return value of Object.GetType().  [FIXME: we need to do this whenever
19683         we get a type back from the reflection library].
19685 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19687         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19689 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19691         * attribute.cs: Return null if we can not look up the type.
19693         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19694         the interface types found.
19696         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19697         interface types found.
19699         * typemanager.cs (GetInterfaces): Make this routine returns alll
19700         the interfaces and work around the lame differences between
19701         System.Type and System.Reflection.Emit.TypeBuilder in the results
19702         result for GetInterfaces.
19704         (ExpandInterfaces): Given an array of interface types, expand and
19705         eliminate repeated ocurrences of an interface.  This expands in
19706         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19707         be IA, IB, IC.
19709 2002-06-21  Martin Baulig  <martin@gnome.org>
19711         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19712         on System.Enum.
19714 2002-06-21  Martin Baulig  <martin@gnome.org>
19716         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19717         and called with one of the core types, return the corresponding typebuilder for
19718         that type.
19720         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19721         element type.
19723 2002-06-21  Martin Baulig  <martin@gnome.org>
19725         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19726         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19727         (Expression.ConvertReferenceExplicit): Likewise.
19729         * expression.cs (ElementAccess.DoResolve): Likewise.
19730         (ElementAccess.DoResolveLValue): Likewise.
19732 2002-06-10  Martin Baulig  <martin@gnome.org>
19734         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19735         add the "value" parameter to the parameter list.
19737         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19738         to our caller.
19740 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19742         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19743         the argument to an int, uint, long or ulong, per the spec.  Also
19744         catch negative constants in array creation.
19746 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19748         * class.cs: do not allow the same interface to appear twice in
19749         the definition list.
19751 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19753         * ecore.cs: don't use ldlen with System.Array.
19755 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19757         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19759 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19761         * modifiers.cs: produce correct field attributes for protected
19762         internal. Easy fix so miguel can work on ther harder stuff:-)
19764 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19766         * pending.cs: New file.  Move the code from class.cs here.
19767         Support clearning the pending flag for all methods (when not doing
19768         explicit interface implementation).
19770 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19772         * rootcontext.cs: added a couple more types needed to bootstrap.
19774 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19776         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19777         constructor in the type, instead of any constructor in the type
19778         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19779         a bug in the Mono runtime when applying the params attribute). 
19781 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19782         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19784 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19786         * expression.cs (Unary.ResolveOperator): Use TypeManager
19787         to resolve the type.
19789 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19791         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19792         attached.
19794         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19795         with each member too.
19797         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19798         field builders too - this takes care of the enum member case.
19800 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19802         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19803         address-of operator on both value types and pointers.
19805 2002-06-10  Martin Baulig  <martin@gnome.org>
19807         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19808         PropertyBuilder to the `property_builders' list.
19810         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19811         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19812         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19813         find any indexers which are inherited from an interface.
19815 2002-06-09  Martin Baulig  <martin@gnome.org>
19817         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19818         the same type as the constant if necessary.  There's also a test-130.cs
19819         for this.
19821         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19823         * typemanager.cs (TypeManager.ChangeType): Previously known as
19824         Enum.ChangeEnumType().
19826 2002-06-09  Martin Baulig  <martin@gnome.org>
19828         * expression.cs (Cast.TryReduce): Added support for consts.
19830 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19832         * class.cs (Accessor): Hold attributes information so we can pass
19833         it along.
19835         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19836         Modify to pass in attributes attached to the methods.
19838         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19840         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19841         to handle the Accessor kind :-)
19843         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19845 2002-06-08  Martin Baulig  <martin@gnome.org>
19847         * expression.cs (Unary.TryReduceNegative): Added support for
19848         ULongConstants.
19850 2002-06-08  Martin Baulig  <martin@gnome.org>
19852         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19853         name can't be found in the `defined_names' - the caller will do a
19854         MemberLookup in this case and thus find methods in System.Enum
19855         such as Enum.IsDefined().
19857 2002-06-08  Martin Baulig  <martin@gnome.org>
19859         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19860         Convert.ChangeType() which works with TypeBuilder created types.
19861         (Enum.LookupEnumValue, Enum.Define): Use it here.
19863         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19864         `TypeBuilder.BaseType != null' check.
19865         (TypeContainer.FindMembers): Only lookup parent members if we
19866         actually have a parent.
19867         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19868         (ConstructorInitializer.Resolve): Likewise.
19870         * interface.cs (Interface.FindMembers): Added
19871         `TypeBuilder.BaseType != null' check.
19873         * rootcontext.cs (RootContext.ResolveCore): Added
19874         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19875         classes_second_stage.
19877         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19878         debug_type and trace_type when compiling with --nostdlib.       
19880 2002-06-07  Martin Baulig  <martin@gnome.org>
19882         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19883         (AddField): Set it to true when adding a non-static field.
19884         (DefineType): Use `have_nonstatic_fields' to find out whether we
19885         have non-static fields, not `Fields != null'.
19887 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19889         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19890         dereferencing a null on the static-field code path)
19892 2002-05-30  Martin Baulig  <martin@gnome.org>
19894         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19895         to take command line arguments.  Use reflection to call the new
19896         custom `Initialize' function on the symbol writer and pass it the
19897         command line arguments.
19899         * driver.cs (--debug-args): New command line argument to pass command
19900         line arguments to the symbol writer.
19902 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19904         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19905         the target type for indexers and properties.  Thanks to Joe for
19906         catching this.
19908 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19910         * typemanager.cs (MethodFlags): returns the method flags
19911         (Obsolete/ShouldIgnore) that control warning emission and whether
19912         the invocation should be made, or ignored. 
19914         * expression.cs (Invocation.Emit): Remove previous hack, we should
19915         not do this on matching a base type, we should do this based on an attribute
19917         Only emit calls to System.Diagnostics.Debug and
19918         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19919         on the command line.
19921         * rootcontext.cs: Global settings for tracing and debugging.
19923         * cs-tokenizer.cs (define): New utility function to track
19924         defines.   Set the global settings for TRACE and DEBUG if found.
19926 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19928         * interface.cs (Populate*): Pass in the TypeContainer as well as
19929         the DeclSpace as parameters so that we can create EmitContexts and
19930         then use that to apply attributes etc.
19932         (PopulateMethod, PopulateEvent, PopulateProperty)
19933         (PopulateIndexer): Apply attributes everywhere.
19935         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19936         etc.
19938         (ApplyAttributes): Update accordingly.
19940         We now apply interface attributes for all members too.
19942 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19944         * class.cs (Indexer.Define); Correctly check if we are explicit
19945         implementation (instead of checking the Name for a ".", we
19946         directly look up if the InterfaceType was specified).
19948         Delay the creation of the PropertyBuilder.
19950         Only create the PropertyBuilder if we are not an explicit
19951         interface implementation.   This means that explicit interface
19952         implementation members do not participate in regular function
19953         lookups, and hence fixes another major ambiguity problem in
19954         overload resolution (that was the visible effect).
19956         (DefineMethod): Return whether we are doing an interface
19957         implementation. 
19959         * typemanager.cs: Temporary hack until we get attributes in
19960         interfaces (Ravi is working on that) and we get IndexerName
19961         support in interfaces.
19963         * interface.cs: Register the indexers as properties.
19965         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19966         warning, I have verified that this is a bug in the .NET runtime
19967         (JavaScript suffers of the same problem).
19969         * typemanager.cs (MemberLookup): When looking up members for
19970         interfaces, the parent of an interface is the implicit
19971         System.Object (so we succeed in searches of Object methods in an
19972         interface method invocation.  Example:  IEnumerable x;  x.ToString
19973         ()) 
19975 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19977         * class.cs (Event): Events should also register if they do
19978         implement the methods that an interface requires.
19980         * typemanager.cs (MemberLookup); use the new GetInterfaces
19981         method. 
19983         (GetInterfaces): The code used to lookup interfaces for a type is
19984         used in more than one place, factor it here. 
19986         * driver.cs: Track the errors at the bottom of the file, we kept
19987         on going.
19989         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19990         instance if the method we are calling is static!
19992 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19994         * attribute.cs (ApplyAttributes): Make this function filter out
19995         the IndexerName attribute (as that attribute in reality is never
19996         applied) and return the string constant for the IndexerName
19997         attribute. 
19999         * class.cs (TypeContainer.Emit): Validate that all the indexers
20000         have the same IndexerName attribute, and if so, set the
20001         DefaultName attribute on the class. 
20003         * typemanager.cs: The return value might contain other stuff (not
20004         only methods).  For instance, consider a method with an "Item"
20005         property and an Item method.
20007         * class.cs: If there is a problem with the parameter types,
20008         return. 
20010 2002-05-24  Ravi Pratap  <ravi@ximian.com>
20012         * ecore.cs (ImplicitConversionExists): Wrapper function which also
20013         looks at user defined conversion after making a call to 
20014         StandardConversionExists - we need this for overload resolution.
20016         * expression.cs : Update accordingly the various method calls.
20018         This fixes 2 bugs filed against implicit user defined conversions 
20020 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
20022         * statement.cs: Track the result of the assignment.
20024 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
20026         * expression.cs (MemberAccess): Improved error reporting for
20027         inaccessible members.
20029 2002-05-22  Martin Baulig  <martin@gnome.org>
20031         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
20032         itself with debugging support.
20034 2002-05-22  Martin Baulig  <martin@gnome.org>
20036         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
20037         Removed, this isn't needed anymore.
20039 2002-05-20  Martin Baulig  <martin@gnome.org>
20041         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
20042         be underlying type for an enum.
20044 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
20046         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
20047         that splits out the loading of just the core types.
20049         * rootcontext.cs (ResolveCore): Split the struct resolution in
20050         two, so we can load the enumeration underlying types before any
20051         enums are used.
20053         * expression.cs (Is): Bandaid until we fix properly Switch (see
20054         bug #24985 for details).
20056         * typemanager.cs (ImplementsInterface): The hashtable will contain
20057         a null if there are no interfaces implemented.
20059 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
20061         * cs-parser.jay (indexer_declarator): It is fine to have array
20062         parameters
20064 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20066         * typemanager.cs: (RegisterBuilder): New function used to register
20067         TypeBuilders that implement interfaces.  Since
20068         TypeBuilder.GetInterfaces (as usual) does not work with lame
20069         Reflection.Emit. 
20070         (AddUserType): register interfaces.
20072         (ImplementsInterface): Use the builder_to_ifaces hash if we are
20073         dealing with TypeBuilder.  Also, arrays are showing up as
20074         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20075         methods can not be invoked on them!
20077         * ecore.cs (ExplicitReferenceConversionExists): Made public.
20078         (ImplicitReferenceConversionExists): Split out from
20079         StandardConversionExists. 
20081         * expression.cs (As): We were only implementing one of the three
20082         cases for the as operator.  We now implement them all.
20083         (Is): Implement the various other cases for Is as well.
20085         * typemanager.cs (CACHE): New define used to control if we want or
20086         not the FindMembers cache.  Seems to have a negative impact on
20087         performance currently
20089         (MemberLookup): Nested types have full acess to
20090         enclosing type members
20092         Remove code that coped with instance/static returns for events, we
20093         now catch this in RealFindMembers.
20095         (RealFindMembers): only perform static lookup if the instance
20096         lookup did not return a type or an event.  
20098 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
20100         * assign.cs (CompoundAssign): We pass more semantic information
20101         now to Compound Assignments than we did before: now we have all
20102         the information at hand, and now we resolve the target *before* we
20103         do the expression expansion, which allows the "CacheValue" method
20104         to have the effect we intended (before, a [x] += 1 would generate
20105         two differen ArrayAccess expressions from the ElementAccess,
20106         during the resolution process).
20108         (CompoundAssign.DoResolve): Resolve target and original_source here.
20110 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
20112         * expression.cs (ArrayAccess): dropped debugging information. 
20114         * typemanager.cs: Small bug fix: I was always returning i_members,
20115         instead of one of i_members or s_members (depending on which had
20116         the content).
20118         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
20119         method is invoked before any code generation takes place, and it
20120         is a mechanism to inform that the expression will be invoked more
20121         than once, and that the method should use temporary values to
20122         avoid having side effects
20124         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20126         * ecore.cs (Expression.CacheTemporaries): Provide empty default
20127         implementation.
20129         * expression.cs (Indirection, ArrayAccess): Add support for
20130         CacheTemporaries in these two bad boys. 
20132         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20133         ldobj or ldind_ref.  
20134         (StoreFromPtr): Handle stobj as well.
20136         * expression.cs (UnaryMutator): Share more code.
20138         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20139         down: I was not tracking the Filter function as well, which
20140         was affecting the results of the cache.
20142 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
20144         * attribute.cs: Remove the hack to handle the CharSet property on
20145         StructLayouts. 
20147 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
20149         * attribute.cs (DoResolve): More uglyness, we now only try to
20150         resolve the attribute partially, to extract the CharSet
20151         information (only if we are a StructLayout attribute).  Otherwise 
20153         (GetExtraTypeInfo): Add some code to conditionally kill in the
20154         future this.   I am more and more convinced that the .NET
20155         framework has special code to handle the attribute setting on
20156         certain elements.
20158         * expression.cs (IsParamsMethodApplicable): Revert my previous
20159         foreach change here, it was wrong.
20161 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
20163         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20164         (pp_expr): do not abort on unknown input, just return.
20165         (eval): abort if there are pending chars.
20167         * attribute.cs (Attribute.Resolve): Positional parameters are
20168         optional.  Deal with that case.
20170         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20171         the Ansi/Unicode/Auto information for the type.
20173         (TypeContainer.DefineType): instantiate the EmitContext here, as
20174         we will be using it during the type definition (to resolve
20175         attributes) and during the emit phase.
20177         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20178         to pull type information out of the attributes
20180         (Attribute.Resolve): track the constructor builder, and allow for
20181         multiple invocations (structs and classes will use this).
20183         * ecore.cs (MemberLookupFinal): new version with all the
20184         parameters customizable.
20186         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20187         constructors.  Return if the result value is null (as the error
20188         would have been flagged already by MemberLookupFinal)
20190         Do not allow instances of abstract classes or interfaces to be
20191         created.
20193         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20194         We have to compare the assembly property here when dealing with
20195         FamANDAssem and Assembly access modifiers, because we might be
20196         creating an assembly from *modules* (that means that we are not
20197         getting TypeBuilders for types defined in other modules that are
20198         part of this assembly).
20200         (Method.Emit): If the method is marked abstract and has a body,
20201         emit an error. 
20203         (TypeContainer.DefineMembers): If both the defined member and the
20204         parent name match are methods, then do not emit any warnings: let
20205         the Method.Define routine take care of flagging warnings.  But if
20206         there is a mismatch (method overrides something else, or method is
20207         overriwritten by something, then emit warning).
20209         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20210         set to null, this means `do not check for the return type on the
20211         signature'. 
20213         (Method.Define): set the return type for the method signature to
20214         null, so that we get methods with the same name and parameters and
20215         different return types.  This is used to flag warning 114 (you are
20216         hiding a method, and you probably want to use the new/override
20217         keywords instead).
20219         * typemanager.cs (MemberLookup): Implemented proper access
20220         control, closing a long standing set of bug reports.  The problem
20221         was that the Framework only has two bits: Public and NonPublic,
20222         and NonPublic includes private and protected methods, but we need
20223         to enforce the FamANDAssem, FamOrAssem and Family. 
20225 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
20227         * statement.cs (GotoCase): Return true: Ammounts to giving up
20228         knowledge on whether we return or not, and letting the other case
20229         be responsible for it.
20231 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
20233         * driver.cs: Do not load directories for each file processed, only
20234         do it if there is a pattern.
20236         * ecore.cs: Report readonly assigns here as well, as we might have
20237         been resolved only by MemberAccess.
20239         (SimpleName.SimpleNameResolve): Also be useful for LValue
20240         resolution.   We need this to propagate assign to local readonly variables
20242         * typemanager.cs: Use a ptrhashtable for the criteria, because we
20243         do not want to reuse potential criteria memory.
20245         * class.cs (MyEventBuilder): Set reflected_type;
20247         * ecore.cs (Constantify): Added support for constifying bools.
20249         (RootContext.LookupType): Added a cache for values looked up in
20250         the declaration space.
20252         * typemanager.cs (FindMembers): Now is a front-end to
20253         RealFindMembers, and provides a two-level hashtable-based cache to
20254         the request.  
20256         15% performance improvement: from 22.5 to 19.2 seconds.
20258         * expression.cs (IsParamsMethodApplicable): use foreach.
20259         (Invocation.DoResolve): ditto.
20260         (New.DoResolve): ditto.
20261         (ArrayCreation.DoResolve): ditto.
20263         * ecore.cs (FindMostEncompassingType): use foreach.
20265         * delegate.cs (NewDelegate.DoResolve): Use foreach
20267         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20268         (RemoveMethods): use foreach.
20270         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20271         nested foreach statements instead of for, and also break out of
20272         the inner loop once a match is found.
20274         (Invocation.OverloadResolve): Use foreach, simplify the code. 
20276 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
20278         * cfold.cs (BinaryFold): During an enumeration evaluation context,
20279         we actually unwrap the expression to allow for extra information
20280         to be extracted. 
20282         * expression.cs: Use Shr_Un on unsigned operations. 
20284 2002-05-08  Ravi Pratap  <ravi@ximian.com>
20286         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
20287         applicable operators was not being considered correctly. This closes
20288         the bug Miguel reported.
20290 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20292         * attribute.cs: check that the type derives from System.Attribute
20293         and report the correct error in that case (moved the duplicate code to
20294         its own method, too).
20296 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20298         * attribute.cs: lookup attribute type name as the spec says: first the
20299         bare attribute name and then name + "Attribute" (nant compiles with
20300         mcs after this fix).
20302 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
20304         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
20305         Because of the way we parse things, we should try to see if a
20306         UIntConstant can fit in an integer.
20308 2002-05-07  Ravi Pratap  <ravi@ximian.com>
20310         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20311         when we are in an explicit context.
20313         (ConvertReferenceExplicit): When converting from Iface type S to Class
20314         T make sure the rules are implemented as an OR.
20316         * parameter.cs (ParameterType): Make it a property for now although the
20317         purpose really isn't anything immediate.
20319         * expression.cs (Is*Applicable): Do better checking on the parameter type
20320         of a ref/out parameter. The ones from the system assemblies are already 
20321         marked with the correct type so we don't need to do any correction.
20323         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
20324         the object type is standard too so include that.
20326 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20328         * ecore.cs (StandardConversionExists): Augment with missing code:
20329         deal with IntConstant, LongConstants and Enumerations.
20331         * assign.cs: Report the error, instead of failing silently
20333         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20334         typecontainer that they are declared, because the
20335         typecontainer/namespace will have the list of using clauses that
20336         need to be applied.
20338         Assembly Attributes were escaping the normal registration
20339         mechanism. 
20341         (EmitCode): Apply attributes within an EmitContext that represents
20342         the container they were declared on.
20344         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
20346 2002-05-06  Ravi Pratap  <ravi@ximian.com>
20348         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20349         Revamp completely - make much cleaner as we now operate only
20350         on a set of Types.
20352         (FindMostSpecificSource, FindMostSpecificTarget): New methods
20353         to implement the logic detailed in the spec more correctly.
20355         (UserDefinedConversion): Update accordingly.
20357 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20359         * statement.cs: Return flow analysis information up.
20361         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20362         and the default.
20364         (token): Do not consume an extra character before calling
20365         decimal_digits.
20367 2002-05-06  Piers Haken <piersh@friskit.com>
20369         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20371 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
20373         * class.cs (Constructor.Emit): Set the IsStatic flag in the
20374         EmitContext during the instance constructor initializer
20375         resolution, to stop access to instance variables.
20377         This is mandated by the spec, last paragraph of the `constructor
20378         initializers' section. 
20380 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
20382         * cs-parser.jay, class.cs (Accessor): new class used to represent
20383         an accessor (get or set).  In the past we used `null' to represent
20384         a missing accessor.  But this is ambiguous because there was no
20385         way to tell in abstract indexers/properties if one of them was
20386         specified.
20388         Now there is a way of addressing that.
20390         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20391         instead of FindMembers.
20393         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20394         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20396         * attribute.cs: Treat indexers and properties as the same in terms
20397         of applying attributes
20399         * ecore.cs (FindMostEncompassedType): Use statically initialized
20400         EmptyExpressions()s like we do elsewhere to avoid creating useless
20401         objects (and we take this out of the tight loop).
20403         (GetConversionOperators): Move the code to extract the actual
20404         operators to a separate routine to clean things up.
20406 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
20408         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20409         events are always registered FieldBuilders.
20411         * class.cs (FieldBase): New class shared by Fields 
20413         * delegate.cs: If we are a toplevel delegate, use our full name.
20414         If we are a nested delegate, then only use our tail name.
20416 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20418         * expression.cs (IsApplicable): Ensure that we add the "&" to
20419         ref/out types before comparing it with the type of the argument.
20421         (IsParamsMethodApplicable): Ditto.
20423         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20424         silly me ;-)
20426         * delegate.cs : Handle the case when we have more than one applicable
20427         method. Flag an error only when we finish checking all.
20429 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20431         * expression.cs: Add support for boolean static initializers.
20433 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20435         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20437         * parameter.cs (ComputeParameterTypes,
20438         ComputeAndDefineParameterTypes): Better error handling: now we
20439         clear the `types' cache if we fail during any of the type lookups.
20440         We also return the status code correctly to our caller
20442         * delegate.cs: If we fail to define a delegate, abort the extra
20443         steps. 
20445         * expression.cs (Binary.ResolveOperator): for
20446         operator==(object,object) and operator !=(object, object) we also
20447         have to verify that there is an implicit conversion from one to
20448         the other.
20450         (ArrayAccess.DoResolve): Array Access can operate on
20451         non-variables. 
20453 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20455         * assign.cs (CompoundAssign): A new class used as a "flag" that
20456         the assignment actually is happening as part of a compound
20457         assignment operator.
20459         During compound assignment, a few new rules exist to enable things
20460         like:
20462         byte b |= 1 + 2
20464         From the spec:
20466         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20467         to the type of x) if y is implicitly convertible to the type of x,
20468         and the operator is a builtin operator and the return type of the
20469         operator is explicitly convertible to the type of x. 
20471         * rootcontext.cs: Reset warning level to 2.  4 catches various
20472         "interesting" features in mcs, we must clean this up at some
20473         point, but currently am trying to kill other bugs ;-)
20475         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20476         in container classes as well.  
20478         * expression.cs (Binary.ResolveOperator): Handle string case
20479         before anything else (as operator overloading does emit an error
20480         before doing anything else).
20482         This code could go away when we move to a table driven model, but
20483         i could not come up with a good plan last night.
20485 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20487         * typemanager.cs (CSharpName): reimplementation using regex.
20488         * class.cs: added null check for fields in Emit
20489         * rootcontext.cs: set warninglevel to 4
20491 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20493         * typemanager.cs (CSharpName): reimplemented with Lupus
20494         suggestion.
20496 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20498         * statement.cs (If): correclty implement Resolve, because we were
20499         not catching sem errors in there.  The same process is needed
20500         everywhere else. 
20501         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20504         (Statement.Warning_DeadCodeFound): Factorize code.
20505         (While): Report dead code here too.
20507         (Statement): Added Resolve virtual method to allow
20508         for resolution split from the emit code.
20510 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20512         * statement.cs (EmitBoolExpression): No longer try to resolve the
20513         expression here.    
20514         (MakeBoolean): New utility function that resolve, implicitly
20515         converts to boolean and tags the expression. 
20518         (If, Do): Implement dead code elimination.
20519         (While): Implement loop inversion
20521         (Do, While, For, If): Resolve the expression prior to calling our
20522         code generation.
20524 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20526         * class.cs:
20527           - added method Report28 (warning: program has more than one entry point)
20528           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20529           - modified method Method.Define, the part at the end of the method
20531         * rootcontext.cs: added static public Location EntryPointLocation;
20532           
20533         * ../errors/cs0028.cs : Add test case for the above warning.              
20535         * typemanager.cs:
20536           - modified method CSharpName to allow arrays of primitive type to
20537             be printed nicely (e.g. instead of System.Int32[][] it now prints
20538             int[][])
20539           - added method CSharpSignature: returns the signature of a method
20540             in string format to be used in reporting errors, warnings, etc.
20542         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20543         with String.Empty.
20545 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20547         * delegate.cs (Define): Fix extremely silly bug where I was
20548         setting the type of the 'object' parameter of the BeginInvoke
20549         method to System.IAsyncResult instead of System.Object ;-)
20551 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20553         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20554         here. 
20556         (Constructor.Emit): return if we fail to initialize the
20557         constructor.  Another door closed!  
20559         * expression.cs (New.DoResolve): Improve error message (from -6 to
20560         1501).  Use DeclaredOnly lookup to find the exact constructor.
20562         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20563         loop.  This is useful.
20565         * cs-parser.jay: Adjust the default parameters so that destructors
20566         have the proper signature.
20568 2002-04-26  Martin Baulig  <martin@gnome.org>
20570         * driver.cs (LoadAssembly): If `assembly' contains any characters
20571         which are only valid in path names and not in assembly names
20572         (currently slash, backslash and point), use Assembly.LoadFrom ()
20573         instead of Assembly.Load () on the `assembly' (before iteration
20574         over the link_paths).
20576 2002-04-26  Martin Baulig  <martin@gnome.org>
20578         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20580 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20582         * class.cs (Property): use the new typemanager.MemberLookup
20584         (TypeContainer.MemberLookup): Implement using the
20585         TypeManager.MemberLookup now. 
20587         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20588         and return MemberInfos, so that these can be used without an
20589         EmitContext (what we had before).
20591 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20593         * expression.cs: Fix the case where the argument to params if the
20594         type of the params.  I omitted handling this before.   Fixed
20596 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20598         * driver.cs: Call BootCorlib_PopulateCoreType
20600         * class.cs (Property.CheckBase): Check for properties only, not
20601         for all members. 
20603         * interface.cs: Temporary hack: try/catch around the
20604         CustomAttributeBuilder, because I am getting an exception that I
20605         do not understand.
20607         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20608         types whose definitions are required to be there (attributes are
20609         defined before standard types).
20611         Compute definitions as we boot the various types, as they are used
20612         immediately (value_type class will need object_type, but if we do
20613         not initialize object_type, we will pass a null, which will let
20614         the runtime pick the System.Object from the existing corlib, which
20615         is not what we want).
20617 2002-04-22  Patrik Torstensson <totte@labs2.com>
20619         * cs-tokenizer.cs: fixed a number of trim() issues.
20621 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20623         * expression.cs (Argument.Type): Ensure that we return the correct
20624         type when we have out or ref parameters [in which case we 
20625         append a "&"].
20627 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20629         * class.cs (Property, Indexer): Allow extern modifier in there. 
20631         * typemanager.cs (InitBaseTypes): Initializes object_type and
20632         value_type, since those will be used early on during the bootstrap
20633         process to compile corlib.
20635         (InitCoreTypes): Move code from here to InitBaseTypes.
20637 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20639         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20640         single-dimension arrays as using the ldlen opcode.  
20642         Daniel Lewis discovered this optimization.  
20644         * typemanager.cs: Add signature for System.Array::get_Length
20646 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20648         * statement.cs: report the error when the foreach does not apply to an
20649         array nor a collection.
20651 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20653         * expression.cs: Add implicit conversions to the operator ~.
20655         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20657         * typemanager.cs: Locate the decimal constructor.
20659 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20661         * attribute.cs: use the new property of TypeOf.
20662         * expression.cs: added 'get' property around typearg.
20664         These changes fix a build breaker reported by NickD. Is this the
20665         correct way to fix?  If not, please, revert my changes and make it
20666         work :-).
20668 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20670         * attribute.cs: Add support for typeof in attribute invocations.
20671         I am not sure that this is right though.
20673 2002-04-14  Duncan Mak  <duncan@ximian.com>
20675         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20676         Binary.Operator.Division case.
20678 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20680         * class.cs (DefineType): Ensure that we do a proper check on
20681         attribute types and also register it with the TypeManager.
20683         (TypeContainer.Targets): The default for attribute types is
20684         AttributeTargets.All.
20686         * attribute.cs (ApplyAttributes): Registering the attribute type
20687         is done elsewhere, not when we discover we have a Usage attribute.
20689 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20691         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20692         and get rid of is_delegate parameter.
20694         * everywhere : update.
20696 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20698         * cs-parser.jay (compilation_unit): Revamp completely to use
20699         some new ideas that I got from Rhys' grammar to solve the problems
20700         with assembly level attributes.
20702         (outer_declaration): New grammar production.
20704         (attribute_sections): Add.
20706         (opt_attributes): Base on attribute_sections
20708         (namespace_declaration): Allow opt_attributes to tackle the case
20709         when we have assembly level attributes - we are clever in this
20710         regard now ;-)
20712         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20713         attributes in the non-global context.
20715         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20716         instead of SetGlobalAttributes.
20718         * class.cs, rootcontext.cs : Ensure we define and generate 
20719         attribute types before anything else.
20721         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20722         and flag the new error -20 for the case when the attribute type
20723         does not have valid targets specified. csc does not catch this.
20725         * ../errors/errors.txt : update for error # -20
20727 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20729         * support.cs (InternalParameters.ParameterModifier): Do some null
20730         checking and return sane values.
20732         * class.cs (Method.Define): If we are a PInvoke method, ensure
20733         that we are static and extern. Report error # 601
20735         * ../errors/cs0601.cs : Add test case for the above error.
20737 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20739         * rootcontext.cs (attribute_types): We need to keep type of
20740         all attribute types separately and emit code for them first.
20742         (RegisterAttribute) : Implement.
20744         * class.cs (DefineType): Check if the current Type is a custom
20745         attribute type and register it accordingly.
20747         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20748         adding the first attribute twice and rename to
20750         (SetGlobalAttributes): this.
20752         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20753         lookups.
20755         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20756         if we are processing global arguments. Hmm, I am unsure of this.
20758 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20760         * expression.cs: added static array of strings to avoid calling
20761         Enum.ToString () for Operator in Binary. Significant recover of
20762         performance.
20764 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20766         * class.cs (FindMembers): Allow the Builders of the various
20767         members to be null.  If they are skip them.  This only happens
20768         during the PInvoke declaration.
20770 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20772         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20773         failure, so we do not keep going afterwards.
20775         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20776         wanted to pass `false' as the `is_delegate' argument.  If this is
20777         the case, why not use delegate_type == null to mean `is_delegate =
20778         false' and anything else as is_delegate = true.
20780 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20782         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20783         code for the section, not the beginning of the tests.
20785 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20787         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20789         * expression.cs (Binary): same.  Warn about errors where we have
20790         Enum/Enum in operator + as well.
20792 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20794         * statement.cs:
20795                 - added support for switch(bool)
20796                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20797                 - add TableSwitchEmit() to handle table-based switch statements
20799 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20801         * expression.cs (Invocation.OverloadResolve): Factor out code which
20802         does parameter compatibility checking with arguments so that we can 
20803         re-use the code even from Delegate.VerifyApplicability
20805         (VerifyArgumentsCompat): Move above code here.
20807         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20808         and instead make a call to the above method.
20810 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20812         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20813         We use it to keep track of classes which are attribute types.
20815 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20817         * delegate.cs (Delegate.Define): Correctly define the types in the
20818         presence of fixed and array parameters.
20820         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20821         doing FindMembers.
20823         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20824         include NonPublic after the first iteration.
20826         * class.cs (Indexer.CheckBase): Only check if both parents are
20827         non-null. 
20829         * cs-parser.jay (accessor_body): If empty, set to null.
20831         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20832         same code path here to resolve constants names that we did have in
20833         MemberAccess.DoResolve.  There is too much code duplicated here.
20835 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20837         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20839         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20840         to MakeUnionSet.
20842         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20843         tokens, numbers and strings.
20845         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20846         parenthesis.
20848         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20849         asyncronous parameters and the regular parameters.  
20851         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20852         specify the target directory.
20854         * expression.cs: (This.DoResolve): Simplify
20855         (As.Emit): Optimize, do not generate IsInst if the expression is
20856         always of the given type.
20858         (Is.DoResolve): Bug fix, we were reporting both always/never for
20859         the is expression.
20861         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20862         creating too many unnecessary arrays.
20864 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20866         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20867         fields instead of rolling our own initializer.   Takes care of all
20868         implicit conversions, and drops unnecessary static checks/argument.
20870 2002-03-31  Dick Porter  <dick@ximian.com>
20872         * driver.cs: use the GetDirectories() return values properly, and
20873         use "/" as path separator.
20875 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20877         * expression.cs (Unary): Optimize - - expr into expr.
20878         (Binary): Optimize a + (-b) into a -b.
20880         * codegen.cs (CodeGen): Made all methods static.
20882 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20884         * rootcontext.cs: 
20886         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20887         TypeBuilder property.
20889         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20890         instead. 
20892         * tree.cs: Removed the various RecordXXXX, and replaced with a
20893         single RecordDecl.  Removed all the accessor methods, and just
20894         left a single access point Type 
20896         * enum.cs: Rename DefineEnum to DefineType.
20898         * decl.cs: New abstract method `DefineType' used to unify the
20899         Defines for Enumerations, Interfaces, TypeContainers and
20900         Delegates.
20902         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20903         LookupBaseClasses method that used to live in class.cs and
20904         interface.cs here, and renamed to FindType.
20906         * delegate.cs: Implement DefineType.  Take advantage of the
20907         refactored pattern for locating the parent builder without taking
20908         the parent_builder argument (which we know does not work if we are
20909         nested, and triggering a toplevel definition).
20911 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20913         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20914         accessibility of a member has changed during override and report
20915         an error if so.
20917         * class.cs (Method.Define, Property.Define): Only complain on
20918         overrides if the method is private, any other accessibility is
20919         fine (and since we just checked the permission is the same, we are
20920         good to go).
20922         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20923         and elif are processed always.  The other pre-processing
20924         directives are only processed if we are "taking" the path
20926 2002-03-29  Martin Baulig  <martin@gnome.org>
20928         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20929         current location is not Null.
20931         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20932         a separate method so we can profile it.
20934         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20935         `span.Seconds' are just seconds, but no minutes or hours.
20936         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20938 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20940         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20941         Remove the gratuitous set of Final:
20943                                 // If an interface implementation, then we can set Final.
20944                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20945                                     implementing.DeclaringType.IsInterface)
20946                                         flags |= MethodAttributes.Final;
20948         I do not know what I was smoking when I used that.
20951         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20952         step into fixing the name resolution issues for delegates and
20953         unifying the toplevel name resolution.
20955 2002-03-28  Martin Baulig  <martin@gnome.org>
20957         * class.cs (Method.Emit): If we have a symbol writer, call its
20958         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20959         tell it about the current method.
20961         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20962         writer that we're going to emit the first byte of IL code for a new
20963         statement (a new source line).
20964         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20965         EmitContext.Mark() before emitting any code.
20967         * location.cs (SymbolDocument): Return null when we're Null.
20969         * statement.cs (Statement): Moved the `Location loc' variable here.
20970         (Statement.EmitBoolExpression): If we have a symbol writer, call
20971         ec.Mark() before emitting any code to tell it that we're at the
20972         beginning of a new statement.
20973         (StatementExpression): Added `Location' argument to the constructor.
20974         (Block): Added public readonly variable `StartLocation' and public
20975         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20976         (Block): Added constructor which takes a start and end location.
20977         (Block.SetEndLocation): New method. This sets the end location.
20978         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20979         local variables we create.
20980         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20981         each statement and do also mark the begin and end of the block.
20983         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20984         tell it the current lexer.Location, use Location.Null for the end of the
20985         block.
20986         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20987         current block, set its end location using SetEndLocation().
20988         (statement_expression): StatementExpression constructor now takes the
20989         lexer.Location as additional argument.
20990         (for_statement, declare_local_variables): Likewise.
20991         (declare_local_variables): When creating a new implicit block, use the
20992         new Block constructor and pass it the lexer.Location.
20994 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20996         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20997         members also on the parent interfaces recursively.
20999 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
21001         * report.cs: Use new formats, since Gonzalo finished the missing
21002         bits. 
21004         * expression.cs (Binary.ResolveOperator): added missing operator|
21005         operator& and operator^ for bool/bool.
21007         * cs-parser.jay: CheckDef now takes a Location argument that is
21008         used to report errors more precisly (instead of reporting the end
21009         of a definition, we try to track something which is a lot closer
21010         to the source of the problem).
21012         * cs-tokenizer.cs: Track global token use, so we can properly flag
21013         the use of #define/#undef after the first token has been seen.
21015         Also, rename the reportXXXX to Error_DescriptiveName
21017         * decl.cs (DeclSpace.IsTopLevel): Move property here from
21018         TypeContainer, so that Enum and Interface can use this too.
21020         * class.cs (TypeContainer.LookupInterfaceOrClass,
21021         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
21022         `builder' argument.  Typically this was used to pass the parent
21023         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
21024         the definition).  
21026         The problem is that a nested class could trigger the definition of
21027         a toplevel class, and the builder would be obviously wrong in that
21028         case. 
21030         So we drop this argument, and we compute dynamically the
21031         TypeBuilder/ModuleBuilder (the correct information was available
21032         to us anyways from DeclSpace.Parent)
21034         * interface.cs (Interface.DefineInterface): Drop builder
21035         parameter cleanup like class.cs
21037         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
21038         like class.cs
21040         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
21041         values. 
21043         (Try.Emit): Propagate the returns value from the statement.
21045         (Return.Emit): Even if we are leavning 
21047         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
21049         * modifiers.cs: Fix the computation of MethodAttributes flags.
21051 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
21053         * driver.cs: allow compilation of files that start with '/'.
21054         Add a default case when checking the argument of --target.
21056 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
21058         * interface.cs: Implement the same search algorithm for types in
21059         the interface code.
21061         * delegate.cs: Do not allow multiple definition.
21063         * Recovered ChangeLog that got accidentally amputated
21065         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21067         * rootcontext.cs: Load manually enum to allow core classes to
21068         contain enumerations.
21070         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21071         Update to new static methods in TypeManager.
21073         * typemanager.cs (GetMethod, GetConstructor): Use our
21074         implementation of FindMembers to find the members, since during
21075         corlib compilation, the types are TypeBuilders and GetMethod and
21076         GetConstructor do not work.
21078         Make all methods in TypeManager static.
21080         (InitCodeHelpers): Split the functionality from
21081         the InitCodeTypes function.
21083         * driver.cs: Call InitCodeHelpers after we have populated the
21084         types. 
21086         * cs-parser.jay (delegate_declaration): we did not used to compute
21087         the delegate name correctly for void delegates.
21089 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
21091         * rootcontext.cs (RootContext): Init the interface_resolve_order
21092         and type_container_resolve_order always.
21094         (ResolveCore, BootstrapCorlib_ResolveClass,
21095         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21096         compiler when compiling with --nostdlib
21098         * class.cs (TypeContainer.DefineType): Check that our parent is
21099         not null.  This test is most important when we are bootstraping
21100         the core types.
21102         * codegen.cs: Split out the symbol writing code.
21104 2002-03-25  Martin Baulig  <martin@gnome.org>
21106         * driver.cs (-g): Made -g an alias for --debug.
21108 2002-03-24  Martin Baulig  <martin@gnome.org>
21110         * codegen.cs (SymbolWriter): New public variable. Returns the
21111         current symbol writer.
21112         (CodeGen): Added `bool want_debugging_support' argument to the
21113          constructor. If true, tell the ModuleBuild that we want debugging
21114         support and ask it for the ISymbolWriter.
21115         (Save): If we have a symbol writer, call it's Close() method after
21116         saving the assembly.
21118         * driver.c (--debug): New command line argument to create a
21119         debugger information file.
21121         * location.cs (SymbolDocument): New public property. Returns an
21122         ISymbolDocumentWriter object for the current source file or null
21123         if we don't have a symbol writer.
21125 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
21127         * driver.cs (LoadAssembly): Correctly return when all the paths
21128         have been tried and not before.
21130         * statement.cs (Switch.Emit): return the actual coverage for this
21131         statement (returns/not-returns)
21133         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21134         switch of the statement if we are the last switch section.  That
21135         kills two problems: try/catch problems (we used to emit an empty
21136         nop at the end) and switch statements where all branches would
21137         return. 
21139 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
21141         * driver.cs: Add default assemblies (the equivalent to the
21142         Microsoft CSC.RSP file)
21144         * cs-tokenizer.cs: When updating `cols and setting it to zero,
21145         also update tokens_seen and set it to false.
21147         * driver.cs: Implement --recurse for Mike.
21149         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21150         correctly splitting out the paths.
21152 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
21154         * interface.cs (Interface.PopulateProperty): Instead of using
21155         `parent' as the declaration space for the set parameters, use
21156         `this' 
21158         * support.cs (InternalParameters): InternalParameters constructor
21159         takes a DeclSpace instead of a TypeContainer.
21161         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21162         types are being initialized, load the address of it before calling
21163         the function.  
21165         (New): Provide a mechanism to disable the generation of local
21166         value type temporaries when the caller will be providing us with
21167         an address to store it.
21169         (ArrayCreation.EmitDynamicInitializers): Use it.
21171 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
21173         * expression.cs (Invocation.EmitArguments): Only probe for array
21174         property if there is more than one argument.  Sorry about that.
21176         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21177         empty param arrays.
21179         * class.cs (Method.LabelParameters): Fix incorrect code path that
21180         prevented the `ParamArrayAttribute' from being applied to the
21181         params attribute.
21183 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
21185         * support.cs (ReflectionParameters): Correctly compute whether the
21186         last argument is a params array.  Fixes the problem with
21187         string.Split ('a')
21189         * typemanager.cs: Make the assemblies array always be non-null
21190         (empty, but non-null)
21192         * tree.cs (RecordDecl): New function that abstracts the recording
21193         of names.  This reports error 101, and provides a pointer to the
21194         previous declaration.  Fixes a crash in the compiler.
21196         * cs-parser.jay (constructor_declaration): Update to new grammar,
21197         and provide a constructor_body that can be empty.
21199 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
21201         * driver.cs: Add support for --resources.
21203         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21204         Make all types for the various array helper methods be integer.
21206         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21207         CheckState to ConvCast.
21209         (ConvCast): Now it takes a `checked' state argument, to avoid
21210         depending on the emit context for the conversion, and just using
21211         the resolve time setting.
21213         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21214         instead of Invocation.EmitArguments.  We do not emit the original
21215         arguments, instead we emit those which have been converted to
21216         unsigned int expressions.
21218         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21220         * codegen.cs: ditto.
21222         * expression.cs (LocalVariableReference): Drop the use of the
21223         Store function that depended on the variable index.
21225         * statement.cs (VariableInfo): Drop the `Idx' property from this
21226         class, as this is not taking into account the indexes for
21227         temporaries tat we generate during the execution, getting the
21228         indexes wrong.
21230         * class.cs: First emit class initializers, then call the parent
21231         constructor. 
21233         * expression.cs (Binary): Fix opcode emision.
21234         (UnaryMutator.EmitCode): Support checked code generation
21236         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21237         matches for events for both the Static and Instance scans,
21238         pointing to the same element.   Fix that.
21240 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
21242         * rootcontext.cs (ResolveTree): Always set the
21243         interface_resolve_order, because nested interfaces will be calling
21244         into us.
21246         * class.cs (GetInterfaceOrClass): Track the same resolution
21247         process used by TypeManager.LookupType.  This fixes the nested
21248         type lookups in class declarations (separate path from
21249         LookupType). 
21251         (TypeContainer.DefineType): Also define nested interfaces.
21252         (TypeContainer.RegisterOrder): New public function used to
21253         register the order in which child interfaces need to be closed.
21255         Nested interfaces need to be closed after their parents have been
21256         created. 
21258         * interface.cs (InterfaceAttr): Put all the logic for computing
21259         the interface attribute here. 
21261         (DefineInterface): Register our interface order with the
21262         RootContext or with the TypeContainer depending on the case.
21264 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21266         * cs-parser.jay: rework foreach statement to work with the new
21267         changes to the policy on SimpleNames.
21269         * report.cs: support Stacktrace on warnings as well.
21271         * makefile: drop --unsafe and /unsafe from the compile.
21273 2002-03-13  Ravi Pratap  <ravi@ximian.com>
21275         * ecore.cs (StandardConversionExists): Modify to take an Expression
21276         as the first parameter. Ensure we do null -> reference type conversion
21277         checking.
21279         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21280         temporary Expression objects.
21282 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21284         * interface.cs: workaround bug in method overloading resolution
21285         (there is already a bugzilla bug for it).
21287 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
21289         We could also solve this problem by having a separate path for
21290         performing type lookups, instead of DoResolve, we could have a
21291         ResolveType entry point, and only participating pieces of the
21292         production (simplename, deref, array) would implement this. 
21294         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21295         signal SimpleName to only resolve type names and not attempt to
21296         resolve anything else.
21298         * expression.cs (Cast): Set the flag.
21300         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21302         * class.cs: Only report 108 if there is no `new' modifier.
21304         * cs-parser.jay: rework foreach statement to work with the new
21305         changes to the policy on SimpleNames.
21306         
21307         * report.cs: support Stacktrace on warnings as well.
21309         * makefile: drop --unsafe and /unsafe from the compile.
21311 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
21313         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21314         lookups here, instead of doing that at parse time.  This means
21315         that our grammar will not introduce `LocalVariableReferences' as
21316         expressions at this point.  That solves the problem of code like
21317         this:
21319         class X {
21320            static void Main ()
21321            { int X = 1;
21322             { X x = null }}}
21324         This is only half the fix.  The full fix requires parameters to
21325         also be handled in this way.
21327         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21328         makes the use more obvious of the DeclSpace.  The
21329         ec.TypeContainer.TypeBuilder is now only used to pull the
21330         TypeBuilder for it.
21332         My theory is that I can get rid of the TypeBuilder completely from
21333         the EmitContext, and have typecasts where it is used (from
21334         DeclSpace to where it matters).  
21336         The only pending problem is that the code that implements Aliases
21337         is on TypeContainer, and probably should go in DeclSpace.
21339         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21340         lookups here, instead of doing that at parse time.  This means
21341         that our grammar will not introduce `LocalVariableReferences' as
21342         expressions at this point.  That solves the problem of code like
21343         this:
21345         class X {
21346            static void Main ()
21347            { int X = 1;
21348             { X x = null }}}
21350         This is only half the fix.  The full fix requires parameters to
21351         also be handled in this way.
21353         * class.cs (Property.DefineMethod): When implementing an interface
21354         method, set newslot, when implementing an abstract method, do not
21355         set the flag (before we tried never setting it, or always setting
21356         it, which is the difference).
21357         (Indexer.DefineMethod): same.
21358         (Method.DefineMethod): same.
21360         * ecore.cs: Only set the status used flag if we get back a Field.
21362         * attribute.cs: Temporary hack, so Paolo can keep working.
21364 2002-03-08  Ravi Pratap  <ravi@ximian.com>
21366         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21367         the unmanaged type in the case we have a MarshalAs attribute.
21369         (Resolve): Handle the case when we are parsing the special MarshalAs
21370         attribute [we need to store the unmanaged type to use later]
21372         * typemanager.cs (marshal_as_attr_type): Built in type for the 
21373         MarshalAs Attribute.
21375         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
21376         on parameters and accordingly set the marshalling info.
21378 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
21380         * class.cs: Optimizing slightly by removing redundant code after
21381         we switched to the `NoTypes' return value.
21382         (Property.DefineMethod): use NoTypes here too.
21384         This fixes the bug I introduced in my last batch of changes.
21386 2002-03-05  Ravi Pratap  <ravi@ximian.com>
21388         * tree.cs (RecordEnum): Add. We now keep track of enums too.
21390         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21391         Enums since those are types too. 
21393         * cs-parser.jay (enum_declaration): Record enums as we parse them.
21395         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
21396         thanks to a call during the lookup process.
21398 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
21400         * statement.cs (Foreach): Lots of work to accomodate a particular
21401         kind of foreach statement that I had not kept in mind.  It is
21402         possible to have foreachs on classes that provide a GetEnumerator
21403         method that return objects that implement the "pattern" for using
21404         a foreach, there is no need to support GetEnumerator
21405         specifically. 
21407         This is needed to compile nant.
21409         * decl.cs: Only report 114 if the member is not `Finalize' and if
21410         the warning level is at least 2.
21412         * class.cs: Moved the compare function from Method to
21413         MethodSignature. 
21415         (MethodSignature.InheritableMemberSignatureCompare): Add new
21416         filter function that is used to extract inheritable methods from a
21417         class. 
21419         (Method.Define): Use the new `inheritable_method_signature_filter'
21420         delegate
21422         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21423         command. 
21425 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21427         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21429         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21431         * expression.cs: Pass location information to
21432         ConvertImplicitStandard. 
21434         * class.cs: Added debugging code to track return values from
21435         interfaces. 
21437 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21439         * expression.cs (Is.DoResolve): If either side of the `is' is an
21440         interface, do not flag the warning.
21442         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21443         for interfaces
21445         * report.cs: Allow for --fatal to be used with --probe.
21447         * typemanager.cs (NoTypes): Move the definition for the empty Type
21448         array here. 
21450         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21451         properties. 
21452         (TypeContainer.DefineProxy): New function used to proxy to parent
21453         implementations when implementing interfaces.
21454         (TypeContainer.ParentImplements): used to lookup if our parent
21455         implements a public function that is required by an interface.
21456         (TypeContainer.VerifyPendingMethods): Hook this up.
21458         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21459         `modules' and `assemblies' arraylists into arrays.  We only grow
21460         these are the very early start up of the program, so this improves
21461         the speedof LookupType (nicely measured).
21463         * expression.cs (MakeByteBlob): Replaced unsafe code with
21464         BitConverter, as suggested by Paolo.
21466         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21467         folding of string concatenation, but if either side is a string,
21468         and the other is not, then return null, and let the runtime use
21469         the concatenation on the string plus the object (using
21470         `Object.ToString'). 
21472 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21474         Constant Folding has been implemented now.
21476         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21477         the error instead on types that are not supported in one's
21478         complement. 
21480         * constant.cs (Constant and all children): New set of functions to
21481         perform implict and explicit conversions.
21483         * ecore.cs (EnumConstant): Implement the new functions to perform
21484         conversion by proxying to the child expression.
21486         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21487         own separate setting that can not be turned off from the command
21488         line using --unchecked or --checked and is only controlled using
21489         the checked/unchecked statements and expressions.  This setting is
21490         used by the constant folder to flag errors.
21492         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21493         ConstantCheckState as well.   
21495         During Resolve, they also have to flag the state, because the
21496         constant folder runs completely in the Resolve phase.
21498         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21499         well.
21501 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21503         * cfold.cs: New file, this file contains the constant folder.
21505         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21506         argument to track whether we are using the resulting address to
21507         load or store a value and provide better error messages. 
21509         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21510         new AddressOf arguments.
21512         * statement.cs (Foreach.EmitCollectionForeach): Update
21514         * expression.cs (Argument.Emit): Call AddressOf with proper
21515         arguments to track usage.
21517         (New.DoEmit): Call AddressOf with new arguments.
21519         (Unary.Emit): Adjust AddressOf call.
21521 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21523         * cs-parser.jay (member_access): Change the case for pre-defined types
21524         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21525         this suggestion.
21527         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21528         a method body.
21530         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21531         essentially like methods and apply attributes like MethodImplOptions to them too.
21533         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21534         not being null.
21536         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21537         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21538         is the DeclSpace.
21540         * Update code everywhere accordingly.
21542         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21544         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21546 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21548         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21549         try performing lookups against those instead of jumping straight into using
21550         the 'using' clauses.
21552         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21554         (LookupType): Perform lookups in implicit parents too.
21556         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21557         sequence as RootContext.LookupType. 
21559         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21560         the various cases of namespace lookups into this method.
21562 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21564         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21565         in positional arguments)
21567         * class.cs (Operator): Update the AllowedModifiers to contain
21568         extern. 
21570         * cs-parser.jay: Update operator declaration to allow for the
21571         operator body to be empty.
21573         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21574         values. 
21576 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21578         * class.cs (Method.Emit): Label parameters.
21580         * driver.cs: Return 1 or 0 as the program exit code.
21582 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21584         * expression.cs: Special case the `null' object when trying to
21585         auto-compute the type, as anything can be explicitly converted to
21586         that. 
21588         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21589         spotting this Paolo.
21591         (Expression.ImplicitNumericConversion): Perform comparissions of
21592         the type using the underlying type in the case of an enumeration
21593         rather than using the enumeration type for the compare.
21595         Cope with the underlying == type case, which is not possible to
21596         catch before. 
21598         (Expression.ConvertNumericExplicit): Perform comparissions of
21599         the type using the underlying type in the case of an enumeration
21600         rather than using the enumeration type for the compare.
21602         * driver.cs: If the user does not supply an extension, assume .exe
21604         * cs-parser.jay (if_statement): Rewrote so that we can track the
21605         location for the if statement.
21607         * expression.cs (Binary.ConstantFold): Only concat strings when
21608         the operation is "+", not everything ;-)
21610         * statement.cs (Statement.EmitBoolExpression): Take a location
21611         argument. 
21612         (If, While, Do): Track location.
21614         * expression.cs (Binary.ResolveOperator): In the object + string
21615         case, I was missing a call to ConvertImplicit
21617 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21619         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21620         Location arguments. Ensure we use RootContext.LookupType to do our work
21621         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21623         * interface.cs (PopulateMethod): Handle the type of the parameter being
21624         null gracefully.
21626         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21627         have a params method with no fixed arguments and a call is made with no
21628         arguments.
21630 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21632         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21633         the verbatim-string-literal
21635         * support.cs (InternalParameters.ParameterModifier): handle null
21636         fixed parameters.
21637         (InternalParameters.ParameterType): ditto.
21639         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21640         duplicating the name of the variable parameter.
21641         (GetParameterByName): Fix bug where we were not looking up array
21642         paramters if they were the only present (thanks Paolo!).
21643         (GetParameterInfo): We only have an empty set of types if both
21644         fixed and array are set to null.
21645         (GetParameterInfo-idx): Handle FixedParameter == null
21647         * cs-parser.jay: Handle the case where there is no catch
21648         statements (missing null test).
21650 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21652         * driver.cs (MainDriver): Be conservative on our command line
21653         handling.
21655         Catch DirectoryNotFoundException when calling GetFiles.
21657         (SplitPathAndPattern): Used to split the input specification into
21658         a path and a pattern that we can feed to Directory.GetFiles.
21660 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21662         * statement.cs (Fixed): Implement the last case of the Fixed
21663         statement (string handling).
21665         * expression.cs (StringPtr): New class used to return a char * to
21666         a string;  Used by the Fixed statement.
21668         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21670         * expression.cs (Binary.ResolveOperator): Remove redundant
21671         MemberLookup pn parent type.
21672         Optimize union call, we do not need a union if the types are the same.
21673         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21674         type.
21676         Specialize the use of MemberLookup everywhere, instead of using
21677         the default settings. 
21679         (StackAlloc): Implement stackalloc keyword.
21681         * cs-parser.jay: Add rule to parse stackalloc.
21683         * driver.cs: Handle /h, /help, /?
21685         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21686         before we supported unsafe code.
21688         * makefile: add --unsafe to the self compilation of mcs.
21690 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21692         * expression.cs (PointerArithmetic): New class that is used to
21693         perform pointer arithmetic.
21694         (Binary.Resolve): Handle pointer arithmetic
21695         Handle pointer comparission.
21696         (ArrayPtr): Utility expression class that is used to take the
21697         address of an array.
21699         (ElementAccess): Implement array access for pointers
21701         * statement.cs (Fixed): Implement fixed statement for arrays, we
21702         are missing one more case before we are done.
21704         * expression.cs (Indirection): Implement EmitAssign and set the
21705         ExprClass to Variable.  This allows pointer dereferences to be
21706         treated as variables, and to have values assigned to them.
21708         * ecore.cs (Expression.StoreFromPtr): New utility function to
21709         store values dereferencing.
21711 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21713         * expression.cs (Binary.ResolveOperator): Ensure that we are
21714         not trying to operate on a void type - this fixes the reported
21715         bug.
21717         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21718         the parent implementation is sealed.
21720         * ../errors/cs0239.cs : Add.
21722         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21724         * typemanager.cs (unverifiable_code_type): Corresponds to 
21725         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21726         which have unsafe code in them.
21728         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21729         unsafe context.
21731 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21733         * cs-tokenizer.cs: Add support for @"litreal strings"
21735         Make tokenizer accept pre-processor directives
21736         on any column (remove the old C-like limitation). 
21738         * rootcontext.cs (EmitCode): Emit any global attributes.
21739         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21741         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21743         * cs-parser.jay: Add support for global attributes.  
21745 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21747         * expression.cs (Indirection): New helper class.  Unary will
21748         create Indirection classes to be able to implement the
21749         IMemoryLocation interface on it.
21751 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21753         * cs-parser.jay (fixed_statement): reference the right statement.
21755         * statement.cs (Fixed.Emit): Finish implementing the fixed
21756         statement for the &x case.
21758 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21760         * class.cs (Property.Define, Method.Define): Remove newslot when
21761         `implementing'.  
21763         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21764         wrong.  NewSlot should only be used if the `new' keyword is present.
21766         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21767         locating our system dir.  Sorry about this.
21769 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21771         * driver.cs (GetSystemDir): Compute correctly the location of our
21772         system assemblies.  I was using the compiler directory instead of
21773         the library directory.
21775 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21777         * expression.cs (BetterFunction): Put back in what Miguel commented out
21778         since it is the correct fix. The problem is elsewhere ;-)
21780         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21781         parameters of the parms method are themselves compatible or not !
21783         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21784         to check that a class implements an interface before saying that an implicit
21785         conversion was allowed. Use ImplementsInterface to do the checking.
21787 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21789         * class.cs (Method.Define): Track whether we are an explicit
21790         implementation or not.  And only call DefineMethodOverride if we
21791         are an explicit implementation.
21793         (Property.DefineMethod): Ditto.
21795 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21797         * expression.cs (BetterFunction): Catch hideous bug which was
21798          preventing us from detecting ambiguous calls due to implicit casts i.e
21799         cs0121.
21801 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21803         * support.cs (Pair): Remove un-needed method.  I figured why I was
21804         getting the error in cs-parser.jay, the variable in a foreach loop
21805         is readonly, and the compiler does not really treat this as a variable.
21807         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21808         instead of EQUALS in grammar.  
21810         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21812         * expression.cs (Unary.DoResolve): Check whether the argument is
21813         managed or not.
21815 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21817         * support.cs: Api for Pair to set a value.  Despite the fact that
21818         the variables are public the MS C# compiler refuses to compile
21819         code that accesses the field if the variable is part of a foreach
21820         statement. 
21822         * statement.cs (Fixed): Begin implementation of the fixed
21823         statement.
21825         (Block.AddVariable): Return the VariableInfo on success and null
21826         on failure instead of true/false. 
21828         * cs-parser.jay (foreach): Catch errors on variables already
21829         defined (we were ignoring this value before) and properly unwind
21830         the block hierarchy
21832         (fixed_statement): grammar for the fixed statement.
21834 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21836         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21837         pointer types to be incretemented.
21839         (SizeOf): Implement.
21841         * cs-parser.jay (pointer_member_access): Implement
21842         expr->IDENTIFIER production.
21844         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21845         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21846         on safe contexts.
21848         (Unary): Implement indirection.
21850         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21851         use in non-unsafe context).
21853         (SimpleName.DoResolve): Check for pointers in field access on safe
21854         contexts. 
21856         (Expression.LoadFromPtr): Factor the load-indirect code in this
21857         function.  This was duplicated in UnboxCast and ParameterReference
21859 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21861         * expression.cs (ComposedCast): report an error if a pointer cast
21862         is used in a safe region.
21864         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21865         pointer type casts in unsafe context.
21867         * codegen.cs (EmitContext): Set up IsUnsafe.
21869         * cs-parser.jay (non_expression_type): Add productions for pointer
21870         casts. 
21872         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21873         code.  We should not use force into static mode if the method is
21874         not virtual.  Fixes bug in MIS
21876         * statement.cs (Do.Emit, While.Emit, For.Emit,
21877         Statement.EmitBoolExpression): Add support to Do and While to
21878         propagate infinite loop as `I do return' semantics.
21880         Improve the For case to also test for boolean constants.
21882         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21883         to the list of attributes we can add.
21885         Remove `EmitContext' argument.
21887         * class.cs (Method.Define): Apply parameter attributes.
21888         (Constructor.Define): Apply parameter attributes.
21889         (MethodCore.LabelParameters): Move here the core of labeling
21890         parameters. 
21892         * support.cs (ReflectionParameters.ParameterModifier,
21893         InternalParameters.ParameterModifier): Use IsByRef on the type and
21894         only return the OUT bit for these parameters instead of in/out/ref
21895         flags.
21897         This is because I miss-understood things.  The ParameterInfo.IsIn
21898         and IsOut represent whether the parameter has the [In] and [Out]
21899         attributes set.  
21901 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21903         * ecore.cs (FieldExpr.Emit): Release temporaries.
21905         * assign.cs (LocalTemporary.Release): new function.
21907         * codegen.cs (EmitContext.GetTemporaryStorage,
21908         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21909         temporary storage.  Now we can "put back" localbuilders when we
21910         are done with them
21912 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21914         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21915         need to make a copy of the variable to generate verifiable code.
21917 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21919         * driver.cs: Compute dynamically the system directory.
21921         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21922         Slower, but more generally useful.  Used by the abstract
21923         registering implementation. 
21925         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21926         the rules for the special rule on Type/instances.  First check if
21927         we have the same name, and if so, try that special static path
21928         rather than the instance path.
21930 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21932         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21933         for, while and if.
21935         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21936         Enum, ValueType, Delegate or Array for non-corlib compiles.
21938         * cs-tokenizer.cs: Catch long identifiers (645)
21940         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21941         piece of code.
21943         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21944         fix, we were returning too early, so we were not registering
21945         pending methods from abstract classes.
21947         Do not register pending methods if the class is abstract.
21949         * expression.cs (Conditional.DoResolve): Report circular implicit
21950         conversions when we neecd to compute it for conditional
21951         expressions. 
21953         (Is.DoResolve): If the expression is always of the provided type,
21954         flag warning 183.  If the expression can not ever be of the
21955         provided type flag warning 184.
21957         * class.cs: Catch 169 as well.
21959         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21960         read. 
21962 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21964         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21966 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21968         * interface.cs: (PopulateMethod): Check for pointers being defined
21969         only if the unsafe context is active.
21970         (PopulateProperty): ditto.
21971         (PopulateIndexer): ditto.
21973         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21974         specified.  If pointers are present, make sure that they are
21975         present in an unsafe context.
21976         (Constructor, Constructor.Define): ditto.
21977         (Field, Field.Define): ditto.
21978         (Property, Property.Define): ditto.
21979         (Event, Event.Define): ditto.
21981         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21982         hashtable if there are classes or structs defined.
21984         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21985         code, as the constant resolution moved.
21987         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21988         the metadata, so we can flag error 133. 
21990         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21991         pointer is being declared in an unsafe context.
21993 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21995         * modifiers.cs (Modifiers.Check): Require a Location argument.
21996         Report error 227 for Unsafe use.
21998         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
22000         * statement.cs (For.Emit): If the test is null, then report that
22001         we do `return', as we wont reach anything afterwards.
22003         (Switch.SwitchGoverningType): Track the expression that matched
22004         the conversion.
22006         * driver.cs: Allow negative numbers as an error code to flag.
22008         * cs-parser.jay: Handle 1551.
22010         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
22012 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22014         * cs-parser.jay: Report 1518 (type declaration can only contain
22015         class, struct, interface, enum or delegate)
22017         (switch_label): Report 1523 (keywords `case' or `default' must
22018         preced code)
22020         (opt_switch_sections): Report 1522 (empty switch)
22022         * driver.cs: Report 1515 (response file specified multiple times)
22023         Report 1516 (Source file specified multiple times).
22025         * expression.cs (Argument.Resolve): Signal 1510
22027         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
22028         access not allowed in static code)
22030 2002-01-11  Ravi Pratap  <ravi@ximian.com>
22032         * typemanager.cs (IsPointerType): Utility method which we are going
22033         to need a lot.
22035         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
22036         the object type, so we take care of that.
22038         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
22040         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
22041         added to non-params parameters :-)
22043         * typemanager.cs (CSharpName): Include 'void' type too. 
22045         (void_ptr_type): Include in the set of core types.
22047         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
22048         duplicating code.
22050         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
22051         an unsafe context.
22053         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
22054         completely forgotten about it.
22056 2002-01-10  Ravi Pratap  <ravi@ximian.com>
22058         * cs-parser.jay (pointer_type): Add. This begins our implementation
22059         of parsing rules for unsafe code.
22061         (unsafe_statement): Implement.
22063         (embedded_statement): Modify to include the above.
22065         * statement.cs (Unsafe): Implement new class for unsafe blocks.
22067         * codegen.cs (EmitContext.InUnsafe): Add. This determines
22068         if the current context is an unsafe one.
22070         * cs-parser.jay (local_variable_pointer_type): Since local variable types
22071         are handled differently, we need separate rules for them.
22073         (local_variable_declaration): Update to use local_variable_pointer_type
22074         to allow variable declarations of unmanaged pointer types.
22076         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22077         in unsafe contexts.
22079         * ../errors/cs0214.cs : Add.
22081 2002-01-16  Nick Drochak  <ndrochak@gol.com>
22083         * makefile: remove 'response' file when cleaning.
22085 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
22087         * cs-parser.jay: Report 1524.
22089 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
22091         * typemanager.cs (RegisterMethod): drop checking if we have
22092         registered this from here
22094 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
22096         * class.cs (Method.EmitDestructor): Implement calling our base
22097         destructor. 
22099         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22100         value of InFinally.
22102         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22103         this routine and will wrap the call in a try/catch block.  Deal
22104         with the case.
22106 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
22108         * ecore.cs (Expression.MemberLookup): instead of taking a
22109         parameter `same_type' that was used to tell whether we could
22110         access private members we compute our containing type from the
22111         EmitContext.
22113         (FieldExpr): Added partial support for volatile fields.  This does
22114         not work for volatile fields exposed from assemblies, as I can not
22115         figure out how to extract the modreq from it.
22117         Updated all the source files to use this.
22119         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22120         because it is referenced by MemberLookup very often. 
22122 2002-01-09  Ravi Pratap  <ravi@ximian.com>
22124         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22125         TypeBuilder.GetCustomAttributes to retrieve what we need.
22127         Get rid of redundant default_member_attr_type as this is the same as
22128         default_member_type which already exists.
22130         * interface.cs, attribute.cs : Update accordingly.
22132 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
22134         * typemanager.cs: Enable IndexerPropertyName again.  It does not
22135         work for TYpeBuilders though.  Ravi, can you please fix this?
22137         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22139         * expression.cs (Argument.Emit): Handle the case of ref objects
22140         being passed to ref functions;  
22142         (ParameterReference.EmitLoad): Loads the content of the pointer
22143         without dereferencing.
22145 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22147         * cs-tokenizer.cs: Implemented the pre-processing expressions.
22149 2002-01-08  Ravi Pratap  <ravi@ximian.com>
22151         * class.cs (Indexer.DefineMethod): Incorporate the interface
22152         type in the name of the method if we are doing explicit interface
22153         implementation.
22155         * expression.cs (ConversionExists): Remove as it is completely obsolete.
22157         (BetterConversion): Fix extremely trivial bug where we were referring to
22158         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22159         again !
22161         * ../errors/bug16.cs : Add although we have fixed it.
22163 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
22165         * expression.cs (BaseIndexer): Begin implementation.
22167         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22169         * cs-parser.jay (indexer_declarator): Use qualified_identifier
22170         production directly to remove a shift/reduce, and implement
22171         explicit interface implementation.
22173         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22174         after a floating point suffix.
22176         * expression.cs (DoNumericPromotions): Improved the conversion for
22177         uint/uint.  If we have a constant, we avoid doing a typecast to a
22178         larger type.
22180         * class.cs (Indexer): Implement explicit interface implementation
22181         for indexers.
22183 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22185         * class.cs: make the default instance constructor public and hidebysig.
22187 2001-01-03  Ravi Pratap  <ravi@ximian.com>
22189         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22190         so we can call it from elsewhere.
22192         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22193         we emit it internally if the class has a defined indexer; otherwise the user
22194         emits it by decorating the class definition with the DefaultMemberAttribute.
22196         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22197         attribute is not used on a type which defines an indexer.
22199         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22200         character when we skip whitespace.
22202         * ../errors/cs0646.cs : Add.
22204 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
22206         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22207         again. 
22209         * makefile: Add practical target `mcs3.exe' which builds the third
22210         generation compiler. 
22212         * expression.cs (New): Fix structures constructor calling.
22214         * class.cs (Property, Method, Indexer): Emit Final flag on the
22215         method if we are an interface implementation and we are not
22216         abstract. 
22218         * ecore.cs (PropertyExpr): New public field `IsBase', tells
22219         whether this property is referencing a `base' method.
22221         * expression.cs (Invocation.EmitCall): take an extra argument:
22222         is_base, this is used to determine whether the `call' or
22223         `callvirt' opcode should be used.
22226         * delegate.cs: update EmitCall.
22228         * class.cs (Method.Define): Set NewSlot for the cases where we are
22229         not implementing an interface method.
22231         (Property.Define): ditto.
22233 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
22235         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22236         'r'.  Allows mcs to parse itself fully.
22238 2002-01-02  Ravi Pratap  <ravi@ximian.com>
22240         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22241         of the number of initializers that require the InitializeArray method.
22243         (CheckIndices): Store the Expression in all cases - not the plain value. Also
22244         update the above field where necessary.
22246         (MakeByteBlob): Update accordingly.
22248         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
22249         greater than 2.
22251         (EmitDynamicInitializers): Update in accordance with the new optimization.
22253         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22254         same OpCode applies.
22256         * cs-parser.jay : Fix some glaring errors I introduced.
22258 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
22260         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22261         so that we can check for name clashes there too.
22263         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22264         for interface indexers.
22266         * interfaces.cs (Define): Emit the default member attribute.
22268         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22269         variable was being referred to while setting the value ;-)
22271 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
22273         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22274         byte-by-byte information when we know the data is zero.
22276         Make the block always a multiple of 4, because
22277         DefineInitializedData has a bug.
22279         * assign.cs: Fix, we should assign from the temporary, not from
22280         the source. 
22282         * expression.cs (MakeByteBlob): Fix my incorrect code.
22284 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
22286         * typemanager.cs (EnumToUnderlying): This function is used to get
22287         the underlying type from an enumeration, because it does not
22288         always work. 
22290         * constant.cs: Use the I4_S form for values between -128 and 127.
22292         * statement.cs (Block.LookupLabel): Looks up a label.
22293         (Block): Drop support for labeled blocks.
22295         (LabeledStatement): New kind of statement that represents a label
22296         only.
22298         (Goto): Finally implement this bad boy.
22300         * cs-parser.jay: Update to reflect new mechanism to implement
22301         labels.
22303 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
22305         * codegen.cs (EmitContext.This): a codegen property that keeps the
22306         a single instance of this instead of creating many different this
22307         instances. 
22309         * delegate.cs (Delegate.DoResolve): Update to use the property;
22311         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22313         * expression.cs (BaseAccess.DoResolve): Ditto.
22315 2001-12-29  Ravi Pratap  <ravi@ximian.com>
22317         * typemanager.cs (methodimpl_attr_type): Add to hold the type
22318         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22320         (InitCoreTypes): Update accordingly.
22322         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22323         so we can quickly store the state.
22325         (ApplyAttributes): Set the correct implementation flags
22326         for InternalCall methods.
22328 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
22330         * expression.cs (EmitCall): if a method is not virtual, then do
22331         not use callvirt on it.
22333         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22334         user defined stuff) requires the use of stobj, which takes an
22335         address on the stack instead of an array and an index.  So emit
22336         the Ldelema operation for it.
22338         (EmitStoreOpcode): Use stobj for valuetypes.
22340         (UnaryMutator.EmitCode): Use the right 1 value depending on
22341         whether we are dealing with int64/uint64, float or doubles.
22343         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22344         constructors that I implemented last night.
22346         (Constructor.IsDefault): Fix to work properly for static
22347         constructors.
22349         * cs-parser.jay (CheckDef): report method signature errors.
22350         Update error number 103 to be 132.
22352         * decl.cs: New AdditionResult enumeration value: MethodExists.
22353         Although we do this check for methods later on in the semantic
22354         analysis, catching repeated default constructors is so easy that
22355         we catch these here. 
22357         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22358         promotions code.
22360         (ParameterReference.EmitAssign, Emit): handle
22361         bools as bytes.
22363         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22364         (ArrayAccess.EmitStoreOpcode): ditto.
22366         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22368         * expression.cs (MakeByteBlob): Complete all the missing types
22369         (uint, short, ushort, byte, sbyte)
22371         * class.cs: Only init instance field initializers on instance
22372         constructors. 
22374         Rename `constructors' to instance_constructors. 
22376         (TypeContainer.AddConstructor): Only add constructors to the list
22377         if it is not static.
22379         Make sure that we handle default_static_constructor independently
22380         everywhere where we handle instance_constructors
22382 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
22384         * class.cs: Do not lookup or create a base initializer for a
22385         static constructor.
22387         (ConstructorInitializer.Resolve): use the proper type to lookup
22388         for constructors.
22390         * cs-parser.jay: Report error 1585 (modifiers between type and name).
22392         * enum.cs, interface.cs: Remove CloseType, this is taken care by
22393         in DeclSpace. 
22395         * decl.cs: CloseType is now an virtual method, the default
22396         implementation just closes this type.
22398 2001-12-28  Ravi Pratap  <ravi@ximian.com>
22400         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22401         to PreserveSig by default. Also emit HideBySig on such methods.
22403         Basically, set the defaults to standard values.
22405         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22406         argument, if candidate is better, it can't be worse than the best !
22408         (Invocation): Re-write bits to differentiate between methods being
22409         applicable in their expanded form and their normal form - for params
22410         methods of course.
22412         Get rid of use_standard everywhere as only standard conversions are allowed
22413         in overload resolution. 
22415         More spec conformance.
22417 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22419         * driver.cs: Add --timestamp, to see where the compiler spends
22420         most of its time.
22422         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22423         `this' in static code.
22425         (SimpleName.DoResolve): Implement in terms of a helper function
22426         that allows static-references to be passed upstream to
22427         MemberAccess.
22429         (Expression.ResolveWithSimpleName): Resolve specially simple
22430         names when called by MemberAccess to implement the special
22431         semantics. 
22433         (Expression.ImplicitReferenceConversion): Handle conversions from
22434         Null to reference types before others, as Null's type is
22435         System.Object. 
22437         * expression.cs (Invocation.EmitCall): Handle the special case of
22438         calling methods declared on a reference type from a ValueType
22439         (Base classes System.Object and System.Enum)
22441         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22442         the left hand side is a TypeExpr, not on every enumeration. 
22444         (Binary.Resolve): If types are reference types, then do a cast to
22445         object on operators != and == of both arguments.
22447         * typemanager.cs (FindMembers): Extract instance and static
22448         members if requested.
22450         * interface.cs (PopulateProperty): Use void_type instead of null
22451         as the return type for the setter method.
22453         (PopulateIndexer): ditto.
22455 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22457         * support.cs (ReflectionParameters): Fix minor bug where we
22458         were examining the wrong parameter for the ParamArray attribute.
22460         Cope with requests for the type of the parameter at position
22461         greater than the params parameter's. We now return the element
22462         type of the params array as that makes more sense.
22464         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22465         accordingly as we no longer have to extract the element type
22466         ourselves.
22468         (Invocation.OverloadResolve): Update.
22470 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22472         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22473         against IEnumerator, test whether the return value is a descendant
22474         of the IEnumerator interface.
22476         * class.cs (Indexer.Define): Use an auxiliary method to implement
22477         the other bits of the method definition.  Begin support for
22478         explicit interface implementation.
22480         (Property.DefineMethod): Use TypeManager.void_type instead of null
22481         for an empty return value.
22483 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22485         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22486         dealing with a FieldExpr which is composed of a FieldBuilder, in
22487         the code path we did extract the constant, but we should have
22488         obtained the underlying value to be able to cast it (otherwise we
22489         end up in an infinite loop, this is what Ravi was running into).
22491         (ArrayCreation.UpdateIndices): Arrays might be empty.
22493         (MemberAccess.ResolveMemberAccess): Add support for section
22494         14.5.4.1 that deals with the special case of E.I when E is a type
22495         and something else, that I can be a reference to a static member.
22497         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22498         handle a particular array type to create byte blobs, it is just
22499         something we dont generate byteblobs for.
22501         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22502         arguments. 
22504         * location.cs (Push): remove the key from the hashtable that we
22505         are about to add.   This happens for empty files.
22507         * driver.cs: Dispose files after we have parsed them.
22509         (tokenize): new function that only runs the tokenizer on its
22510         input, for speed testing.
22512 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22514         * class.cs (Event.Define): Define the private field only if there
22515         are no accessors defined.
22517         * expression.cs (ResolveMemberAccess): If there is no associated
22518         field with the event, that means we have an event defined with its
22519         own accessors and we should flag error cs0070 since transforming
22520         ourselves into a field is not valid in that case.
22522         * ecore.cs (SimpleName.DoResolve): Same as above.
22524         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22525         and charset to sane values.
22527 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22529         * assign.cs (DoResolve): Perform check on events only if they 
22530         are being accessed outside the declaring type.
22532         * cs-parser.jay (event_declarations): Update rules to correctly
22533         set the type of the implicit parameter etc.
22535         (add_accessor, remove_accessor): Set current local parameters.
22537         * expression.cs (Binary): For delegate addition and subtraction,
22538         cast the return value from the method into the appropriate delegate
22539         type.
22541 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22543         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22544         of these as the workaround is unnecessary.
22546         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22547         delegate data - none of that is needed at all.
22549         Re-write bits to extract the instance expression and the delegate method
22550         correctly.
22552         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22553         on delegates too.
22555         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22556         of attaching attributes instead of duplicating code everywhere.
22558         * everywhere : Update code to do attribute emission using the above method.
22560 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22562         * expression.cs (IsParamsMethodApplicable): if there are not
22563         parameters, return immediately.
22565         * ecore.cs: The 0 literal can be implicity converted to an enum
22566         type. 
22568         (SimpleName.DoResolve): First lookup the type, then lookup the
22569         members. 
22571         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22572         want to get its address.  If the InstanceExpression is not
22573         addressable, store the result in a temporary variable, then get
22574         the address of it.
22576         * codegen.cs: Only display 219 errors on warning level or above. 
22578         * expression.cs (ArrayAccess): Make it implement the
22579         IMemoryLocation interface.
22581         (Binary.DoResolve): handle the operator == (object a, object b)
22582         and operator != (object a, object b) without incurring into a
22583         BoxedCast (because 5 != o should never be performed).
22585         Handle binary enumerator operators.
22587         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22588         value type, otherwise use Ldelem_ref.
22590         Use precomputed names;
22592         (AddressOf): Implement address of
22594         * cs-parser.jay (labeled_statement): Fix recursive block
22595         addition by reworking the production.
22597         * expression.cs (New.DoEmit): New has a special case:
22598                 
22599                  If we are dealing with a ValueType, we have a few
22600                  situations to deal with:
22601                 
22602                     * The target of New is a ValueType variable, that is
22603                       easy, we just pass this as the variable reference
22604                 
22605                     * The target of New is being passed as an argument,
22606                       to a boxing operation or a function that takes a
22607                       ValueType.
22608                 
22609                       In this case, we need to create a temporary variable
22610                       that is the argument of New.
22613 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22615         * rootcontext.cs (LookupType): Check that current_type is not null before
22616         going about looking at nested types.
22618         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22619         not implement the IAssignMethod interface any more.
22621         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22622         where we tranform them into FieldExprs if they are being resolved from within
22623         the declaring type.
22625         * ecore.cs (SimpleName.DoResolve): Do the same here.
22627         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22629         * ../errors/bug10.cs : Add.
22631         * ../errors/cs0070.cs : Add.
22633         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22635         * assign.cs : Get rid of EventIsLocal everywhere.
22637 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22639         * ecore.cs (ConvertIntLiteral): finished the implementation.
22641         * statement.cs (SwitchLabel): Convert the value we are using as a
22642         key before looking up the table.
22644 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22646         * codegen.cs (EmitTopBlock): Require a Location argument now.
22648         * cs-parser.jay (constructor_declarator): We need to setup
22649         current_local_parameters before we parse the
22650         opt_constructor_initializer, to allow the variables to be bound
22651         to the constructor arguments.
22653         * rootcontext.cs (LookupType): First lookup nested classes in our
22654         class and our parents before we go looking outside our class.
22656         * expression.cs (ConstantFold): Extract/debox the values at the
22657         beginnning. 
22659         * rootcontext.cs (EmitCode): Resolve the constants first before we
22660         resolve the types.  This is not really needed, but it helps debugging.
22662         * statement.cs: report location.
22664         * cs-parser.jay: pass location to throw statement.
22666         * driver.cs: Small bug fix.
22668         * report.cs: Updated format to be 4-zero filled digits.
22670 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22672         * expression.cs (CheckIndices): Fix minor bug where the wrong
22673         variable was being referred to ;-)
22675         (DoEmit): Do not call EmitStaticInitializers when the 
22676         underlying type is System.Object.
22678 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22680         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22681         and do the usual workaround for SRE.
22683         * class.cs (MyEventBuilder.EventType): New member to get at the type
22684         of the event, quickly.
22686         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22688         * assign.cs (Assign.DoResolve): Handle the case when the target
22689         is an EventExpr and perform the necessary checks.
22691         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22692         interface.
22694         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22696         (EventExpr): Set the type in the constructor itself since we 
22697         are meant to be born fully resolved.
22699         (EventExpr.Define): Revert code I wrote earlier.
22700                 
22701         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22702         instance expression is null. The instance expression is a This in that case
22703         or a null, depending on whether it is a static method or not.
22705         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22706         refers to more than one method.
22708         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22709         and accordingly flag errors.
22711 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22713         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22715 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22717         * location.cs (ToString): Provide useful rutine.
22719 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22721         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22722         objects, return the actual integral boxed.
22724         * statement.cs (SwitchLabel): define an ILLabel for each
22725         SwitchLabel. 
22727         (Switch.CheckSwitch): If the value is a Literal, extract
22728         the underlying literal.
22730         Also in the unused hashtable we had, add the SwitchLabel so we can
22731         quickly look this value up.
22733         * constant.cs: Implement a bunch of new constants.  Rewrite
22734         Literal based on this.  Made changes everywhere to adapt to this.
22736         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22737         dereferencing array only once, and also copes with enumrations.
22739         bytes are two bytes wide, not one.
22741         (Cast): Perform constant conversions.
22743         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22744         wrappers to the literals here.
22746         * expression.cs (DoNumericPromotions): long literals can converted
22747         to ulong implicity (this is taken care of elsewhere, but I was
22748         missing this spot).
22750         * ecore.cs (Expression.Literalize): Make the return type Literal,
22751         to improve type checking.
22753         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22755 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22757         * literal.cs: Revert code from ravi that checked the bounds.  The
22758         bounds are sane by the definition of the type itself. 
22760         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22761         need to actually look up in our parent hierarchy for interfaces
22762         implemented. 
22764         * const.cs: Use the underlying type for enumerations
22766         * delegate.cs: Compute the basename for the delegate creation,
22767         that should fix the delegate test case, and restore the correct
22768         Type Lookup semantics in rootcontext
22770         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22771         referencing a nested type with the Reflection API is using the "+"
22772         sign. 
22774         * cs-parser.jay: Do not require EOF token at the end.
22776 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22778         * rootcontext.cs (LookupType): Concatenate type names with
22779         a '.' instead of a '+' The test suite passes again.
22781         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22782         field of the enumeration.
22784         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22785         the case when the member is an EventExpr.
22787         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22788         static has an associated instance expression.
22790         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22792         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22794         * class.cs (Event.Define): Register event and perform appropriate checks
22795         for error #111.
22797         We define the Add and Remove methods even if the use provides none because
22798         in that case, we provide default implementations ourselves.
22800         Define a private field of the type of the event. This is done by the CSC compiler
22801         and we should be doing it too ;-)
22803         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22804         More methods we use in code we generate.
22806         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22807         is important.
22809         (InitCoreTypes): Update accordingly for the above.
22811         * class.cs (Event.Emit): Generate code for default accessors that we provide
22813         (EmitDefaultMethod): Do the job in the above.
22815         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22816         appropriate place.
22818 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22820         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22821         builders even if we were missing one.
22823         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22824         pass the Basename as our class name instead of the Name.  The
22825         basename will be correctly composed for us.
22827         * parameter.cs (Paramters): Now takes a Location argument.
22829         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22830         make all the code call directly LookupType in RootContext and take
22831         this chance to pass the Location information everywhere.
22833         * Everywhere: pass Location information.
22835 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22837         * class.cs (Constructor.Define): Updated way of detecting the
22838         length of the parameters.
22840         (TypeContainer.DefineType): Use basename as the type name for
22841         nested types.
22843         (TypeContainer.Define): Do not recursively define types here, as
22844         definition is taken care in order by the RootContext.
22846         * tree.cs: Keep track of namespaces in a per-file basis.
22848         * parameter.cs (Parameter.ComputeSignature): Update to use
22849         DeclSpace. 
22851         (Parameters.GetSignature): ditto.
22853         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22854         instead of a TypeContainer.
22856         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22857         resolve names.  Because we need to be resolve in our context, not
22858         our parents.
22860         * driver.cs: Implement response files.
22862         * class.cs (TypeContainer.DefineType): If we are defined, do not
22863         redefine ourselves.
22865         (Event.Emit): Emit the code for add/remove handlers.
22866         (Event.Define): Save the MethodBuilders for add/remove.
22868         * typemanager.cs: Use pair here too.
22870         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22871         DictionaryEntry requires the first argument to be non-null.  
22873         (enum_declaration): Compute full name for registering the
22874         enumeration.
22876         (delegate_declaration): Instead of using
22877         formal_parameter_list, use opt_formal_parameter_list as the list
22878         can be empty.
22880         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22881         (EventParsing): New property that controls whether `add' and
22882         `remove' are returned as tokens or identifiers (for events);
22884 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22886         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22887         use MyEventBuilder only and let it wrap the real builder for us.
22889         (MyEventBuilder): Revamp constructor etc.
22891         Implement all operations that we perform on EventBuilder in precisely the same
22892         way here too.
22894         (FindMembers): Update to use the EventBuilder member.
22896         (Event.Emit): Update accordingly.
22898 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22900         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22901         by calling the appropriate methods.
22903         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22904         useful.
22906         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22908 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22910         * delegate.cs (Delegate.Populate): Check that the return type
22911         and various parameters types are indeed accessible.
22913         * class.cs (Constructor.Define): Same here.
22915         (Field.Define): Ditto.
22917         (Event.Define): Ditto.
22919         (Operator.Define): Check that the underlying Method defined itself
22920         correctly - so it's MethodBuilder should not be null.
22922         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22923         expression happens to be null.
22925         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22926         members but as of now we don't seem to be able to do anything really useful with it.
22928         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22929         not the EventBuilder.
22931 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22933         * cs-tokenizer.cs: Add support for defines.
22934         Add support for #if, #elif, #else, #endif
22936         (eval_var): evaluates a variable.
22937         (eval): stubbed for evaluating functions.
22939         * cs-parser.jay: Pass the defines information
22941         * driver.cs: Add --define command line option.
22943         * decl.cs: Move MemberCore here.
22945         Make it the base class for DeclSpace.  This allows us to catch and
22946         report 108 and 109 for everything now.
22948         * class.cs (TypeContainer.Define): Extract all the members
22949         before populating and emit the warning 108 (new keyword required
22950         to override) instead of having each member implement this.
22952         (MemberCore.Define): New abstract method, we will be using this in
22953         the warning reporting engine in Populate.
22955         (Operator.Define): Adjust to new MemberCore protocol. 
22957         * const.cs (Const): This does not derive from Expression, it is a
22958         temporary object we use to create fields, it is a MemberCore. 
22960         * class.cs (Method.Define): Allow the entry point to be in a
22961         specific class.
22963         * driver.cs: Rewrite the argument handler to clean it up a bit.
22965         * rootcontext.cs: Made it just an auxiliary namespace feature by
22966         making everything static.
22968         * driver.cs: Adapt code to use RootContext type name instead of
22969         instance variable.
22971         * delegate.cs: Remove RootContext argument.
22973         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22974         argument. 
22976         * class.cs (Event.Define): The lookup can fail.
22978         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22980         * expression.cs: Resolve the this instance before invoking the code.
22982 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22984         * cs-parser.jay: Add a production in element_access that allows
22985         the thing to become a "type" reference.  This way we can parse
22986         things like "(string [])" as a type.
22988         Note that this still does not handle the more complex rules of
22989         casts. 
22992         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22994         * ecore.cs: (CopyNewMethods): new utility function used to
22995         assemble the list of methods from running FindMembers.
22997         (MemberLookup): Rework FindMembers so that 
22999 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
23001         * class.cs (TypeContainer): Remove Delegates who fail to be
23002         defined.
23004         * delegate.cs (Populate): Verify that we dont get null return
23005         values.   TODO: Check for AsAccessible.
23007         * cs-parser.jay: Use basename to emit error 574 (destructor should
23008         have the same name as container class), not the full name.
23010         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
23011         possible representation.  
23013         Also implements integer type suffixes U and L.
23015 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
23017         * expression.cs (ArrayCreation.DoResolve): We need to do the
23018         argument resolution *always*.
23020         * decl.cs: Make this hold the namespace.  Hold the root context as
23021         well.
23022         (LookupType): Move here.
23024         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
23026         * location.cs (Row, Name): Fixed the code, it was always returning
23027         references to the first file.
23029         * interface.cs: Register properties defined through interfaces.
23031         * driver.cs: Add support for globbing on the command line
23033         * class.cs (Field): Make it derive from MemberCore as well.
23034         (Event): ditto.
23036 2001-12-15  Ravi Pratap  <ravi@ximian.com>
23038         * class.cs (Event::Define): Check that the type of the event is a delegate
23039         type else flag error #66.
23041         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
23042         same.
23044         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
23045         values of EntryPoint, CharSet etc etc.
23047         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
23049         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
23050         be null and we should ignore this. I am not sure if this is really clean. Apparently,
23051         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
23052         which needs this to do its work.
23054         * ../errors/cs0066.cs : Add.
23056 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
23058         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
23059         helper functions.
23061         * class.cs: (MethodSignature.MethodSignature): Removed hack that
23062         clears out the parameters field.
23063         (MemberSignatureCompare): Cleanup
23065         (MemberCore): New base class used to share code between MethodCore
23066         and Property.
23068         (RegisterRequiredImplementations) BindingFlags.Public requires
23069         either BindingFlags.Instace or Static.  Use instance here.
23071         (Property): Refactored code to cope better with the full spec.
23073         * parameter.cs (GetParameterInfo): Return an empty array instead
23074         of null on error.
23076         * class.cs (Property): Abstract or extern properties have no bodies.
23078         * parameter.cs (GetParameterInfo): return a zero-sized array.
23080         * class.cs (TypeContainer.MethodModifiersValid): Move all the
23081         method modifier validation to the typecontainer so we can reuse
23082         this on properties.
23084         (MethodCore.ParameterTypes): return an empty sized array of types.
23086         (Property.Define): Test property modifier validity.
23088         Add tests for sealed/override too.
23090         (Method.Emit): abstract or extern methods have no bodies.
23092 2001-12-14  Ravi Pratap  <ravi@ximian.com>
23094         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23095         thing.
23097         (Method::Define, ::Emit): Modify accordingly.
23099         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23101         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23103         * makefile: Pass in /unsafe.
23105 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
23107         * class.cs (MakeKey): Kill routine.
23109         * class.cs (TypeContainer.Define): Correctly define explicit
23110         method implementations (they require the full interface name plus
23111         the method name).
23113         * typemanager.cs: Deply the PtrHashtable here and stop using the
23114         lame keys.  Things work so much better.
23116         This of course broke everyone who depended on `RegisterMethod' to
23117         do the `test for existance' test.  This has to be done elsewhere.
23119         * support.cs (PtrHashtable): A hashtable that avoid comparing with
23120         the object stupid Equals method (because, that like fails all over
23121         the place).  We still do not use it.
23123         * class.cs (TypeContainer.SetRequiredInterface,
23124         TypeContainer.RequireMethods): Killed these two routines and moved
23125         all the functionality to RegisterRequiredImplementations.
23127         (TypeContainer.RegisterRequiredImplementations): This routine now
23128         registers all the implementations required in an array for the
23129         interfaces and abstract methods.  We use an array of structures
23130         which can be computed ahead of time to reduce memory usage and we
23131         also assume that lookups are cheap as most classes will not
23132         implement too many interfaces.
23134         We also avoid creating too many MethodSignatures.
23136         (TypeContainer.IsInterfaceMethod): Update and optionally does not
23137         clear the "pending" bit if we find that there are problems with
23138         the declaration.
23140         (TypeContainer.VerifyPendingMethods): Update to report errors of
23141         methods that look like implementations but are not.
23143         (TypeContainer.Define): Add support for explicit interface method
23144         implementation. 
23146 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
23148         * typemanager.cs: Keep track of the parameters here instead of
23149         being a feature of the TypeContainer.
23151         * class.cs: Drop the registration of parameters here, as
23152         InterfaceMethods are also interface declarations.
23154         * delegate.cs: Register methods with the TypeManager not only with
23155         the TypeContainer.  This code was buggy.
23157         * interface.cs: Full registation here.
23159 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
23161         * expression.cs: Remove reducer for binary expressions, it can not
23162         be done this way.
23164         * const.cs: Put here the code that used to go into constant.cs
23166         * constant.cs: Put here the code for constants, this is a new base
23167         class for Literals.
23169         * literal.cs: Make Literal derive from Constant.
23171 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
23173         * statement.cs (Return.Emit): Report error 157 if the user
23174         attempts to return from a finally block.
23176         (Return.Emit): Instead of emitting a return, jump to the end of
23177         the function.
23179         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23180         LocalBuilder to store the result of the function.  ReturnLabel is
23181         the target where we jump.
23184 2001-12-09  Radek Doulik  <rodo@ximian.com>
23186         * cs-parser.jay: remember alias in current namespace
23188         * ecore.cs (SimpleName::DoResolve): use aliases for types or
23189         namespaces
23191         * class.cs (LookupAlias): lookup alias in my_namespace
23193         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23194         aliases hashtable
23195         (LookupAlias): lookup alias in this and if needed in parent
23196         namespaces
23198 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
23200         * support.cs: 
23202         * rootcontext.cs: (ModuleBuilder) Made static, first step into
23203         making things static.  I need this to avoid passing the
23204         TypeContainer when calling ParameterType.
23206         * support.cs (InternalParameters.ParameterType): Remove ugly hack
23207         that did string manipulation to compute the type and then call
23208         GetType.  Use Parameter.ParameterType instead.
23210         * cs-tokenizer.cs: Consume the suffix for floating values.
23212         * expression.cs (ParameterReference): figure out whether this is a
23213         reference parameter or not.  Kill an extra variable by computing
23214         the arg_idx during emission.
23216         * parameter.cs (Parameters.GetParameterInfo): New overloaded
23217         function that returns whether a parameter is an out/ref value or not.
23219         (Parameter.ParameterType): The type of the parameter (base,
23220         without ref/out applied).
23222         (Parameter.Resolve): Perform resolution here.
23223         (Parameter.ExternalType): The full type (with ref/out applied).
23225         * statement.cs (Using.Emit, Using.EmitExpression): Implement
23226         support for expressions on the using statement.
23228 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
23230         * statement.cs (Using.EmitLocalVariableDecls): Split the
23231         localvariable handling of the using statement.
23233         (Block.EmitMeta): Keep track of variable count across blocks.  We
23234         were reusing slots on separate branches of blocks.
23236         (Try.Emit): Emit the general code block, we were not emitting it. 
23238         Check the type of the declaration to be an IDisposable or
23239         something that can be implicity converted to it. 
23241         Emit conversions if required.
23243         * ecore.cs (EmptyExpression): New utility class.
23244         (Expression.ImplicitConversionExists): New utility function.
23246 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
23248         * statement.cs (Using): Implement.
23250         * expression.cs (LocalVariableReference): Support read only variables.
23252         * statement.cs: Remove the explicit emit for the Leave opcode.
23253         (VariableInfo): Add a readonly field.
23255 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
23257         * ecore.cs (ConvCast): new class used to encapsulate the various
23258         explicit integer conversions that works in both checked and
23259         unchecked contexts.
23261         (Expression.ConvertNumericExplicit): Use new ConvCast class to
23262         properly generate the overflow opcodes.
23264 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23266         * statement.cs: The correct type for the EmptyExpression is the
23267         element_type, not the variable type.  Ravi pointed this out.
23269 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23271         * class.cs (Method::Define): Handle PInvoke methods specially
23272         by using DefinePInvokeMethod instead of the usual one.
23274         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23275         above to do the task of extracting information and defining the method.
23277 2001-12-04  Ravi Pratap  <ravi@ximian.com>
23279         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23280         of the condition for string type.
23282         (Emit): Move that here. 
23284         (ArrayCreation::CheckIndices): Keep string literals in their expression
23285         form.
23287         (EmitDynamicInitializers): Handle strings appropriately.
23289 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
23291         * codegen.cs (EmitContext): Replace multiple variables with a
23292         single pointer to the current Switch statement.
23294         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23295         EmitContext.
23297 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23299         * statement.cs 
23301         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23302         default'.
23304         (Foreach.Emit): Foreach on arrays was not setting
23305         up the loop variables (for break/continue).
23307         (GotoCase): Semi-implented.
23309 2001-12-03  Ravi Pratap  <ravi@ximian.com>
23311         * attribute.cs (CheckAttribute): Handle system attributes by using
23312         Attribute.GetAttributes to examine information we need.
23314         (GetValidPlaces): Same here.
23316         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23318         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23320         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23322         (Method::Define): Set appropriate flags if we have a DllImport attribute.
23324         (Method::Emit): Handle the case when we are a PInvoke method.
23326 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
23328         * expression.cs: Use ResolveWithSimpleName on compound names.
23330 2001-12-02  Ravi Pratap  <ravi@ximian.com>
23332         * constant.cs (EmitConstant): Make sure we resolve the associated expression
23333         before trying to reduce it.
23335         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23337         * constant.cs (LookupConstantValue): Implement.
23339         (EmitConstant): Use the above in emitting the constant.
23341         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23342         that are user-defined by doing a LookupConstantValue on them.
23344         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23345         too, like above.
23347 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
23349         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23351         (BaseAccess.DoResolve): Implement.
23353         (MemberAccess.DoResolve): Split this routine into a
23354         ResolveMemberAccess routine that can be used independently
23356 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
23358         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23359         As that share bits of the implementation.  Is returns a boolean,
23360         while As returns the Type that is being probed.
23362 2001-12-01  Ravi Pratap  <ravi@ximian.com>
23364         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23365         instead of a Literal - much easier.
23367         (EnumInTransit): Remove - utterly useless :-)
23369         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23371         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23373         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23374         chain when we have no associated expression.
23376 2001-11-30  Ravi Pratap  <ravi@ximian.com>
23378         * constant.cs (Define): Use Location while reporting the errror.
23380         Also emit a warning when 'new' is used and there is no inherited
23381         member to hide.
23383         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
23384         populated.
23386         (LookupEnumValue): Implement to lookup an enum member's value and define it
23387         if necessary.
23389         (Populate): Re-write accordingly to use the above routine.
23391 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
23393         * expression.cs (This): Fix prototype for DoResolveLValue to
23394         override the base class DoResolveLValue.
23396         * cs-parser.cs: Report errors cs574 and cs575 (destructor
23397         declarations) 
23399         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23400         (we need to load the address of the field here).  This fixes
23401         test-22. 
23403         (FieldExpr.DoResolveLValue): Call the DoResolve
23404         function to initialize the Instance expression.
23406         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23407         correctly the GetEnumerator operation on a value type.
23409         * cs-parser.jay: Add more simple parsing error catches.
23411         * statement.cs (Switch): Add support for string switches.
23412         Handle null specially.
23414         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23416 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23418         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23420         (declare_local_constant): New helper function.
23422         * statement.cs (AddConstant): Keep a separate record of constants
23424         (IsConstant): Implement to determine if a variable is a constant.
23426         (GetConstantExpression): Implement.
23428         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23430         * statement.cs (IsVariableDefined): Re-write.
23432 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23434         * class.cs (TypeContainer::FindMembers): Look for constants
23435         in the case when we are looking for MemberTypes.Field
23437         * expression.cs (MemberAccess::DoResolve): Check that in the
23438         case we are a FieldExpr and a Literal, we are not being accessed
23439         by an instance reference.
23441         * cs-parser.jay (local_constant_declaration): Implement.
23443         (declaration_statement): Implement for constant declarations.
23445 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23447         * statement.cs (Switch): Catch double defaults.
23449         (Switch): More work on the switch() statement
23450         implementation.  It works for integral values now, need to finish
23451         string support.
23454 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23456         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23457         integer literals into other integer literals.  To be used by
23458         switch. 
23460 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23462         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23463         some memory.
23465         (EmitDynamicInitializers): Cope with the above since we extract data
23466         directly from ArrayData now.
23468         (ExpectInitializers): Keep track of whether initializers are mandatory
23469         or not.
23471         (Bounds): Make it a hashtable to prevent the same dimension being 
23472         recorded for every element in that dimension.
23474         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23475         from being found.
23477         Also fix bug which was causing the indices to be emitted in the reverse
23478         order.
23480 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23482         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23483         unfinished.  They do not work, because the underlying code is
23484         sloppy.
23486 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23488         * cs-parser.jay: Remove bogus fixme.
23490         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23491         on Switch statement.
23493 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23495         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23496         the same. 
23498         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23499         parameter. Apparently, any expression is allowed. 
23501         (ValidateInitializers): Update accordingly.
23503         (CheckIndices): Fix some tricky bugs thanks to recursion.
23505         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23506         I was being completely brain-dead.
23508         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23509         and re-write acordingly.
23511         (DelegateInvocation): Re-write accordingly.
23513         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23515         (MakeByteBlob): Handle types more correctly.
23517         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23518         initialization from expressions but it is incomplete because I am a complete
23519         Dodo :-|
23521 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23523         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23524         on If.  Basically, we have to return `true' (ie, we do return to
23525         our caller) only if both branches of the if return.
23527         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23528         short-circuit operators, handle them as short circuit operators. 
23530         (Cast.DoResolve): Resolve type.
23531         (Cast.Cast): Take an expression as the target type.
23533         * cs-parser.jay (cast_expression): Remove old hack that only
23534         allowed a limited set of types to be handled.  Now we take a
23535         unary_expression and we resolve to a type during semantic
23536         analysis.
23538         Use the grammar productions from Rhys to handle casts (this is
23539         not complete like Rhys syntax yet, we fail to handle that corner
23540         case that C# has regarding (-x), but we will get there.
23542 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23544         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23545         field which is an array type.
23547         * cs-parser.jay (declare_local_variables): Support array initialization too.
23549         * typemanager.cs (MakeKey): Implement.
23551         (everywhere): Use the above appropriately.
23553         * cs-parser.jay (for_statement): Update for array initialization while
23554         declaring variables.
23556         * ecore.cs : The error message was correct, it's the variable's names that
23557         were misleading ;-) Make the code more readable.
23559         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23560         the correct type etc.
23562         (ConvertExplicit): Handle Enum types by examining the underlying type.
23564 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23566         * parameter.cs (GetCallingConvention): Always return
23567         CallingConventions.Standard for now.
23569 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23571         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23572         and `r' after calling DoNumericPromotions.
23574         * ecore.cs: Fix error message (the types were in the wrong order).
23576         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23577         BindingFlags.Instance as well 
23579         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23580         implicit int literal conversion in an empty cast so that we
23581         propagate the right type upstream.
23583         (UnboxCast): new class used to unbox value types.
23584         (Expression.ConvertExplicit): Add explicit type conversions done
23585         by unboxing.
23587         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23588         the target type before applying the implicit LongLiterals to ULong
23589         literal cast.
23591 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23593         * cs-parser.jay (for_statement): Reworked the way For works: now
23594         we declare manually any variables that are introduced in
23595         for_initializer to solve the problem of having out-of-band code
23596         emition (that is what got for broken).
23598         (declaration_statement): Perform the actual variable declaration
23599         that used to be done in local_variable_declaration here.
23601         (local_variable_declaration): Do not declare anything, just pass
23602         the information on a DictionaryEntry
23604 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23606         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23607         re-write of the logic to now make it recursive.
23609         (UpdateIndices): Re-write accordingly.
23611         Store element data in a separate ArrayData list in the above methods.
23613         (MakeByteBlob): Implement to dump the array data into a byte array.
23615 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23617         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23618         into CheckIndices.
23620         * constant.cs (Define): Implement.
23622         (EmitConstant): Re-write fully.
23624         Pass in location info.
23626         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23627         respectively.
23629         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23630         DictionaryEntry since we need location info too.
23632         (constant_declaration): Update accordingly.
23634         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23635         code into another method : UpdateIndices.
23637 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23639         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23640         some type checking etc.
23642 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23644         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23645         bits to provide dimension info if the user skips doing that.
23647         Update second constructor to store the rank correctly.
23649 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23651         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23652         and try to implement.
23654         * ../errors/cs0150.cs : Add.
23656         * ../errors/cs0178.cs : Add.
23658 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23660         * statement.cs: Implement foreach on multi-dimensional arrays. 
23662         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23663         name of the params argument.
23665         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23666         initializing the array.
23668         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23669         we can use this elsewhere.
23671         * statement.cs: Finish implementation of foreach for single
23672         dimension arrays.
23674         * cs-parser.jay: Use an out-of-band stack to pass information
23675         around, I wonder why I need this.
23677         foreach_block: Make the new foreach_block the current_block.
23679         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23680         function used to return a static Parameters structure.  Used for
23681         empty parameters, as those are created very frequently.
23683         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23685 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23687         * interface.cs : Default modifier is private, not public. The
23688         make verify test passes again.
23690 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23692         * support.cs (ReflectionParameters): Fix logic to determine
23693         whether the last parameter is a params one. Test 9 passes again.
23695         * delegate.cs (Populate): Register the builders we define with
23696         RegisterParameterForBuilder. Test 19 passes again.
23698         * cs-parser.jay (property_declaration): Reference $6 instead
23699         of $$ to get at the location.
23701         (indexer_declaration): Similar stuff.
23703         (attribute): Ditto.
23705         * class.cs (Property): Register parameters for the Get and Set methods
23706         if they exist. Test 23 passes again.
23708         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23709         call to EmitArguments as we are sure there aren't any params arguments. 
23710         Test 32 passes again.
23712         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23713         IndexOutOfRangeException. 
23715         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23716         Test 33 now passes again.
23718 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23720         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23721         broke a bunch of things.  Will have to come up with a better way
23722         of tracking locations.
23724         * statement.cs: Implemented foreach for single dimension arrays.
23726 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23728         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23729         an error.  This removes the lookup from the critical path.
23731         * cs-parser.jay: Removed use of temporary_loc, which is completely
23732         broken. 
23734 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23736         * support.cs (ReflectionParameters.ParameterModifier): Report
23737         whether the argument is a PARAMS argument or not.
23739         * class.cs: Set the attribute `ParamArrayAttribute' on the
23740         parameter argument.
23742         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23743         and cons_param_array_attribute (ConstructorInfo for
23744         ParamArrayAttribute)., 
23746         * codegen.cs: Emit the return using the `Return' statement, that
23747         way we can report the error correctly for missing return values. 
23749         * class.cs (Method.Emit): Clean up.
23751         * expression.cs (Argument.Resolve): Take another argument: the
23752         location where this argument is used.  Notice that this is not
23753         part of the "Argument" class as to reduce the size of the
23754         structure (we know the approximate location anyways).
23756         Test if the argument is a variable-reference, if not, then
23757         complain with a 206.
23759         (Argument.Emit): Emit addresses of variables.
23761         (Argument.FullDesc): Simplify.
23763         (Invocation.DoResolve): Update for Argument.Resolve.
23765         (ElementAccess.DoResolve): ditto.
23767         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23768         method should be virtual, as this method is always virtual.
23770         (NewDelegate.DoResolve): Update for Argument.Resolve.
23772         * class.cs (ConstructorInitializer.DoResolve): ditto.
23774         * attribute.cs (Attribute.Resolve): ditto.
23776 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23778         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23780         * expression.cs (ParameterReference): Drop IStackStorage and implement
23781         IAssignMethod instead. 
23783         (LocalVariableReference): ditto.
23785         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23786         IAssignMethod instead. 
23788 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23790         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23791         enumerations that are used in heavily used structures derive from
23792         byte in a laughable and pathetic attempt to reduce memory usage.
23793         This is the kind of pre-optimzations that you should not do at
23794         home without adult supervision.
23796         * expression.cs (UnaryMutator): New class, used to handle ++ and
23797         -- separatedly from the other unary operators.  Cleans up the
23798         code, and kills the ExpressionStatement dependency in Unary.
23800         (Unary): Removed `method' and `Arguments' from this class, making
23801         it smaller, and moving it all to SimpleCall, so I can reuse this
23802         code in other locations and avoid creating a lot of transient data
23803         strucutres when not required.
23805         * cs-parser.jay: Adjust for new changes.
23807 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23809         * enum.cs (Enum.Populate): If there is a failure during
23810         definition, return
23812         * cs-parser.jay (opt_enum_base): we used to catch type errors
23813         here, but this is really incorrect.  The type error should be
23814         catched during semantic analysis.
23816 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23818         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23819         current_local_parameters as expected since I, in my stupidity, had forgotten
23820         to do this :-)
23822         * attribute.cs (GetValidPlaces): Fix stupid bug.
23824         * class.cs (Method::Emit): Perform check on applicability of attributes.
23826         (Constructor::Emit): Ditto.
23828         (Field::Emit): Ditto.
23830         (Field.Location): Store location information.
23832         (Property, Event, Indexer, Operator): Ditto.
23834         * cs-parser.jay (field_declaration): Pass in location for each field.
23836         * ../errors/cs0592.cs : Add.
23838 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23840         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23842         (InitCoreTypes): Update accordingly.
23844         (RegisterAttrType, LookupAttr): Implement.
23846         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23847         info about the same.
23849         (Resolve): Update to populate the above as necessary.
23851         (Error592): Helper.
23853         (GetValidPlaces): Helper to the above.
23855         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23857         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23859 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23861         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23863         * ../errors/cs0617.cs : Add.
23865 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23867         * enum.cs (Emit): Rename to Populate to be more consistent with what
23868         we expect it to do and when exactly it is called.
23870         * class.cs, rootcontext.cs : Update accordingly.
23872         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23873         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23875         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23877         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23878         of a fieldinfo using the above, when dealing with a FieldBuilder.
23880 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23882         * ../errors/cs0031.cs : Add.
23884         * ../errors/cs1008.cs : Add.
23886         * ../errrors/cs0543.cs : Add.
23888         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23889         enum type.
23891         (FindMembers): Implement.
23893         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23894         enums and delegates too.
23896         (enum_types): Rename to builder_to_enum.
23898         (delegate_types): Rename to builder_to_delegate.
23900         * delegate.cs (FindMembers): Implement.
23902 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23904         * typemanager.cs (IsEnumType): Implement.
23906         * enum.cs (Emit): Re-write parts to account for the underlying type
23907         better and perform checking etc.
23909         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23910         of the underlying type.
23912         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23913         value
23915         * enum.cs (error31): Helper to report error #31.
23917         * cs-parser.jay (enum_declaration): Store location of each member too.
23919         * enum.cs (member_to_location): New hashtable. 
23921         (AddEnumMember): Update location hashtable.
23923         (Emit): Use the location of each member while reporting errors.
23925 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23927         * cs-parser.jay: A for_initializer if is a
23928         local_variable_declaration really ammount to have an implicit
23929         block with the variable declaration and no initializer for for.
23931         * statement.cs (For.Emit): Cope with null initializers.
23933         This fixes the infinite loop on for initializers.
23935 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23937         * enum.cs: More cleanup.
23939         * ecore.cs: Remove dead code.
23941         * class.cs (Property.Emit): More simplification.
23942         (Event.Emit): ditto.
23944         Reworked to have less levels of indentation.
23946 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23948         * class.cs (Property): Emit attributes.
23950         (Field): Ditto.
23952         (Event): Ditto.
23954         (Indexer): Ditto.
23956         (Operator): Ditto.
23958         * enum.cs (Emit): Ditto.
23960         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23961         Enums too.
23963         * class.cs (Field, Event, etc.): Move attribute generation into the
23964         Emit method everywhere.
23966         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23967         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23968         as we had no way of defining nested enums !
23970         * rootcontext.cs : Adjust code accordingly.
23972         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23974 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23976         * expression.cs (EvalConstantExpression): Move into ecore.cs
23978         * enum.cs (Enum): Rename some members and make them public and readonly
23979         according to our convention.
23981         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23982         nothing else.
23984         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23986         (Enum::Emit): Write a simple version for now which doesn't try to compute
23987         expressions. I shall modify this to be more robust in just a while.
23989         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23991         (TypeContainer::CloseType): Create the Enum types too.
23993         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23995         * expression.cs (EvalConstantExpression): Get rid of completely.
23997         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23998         user-defined values and other cases.
24000         (IsValidEnumLiteral): Helper function.
24002         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
24003         out there in the case we had a literal FieldExpr.
24005         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
24007         (Literalize): Revamp a bit to take two arguments.
24009         (EnumLiteral): New class which derives from Literal to wrap enum literals.
24011 2001-11-06  Ravi Pratap  <ravi@ximian.com>
24013         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
24015         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
24017         (Resolve): Use the above to ensure we have proper initializers.
24019 2001-11-05  Ravi Pratap  <ravi@ximian.com>
24021         * expression.cs (Expression::EvalConstantExpression): New method to 
24022         evaluate constant expressions.
24024         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
24026 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
24028         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
24029         in an array.
24031         (Binary.ResolveOperator): Handle operator != (object a, object b)
24032         and operator == (object a, object b);
24034         (Binary.DoNumericPromotions): Indicate whether the numeric
24035         promotion was possible.
24037         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
24038         Implement.  
24040         Made the ArrayAccess implement interface IAssignMethod instead of
24041         IStackStore as the order in which arguments are passed reflects
24042         this.
24044         * assign.cs: Instead of using expr.ExprClass to select the way of
24045         assinging, probe for the IStackStore/IAssignMethod interfaces.
24047         * typemanager.cs: Load InitializeArray definition.
24049         * rootcontext.cs (RootContext.MakeStaticData): Used to define
24050         static data that can be used to initialize arrays. 
24052 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
24054         * expression.cs: Handle operator== and operator!= for booleans.
24056         (Conditioal.Reduce): Implement reducer for the ?: operator.
24058         (Conditional.Resolve): Implement dead code elimination.
24060         (Binary.Resolve): Catch string literals and return a new
24061         concatenated string.
24063         (Unary.Reduce): Implement reduction of unary expressions.
24065         * ecore.cs: Split out the expression core handling here.
24067         (Expression.Reduce): New method used to perform constant folding
24068         and CSE.  This is needed to support constant-expressions. 
24070         * statement.cs (Statement.EmitBoolExpression): Pass true and false
24071         targets, and optimize for !x.
24073 2001-11-04  Ravi Pratap  <ravi@ximian.com>
24075         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24076         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24077         set custom atttributes.
24079         * literal.cs (Literal::GetValue): New abstract method to return the actual
24080         value of the literal, cast as an object.
24082         (*Literal): Implement GetValue method.
24084         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24085         expressions to the arraylist but objects of type Argument.
24087         * class.cs (TypeContainer::Emit): Emit our attributes too.
24089         (Method::Emit, Constructor::Emit): Ditto.
24091         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24092         to be ignoring earlier.
24094 2001-11-03  Ravi Pratap  <ravi@ximian.com>
24096         * attribute.cs (AttributeSection::Define): Implement to do the business
24097         of constructing a CustomAttributeBuilder.
24099         (Attribute): New trivial class. Increases readability of code.  
24101         * cs-parser.jay : Update accordingly.
24103         (positional_argument_list, named_argument_list, named_argument): New rules
24105         (attribute_arguments): Use the above so that we are more correct.
24107 2001-11-02  Ravi Pratap  <ravi@ximian.com>
24109         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24110         to perform all checks for a method with a params parameter.
24112         (Invocation::OverloadResolve): Update to use the above method and therefore
24113         cope correctly with params method invocations.
24115         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
24116         params too.
24118         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24119         constructors in our parent too because we can't afford to miss out on 
24120         protected ones ;-)
24122         * attribute.cs (AttributeSection): New name for the class Attribute
24124         Other trivial changes to improve readability.
24126         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24127         use the new class names.
24129 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24131         * class.cs (Method::Define): Complete definition for params types too
24133         (Indexer::Define): Ditto.
24135         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24136         Cope everywhere with a request for info about the array parameter.
24138 2001-11-01  Ravi Pratap  <ravi@ximian.com>
24140         * tree.cs (RecordNamespace): Fix up to check for the correct key.
24142         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
24143         local_variable_type to extract the string corresponding to the type.
24145         (local_variable_type): Fixup the action to use the new helper method.
24147         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
24148         go.
24150         * expression.cs : Clean out code which uses the above.
24152 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24154         * typemanager.cs (RegisterMethod): Check if we already have an existing key
24155         and bale out if necessary by returning a false.
24157         (RegisterProperty): Ditto.
24159         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24160         and print out appropriate error messages.
24162         * interface.cs (everywhere): Ditto.
24164         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24165         location to constructor.
24167         * class.cs (Property, Event, Indexer): Update accordingly.
24169         * ../errors/cs111.cs : Added.
24171         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24172         of a method, as laid down by the spec.
24174         (Invocation::OverloadResolve): Use the above method.
24176 2001-10-31  Ravi Pratap  <ravi@ximian.com>
24178         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24179         now take a TypeContainer and a Parameters object.
24181         (ParameterData): Modify return type of ParameterModifier method to be 
24182         Parameter.Modifier and not a string.
24184         (ReflectionParameters, InternalParameters): Update accordingly.
24186         * expression.cs (Argument::GetParameterModifier): Same here.
24188         * support.cs (InternalParameters::ParameterType): Find a better way of determining
24189         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24190         symbol in it at all so maybe this is only for now.
24192 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24194         * support.cs (InternalParameters): Constructor now takes an extra argument 
24195         which is the actual Parameters class.
24197         (ParameterDesc): Update to provide info on ref/out modifiers.
24199         * class.cs (everywhere): Update call to InternalParameters to pass in
24200         the second argument too.
24202         * support.cs (ParameterData): Add ParameterModifier, which is a method 
24203         to return the modifier info [ref/out etc]
24205         (InternalParameters, ReflectionParameters): Implement the above.
24207         * expression.cs (Argument::ParameterModifier): Similar function to return
24208         info about the argument's modifiers.
24210         (Invocation::OverloadResolve): Update to take into account matching modifiers 
24211         too.
24213         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24214         a new SetFormalParameters object which we pass to InternalParameters.
24216 2001-10-30  Ravi Pratap  <ravi@ximian.com>
24218         * expression.cs (NewArray): Merge into the ArrayCreation class.
24220 2001-10-29  Ravi Pratap  <ravi@ximian.com>
24222         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
24223         NewUserdefinedArray into one as there wasn't much of a use in having
24224         two separate ones.
24226         * expression.cs (Argument): Change field's name to ArgType from Type.
24228         (Type): New readonly property which returns the proper type, taking into 
24229         account ref/out modifiers.
24231         (everywhere): Adjust code accordingly for the above.
24233         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24234         whether we are emitting for a ref or out parameter.
24236         * expression.cs (Argument::Emit): Use the above field to set the state.
24238         (LocalVariableReference::Emit): Update to honour the flag and emit the
24239         right stuff.
24241         * parameter.cs (Attributes): Set the correct flags for ref parameters.
24243         * expression.cs (Argument::FullDesc): New function to provide a full desc.
24245         * support.cs (ParameterData): Add method ParameterDesc to the interface.
24247         (ReflectionParameters, InternalParameters): Implement the above method.
24249         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24250         reporting errors.
24252         (Invocation::FullMethodDesc): Ditto. 
24254 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
24256         * cs-parser.jay: Add extra production for the second form of array
24257         creation. 
24259         * expression.cs (ArrayCreation): Update to reflect the above
24260         change. 
24262         * Small changes to prepare for Array initialization.
24264 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
24266         * typemanager.cs (ImplementsInterface): interface might be null;
24267         Deal with this problem;
24269         Also, we do store negative hits on the cache (null values), so use
24270         this instead of calling t.GetInterfaces on the type everytime.
24272 2001-10-28  Ravi Pratap  <ravi@ximian.com>
24274         * typemanager.cs (IsBuiltinType): New method to help determine the same.
24276         * expression.cs (New::DoResolve): Get rid of array creation code and instead
24277         split functionality out into different classes.
24279         (New::FormArrayType): Move into NewBuiltinArray.
24281         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24282         quite useless.
24284         (NewBuiltinArray): New class to handle creation of built-in arrays.
24286         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24287         account creation of one-dimensional arrays.
24289         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24291         (NewUserdefinedArray::DoResolve): Implement.
24293         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24295         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24296         we maintain inside the TypeManager. This is necessary to perform lookups on the
24297         module builder.
24299         (LookupType): Update to perform GetType on the module builders too.     
24301         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24303         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24305 2001-10-23  Ravi Pratap  <ravi@ximian.com>
24307         * expression.cs (New::DoResolve): Implement guts of array creation.
24309         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24311 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
24313         * expression.cs: Fix bug I introduced lsat night that broke
24314         Delegates. 
24316         (Expression.Resolve): Report a 246 error (can not resolve name)
24317         if we find a SimpleName in the stream.
24319         (Expression.ResolveLValue): Ditto.
24321         (Expression.ResolveWithSimpleName): This function is a variant of
24322         ResolveName, this one allows SimpleNames to be returned without a
24323         warning.  The only consumer of SimpleNames is MemberAccess
24325 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
24327         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24328         might arrive here.  I have my doubts that this is correct.
24330         * statement.cs (Lock): Implement lock statement.
24332         * cs-parser.jay: Small fixes to support `lock' and `using'
24334         * cs-tokenizer.cs: Remove extra space
24336         * driver.cs: New flag --checked, allows to turn on integer math
24337         checking. 
24339         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24340         Threading.Monitor.Exit 
24342 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
24344         * expression.cs (IndexerAccess::DoResolveLValue): Set the
24345         Expression Class to be IndexerAccess.
24347         Notice that Indexer::DoResolve sets the eclass to Value.
24349 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
24351         * class.cs (TypeContainer::Emit): Emit code for indexers.
24353         * assign.cs (IAssignMethod): New interface implemented by Indexers
24354         and Properties for handling assignment.
24356         (Assign::Emit): Simplify and reuse code. 
24358         * expression.cs (IndexerAccess, PropertyExpr): Implement
24359         IAssignMethod, clean up old code. 
24361 2001-10-22  Ravi Pratap  <ravi@ximian.com>
24363         * typemanager.cs (ImplementsInterface): New method to determine if a type
24364         implements a given interface. Provides a nice cache too.
24366         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24367         method.
24369         (ConvertReferenceExplicit): Ditto.
24371         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
24372         various methods, with correct names etc.
24374         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
24375         Operator.UnaryNegation.
24377         * cs-parser.jay (operator_declarator): Be a little clever in the case where
24378         we have a unary plus or minus operator.
24380         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
24381         UnaryMinus.
24383         * everywhere : update accordingly.
24385         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24386         respectively.
24388         * class.cs (Method::Define): For the case where we are implementing a method
24389         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
24390         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24392 2001-10-21  Ravi Pratap  <ravi@ximian.com>
24394         * interface.cs (FindMembers): Implement to work around S.R.E
24395         lameness.
24397         * typemanager.cs (IsInterfaceType): Implement.
24399         (FindMembers): Update to handle interface types too.
24401         * expression.cs (ImplicitReferenceConversion): Re-write bits which
24402         use IsAssignableFrom as that is not correct - it doesn't work.
24404         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24405         and accordingly override EmitStatement.
24407         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24408         using the correct logic :-)
24410 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24412         * ../errors/cs-11.cs : Add to demonstrate error -11 
24414 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24416         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24417         then pass this as a hint to ResolveLValue.
24419         * expression.cs (FieldExpr): Add Location information
24421         (FieldExpr::LValueResolve): Report assignment to readonly
24422         variable. 
24424         (Expression::ExprClassFromMemberInfo): Pass location information.
24426         (Expression::ResolveLValue): Add new method that resolves an
24427         LValue. 
24429         (Expression::DoResolveLValue): Default invocation calls
24430         DoResolve. 
24432         (Indexers): New class used to keep track of indexers in a given
24433         Type. 
24435         (IStackStore): Renamed from LValue, as it did not really describe
24436         what this did.  Also ResolveLValue is gone from this interface and
24437         now is part of Expression.
24439         (ElementAccess): Depending on the element access type
24441         * typemanager.cs: Add `indexer_name_type' as a Core type
24442         (System.Runtime.CompilerServices.IndexerNameAttribute)
24444         * statement.cs (Goto): Take a location.
24446 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24448         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24449         if two delegates are compatible.
24451         (NewDelegate::DoResolve): Update to take care of the case when
24452         we instantiate a delegate from another delegate.
24454         * typemanager.cs (FindMembers): Don't even try to look up members
24455         of Delegate types for now.
24457 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24459         * delegate.cs (NewDelegate): New class to take care of delegate
24460         instantiation.
24462         * expression.cs (New): Split the delegate related code out into 
24463         the NewDelegate class.
24465         * delegate.cs (DelegateInvocation): New class to handle delegate 
24466         invocation.
24468         * expression.cs (Invocation): Split out delegate related code into
24469         the DelegateInvocation class.
24471 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24473         * expression.cs (New::DoResolve): Implement delegate creation fully
24474         and according to the spec.
24476         (New::DoEmit): Update to handle delegates differently.
24478         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24479         because of which we were printing out arguments in reverse order !
24481         * delegate.cs (VerifyMethod): Implement to check if the given method
24482         matches the delegate.
24484         (FullDelegateDesc): Implement.
24486         (VerifyApplicability): Implement.
24488         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24489         delegate invocations too.
24491         (Invocation::Emit): Ditto.
24493         * ../errors/cs1593.cs : Added.
24495         * ../errors/cs1594.cs : Added.
24497         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24499 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24501         * typemanager.cs (intptr_type): Core type for System.IntPtr
24503         (InitCoreTypes): Update for the same.
24505         (iasyncresult_type, asynccallback_type): Ditto.
24507         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24508         correct.
24510         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24511         too.
24513         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24514         the builders for the 4 members of a delegate type :-)
24516         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24517         type.
24519         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24521         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24523 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24525         * statement.cs (Break::Emit): Implement.   
24526         (Continue::Emit): Implement.
24528         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24529         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24530         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24531         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24532         end loop
24534         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24535         properties that track the label for the current loop (begin of the
24536         loop and end of the loop).
24538 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24540         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24541         use of emitting anything at all.
24543         * class.cs, rootcontext.cs : Get rid of calls to the same.
24545         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24547         (Populate): Define the constructor correctly and set the implementation
24548         attributes.
24550         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24551         have been defined.
24553         (AddDelegateType): Implement.
24555         (IsDelegateType): Implement helper method.
24557         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24559         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24560         and accordingly handle it.
24562         * delegate.cs (Populate): Take TypeContainer argument.
24563         Implement bits to define the Invoke method. However, I still haven't figured out
24564         how to take care of the native int bit :-(
24566         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24567         Qualify the name of the delegate, not its return type !
24569         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24570         conversion.
24572         (StandardConversionExists): Checking for array types turns out to be recursive.
24574         (ConvertReferenceExplicit): Implement array conversion.
24576         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24578 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24580         * cs-parser.jay (delegate_declaration): Store the fully qualified
24581         name as it is a type declaration.
24583         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24584         readonly.
24586         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24587         as TypeContainer::DefineType.
24589         (Populate): Method in which all the definition of the various methods (Invoke)
24590         etc is done.
24592         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24593         see.
24595         (CloseDelegate): Finally creates the delegate.
24597         * class.cs (TypeContainer::DefineType): Update to define delegates.
24598         (Populate, Emit and CloseType): Do the same thing here too.
24600         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24601         delegates in all these operations.
24603 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24605         * expression.cs: LocalTemporary: a new expression used to
24606         reference a temporary that has been created.
24608         * assign.cs: Handle PropertyAccess back here, so that we can
24609         provide the proper semantic access to properties.
24611         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24612         a few more explicit conversions. 
24614         * modifiers.cs: `NEW' modifier maps to HideBySig.
24616         * expression.cs (PropertyExpr): Make this into an
24617         ExpressionStatement, and support the EmitStatement code path. 
24619         Perform get/set error checking, clean up the interface.
24621         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24622         them into toplevel access objects.
24624 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24626         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24627         SRE.
24629         * typemanager.cs: Keep track here of our PropertyBuilders again to
24630         work around lameness in SRE.
24632 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24634         * expression.cs (LValue::LValueResolve): New method in the
24635         interface, used to perform a second resolution pass for LValues. 
24637         (This::DoResolve): Catch the use of this in static methods.
24639         (This::LValueResolve): Implement.
24641         (This::Store): Remove warning, assigning to `this' in structures
24642         is 
24644         (Invocation::Emit): Deal with invocation of
24645         methods on value types.  We need to pass the address to structure
24646         methods rather than the object itself.  (The equivalent code to
24647         emit "this" for structures leaves the entire structure on the
24648         stack instead of a pointer to it). 
24650         (ParameterReference::DoResolve): Compute the real index for the
24651         argument based on whether the method takes or not a `this' pointer
24652         (ie, the method is static).
24654         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24655         value types returned from functions when we need to invoke a
24656         method on the sturcture.
24659 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24661         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24662         defining the type in the Modulebuilder or Typebuilder. This is to take
24663         care of nested types which need to be defined on the TypeBuilder using
24664         DefineNestedMethod.
24666         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24667         methods in RootContext, only ported to be part of TypeContainer.
24669         (TypeContainer::GetInterfaceOrClass): Ditto.
24671         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24673         * interface.cs (Interface::DefineInterface): New method. Does exactly
24674         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24675         too.
24677         (Interface::GetInterfaces): Move from RootContext here and port.
24679         (Interface::GetInterfaceByName): Same here.
24681         * rootcontext.cs (ResolveTree): Re-write.
24683         (PopulateTypes): Re-write.
24685         * class.cs (TypeContainer::Populate): Populate nested types too.
24686         (TypeContainer::Emit): Emit nested members too.
24688         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24689         instead just use the name argument passed in as it is already fully
24690         qualified.
24692         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24693         to TypeContainer mapping to see if a type is user-defined.
24695         * class.cs (TypeContainer::CloseType): Implement. 
24697         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24698         the default constructor.
24700         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24701         twice.
24703         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24705         * interface.cs (CloseType): Create the type here.
24707         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24708         the hierarchy.
24710         Remove all the methods which are now in TypeContainer.
24712 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24714         * delegate.cs (Define): Re-write bits to define the delegate
24715         correctly.
24717 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24719         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24721         * expression.cs (ImplicitReferenceConversion): handle null as well
24722         as a source to convert to any reference type.
24724         * statement.cs (Return): Perform any implicit conversions to
24725         expected return type.  
24727         Validate use of return statement.  
24729         * codegen.cs (EmitContext): Pass the expected return type here.
24731         * class.cs (Method, Constructor, Property): Pass expected return
24732         type to EmitContext.
24734 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24736         * expression.cs: Make DoResolve take an EmitContext instead of a
24737         TypeContainer.
24739         Replaced `l' and `location' for `loc', for consistency.
24741         (Error, Warning): Remove unneeded Tc argument.
24743         * assign.cs, literal.cs, constant.cs: Update to new calling
24744         convention. 
24746         * codegen.cs: EmitContext now contains a flag indicating whether
24747         code is being generated in a static method or not.
24749         * cs-parser.jay: DecomposeQI, new function that replaces the old
24750         QualifiedIdentifier.  Now we always decompose the assembled
24751         strings from qualified_identifier productions into a group of
24752         memberaccesses.
24754 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24756         * rootcontext.cs: Deal with field-less struct types correctly now
24757         by passing the size option to Define Type.
24759         * class.cs: Removed hack that created one static field. 
24761 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24763         * statement.cs: Moved most of the code generation here. 
24765 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24767         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24768         seem very right.
24770         (ElementAccess): Remove useless bits for now - keep checks as the spec
24771         says.
24773 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24775         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24776         and start performing checks according to the spec.
24778 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24780         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24781         rank_specifiers instead.
24783         (rank_specifiers): Change the order in which the rank specifiers are stored
24785         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24787         * expression.cs (ElementAccess): Implement the LValue interface too.
24789 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24791         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24792         except that user defined conversions are not included.
24794         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24795         perform the conversion of the return type, if necessary.
24797         (New::DoResolve): Check whether we are creating an array or an object
24798         and accordingly do the needful.
24800         (New::Emit): Same here.
24802         (New::DoResolve): Implement guts of array creation.
24804         (New::FormLookupType): Helper function.
24806 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24808         * codegen.cs: Removed most of the code generation here, and move the
24809         corresponding code generation bits to the statement classes. 
24811         Added support for try/catch/finalize and throw.
24813         * cs-parser.jay: Added support for try/catch/finalize.
24815         * class.cs: Catch static methods having the flags override,
24816         virtual or abstract.
24818         * expression.cs (UserCast): This user cast was not really doing
24819         what it was supposed to do.  Which is to be born in fully resolved
24820         state.  Parts of the resolution were being performed at Emit time! 
24822         Fixed this code.
24824 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24826         * expression.cs: Implicity convert the result from UserCast.
24828 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24830         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24831         prevented it from working correctly. 
24833         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24834         merely ConvertImplicit.
24836 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24838         * typemanager.cs: Make the LookupTypeContainer function static,
24839         and not per-instance.  
24841         * class.cs: Make static FindMembers (the one that takes a Type
24842         argument). 
24844         * codegen.cs: Add EmitForeach here.
24846         * cs-parser.jay: Make foreach a toplevel object instead of the
24847         inline expansion, as we need to perform semantic analysis on it. 
24849 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24851         * expression.cs (Expression::ImplicitUserConversion): Rename to
24852         UserDefinedConversion.
24854         (Expression::UserDefinedConversion): Take an extra argument specifying 
24855         whether we look for explicit user conversions too.
24857         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24859         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24861         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24862         with the appropriate arguments.
24864         * cs-parser.jay (cast_expression): Record location too.
24866         * expression.cs (Cast): Record location info.
24868         (Expression::ConvertExplicit): Take location argument.
24870         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24871         to determine if we are doing explicit conversions.
24873         (UserCast::Emit): Update accordingly.
24875         (Expression::ConvertExplicit): Report an error if everything fails.
24877         * ../errors/cs0030.cs : Add.
24879 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24881         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24882         virtual and newslot bits. 
24884         * class.cs (TypeContainer::RegisterRequiredImplementations):
24885         Record methods we need.
24887         (TypeContainer::MakeKey): Helper function to make keys for
24888         MethodBases, since the Methodbase key is useless.
24890         (TypeContainer::Populate): Call RegisterRequiredImplementations
24891         before defining the methods.   
24893         Create a mapping for method_builders_to_methods ahead of time
24894         instead of inside a tight loop.
24896         (::RequireMethods):  Accept an object as the data to set into the
24897         hashtable so we can report interface vs abstract method mismatch.
24899 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24901         * report.cs: Make all of it static.
24903         * rootcontext.cs: Drop object_type and value_type computations, as
24904         we have those in the TypeManager anyways.
24906         Drop report instance variable too, now it is a global.
24908         * driver.cs: Use try/catch on command line handling.
24910         Add --probe option to debug the error reporting system with a test
24911         suite. 
24913         * report.cs: Add support for exiting program when a probe
24914         condition is reached.
24916 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24918         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24919         we do a forcible conversion regardless of type, to check if 
24920         ForceConversion returns a null.
24922         (Binary::error19): Use location to report error.
24924         (Unary::error23): Use location here too.
24926         * ../errors/cs0019.cs : Check in.
24928         * ../errors/cs0023.cs : Check in.
24930         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24931         case of a non-null MethodInfo object with a length of 0 !
24933         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24934         an applicable member - according to the spec :-)
24935         Also fix logic to find members in base types.
24937         (Unary::ResolveOperator): Same here.
24939         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24940         as I was getting thoroughly confused between this and error19 :-)
24942         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24943         (::FindMostEncompassedType): Implement.
24944         (::FindMostEncompassingType): Implement.
24945         (::StandardConversionExists): Implement.
24947         (UserImplicitCast): Re-vamp. We now need info about most specific
24948         source and target types so that we can do the necessary conversions.
24950         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24951         mathematical union with no duplicates.
24953 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24955         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24956         in order from base classes to child classes, so that we can in
24957         child classes look up in our parent for method names and
24958         attributes (required for handling abstract, virtual, new, override
24959         constructs: we need to instrospect our base class, and if we dont
24960         populate the classes in order, the introspection might be
24961         incorrect.  For example, a method could query its parent before
24962         the parent has any methods and would determine that the parent has
24963         no abstract methods (while it could have had them)).
24965         (RootContext::CreateType): Record the order in which we define the
24966         classes.
24968 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24970         * class.cs (TypeContainer::Populate): Also method definitions can
24971         fail now, keep track of this.
24973         (TypeContainer::FindMembers): Implement support for
24974         DeclaredOnly/noDeclaredOnly flag.
24976         (Constructor::Emit) Return the ConstructorBuilder.
24978         (Method::Emit) Return the MethodBuilder. 
24979         Check for abstract or virtual methods to be public.
24981         * rootcontext.cs (RootContext::CreateType): Register all the
24982         abstract methods required for the class to be complete and the
24983         interface methods that must be implemented. 
24985         * cs-parser.jay: Report error 501 (method requires body if it is
24986         not marked abstract or extern).
24988         * expression.cs (TypeOf::Emit): Implement.
24990         * typemanager.cs: runtime_handle_type, new global type.
24992         * class.cs (Property::Emit): Generate code for properties.
24994 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24996         * expression.cs (Unary::ResolveOperator): Find operators on base type
24997         too - we now conform exactly to the spec.
24999         (Binary::ResolveOperator): Same here.
25001         * class.cs (Operator::Define): Fix minor quirk in the tests.
25003         * ../errors/cs0215.cs : Added.
25005         * ../errors/cs0556.cs : Added.
25007         * ../errors/cs0555.cs : Added.
25009 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
25011         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
25012         single integer which is really efficient
25014 2001-10-01  Ravi Pratap  <ravi@ximian.com>
25016         *  expression.cs (Expression::ImplicitUserConversion): Use location
25017         even in the case when we are examining True operators.
25019         * class.cs (Operator::Define): Perform extensive checks to conform
25020         with the rules for operator overloading in the spec.
25022         * expression.cs (Expression::ImplicitReferenceConversion): Implement
25023         some of the other conversions mentioned in the spec.
25025         * typemanager.cs (array_type): New static member for the System.Array built-in
25026         type.
25028         (cloneable_interface): For System.ICloneable interface.
25030         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
25031         we start resolving the tree and populating types.
25033         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
25035 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
25037         * expression.cs (Expression::ExprClassFromMemberInfo,
25038         Expression::Literalize): Create literal expressions from
25039         FieldInfos which are literals.
25041         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
25042         type casts, because they were wrong.  The test suite in tests
25043         caught these ones.
25045         (ImplicitNumericConversion): ushort to ulong requires a widening
25046         cast. 
25048         Int32 constant to long requires widening cast as well.
25050         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
25051         for integers because the type on the stack is not i4.
25053 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
25055         * expression.cs (report118): require location argument. 
25057         * parameter.cs: Do not dereference potential null value.
25059         * class.cs: Catch methods that lack the `new' keyword when
25060         overriding a name.  Report warnings when `new' is used without
25061         anything being there to override.
25063         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25065         * class.cs: Only add constructor to hashtable if it is non-null
25066         (as now constructors can fail on define).
25068         (TypeManager, Class, Struct): Take location arguments.
25070         Catch field instance initialization in structs as errors.
25072         accepting_filter: a new filter for FindMembers that is static so
25073         that we dont create an instance per invocation.
25075         (Constructor::Define): Catch errors where a struct constructor is
25076         parameterless 
25078         * cs-parser.jay: Pass location information for various new
25079         constructs. 
25081         * delegate.cs (Delegate): take a location argument.
25083         * driver.cs: Do not call EmitCode if there were problesm in the
25084         Definition of the types, as many Builders wont be there. 
25086         * decl.cs (Decl::Decl): Require a location argument.
25088         * cs-tokenizer.cs: Handle properly hex constants that can not fit
25089         into integers, and find the most appropiate integer for it.
25091         * literal.cs: Implement ULongLiteral.
25093         * rootcontext.cs: Provide better information about the location of
25094         failure when CreateType fails.
25096 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
25098         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25099         as well.
25101         * expression.cs (Binary::CheckShiftArguments): Add missing type
25102         computation.
25103         (Binary::ResolveOperator): Add type to the logical and and logical
25104         or, Bitwise And/Or and Exclusive Or code paths, it was missing
25105         before.
25107         (Binary::DoNumericPromotions): In the case where either argument
25108         is ulong (and most signed types combined with ulong cause an
25109         error) perform implicit integer constant conversions as well.
25111 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25113         * expression.cs (UserImplicitCast): Method should always be
25114         non-null. 
25115         (Invocation::BetterConversion): Simplified test for IntLiteral.
25117         (Expression::ImplicitNumericConversion): Split this routine out.
25118         Put the code that performs implicit constant integer conversions
25119         here. 
25121         (Expression::Resolve): Become a wrapper around DoResolve so we can
25122         check eclass and type being set after resolve.
25124         (Invocation::Badness): Remove this dead function
25126         (Binary::ResolveOperator): Do not compute the expensive argumnets
25127         unless we have a union for it.
25129         (Probe::Emit): Is needs to do an isinst and then
25130         compare against null.
25132         (::CanConvert): Added Location argument.  If the Location argument
25133         is null (Location.Null), then we do not report errors.  This is
25134         used by the `probe' mechanism of the Explicit conversion.  We do
25135         not want to generate an error for something that the user
25136         explicitly requested to be casted.  But the pipeline for an
25137         explicit cast first tests for potential implicit casts.
25139         So for now, if the Location is null, it means `Probe only' to
25140         avoid adding another argument.   Might have to revise this
25141         strategy later.
25143         (ClassCast): New class used to type cast objects into arbitrary
25144         classes (used in Explicit Reference Conversions).
25146         Implement `as' as well.
25148         Reverted all the patches from Ravi below: they were broken:
25150                 * The use of `level' as a mechanism to stop recursive
25151                   invocations is wrong.  That was there just to catch the
25152                   bug with a strack trace but not as a way of addressing
25153                   the problem.
25155                   To fix the problem we have to *understand* what is going
25156                   on and the interactions and come up with a plan, not
25157                   just get things going.
25159                 * The use of the type conversion cache that I proposed
25160                   last night had an open topic: How does this work across
25161                   protection domains.  A user defined conversion might not
25162                   be public in the location where we are applying the
25163                   conversion, a different conversion might be selected
25164                   (ie, private A->B (better) but public B->A (worse),
25165                   inside A, A->B applies, but outside it, B->A will
25166                   apply).
25168                 * On top of that (ie, even if the above is solved),
25169                   conversions in a cache need to be abstract.  Ie, `To
25170                   convert from an Int to a Short use an OpcodeCast', not
25171                   `To convert from an Int to a Short use the OpcodeCast on
25172                   the variable 5' (which is what this patch was doing).
25174 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25176         * expression.cs (Invocation::ConversionExists): Re-write to use
25177         the conversion cache
25179         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25180         cache all conversions done, not just user-defined ones.
25182         (Invocation::BetterConversion): The real culprit. Use ConversionExists
25183         to determine if a conversion exists instead of acutually trying to 
25184         perform the conversion. It's faster too.
25186         (Expression::ConvertExplicit): Modify to use ConversionExists to check
25187         and only then attempt the implicit conversion.
25189 2001-09-28  Ravi Pratap  <ravi@ximian.com>
25191         * expression.cs (ConvertImplicit): Use a cache for conversions
25192         already found. Check level of recursion and bail out if necessary.
25194 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
25196         * typemanager.cs (string_concat_string_string, string_concat_object_object):
25197         Export standard methods that we expect for string operations.
25199         * statement.cs (Block::UsageWarning): Track usage of variables and
25200         report the errors for not used variables.
25202         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25203         operator. 
25205 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25207         * codegen.cs: remove unnneded code 
25209         * expression.cs: Removed BuiltinTypeAccess class
25211         Fix the order in which implicit conversions are
25212         done.  
25214         The previous fixed dropped support for boxed conversions (adding a
25215         test to the test suite now)
25217         (UserImplicitCast::CanConvert): Remove test for source being null,
25218         that code is broken.  We should not feed a null to begin with, if
25219         we do, then we should track the bug where the problem originates
25220         and not try to cover it up here.
25222         Return a resolved expression of type UserImplicitCast on success
25223         rather than true/false.  Ravi: this is what I was talking about,
25224         the pattern is to use a static method as a "constructor" for
25225         objects. 
25227         Also, do not create arguments until the very last minute,
25228         otherwise we always create the arguments even for lookups that
25229         will never be performed. 
25231         (UserImplicitCast::Resolve): Eliminate, objects of type
25232         UserImplicitCast are born in a fully resolved state. 
25234         * typemanager.cs (InitCoreTypes): Init also value_type
25235         (System.ValueType). 
25237         * expression.cs (Cast::Resolve): First resolve the child expression.
25239         (LValue): Add new method AddressOf to be used by
25240         the `&' operator.  
25242         Change the argument of Store to take an EmitContext instead of an
25243         ILGenerator, because things like FieldExpr need to be able to call
25244         their children expression to generate the instance code. 
25246         (Expression::Error, Expression::Warning): Sugar functions for
25247         reporting errors.
25249         (Expression::MemberLookup): Accept a TypeContainer instead of a
25250         Report as the first argument.
25252         (Expression::ResolvePrimary): Killed.  I still want to improve
25253         this as currently the code is just not right.
25255         (Expression::ResolveMemberAccess): Simplify, but it is still
25256         wrong. 
25258         (Unary::Resolve): Catch errors in AddressOf operators.
25260         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25261         index to a byte for the short-version, or the compiler will choose
25262         the wrong Emit call, which generates the wrong data.
25264         (ParameterReference::Emit, ::Store): same.
25266         (FieldExpr::AddressOf): Implement.
25268         * typemanager.cs: TypeManager: made public variable instead of
25269         property.
25271         * driver.cs: document --fatal.
25273         * report.cs (ErrorMessage, WarningMessage): new names for the old
25274         Error and Warning classes.
25276         * cs-parser.jay (member_access): Turn built-in access to types
25277         into a normal simplename
25279 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25281         * expression.cs (Invocation::BetterConversion): Fix to cope
25282         with q being null, since this was introducing a bug.
25284         * expression.cs (ConvertImplicit): Do built-in conversions first.
25286 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25288         * expression.cs (UserImplicitCast::Resolve): Fix bug.
25290 2001-09-27  Ravi Pratap  <ravi@ximian.com>
25292         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25293         I had introduced long ago (what's new ?).
25295         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
25296         the work of all the checking. 
25297         (ConvertImplicit): Call CanConvert and only then create object if necessary.
25298         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25300         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25301         that is the right way. 
25303         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
25304         overloading resolution. Use everywhere instead of cutting and pasting code.
25306         (Binary::ResolveOperator): Use MakeUnionSet.
25308         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
25309         we have to convert to bool types. Not complete yet.
25311 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
25313         * typemanager.cs (TypeManager::CSharpName): support ushort.
25315         * expression.cs (Expression::TryImplicitIntConversion): Attempts
25316         to provide an expression that performsn an implicit constant int
25317         conversion (section 6.1.6).
25318         (Expression::ConvertImplicitRequired): Reworked to include
25319         implicit constant expression conversions.
25321         (Expression::ConvertNumericExplicit): Finished.
25323         (Invocation::Emit): If InstanceExpression is null, then it means
25324         that we perform a call on this.
25326 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25328         * expression.cs (Unary::Emit): Remove some dead code.
25329         (Probe): Implement Resolve and Emit for `is'.
25330         (Expression::ConvertImplicitRequired): Attempt to do constant
25331         expression conversions here.  Maybe should be moved to
25332         ConvertImplicit, but I am not sure.
25333         (Expression::ImplicitLongConstantConversionPossible,
25334         Expression::ImplicitIntConstantConversionPossible): New functions
25335         that tell whether is it possible to apply an implicit constant
25336         expression conversion.
25338         (ConvertNumericExplicit): Started work on explicit numeric
25339         conversions.
25341         * cs-parser.jay: Update operator constants.
25343         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25344         (Parameters::GetSignature): Hook up VerifyArgs here.
25345         (Parameters::VerifyArgs): Verifies that no two arguments have the
25346         same name. 
25348         * class.cs (Operator): Update the operator names to reflect the
25349         ones that the spec expects (as we are just stringizing the
25350         operator names).
25352         * expression.cs (Unary::ResolveOperator): Fix bug: Use
25353         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25354         previous usage did only work for our methods.
25355         (Expression::ConvertImplicit): Handle decimal implicit numeric
25356         conversions as well.
25357         (Expression::InternalTypeConstructor): Used to invoke constructors
25358         on internal types for default promotions.
25360         (Unary::Emit): Implement special handling for the pre/post
25361         increment/decrement for overloaded operators, as they need to have
25362         the same semantics as the other operators.
25364         (Binary::ResolveOperator): ditto.
25365         (Invocation::ConversionExists): ditto.
25366         (UserImplicitCast::Resolve): ditto.
25368 2001-09-26  Ravi Pratap  <ravi@ximian.com>
25370         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25371         operator, return after emitting body. Regression tests pass again !
25373         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25374         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25375         (Invocation::OverloadResolve): Ditto.
25376         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25378         * everywhere : update calls to the above methods accordingly.
25380 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
25382         * assign.cs (Assign): Make it inherit from ExpressionStatement.
25384         * expression.cs (ExpressionStatement): New base class used for
25385         expressions that can appear in statements, so that we can provide
25386         an alternate path to generate expression that do not leave a value
25387         on the stack.
25389         (Expression::Emit, and all the derivatives): We no longer return
25390         whether a value is left on the stack or not.  Every expression
25391         after being emitted leaves a single value on the stack.
25393         * codegen.cs (EmitContext::EmitStatementExpression): Use the
25394         facilties of ExpressionStatement if possible.
25396         * cs-parser.jay: Update statement_expression.
25398 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
25400         * driver.cs: Change the wording of message
25402 2001-09-25  Ravi Pratap  <ravi@ximian.com>
25404         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
25405         the type of the expression to the return type of the method if
25406         we have an overloaded operator match ! The regression tests pass again !
25407         (Unary::ResolveOperator): Ditto.
25409         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25410         to find "op_Implicit", not "implicit" ;-)
25411         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25412         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25414         * everywhere : Correct calls to the above accordingly.
25416         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25417         (ConvertImplicit): Do user-defined conversion if it exists.
25419 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25421         * assign.cs: track location.
25422         (Resolve): Use implicit conversions on assignment.
25424         * literal.cs: Oops.  Not good, Emit of short access values should
25425         pass (Bytes) or the wrong argument will be selected.
25427         * expression.cs (Unary::Emit): Emit code for -expr.
25429         (Unary::ResolveOperator): Handle `Substract' for non-constants
25430         (substract from zero from the non-constants).
25431         Deal with Doubles as well. 
25433         (Expression::ConvertImplicitRequired): New routine that reports an
25434         error if no implicit conversion exists. 
25436         (Invocation::OverloadResolve): Store the converted implicit
25437         expressions if we make them
25439 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25441         * class.cs (ConstructorInitializer): Take a Location argument.
25442         (ConstructorBaseInitializer): Same here.
25443         (ConstructorThisInitializer): Same here.
25445         * cs-parser.jay : Update all calls accordingly.
25447         * expression.cs (Unary, Binary, New): Take location argument.
25448         Update accordingly everywhere.
25450         * cs-parser.jay : Update all calls to the above to take a location
25451         argument.
25453         * class.cs : Ditto.
25455 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25457         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25458         (Invocation::BetterConversion): Same here
25459         (Invocation::ConversionExists): Ditto.
25461         (Invocation::ConversionExists): Implement.
25463 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25465         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25466         Also take an additional TypeContainer argument.
25468         * All over : Pass in TypeContainer as argument to OverloadResolve.
25470         * typemanager.cs (CSharpName): Update to check for the string type and return
25471         that too.
25473         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25474         a given method.
25476 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25478         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25479         (Invocation::BetterFunction): Implement.
25480         (Invocation::BetterConversion): Implement.
25481         (Invocation::ConversionExists): Skeleton, no implementation yet.
25483         Okay, things work fine !
25485 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25487         * typemanager.cs: declare and load enum_type, delegate_type and
25488         void_type. 
25490         * expression.cs (Expression::Emit): Now emit returns a value that
25491         tells whether a value is left on the stack or not.  This strategy
25492         might be reveted tomorrow with a mechanism that would address
25493         multiple assignments.
25494         (Expression::report118): Utility routine to report mismatches on
25495         the ExprClass.
25497         (Unary::Report23): Report impossible type/operator combination
25498         utility function.
25500         (Unary::IsIncrementableNumber): Whether the type can be
25501         incremented or decremented with add.
25502         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25503         complemented. 
25504         (Unary::ResolveOperator): Implement ++, !, ~,
25506         (Invocation::Emit): Deal with new Emit convetion.
25508         * All Expression derivatives: Updated their Emit method to return
25509         whether they leave values on the stack or not.
25511         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25512         stack for expressions that are statements. 
25514 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25516         * expression.cs (LValue): New interface.  Must be implemented by
25517         LValue objects.
25518         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25519         LValue interface.
25521         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25522         interface for generating code, simplifies the code.
25524 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25526         * expression.cs (everywhere): Comment out return statements in ::Resolve
25527         methods to avoid the warnings.
25529 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25531         * driver.cs (parse): Report error 2001 if we can not open the
25532         source file.
25534         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25535         not resolve it.
25537         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25538         object. 
25540         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25541         otherwise nested blocks end up with the same index.
25543         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25545         * expression.cs:  Instead of having FIXMEs in the Resolve
25546         functions, throw exceptions so it is obvious that we are facing a
25547         bug. 
25549         * cs-parser.jay (invocation_expression): Pass Location information.
25551         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25552         Use a basename for those routines because .NET does not like paths
25553         on them. 
25555         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25556         already defined.
25558 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25560         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25561         are loading the correct data types (throws an exception if not).
25562         (TypeManager::InitCoreTypes): Use CoreLookupType
25564         * expression.cs (Unary::ResolveOperator): return the child
25565         expression for expressions which are just +expr.
25566         (Unary::ResolveOperator): Return negative literals for -LITERAL
25567         expressions (otherwise they are Unary {Literal}).
25568         (Invocation::Badness): Take into account `Implicit constant
25569         expression conversions'.
25571         * literal.cs (LongLiteral): Implement long literal class.
25572         (IntLiteral): export the `Value' of the intliteral. 
25574 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25576         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25578         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25579         instead of 'Operator'
25581         * expression.cs (Binary::ResolveOperator): Update accordingly.
25582         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25583         and 'Minus'
25585         * cs-parser.jay (unary_expression): Update to use the new names.
25587         * gen-treedump.cs (GetUnary): Same here.
25589         * expression.cs (Unary::Resolve): Implement.
25590         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25591         operators are found instead of making noise ;-)
25592         (Unary::ResolveOperator): New method to do precisely the same thing which
25593         Binary::ResolveOperator does for Binary expressions.
25594         (Unary.method, .Arguments): Add.
25595         (Unary::OperName): Implement.   
25596         (Unary::ForceConversion): Copy and Paste !
25598         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25599         a unary operator.
25601         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25602         for the inbuilt operators. Only overloading works for now ;-)
25604 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25606         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25607         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25609         * expression.cs (This::Emit): Implement. 
25610         (This::Resolve): Implement.
25611         (TypeOf:Resolve): Implement.
25612         (Expression::ResolveSimpleName): Add an implicit this to instance
25613         field references. 
25614         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25615         Bind instance variable to Field expressions.
25616         (FieldExpr::Instance): New field used to track the expression that
25617         represents the object instance.
25618         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25619         binding 
25620         (FieldExpr::Emit): Implement.
25622         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25623         the last instruction contains a return opcode to avoid generating
25624         the last `ret' instruction (this generates correct code, and it is
25625         nice to pass the peverify output).
25627         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25628         initializer for static and instance variables.
25629         (Constructor::Emit): Allow initializer to be null in the case of
25630         static constructors.  Only emit initializer for instance
25631         constructors. 
25633         (TypeContainer::FindMembers): Return a null array if there are no
25634         matches.
25636         Also fix the code for the MemberTypes.Method branch, as it was not
25637         scanning that for operators (or tried to access null variables before).
25639         * assign.cs (Assign::Emit): Handle instance and static fields. 
25641         * TODO: Updated.
25643         * driver.cs: Stop compilation if there are parse errors.
25645         * cs-parser.jay (constructor_declaration): Provide default base
25646         initializer for non-static constructors.
25647         (constructor_declarator): Do not provide a default base
25648         initializers if none was specified.
25649         Catch the fact that constructors should not have parameters.
25651         * class.cs: Do not emit parent class initializers for static
25652         constructors, that should be flagged as an error.
25654 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25656         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25657         Move back code into TypeContainer::Populate.
25659 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25661         * class.cs (TypeContainer::AddConstructor): Fix the check to
25662         compare against Name, not Basename. 
25663         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25665         * cs-parser.jay : Update accordingly.
25667         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25668         for methods, don't forget to look into the operators too.
25669         (RegisterMethodBuilder): Helper method to take care of this for
25670         methods, constructors and operators.
25671         (Operator::Define): Completely revamp.
25672         (Operator.OperatorMethod, MethodName): New fields.
25673         (TypeContainer::Populate): Move the registering of builders into
25674         RegisterMethodBuilder.
25675         (Operator::Emit): Re-write.
25677         * expression.cs (Binary::Emit): Comment out code path to emit method
25678         invocation stuff for the case when we have a user defined operator. I am
25679         just not able to get it right !
25681 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25683         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25684         argument. 
25686         (Expression::MemberLookup): Provide a version that allows to
25687         specify the MemberTypes and BindingFlags. 
25689         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25690         so it was not fetching variable information from outer blocks.
25692         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25693         Beforefieldinit as it was buggy.
25695         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25696         that Ravi put here.  
25698         * class.cs (Constructor::Emit): Only emit if block is not null.
25699         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25700         deal with this by semantically definining it as if the user had
25701         done it.
25703         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25704         constructors as we now "emit" them at a higher level.
25706         (TypeContainer::DefineDefaultConstructor): Used to define the
25707         default constructors if none was provided.
25709         (ConstructorInitializer): Add methods Resolve and Emit. 
25711         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25713 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25715         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25716         the default constructor builder with our hashtable for methodbuilders
25717         to methodcores.
25719         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25720         and argument_count is 0 in which case we have a match.
25721         (Binary::ResolveOperator): More null checking and miscellaneous coding
25722         style cleanup.
25724 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25726         * rootcontext.cs (IsNameSpace): Compare against null.
25728         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25730         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25731         and Unary::Operator.
25733         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25734         accordingly.
25736         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25737         we have overloaded operators.
25738         (Binary::ResolveOperator): Implement the part which does the operator overload
25739         resolution.
25741         * class.cs (Operator::Emit): Implement.
25742         (TypeContainer::Emit): Emit the operators we have too.
25744         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25745         the case when we have a user-defined operator.
25747 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25749         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25751 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25753         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25754         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25755         (Constructor::Emit): Implement.
25756         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25757         if we have no work to do. 
25758         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25759         Emit method.
25761         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25762         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25764         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25765         of parent.parent.
25767 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25769         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25770         in the source.
25771         (Tree::RecordNamespace): Method to do what the name says ;-)
25772         (Tree::Namespaces): Property to get at the namespaces hashtable.
25774         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25775         keep track.
25777         * rootcontext.cs (IsNamespace): Fixed it :-)
25779 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25781         * class.cs (TypeContainer::FindMembers): Add support for
25782         constructors. 
25783         (MethodCore): New class that encapsulates both the shared aspects
25784         of a Constructor and a Method.  
25785         (Method, Constructor): Factored pieces into MethodCore.
25787         * driver.cs: Added --fatal which makes errors throw exceptions.
25788         Load System assembly as well as part of the standard library.
25790         * report.cs: Allow throwing exceptions on errors for debugging.
25792         * modifiers.cs: Do not use `parent', instead use the real type
25793         container to evaluate permission settings.
25795         * class.cs: Put Ravi's patch back in.  He is right, and we will
25796         have to cope with the
25798 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25800         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25801         FamORAssem, not FamANDAssem.
25803 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25805         * driver.cs: Added --parse option that only parses its input files
25806         and terminates.
25808         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25809         incorrect.  IsTopLevel is not used to tell whether an object is
25810         root_types or not (that can be achieved by testing this ==
25811         root_types).  But to see if this is a top-level *class* (not
25812         necessarly our "toplevel" container). 
25814 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25816         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25817         parent instead of a direct call to GetType.
25819 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25821         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25822         Modifiers.TypeAttr. This should just be a call to that method.
25824         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25825         object so that we can determine if we are top-level or not.
25827         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25828         TypeContainer too.
25830         * enum.cs (Enum::Define): Ditto.
25832         * modifiers.cs (FieldAttr): Re-write.
25834         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25835         (TypeContainer::HaveStaticConstructor): New property to provide access
25836         to precisely that info.
25838         * modifiers.cs (MethodAttr): Re-write.
25839         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25841         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25842         of top-level types as claimed.
25844 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25846         * expression.cs (MemberLookup): Fruitless attempt to lookup
25847         constructors.  Maybe I need to emit default constructors?  That
25848         might be it (currently .NET emits this for me automatically).
25849         (Invocation::OverloadResolve): Cope with Arguments == null.
25850         (Invocation::EmitArguments): new function, shared by the new
25851         constructor and us.
25852         (Invocation::Emit): Handle static and instance methods.  Emit
25853         proper call instruction for virtual or non-virtual invocations.
25854         (New::Emit): Implement.
25855         (New::Resolve): Implement.
25856         (MemberAccess:Resolve): Implement.
25857         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25858         to track instances.
25859         (FieldExpr::Resolve): Set type.
25861         * support.cs: Handle empty arguments.
25862                 
25863         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25864         SimpleLookup): Auxiliary routines to help parse a qualifier
25865         identifier.  
25867         Update qualifier_identifier rule.
25869         * codegen.cs: Removed debugging messages.
25871         * class.cs: Make this a global thing, this acts just as a "key" to
25872         objects that we might have around.
25874         (Populate): Only initialize method_builders_to_methods once.
25876         * expression.cs (PropertyExpr): Initialize type from the
25877         PropertyType. 
25879         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25880         Resolve pattern.  Attempt to implicitly convert value to boolean.
25881         Emit code.
25883         * expression.cs: Set the type for the int32/int32 argument case.
25884         (Binary::ResolveOperator): Set the return type to boolean for
25885         comparission operators
25887         * typemanager.cs: Remove debugging print code.
25889         (Invocation::Resolve): resolve type.
25891         * class.cs: Allocate a MemberInfo of the correct size, as the code
25892         elsewhere depends on the test to reflect the correct contents.
25894         (Method::) Keep track of parameters, due to System.Reflection holes
25896         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25897         mapping here.
25899         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25900         of the exact size and return that.
25902         (Class::LookupMethodByBuilder): New function that maps
25903         MethodBuilders to its methods.  Required to locate the information
25904         on methods because System.Reflection bit us again.
25906         * support.cs: New file, contains an interface ParameterData and
25907         two implementations: ReflectionParameters and InternalParameters
25908         used to access Parameter information.  We will need to grow this
25909         as required.
25911         * expression.cs (Invocation::GetParameterData): implement a cache
25912         and a wrapper around the ParameterData creation for methods. 
25913         (Invocation::OverloadResolve): Use new code.
25915 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25917         * class.cs (TypeContainer::EmitField): Remove and move into 
25918         (Field::Define): here and modify accordingly.
25919         (Field.FieldBuilder): New member.
25920         (TypeContainer::Populate): Update accordingly.
25921         (TypeContainer::FindMembers): Implement.
25923 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25925         * statement.cs: (VariableInfo::VariableType): New field to be
25926         initialized with the full type once it is resolved. 
25928 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25930         * parameter.cs (GetParameterInfo): Use a type cache to compute
25931         things only once, and to reuse this information
25933         * expression.cs (LocalVariableReference::Emit): Implement.
25934         (OpcodeCast::Emit): fix.
25936         (ParameterReference::Resolve): Implement.
25937         (ParameterReference::Emit): Implement.
25939         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25940         that are expressions need to stay as Expressions.
25942         * typemanager.cs (CSharpName): Returns the C# name of a type if
25943         possible. 
25945         * expression.cs (Expression::ConvertImplicit): New function that
25946         implements implicit type conversions.
25948         (Expression::ImplicitReferenceConversion): Implements implicit
25949         reference conversions.
25951         (EmptyCast): New type for transparent casts.
25953         (OpcodeCast): New type for casts of types that are performed with
25954         a sequence of bytecodes.
25956         (BoxedCast): New type used for casting value types into reference
25957         types.  Emits a box opcode.
25959         (Binary::DoNumericPromotions): Implements numeric promotions of
25960         and computation of the Binary::Type.
25962         (Binary::EmitBranchable): Optimization.
25964         (Binary::Emit): Implement code emission for expressions.
25966         * typemanager.cs (TypeManager): Added two new core types: sbyte
25967         and byte.
25969 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25971         * class.cs (TypeContainer::FindMembers): Method which does exactly
25972         what Type.FindMembers does, only we don't have to use reflection. No
25973         implementation yet.
25975         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25976         typecontainer objects as we need to get at them.
25977         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25979         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25980         typecontainer object.
25982         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25983         of just a Report object.
25985 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25987         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25988         "remove_"
25989         (TypeContainer::Populate): Now define the delegates of the type too.
25990         (TypeContainer.Delegates): Property to access the list of delegates defined
25991         in the type.
25993         * delegates.cs (Delegate::Define): Implement partially.
25995         * modifiers.cs (TypeAttr): Handle more flags.
25997 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25999         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
26000         and not <=
26001         (Operator::Define): Re-write logic to get types by using the LookupType method
26002         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
26003         (Indexer::Define): Ditto.
26004         (Event::Define): Ditto.
26005         (Property::Define): Ditto.
26007 2001-09-10  Ravi Pratap  <ravi@ximian.com>
26009         * class.cs (TypeContainer::Populate): Now define operators too. 
26010         (TypeContainer.Operators): New property to access the list of operators
26011         in a type.
26012         (Operator.OperatorMethodBuilder): New member to hold the method builder
26013         for the operator we are defining.
26014         (Operator::Define): Implement.
26016 2001-09-10  Ravi Pratap  <ravi@ximian.com>
26018         * class.cs (Event::Define): Make the prefixes of the accessor methods
26019         addOn_ and removeOn_ 
26021         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
26022         of the location being passed in too. Ideally, this should go later since all
26023         error reporting should be done through the Report object.
26025         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
26026         (Populate): Iterate thru the indexers we have and define them too.
26027         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
26028         for the get and set accessors.
26029         (Indexer::Define): Implement.
26031 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
26033         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
26034         my previous implementation, did not work.
26036         * typemanager.cs: Add a couple of missing types (the longs).
26038         * literal.cs: Use TypeManager.bool_type instead of getting it.
26040         * expression.cs (EventExpr): New kind of expressions.
26041         (Expressio::ExprClassFromMemberInfo): finish
26043 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
26045         * assign.cs: Emit stores to static fields differently.
26047 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26049         * Merge in changes and adjust code to tackle conflicts. Backed out my
26050         code in Assign::Resolve ;-) 
26052 2001-09-08  Ravi Pratap  <ravi@ximian.com>
26054         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
26055         instead Report.Error and also pass in the location.
26056         (CSharpParser::Lexer): New readonly property to return the reference
26057         to the Tokenizer object.
26058         (declare_local_variables): Use Report.Error with location instead of plain 
26059         old error.
26060         (CheckDef): Ditto.
26062         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26063         (Operator.CheckBinaryOperator): Ditto.
26065         * cs-parser.jay (operator_declarator): Update accordingly.
26067         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26068         (CheckBinaryOperator): Same here.
26070         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26071         on the name without any prefixes of namespace names etc. This is because we
26072         already might have something already fully qualified like 
26073         'System.Console.WriteLine'
26075         * assign.cs (Resolve): Begin implementation. Stuck ;-)
26077 2001-09-07  Ravi Pratap  <ravi@ximian.com>
26079         * cs-tokenizer.cs (location): Return a string which also contains
26080         the file name.
26082         * expression.cs (ElementAccess): New class for expressions of the
26083         type 'element access.'
26084         (BaseAccess): New class for expressions of the type 'base access.'
26085         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26086         respectively.
26088         * cs-parser.jay (element_access): Implement action.
26089         (base_access): Implement actions.
26090         (checked_expression, unchecked_expression): Implement.
26092         * cs-parser.jay (local_variable_type): Correct and implement.
26093         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26095         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26097         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26098         name and the specifiers.
26100         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26102         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
26103         making them all public ;-)
26105         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26106         class anyways.
26108 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
26110         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26111         PropertyExprs.
26112         (FieldExpr, PropertyExprs): New resolved expressions.
26113         (SimpleName::MemberStaticCheck): Perform static checks for access
26114         to non-static fields on static methods. Maybe this should be
26115         generalized for MemberAccesses. 
26116         (SimpleName::ResolveSimpleName): More work on simple name
26117         resolution. 
26119         * cs-parser.jay (primary_expression/qualified_identifier): track
26120         the parameter index.
26122         * codegen.cs (CodeGen::Save): Catch save exception, report error.
26123         (EmitContext::EmitBoolExpression): Chain to expression generation
26124         instead of temporary hack.
26125         (::EmitStatementExpression): Put generic expression code generation.
26127         * assign.cs (Assign::Emit): Implement variable assignments to
26128         local variables, parameters and fields.
26130 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
26132         * statement.cs (Block::GetVariableInfo): New method, returns the
26133         VariableInfo for a variable name in a block.
26134         (Block::GetVariableType): Implement in terms of GetVariableInfo
26136         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26137         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26139 2001-09-06  Ravi Pratap  <ravi@ximian.com>
26141         * cs-parser.jay (operator_declaration): Continue on my quest : update
26142         to take attributes argument.
26143         (event_declaration): Ditto.
26144         (enum_declaration): Ditto.
26145         (indexer_declaration): Ditto.
26147         * class.cs (Operator::Operator): Update constructor accordingly.
26148         (Event::Event): Ditto.
26150         * delegate.cs (Delegate::Delegate): Same here.
26152         * enum.cs (Enum::Enum): Same here.
26154 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26156         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26158         * ../tests/cs0658.cs : New file to demonstrate error 0658.
26160         * attribute.cs (Attributes): New class to encapsulate all attributes which were
26161         being passed around as an arraylist.
26162         (Attributes::AddAttribute): Method to add attribute sections.
26164         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26165         (struct_declaration): Update accordingly.
26166         (constant_declaration): Update.
26167         (field_declaration): Update.
26168         (method_header): Update.
26169         (fixed_parameter): Update.
26170         (parameter_array): Ditto.
26171         (property_declaration): Ditto.
26172         (destructor_declaration): Ditto.
26174         * class.cs (Struct::Struct): Update constructors accordingly.
26175         (Class::Class): Ditto.
26176         (Field::Field): Ditto.
26177         (Method::Method): Ditto.
26178         (Property::Property): Ditto.
26179         (TypeContainer::OptAttribute): update property's return type.
26181         * interface.cs (Interface.opt_attributes): New member.
26182         (Interface::Interface): Update to take the extra Attributes argument.
26184         * parameter.cs (Parameter::Parameter): Ditto.
26186         * constant.cs (Constant::Constant): Ditto.
26188         * interface.cs (InterfaceMemberBase): New OptAttributes field.
26189         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
26190         the attributes as a parameter.
26191         (InterfaceProperty): Update constructor call.
26192         (InterfaceEvent): Ditto.
26193         (InterfaceMethod): Ditto.
26194         (InterfaceIndexer): Ditto.
26196         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
26197         pass the attributes too.
26198         (interface_event_declaration): Ditto.
26199         (interface_property_declaration): Ditto.
26200         (interface_method_declaration): Ditto.
26201         (interface_declaration): Ditto.
26203 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
26205         * class.cs (Method::Define): Track the "static Main" definition to
26206         create an entry point. 
26208         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26209         EntryPoint if we find it. 
26211         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26212         (EmitContext::ig): Make this variable public.
26214         * driver.cs: Make the default output file be the first file name
26215         with the .exe extension.  
26217         Detect empty compilations
26219         Handle various kinds of output targets.  Handle --target and
26220         rename -t to --dumper.
26222         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26223         methods inherited from Expression return now an Expression.  This
26224         will is used during the tree rewriting as we resolve them during
26225         semantic analysis.
26227         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26228         the spec.  Missing entirely is the information about
26229         accessability of elements of it.
26231         (Expression::ExprClassFromMemberInfo): New constructor for
26232         Expressions that creates a fully initialized Expression based on
26233         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26234         a Type.
26236         (Invocation::Resolve): Begin implementing resolution of invocations.
26238         * literal.cs (StringLiteral):  Implement Emit.
26240 2001-09-05  Ravi Pratap  <ravi@ximian.com>
26242         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26243         member.
26245 2001-09-04  Ravi Pratap  <ravi@ximian.com>
26247         * cs-parser.jay (attribute_arguments): Implement actions.
26248         (attribute): Fix bug in production. Implement action.
26249         (attribute_list): Implement.
26250         (attribute_target): Implement.
26251         (attribute_target_specifier, opt_target_specifier): Implement
26252         (CheckAttributeTarget): New method to check if the attribute target
26253         is valid.
26254         (attribute_section): Implement.
26255         (opt_attributes): Implement.
26257         * attribute.cs : New file to handle attributes.
26258         (Attribute): Class to hold attribute info.
26260         * cs-parser.jay (opt_attribute_target_specifier): Remove production
26261         (attribute_section): Modify production to use 2 different rules to 
26262         achieve the same thing. 1 s/r conflict down !
26263         Clean out commented, useless, non-reducing dimension_separator rules.
26265         * class.cs (TypeContainer.attributes): New member to hold list
26266         of attributes for a type.
26267         (Struct::Struct): Modify to take one more argument, the attribute list.
26268         (Class::Class): Ditto.
26269         (Field::Field): Ditto.
26270         (Method::Method): Ditto.
26271         (Property::Property): Ditto.
26273         * cs-parser.jay (struct_declaration): Update constructor call to
26274         pass in the attributes too.
26275         (class_declaration): Ditto.
26276         (constant_declaration): Ditto.
26277         (field_declaration): Ditto.
26278         (method_header): Ditto.
26279         (fixed_parameter): Ditto.
26280         (parameter_array): Ditto.
26281         (property_declaration): Ditto.
26283         * constant.cs (Constant::Constant): Update constructor similarly.
26284         Use System.Collections.
26286         * parameter.cs (Parameter::Parameter): Update as above.
26288 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26290         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26291         (TypeContainer.delegates): New member to hold list of delegates.
26293         * cs-parser.jay (delegate_declaration): Implement the action correctly 
26294         this time as I seem to be on crack ;-)
26296 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
26298         * rootcontext.cs (RootContext::IsNamespace): new function, used to
26299         tell whether an identifier represents a namespace.
26301         * expression.cs (NamespaceExpr): A namespace expression, used only
26302         temporarly during expression resolution.
26303         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26304         utility functions to resolve names on expressions.
26306 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
26308         * codegen.cs: Add hook for StatementExpressions. 
26310         * class.cs: Fix inverted test for static flag in methods.
26312 2001-09-02  Ravi Pratap  <ravi@ximian.com>
26314         * class.cs (Operator::CheckUnaryOperator): Correct error number used
26315         to make it coincide with MS' number.
26316         (Operator::CheckBinaryOperator): Ditto.
26318         * ../errors/errors.txt : Remove error numbers added earlier.
26320         * ../errors/cs1019.cs : Test case for error # 1019
26322         * ../errros/cs1020.cs : Test case for error # 1020
26324         * cs-parser.jay : Clean out commented cruft.
26325         (dimension_separators, dimension_separator): Comment out. Ostensibly not
26326         used anywhere - non-reducing rule.
26327         (namespace_declarations): Non-reducing rule - comment out.
26329         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26330         with TypeContainer::AddEnum.
26332         * delegate.cs : New file for delegate handling classes.
26333         (Delegate): Class for declaring delegates.
26335         * makefile : Update.
26337         * cs-parser.jay (delegate_declaration): Implement.
26339 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
26341         * class.cs (Event::Define): Implement.
26342         (Event.EventBuilder): New member.
26344         * class.cs (TypeContainer::Populate): Update to define all enums and events
26345         we have.
26346         (Events): New property for the events arraylist we hold. Shouldn't we move to using
26347         readonly fields for all these cases ?
26349 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26351         * class.cs (Property): Revamp to use the convention of making fields readonly.
26352         Accordingly modify code elsewhere.
26354         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26355         the Define method of the Property class.
26357         * class.cs : Clean up applied patch and update references to variables etc. Fix 
26358         trivial bug.
26359         (TypeContainer::Populate): Update to define all the properties we have. Also
26360         define all enumerations.
26362         * enum.cs (Define): Implement.
26364 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
26366         * cs-parser.jay (overloadable_operator): The semantic value is an
26367         enum of the Operator class.
26368         (operator_declarator): Implement actions.
26369         (operator_declaration): Implement.
26371         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26372         validity of definitions.
26373         (Operator::CheckBinaryOperator): Static method to check for binary operators
26374         (TypeContainer::AddOperator): New method to add an operator to a type.
26376         * cs-parser.jay (indexer_declaration): Added line to actually call the
26377         AddIndexer method so it gets added ;-)
26379         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
26380         already taken care of by the MS compiler ?  
26382 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26384         * class.cs (Operator): New class for operator declarations.
26385         (Operator::OpType): Enum for the various operators.
26387 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
26389         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26390         ostensibly handle this in semantic analysis.
26392         * cs-parser.jay (general_catch_clause): Comment out
26393         (specific_catch_clauses, specific_catch_clause): Ditto.
26394         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26395         (catch_args, opt_catch_args): New productions.
26396         (catch_clause): Rewrite to use the new productions above
26397         (catch_clauses): Modify accordingly.
26398         (opt_catch_clauses): New production to use in try_statement
26399         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26400         and re-write the code in the actions to extract the specific and
26401         general catch clauses by being a little smart ;-)
26403         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26404         Hooray, try and catch statements parse fine !
26406 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26408         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26409         string from the hashtable of variables.
26411         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26412         I end up making that mistake ;-)
26413         (catch_clauses): Fixed gross error which made Key and Value of the 
26414         DictionaryEntry the same : $1 !!
26416 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26418         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26420         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26421         when the add and remove accessors are specified. 
26423 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26425         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26426         information about indexer_declarator.
26427         (indexer_declarator): Implement actions.
26428         (parsing_indexer): New local boolean used to keep track of whether
26429         we are parsing indexers or properties. This is necessary because 
26430         implicit_parameters come into picture even for the get accessor in the 
26431         case of an indexer.
26432         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26434         * class.cs (Indexer): New class for indexer declarations.
26435         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26436         (TypeContainer::indexers): New member to hold list of indexers for the
26437         type.
26439 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26441         * cs-parser.jay (add_accessor_declaration): Implement action.
26442         (remove_accessor_declaration): Implement action.
26443         (event_accessors_declaration): Implement
26444         (variable_declarators): swap statements for first rule - trivial.
26446         * class.cs (Event): New class to hold information about event
26447         declarations.
26448         (TypeContainer::AddEvent): New method to add an event to a type
26449         (TypeContainer::events): New member to hold list of events.
26451         * cs-parser.jay (event_declaration): Implement actions.
26453 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26455         * cs-parser.jay (dim_separators): Implement. Make it a string
26456         concatenating all the commas together, just as they appear.
26457         (opt_dim_separators): Modify accordingly
26458         (rank_specifiers): Update accordingly. Basically do the same
26459         thing - instead, collect the brackets here.
26460         (opt_rank_sepcifiers): Modify accordingly.
26461         (array_type): Modify to actually return the complete type string
26462         instead of ignoring the rank_specifiers.
26463         (expression_list): Implement to collect the expressions
26464         (variable_initializer): Implement. We make it a list of expressions
26465         essentially so that we can handle the array_initializer case neatly too.
26466         (variable_initializer_list): Implement.
26467         (array_initializer): Make it a list of variable_initializers
26468         (opt_array_initializer): Modify accordingly.
26470         * expression.cs (New::NType): Add enumeration to help us
26471         keep track of whether we have an object/delegate creation
26472         or an array creation.
26473         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26474         members to hold data about array creation.
26475         (New:New): Modify to update NewType
26476         (New:New): New Overloaded contructor for the array creation
26477         case.
26479         * cs-parser.jay (array_creation_expression): Implement to call
26480         the overloaded New constructor.
26482 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26484         * class.cs (TypeContainer::Constructors): Return member
26485         constructors instead of returning null.
26487 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26489         * typemanager.cs (InitCoreTypes): Initialize the various core
26490         types after we have populated the type manager with the user
26491         defined types (this distinction will be important later while
26492         compiling corlib.dll)
26494         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26495         on Expression Classification.  Now all expressions have a method
26496         `Resolve' and a method `Emit'.
26498         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26499         generation from working.     Also add some temporary debugging
26500         code. 
26502 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26504         * codegen.cs: Lots of code generation pieces.  This is only the
26505         beginning, will continue tomorrow with more touches of polish.  We
26506         handle the fundamentals of if, while, do, for, return.  Others are
26507         trickier and I need to start working on invocations soon.
26509         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26510         s.InitStatement. 
26512         * codegen.cs (EmitContext): New struct, used during code
26513         emission to keep a context.   Most of the code generation will be
26514         here. 
26516         * cs-parser.jay: Add embedded blocks to the list of statements of
26517         this block.  So code generation proceeds in a top down fashion.
26519 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26521         * statement.cs: Add support for multiple child blocks.
26523 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26525         * codegen.cs (EmitCode): New function, will emit the code for a
26526         Block of code given a TypeContainer and its ILGenerator. 
26528         * statement.cs (Block): Standard public readonly optimization.
26529         (Block::Block constructors): Link children. 
26530         (Block::Child): Child Linker.
26531         (Block::EmitVariables): Emits IL variable declarations.
26533         * class.cs: Drop support for MethodGroups here, delay until
26534         Semantic Analysis.
26535         (Method::): Applied the same simplification that I did before, and
26536         move from Properties to public readonly fields.
26537         (Method::ParameterTypes): Returns the parameter types for the
26538         function, and implements a cache that will be useful later when I
26539         do error checking and the semantic analysis on the methods is
26540         performed.
26541         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26542         and made a method, optional argument tells whether this is a class
26543         or a structure to apply the `has-this' bit.
26544         (Method::GetCallingConvention): Implement, returns the calling
26545         convention. 
26546         (Method::Define): Defines the type, a second pass is performed
26547         later to populate the methods.
26549         (Constructor::ParameterTypes): implement a cache similar to the
26550         one on Method::ParameterTypes, useful later when we do semantic
26551         analysis. 
26553         (TypeContainer::EmitMethod):  New method.  Emits methods.
26555         * expression.cs: Removed MethodGroup class from here.
26557         * parameter.cs (Parameters::GetCallingConvention): new method.
26559 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26561         * class.cs (TypeContainer::Populate): Drop RootContext from the
26562         argument. 
26564         (Constructor::CallingConvention): Returns the calling convention.
26565         (Constructor::ParameterTypes): Returns the constructor parameter
26566         types. 
26568         (TypeContainer::AddConstructor): Keep track of default constructor
26569         and the default static constructor.
26571         (Constructor::) Another class that starts using `public readonly'
26572         instead of properties. 
26574         (Constructor::IsDefault): Whether this is a default constructor. 
26576         (Field::) use readonly public fields instead of properties also.
26578         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26579         track of static constructors;  If none is used, turn on
26580         BeforeFieldInit in the TypeAttributes. 
26582         * cs-parser.jay (opt_argument_list): now the return can be null
26583         for the cases where there are no arguments. 
26585         (constructor_declarator): If there is no implicit `base' or
26586         `this', then invoke the default parent constructor. 
26588         * modifiers.cs (MethodAttr): New static function maps a set of
26589         modifiers flags into a MethodAttributes enum
26590         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26591         MethodAttr, TypeAttr to represent the various mappings where the
26592         modifiers are used.
26593         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26595 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26597         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26598         method arguments.
26600         * interface.cs (PopulateIndexer): Implemented the code generator
26601         for interface indexers.
26603 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26605         * interface.cs (InterfaceMemberBase): Now we track the new status
26606         here.  
26608         (PopulateProperty): Implement property population.  Woohoo!  Got
26609         Methods and Properties going today. 
26611         Removed all the properties for interfaces, and replaced them with
26612         `public readonly' fields. 
26614 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26616         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26617         initialize their hashtables/arraylists only when they are needed
26618         instead of doing this always.
26620         * parameter.cs: Handle refs and out parameters.
26622         * cs-parser.jay: Use an ArrayList to construct the arguments
26623         instead of the ParameterCollection, and then cast that to a
26624         Parameter[] array.
26626         * parameter.cs: Drop the use of ParameterCollection and use
26627         instead arrays of Parameters.
26629         (GetParameterInfo): Use the Type, not the Name when resolving
26630         types. 
26632 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26634         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26635         and instead use public readonly fields.
26637         * class.cs: Put back walking code for type containers.
26639 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26641         * class.cs (MakeConstant): Code to define constants.
26643         * rootcontext.cs (LookupType): New function.  Used to locate types 
26646 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26648         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26649         this System.Reflection code is.  Kudos to Microsoft
26651         * typemanager.cs: Implement a type cache and avoid loading all
26652         types at boot time.  Wrap in LookupType the internals.  This made
26653         the compiler so much faster.  Wow.  I rule!
26655         * driver.cs: Make sure we always load mscorlib first (for
26656         debugging purposes, nothing really important).
26658         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26659         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26661         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26662         on namespaces that have been imported using the `using' keyword.
26664         * class.cs (TypeContainer::TypeAttr): Virtualize.
26665         (Class::TypeAttr): Return attributes suitable for this bad boy.
26666         (Struct::TypeAttr): ditto.
26667         Handle nested classes.
26668         (TypeContainer::) Remove all the type visiting code, it is now
26669         replaced with the rootcontext.cs code
26671         * rootcontext.cs (GetClassBases): Added support for structs. 
26673 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26675         * interface.cs, statement.cs, class.cs, parameter.cs,
26676         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26677         Drop use of TypeRefs, and use strings instead.
26679 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26681         * rootcontext.cs: 
26683         * class.cs (Struct::Struct): set the SEALED flags after
26684         checking the modifiers.
26685         (TypeContainer::TypeAttr): new property, returns the
26686         TypeAttributes for a class.  
26688         * cs-parser.jay (type_list): Oops, list production was creating a
26689         new list of base types.
26691         * rootcontext.cs (StdLib): New property.
26692         (GetInterfaceTypeByName): returns an interface by type name, and
26693         encapsulates error handling here.
26694         (GetInterfaces): simplified.
26695         (ResolveTree): Encapsulated all the tree resolution here.
26696         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26697         types. 
26699         * driver.cs: Add support for --nostdlib, to avoid loading the
26700         default assemblies.
26701         (Main): Do not put tree resolution here. 
26703         * rootcontext.cs: Beginning of the class resolution.
26705 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26707         * rootcontext.cs: Provide better error reporting. 
26709         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26711         * rootcontext.cs (CreateInterface): Handle the case where there
26712         are no parent interfaces.
26714         (CloseTypes): Routine to flush types at the end.
26715         (CreateInterface): Track types.
26716         (GetInterfaces): Returns an array of Types from the list of
26717         defined interfaces.
26719         * typemanager.c (AddUserType): Mechanism to track user types (puts
26720         the type on the global type hash, and allows us to close it at the
26721         end). 
26723 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26725         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26726         RecordInterface instead.
26728         * cs-parser.jay: Updated to reflect changes above.
26730         * decl.cs (Definition): Keep track of the TypeBuilder type that
26731         represents this type here.  Not sure we will use it in the long
26732         run, but wont hurt for now.
26734         * driver.cs: Smaller changes to accomodate the new code.
26736         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26737         when done. 
26739         * rootcontext.cs (CreateInterface):  New method, used to create
26740         the System.TypeBuilder type for interfaces.
26741         (ResolveInterfaces): new entry point to resolve the interface
26742         hierarchy. 
26743         (CodeGen): Property, used to keep track of the code generator.
26745 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26747         * cs-parser.jay: Add a second production for delegate_declaration
26748         with `VOID'.
26750         (enum_body): Put an opt_comma here instead of putting it on
26751         enum_body or enum_member_declarations so we can handle trailing
26752         commas on enumeration members.  Gets rid of a shift/reduce.
26754         (type_list): Need a COMMA in the middle.
26756         (indexer_declaration): Tell tokenizer to recognize get/set
26758         * Remove old targets.
26760         * Re-add the parser target.
26762 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26764         * cs-parser.jay: Add precendence rules for a number of operators
26765         ot reduce the number of shift/reduce conflicts in the grammar.
26767 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26769         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26770         and put it here.
26772         Get rid of old crufty code.
26774         * rootcontext.cs: Use this to keep track of the parsed
26775         representation and the defined types available to the program. 
26777         * gen-treedump.cs: adjust for new convention.
26779         * type.cs: Split out the type manager, and the assembly builder
26780         from here. 
26782         * typemanager.cs: the type manager will live here now.
26784         * cil-codegen.cs: And the code generator here. 
26786 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26788         * makefile: Fixed up for easy making.
26790 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26792         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26793         the 
26795         (unary_expression): Expand pre_increment_expression and
26796         post_decrement_expression to reduce a shift/reduce.
26798 2001-07-11  Simon Cozens
26800         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26802         Improve allow_keyword_as_indent name.
26804 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26806         * Adjustments for Beta2. 
26808 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26810         * decl.cs: Added `Define' abstract method.
26811         (InTransit): new property, used to catch recursive definitions. 
26813         * interface.cs: Implement `Define'. 
26815         * modifiers.cs: Map Modifiers.constants to
26816         System.Reflection.TypeAttribute flags.
26818         * class.cs: Keep track of types and user-defined types.
26819         (BuilderInit): New method for creating an assembly
26820         (ResolveType): New function to launch the resolution process, only
26821         used by interfaces for now.
26823         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26824         that are inserted into the name space. 
26826 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26828         * ARGH.  I have screwed up my tree so many times due to the use of
26829         rsync rather than using CVS.  Going to fix this at once. 
26831         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26832         load types.
26834 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26836         * Experiment successful: Use System.Type rather that our own
26837         version of Type.  
26839 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26841         * cs-parser.jay: Removed nsAliases from here.
26843         Use new namespaces, handle `using XXX;' 
26845         * namespace.cs: Reimplemented namespace handling, use a recursive
26846         definition of the class.  Now we can keep track of using clauses
26847         and catch invalid using clauses.
26849 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26851         * gen-treedump.cs: Adapted for all the renaming.
26853         * expression.cs (Expression): this class now has a Type property
26854         which returns an expression Type.
26856         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26857         `Type', as this has a different meaning now in the base
26859 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26861         * interface.cs, class.cs: Removed from all the sources the
26862         references to signature computation, as we can not do method
26863         signature computation during the parsing time, as we are not
26864         trying to solve at that point distinguishing:
26866         class X {
26867                 void a (Blah x) {}
26868                 void a (NS.Blah x) {}
26869         }
26871         Which depending on the context might be valid or not, as we do not
26872         know if Blah is the same thing as NS.Blah at that point.
26874         * Redid everything so the code uses TypeRefs now instead of
26875         Types.  TypeRefs are just temporary type placeholders, that need
26876         to be resolved.  They initially have a pointer to a string and the
26877         current scope in which they are used.  This is used later by the
26878         compiler to resolve the reference to an actual Type. 
26880         * DeclSpace is no longer a CIR.Type, and neither are
26881         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26882         are all DeclSpaces, but no Types. 
26884         * type.cs (TypeRefManager): This implements the TypeRef manager,
26885         which keeps track of all the types that need to be resolved after
26886         the parsing has finished. 
26888 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26890         * ARGH.  We are going to have to store `foreach' as a class rather
26891         than resolving it, as we need to verify error 1579 after name
26892         resolution.   *OR* we could keep a flag that says `This request to
26893         IEnumerator comes from a foreach statement' which we can then use
26894         to generate the error.
26896 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26898         * class.cs (TypeContainer.AddMethod): we now add methods to the
26899         MethodGroup instead of the method hashtable.  
26901         * expression.cs: Add MethodGroup abstraction, which gets us one
26902         step closer to the specification in the way we handle method
26903         declarations.  
26905         * cs-parser.jay (primary_expression): qualified_identifier now
26906         tried to match up an identifier to a local variable reference or
26907         to a parameter reference.
26909         current_local_parameters is now a parser global variable that
26910         points to the current parameters for the block, used during name
26911         lookup.
26913         (property_declaration): Now creates an implicit `value' argument to
26914         the set accessor.
26916 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26918         * parameter.cs: Do not use `param' arguments as part of the
26919         signature, per the spec.
26921 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26923         * decl.cs: Base class for classes, structs and interfaces.  This
26924         is the "Declaration Space" 
26926         * cs-parser.jay: Use CheckDef for checking declaration errors
26927         instead of having one on each function.
26929         * class.cs: Factor out some code for handling error handling in
26930         accordance to the "Declarations" section in the "Basic Concepts"
26931         chapter in the ECMA C# spec.
26933         * interface.cs: Make all interface member classes derive from
26934         InterfaceMemberBase.
26936 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26938         * Many things: all interfaces are parsed and generated in
26939         gen-treedump.  Support for member variables, constructors,
26940         destructors, properties, constants is there.
26942         Beginning of the IL backend, but very little done, just there for
26943         testing purposes. 
26945 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26947         * cs-parser.jay: Fix labeled statement.
26949         * cs-tokenizer.cs (escape): Escape " and ' always.
26950         ref_line, ref_name: keep track of the line/filename as instructed
26951         by #line by the compiler.
26952         Parse #line.
26954 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26956         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26957         to match the values in System.CodeDOM.
26959         Divid renamed to Divide.
26961         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26962         statements. 
26963         (Statements.set): remove.
26965         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26966         statements. 
26968         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26969         falseStatements always have valid values. 
26971         * cs-parser.jay: Use System.CodeDOM now.