1 2007-06-08 Marek Safar <marek.safar@gmail.com>
3 * cs-parser.jay: Uses newly defined GroupBy class.
5 * linq.cs (GroupBy): Implemented.
6 (AQueryClause.BuildQueryClause): Refactored to allow customize query
9 2007-06-08 Marek Safar <marek.safar@gmail.com>
11 * generics.cs (InferTypeArguments): Uses AnonymousMethodExpression
14 2007-06-06 Marek Safar <marek.safar@gmail.com>
16 * generics.cs (TypeArguments): New contructor fow known number of
19 2007-06-04 Raja R Harinath <rharinath@novell.com>
21 * linq.cs (Select.DoResolve): Pass the created parameters to the
24 2007-05-29 Raja R Harinath <rharinath@novell.com>
26 * cs-parser.jay: Update to changes in ToplevelBlock.
27 (top_current_block): Remove.
29 2007-05-27 Raja R Harinath <harinath@gmail.com>
31 * cs-parser.jay: Update to new ExplicitBlock invariant.
33 * cs-parser.jay: Update to changes introduced in Block and
36 2007-05-25 Raja R Harinath <rharinath@novell.com>
38 * cs-parser.jay: Use 'start_block' and 'end_block' rather than
39 modifying current_block directly.
41 2007-05-22 Scott Peterson <lunchtimemama@gmail.com>
43 * cs-parser.jay: Implemented automatic properties (C# 3.0)
45 2007-05-15 Scott Peterson <lunchtimemama@gmail.com>
47 * cs-parser.jay: Improved grammar for object and collection
50 2007-04-28 Scott Peterson <lunchtimemama@gmail.com>
52 This code is contributed under the MIT X11 license
54 * cs-parser.jay: Added support for C# 3.0 language features:
55 Variable type inference (the "var" keyword)
59 Collection initialization
61 2007-05-06 Marek Safar <marek.safar@gmail.com>
64 * cs-parser.jay: Add special handling for coalescing operator.
66 2007-05-02 Raja R Harinath <rharinath@novell.com>
68 Fix regression in cs0631-3.cs
69 * cs-parser.jay (operator_declarator): Add opt_attributes to error
70 fallback. Make error fallback catch more cases.
72 2007-05-01 Miguel de Icaza <miguel@novell.com>
74 * cs-parser.jay: Allow parameters in operator declarations to have
77 2007-04-27 Miguel de Icaza <miguel@novell.com>
79 * generic.cs (TypeManager.LambdaInfer): now this routine will
80 make only one inference from the list of lambda expression that
81 have not participated in inferring a type.
83 (TypeManager.InferTypeArguments): The logic that drives the type
84 inference in lambda expressions is now driven here.
86 2007-04-23 Miguel de Icaza <miguel@novell.com>
88 * generic.cs: Large update to LambdaInfer, this is merely an
89 update to start the lambda type inference. It is by no means
90 complete. It is currently merely able to build a sample program
91 (with no iteration for the type parameters).
93 2007-04-12 Duncan Mak <duncan@a-chinaman.com>
95 * cs-parser.jay (interface_method_declaration_body): Fixed typo.
97 2007-04-08 Marek Safar <marek.safar@gmail.com>
99 * cs-parser.jay, linq.cs: First select implementation (hacky).
101 * generic.cs (InferTypeArguments): Simplified.
103 2007-03-31 Marek Safar <marek.safar@gmail.com>
105 * generic.cs (InferTypeArguments): Restored validation check.
106 (InferTypeArguments): Move all logic to Compatible method for re-usability.
108 2007-03-25 Marek Safar <marek.safar@gmail.com>
110 * generic.cs (InferTypeArguments): Infer arguments before they are used
111 for compatibility check.
113 2007-03-15 Marek Safar <marek.safar@gmail.com>
115 * generic.cs (InflatedConstraints): Fixed the check order.
116 (TypeArguments.Resolve): Small optimization for generic parameters.
117 (InferTypeArguments): Add infering support for anonymous methods.
119 2007-03-15 Martin Baulig <martin@ximian.com>
124 (TypeParameter.HasConstructorConstraint): Removed.
125 (ConstraintChecker.HasDefaultConstructor): Removed the
126 `TypeBuilder' argument here; correctly check for the ctor
127 constraint on type parameters.
129 2007-03-15 Martin Baulig <martin@ximian.com>
134 (TypeParameter): Create a `MemberCache' here as well. Note that
135 we need to create this on-demand when it's actually used.
137 2007-03-10 Marek Safar <marek.safar@gmail.com>
139 * generic.cs (TypeArguments.Resolve): Avoid redundant checks.
141 2007-03-09 Raja R Harinath <rharinath@novell.com>
143 * cs-parser.jay (WHERE): Move before QUERY_FIRST_TOKEN. 'where'
144 is a valid keyword outside a linq expression too.
146 2007-03-03 Marek Safar <marek.safar@gmail.com>
148 * cs-parser.jay: Implemented basic linq grammar.
150 * linq.cs: New file for hosting query specific classes.
152 2007-02-26 Marek Safar <marek.safar@gmail.com>
154 * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
156 2007-02-20 Marek Safar <marek.safar@gmail.com>
159 * cs-parser.jay: Anonymous container starts at constructor declaration
160 and not at block beginning because it has to be usable in constructor
163 2007-02-18 Marek Safar <marek.safar@gmail.com>
165 A fix for bug #80493 by Atsushi Enomoto
166 * cs-parser.jay: Ignore invalid attribute target.
168 2007-02-15 Miguel de Icaza <miguel@novell.com>
170 * Remove the call to SetExpression for lambda expressions, we do
171 not actually need it.
173 Remove expression tracking code as its not needed.
175 2007-02-11 Miguel de Icaza <miguel@novell.com>
177 * cs-parser.jay (lambda_expression_body): when the body is an
178 expression add a statement of the form:
180 contextual-return expression.
182 Where `contextual-return' is similar to `return', the difference
183 being that if the delegate that the lambda will be converted to
184 has a void return type, it will check that the result is a
185 ExpressionStatement and the result is a plain ret (no return
186 values on the stack). If the return type of the delegate is of a
187 given type, this turns into a return with a value and does the
188 regular checking to check that the computed value can be
189 implicitly converted to the delegate return.
191 2007-01-30 Miguel de Icaza <miguel@novell.com>
193 * cs-parser.jay (anonymous_method_expression): move the
194 before/after productions to the start_anonymous and end_anonymous
195 methods so the code can be reused for lambda functions.
197 (lambda_expression_body): wrap expressions implicitly into a
200 (block): factor out the setup/teardown of parsing a block so we
201 can reuse that in lambda_expression_body
203 (lambda_expression): use new anonymous method helper methods.
205 2007-01-29 Miguel de Icaza <miguel@novell.com>
207 * cs-parser.jay: oob_stack make it static (am guessing that is why
208 we no longer initialize it anymore) and reuse it across
211 2007-01-28 Miguel de Icaza <miguel@novell.com>
213 * cs-parser.jay (open_parens): Introduce new non-terminal that
214 abstracts OPEN_PARENS and OPEN_PARENS_LAMBDA as the later can now
215 be returned in places where types are followed by identifiers
216 (this is expected in declaration, fixed, using, foreach and catch
219 Use open_parens in those places, keep OPEN_PARENS in the
222 cs-parser.jay: New grammar bits for parsing lambda expressions.
224 2007-01-28 Raja R Harinath <rharinath@novell.com>
226 Fix #80534, gtest-309.cs
227 * generic.cs (UnifyType): Rename from InferType. Make unification
228 of generic insts simpler and don't insist on inferring all generic
229 parameters in a single generic inst unification.
231 (InferGenericInstance): Remove.
232 Analysis and initial patch by David Mitchell <dmitchell@logos.com>.
234 2007-01-20 Marek Safar <marek.safar@gmail.com>
236 * cs-parser.jay: Better parameter error handling.
238 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
239 Raja R Harinath <rharinath@novell.com>
241 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
242 Note the order in which accessors are declared in the source.
244 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
246 * generic.cs (TypeParameter.FindMembers): Use the generic
247 constraints, not the constraints to check for methods (first fix
250 2006-12-30 Marek Safar <marek.safar@gmail.com>
252 * cs-parser.jay: Better syntax errors handling.
254 2006-11-21 Marek Safar <marek.safar@gmail.com>
256 * cs-parser.jay: Tiny change to work with mcs tokenizer.
258 * cs-tokenizer.cs: Remove after unification with mcs.
260 2006-10-28 Marek Safar <marek.safar@gmail.com>
263 * generic.cs (ConstructedType.AsAccessible): Check accessibility of type
266 2006-10-26 Marek Safar <marek.safar@gmail.com>
269 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous methods.
271 2006-10-25 Brian Crowell <brian@fluggo.com>
274 * generic.cs (CheckConstraints): Allow generic parameters with
275 inheritance constraints to satisfy reference type constraints.
277 2006-10-09 Martin Baulig <martin@ximian.com>
280 (NullCoalescingOperator.DoResolve): Fix #78964; added gtest-294.cs.
282 2006-09-25 Martin Baulig <martin@ximian.com>
284 * class.cs: Remove after unification with mcs source.
286 2006-09-24 Raja R Harinath <harinath@gmail.com>
288 * convert.cs: Remove after unification with mcs source.
290 2006-09-24 Marek Safar <marek.safar@seznam.cz>
292 * class.cs (MemberBase.VerifyClsCompliance): When method has type
293 parameters verify them as well.
295 * generic.cs (Constraints.VerifyClsCompliance): Verify CLS-Compliance of
296 the type parameter constraints.
297 (Generics.VerifyClsCompliance): Ditto.
299 2006-09-24 Marek Safar <marek.safar@seznam.cz>
301 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
302 for anonymous block with out argument.
304 2006-09-24 Marek Safar <marek.safar@seznam.cz>
306 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
307 not used private events only.
309 2006-09-23 Marek Safar <marek.safar@seznam.cz>
311 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
313 * cs-parser.jay: Parse correctly cast of default (T).
315 * generic.cs (DefaultValueExpression.DoResolve): Check for void type.
316 Store original type via EmptyConstantCast.
318 2006-09-22 Martin Baulig <martin@ximian.com>
320 * delegate.cs: Removed; this file is now shared with mcs.
322 * attribute.cs: Removed; this file is now shared with mcs.
324 2006-09-22 Martin Baulig <martin@ximian.com>
326 * ecore.cs: Removed; this file is now shared with mcs.
328 2006-09-21 Marek Safar <marek.safar@seznam.cz>
330 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
332 * ecore.cs (NullCast): Derives from NullConstant.
334 * generic.cs (DefaultValueExpression): Fixed to cope with the constant
337 2006-09-21 Martin Baulig <martin@ximian.com>
339 * decl.cs: Removed; this file is now shared with mcs.
341 2006-09-21 Raja R Harinath <rharinath@novell.com>
343 * rootcontext.cs: Remove after unification with mcs source.
345 * report.cs: Remove after unification with mcs source.
346 * generic.cs (AddTypeParameter, LookupTypeParameter): Move to
348 (InitGenerics, CleanUpGenerics): Remove.
350 * support.cs: Remove after unification with mcs source.
352 2006-09-20 Raja R Harinath <rharinath@novell.com>
354 * codegen.cs: Remove after unification with mcs source.
356 2006-09-19 Martin Baulig <martin@ximian.com>
358 * expression.cs: Removed; this file is now shared with mcs.
360 2006-09-19 Martin Baulig <martin@ximian.com>
363 (TypeManager.IsEqual): Moved into ../mcs/typemanager.cs.
364 (TypeManager.DropGenericTypeArguments): Likewise.
365 (TypeManager.DropGenericMethodArguments): Likewise.
366 (TypeManager.GetTypeArguments): Likewise.
367 (TypeManager.HasGenericArguments): Likewise.
369 2006-09-19 Martin Baulig <martin@ximian.com>
371 * ecore.cs (PropertyExpr.InstanceResolve): Fix the CS1540 check.
373 2006-09-19 Martin Baulig <martin@ximian.com>
375 * typemanager.cs: Removed; this file is now shared with mcs.
377 2006-09-16 Raja R Harinath <rharinath@novell.com>
379 * Makefile (LOCAL_MCS_FLAGS): Use instead of PROFILE_MCS_FLAGS.
380 * AssemblyInfo.cs, driver.cs: Remove after unification with mcs source.
382 2006-09-16 Marek Safar <marek.safar@seznam.cz>
385 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
386 only if parent type is class.
387 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
390 2006-09-15 Marek Safar <marek.safar@seznam.cz>
393 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
395 * typemanager.cs(CSharpName): Converts NullType to null.
397 2006-09-15 Martin Baulig <martin@ximian.com>
399 * pending.cs: Removed; this file is now shared with mcs.
401 2006-09-15 Martin Baulig <martin@ximian.com>
403 * statement.cs: Removed; this file is now shared with mcs.
405 2006-09-15 Martin Baulig <martin@ximian.com>
407 * rootcontext.cs (RootContext.BrokenCircularDeps): Removed.
409 * driver.cs: Removed the `--broken-cycles' argument.
411 2006-09-15 Martin Baulig <martin@ximian.com>
413 * namespace.cs: Removed; this file is now shared with mcs.
415 2006-09-15 Martin Baulig <martin@ximian.com>
417 * decl.cs (MemberName): Minor code cleanups.
419 2006-09-15 Martin Baulig <martin@ximian.com>
421 * parameter.cs: Removed; this file is now shared with mcs.
423 2006-09-15 Martin Baulig <martin@ximian.com>
425 * enum.cs: Removed; this file is now shared with mcs.
427 2006-09-15 Martin Baulig <martin@ximian.com>
429 * Makefile: Define `GMCS_SOURCE'.
431 * flowanalysis.cs: Removed; this file is now shared with mcs.
433 2006-09-15 Martin Baulig <martin@ximian.com>
435 Removed modifiers.cs, literal.cs, location.cs, roottypes.cs,
436 assign.cs, const.cs, cfold.cs, constant.cs, symbolwriter.cs and
437 doc.cs - they are now shared with mcs.
439 * gmcs.exe.sources: Include these files from ../mcs/.
441 2006-09-15 Martin Baulig <martin@ximian.com>
443 * old-code.cs, gen-il.cs, gen-treedump.cs: Removed old stuff.
444 * g1.cs, sample-hello.cs, sample-stack.il: Likewise.
446 2006-09-14 Marek Safar <marek.safar@seznam.cz>
448 * assign.cs, ecore.cs, expression.cs: Share error message text.
449 * class.cs (FieldMember.Define): Check for variable of static type.
450 * decl.cs (check_type_parameter): Report correct type name.
451 * driver.cs (LoadAssembly): Uses error output for errors.
452 * generic.cs (Constraints.Resolve): Add check for constraint accessibility
453 (TypeArguments.Resolve): Static class cannot be used as an argument.
454 * statement.cs (ResolveMeta): Constants cannot be generic types.
456 2006-09-12 Martin Baulig <martin@ximian.com>
458 * generic.cs (TypeManager.IsIList): Moved into convert.cs.
460 * convert.cs (Convert.Array_To_IList): Moved here and correctly
461 implement it; fixes #79345.
463 2006-09-08 Marek Safar <marek.safar@seznam.cz>
465 * decl.cs (DeclSpace.SetParameterInfo): Check for nonexistent type
467 * expression.cs (TypeOf.GetAttributableValue): Check for open generic
469 * generic.cs: Improved error messages.
470 * typemanager.cs (RemoveGenericArity): Made public.
472 2006-09-08 Martin Baulig <martin@ximian.com>
474 * typemanager.cs (TypeManager.interlocked_type): New public field.
475 (TypeManager.int_interlocked_compare-exchange): New public field.
476 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
477 enumerator types here and call InitGenericCoreTypes().
478 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
479 after calling InitEnumUnderlyingTypes().
482 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
483 `classes_second_stage'.
485 2006-09-07 Marek Safar <marek.safar@seznam.cz>
487 * class.cs, generic.cs (GenericMethod.Define): Check for type parameter
489 * statement.cs (Block.Variables): Made public.
491 2006-09-07 Martin Baulig <martin@ximian.com>
494 (MainDriver): Revert r62663 from Marek; see #70506 for details.
496 2006-09-01 Martin Baulig <martin@ximian.com>
499 (TypeManager.IsIList): Also handle base classes and interfaces.
501 2006-09-01 Raja R Harinath <rharinath@novell.com>
504 * expression.cs (Invocation.MoreSpecific): Check for reference
507 2006-08-29 Miguel de Icaza <miguel@novell.com>
509 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
511 2006-08-17 Miguel de Icaza <miguel@novell.com>
513 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
514 #52019 and #79064, the use of the \uXXXX sequence in source code
515 to represent unicode characters.
517 2006-08-15 Marek Safar <marek.safar@seznam.cz>
519 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
521 * class.cs, ecore.cs, statement.cs: Merged to one error message.
523 2006-08-14 Raja R Harinath <rharinath@novell.com>
526 * cs-tokenizer.cs (parse_less_than): Allow '*' to appear in a type
527 parameter too. This only avoids a parse error -- the semantic
528 error is caught elsewhere.
530 2006-08-13 Miguel de Icaza <miguel@novell.com>
532 * assign.cs: Catch attempts to assign to a method groups in += and
535 2006-08-13 Marek Safar <marek.safar@seznam.cz>
538 * cs-parser.jay: Don't destroy current array type by typeof of array's.
540 2006-08-12 Marek Safar <marek.safar@seznam.cz>
542 * cs-parser.jay: Check whether a constraint clause has already been
543 specified for type parameter.
544 * generic.cs (Constraints): Exposed location.
546 2006-08-12 Marek Safar <marek.safar@seznam.cz>
548 * class.cs (Method.Define): Issue a warning when generic method looks like
550 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
552 * report.cs: New warning number.
554 2006-08-09 Marek Safar <marek.safar@seznam.cz>
556 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
558 * decl.cs (MemberCache.FindMembers): When container is interface we need to
559 search all base interfaces as a member can be ambiguous.
560 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
561 Constructor member type filter.
562 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
563 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
564 reporting for returned memberinfos.
565 * report.cs: Updated.
566 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
567 version to work on all runtimes.
568 (TypeManager.RealMemberLookup): Removed members filtering.
570 2006-08-08 Raja R Harinath <rharinath@novell.com>
572 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
573 (PropertyExpr.EmitAssign): Likewise.
574 * expression.cs (Indirection.EmitAssign): Likewise.
575 (LocalVariableReference.EmitAssign): Likewise.
576 (ParameterReference.EmitAssign): Likewise.
577 (Invocation.EmitArguments): Likewise.
578 (ArrayAccess.EmitAssign): Likewise.
579 (IndexerAccess.EmitAssign): Likewise.
580 (This.EmitAssign): Likewise.
581 (ConditionalLogicalOperator.Emit): Likewise.
584 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
585 instead of ArrayList. If the hashtable has a LocalBuilder, don't
586 leave it in after returning it.
587 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
589 2006-08-06 Marek Safar <marek.safar@seznam.cz>
591 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
594 2006-08-05 Marek Safar <marek.safar@seznam.cz>
596 * class.cs (TypeContainer.AddPartial): Add check for partial declarations
597 with different type names.
598 (TypeContainer.UpdateTypeParameterConstraints): Updated an error message.
600 2006-08-03 Raja R Harinath <rharinath@novell.com>
602 Fix cs0146-3.cs and cs0146-4.cs.
603 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
604 enclosing types don't depend on the current type.
606 2006-08-02 Raja R Harinath <rharinath@novell.com>
609 * class.cs (TypeContainer.DoDefineMembers): Use
610 FindBaseMemberWithSameName on Parent, since we're interested in
611 whether we hide inherited members or not.
612 (FindBaseMemberWithSameName): Make slightly more robust.
615 * codegen.cs (IResolveContext.GenericDeclContainer): New.
616 (EmitContext): Implement new interface requirement.
617 * namespace.cs (UsingEntry, LocalAliasEntry): Likewise.
618 * decl.cs (MemberCore): Likewise.
619 (DeclSpace.GenericDeclContainer): Rename from DeclContainer.
620 * ecore.cs (SimpleName.ResolveAsTypeTerminal): Use
621 ec.GenericDeclContainer to check for generic parameters.
622 (SimpleName.DoSimpleNameResolve): Likewise.
623 * generic.cs (TypeParameter.DeclContainer): Remove override.
625 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
626 declspaces for doppelgangers too.
627 (UsingEntry): Implement IResolveContext.
628 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
629 'this' as the resolve context.
630 (LocalAliasEntry): Likewise.
632 Implement parts of #77403
633 * roottypes.cs (RootDeclSpace): New. Used to represent the
634 toplevel declaration space. Each namespace declaration introduces
635 a "partial" root declaretion space.
636 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
637 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
638 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
639 from 'current_namespace.SlaveDeclSpace'.
640 (namespace_declaration): Likewise.
641 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
642 check. It can't happen now.
643 * decl.cs (DeclSpace.LookupType): Likewise.
644 * driver.cs (MainDriver): Sanity check.
646 2006-08-01 Raja R Harinath <rharinath@novell.com>
648 * decl.cs (DeclSpace.FindNestedType): Remove.
649 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
650 LookupTypeContainer to get the container of the nested type.
651 * class.cs (TypeContainer.FindNestedType): Make non-override.
653 2006-07-31 Raja R Harinath <rharinath@novell.com>
655 * decl.cs (DeclSpace.PartialContainer): Move field from ...
656 * class.cs (TypeContainer.PartialContainer): ... here.
657 (TypeContainer.AddBasesForPart): New helper.
658 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
660 * cs-parser.jay (current_class): Convert to DeclSpace.
661 (struct_declaration, interface_declaration, class_declaration):
662 Use AddBasesForPart instead of .Bases directly.
663 * const.cs, iterators.cs: Update to changes.
665 2006-07-28 Raja R Harinath <rharinath@novell.com>
667 * class.cs (TypeContainer.AddMemberType): Rename from
669 (TypeContainer.AddMember): Rename from AddToMemberContainer.
670 (AddTypeContainer): New. Combine AddClassOrStruct and
672 (AddPartial): Update. Add 'is_partial' argument.
673 * roottypes.cs: Update to changes.
674 * cs-parser.jay (push_current_class): New helper for handling
675 current_container and current_class.
676 (struct_declaration, interface_declaration, class_declaration):
679 2006-07-26 Raja R Harinath <rharinath@novell.com>
681 * roottypes.cs: Rename from tree.cs.
683 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
684 * tree.cs (Tree, ITreeDump): Remove types.
685 * rootcontext.cs (tree, Tree): Remove fields.
686 (root, ToplevelTypes): New.
687 * *.cs: Update to rename.
689 * tree.cs (Tree.RecordDecl): Remove.
690 (RootTypes.AddToTypeContainer): Record the toplevel type in its
692 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
694 2006-07-23 Raja R Harinath <harinath@gmail.com>
696 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
697 DoFlowAnalysis and OmitStructFlowAnalysis here.
698 (ec.With): Rename from WithUnsafe and generalize.
699 (ec.WithCheckState): Remove. All users can be handled by 'With'.
700 (ec.WithFlowAnalyis): New.
701 * ecore.cs, expression.cs, statement.cs: Update.
703 2006-07-22 Raja R Harinath <harinath@gmail.com>
705 * statement.cs (Block.ResolveMeta): Simplify slightly.
707 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
708 multiple boolean fields. Convert InUnsafe, constant_check_state,
709 check_state to flags.
710 (CheckState, ConstantCheckState): Update.
711 (InUnsafe): New read-only property.
712 (FlagsHandle): Rename from CheckStateHandle and convert to handle
714 (WithUnsafe): New helper similar to WithCheckState.
715 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
716 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
718 2006-07-21 Raja R Harinath <rharinath@novell.com>
720 Make comparisons use the same IL irrespective of whether they're
721 in a 'checked' or 'unchecked' context: one of the issues in #78899
722 * codegen.cs (EmitContext.CheckState): Make read-only property.
723 (EmitContext.ConstantCheckState): Likewise.
724 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
725 helper that implement a save/restore stack for CheckState
726 values. This is the only way to change check-state.
727 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
728 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
729 (CheckedExpr.EmitBranchable): New forwarding method.
730 (UnCheckedExpr): Likewise.
731 * statement.cs (Block.ResolveMeta): Use WithCheckState.
732 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
733 (Checked.Resolve, checked.DoEmit): Likewise.
735 2006-07-21 Martin Baulig <martin@ximian.com>
737 * generic.cs (TypeManager.InferType): When inferring an array
738 type, also allow IList<T> and ICollection<T>. Fixes #78900.
740 2006-07-21 Martin Baulig <martin@ximian.com>
742 * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
743 and allow IList`1 and all its base interfaces.
745 * convert.cs (Convert.ImplicitReferenceConversion): Allow
746 converting from an array-type of T to IList<T>.
748 2006-07-21 Martin Baulig <martin@ximian.com>
750 * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
752 2006-07-20 Miguel de Icaza <miguel@novell.com>
754 * anonymous.cs: Cache the resolved anonymous delegate, and return
755 this so that the ResolveTopBlock is only triggered once, not
758 Currently we trigger ResolvetopBlock twice due to a first pass of
759 argument check compatibility, and a second pass that does the
762 2006-07-15 Marek Safar <marek.safar@seznam.cz>
764 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
766 * rootcontext.cs (Reset): Add helper_classes.
768 2006-07-15 Marek Safar <marek.safar@seznam.cz>
771 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
774 2006-07-13 Miguel de Icaza <miguel@novell.com>
776 * statement.cs (Lock): Handle expressions of type
777 TypeManager.null_type specially. Fixes #78770
779 2006-07-08 Marek Safar <marek.safar@seznam.cz>
781 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
784 2006-07-08 Marek Safar <marek.safar@seznam.cz>
786 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
787 for accessors as well.
788 * ecore.cs (EventExpr): Add AccessorTable.
790 2006-07-03 Martin Baulig <martin@ximian.com>
792 * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
793 instances of value types.
795 * convert.cs (Convert.ExplicitConversion): Correctly handle
796 object->nullable conversions.
798 2006-07-01 Marek Safar <marek.safar@seznam.cz>
801 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
802 for CS0122 where appropriate.
803 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
805 (Filter): Assembly can be null in the case of top level attributes.
807 2006-06-28 Raja R Harinath <rharinath@novell.com>
810 * generic.cs (TypeManager.InferParamsTypeArguments): If there are
811 no arguments, return 'false': nothing can be inferred.
813 2006-06-25 Marek Safar <marek.safar@seznam.cz>
817 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
818 is done at global level.
820 2006-06-24 Marek Safar <marek.safar@seznam.cz>
822 A fix for #77002, Implemented TypeForwarder support.
824 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
825 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
827 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
828 * typemanager.cs (): Add type_forwarder_attr_type.
830 2006-06-24 Marek Safar <marek.safar@seznam.cz>
832 * report.cs: Add CS0469 warning.
834 2006-06-22 Martin Baulig <martin@ximian.com>
837 (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
838 for interfaces; fixes #78686, which is a modification of #78380
839 with interfaces instead of classes.
841 2006-06-21 Martin Baulig <martin@ximian.com>
843 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
844 the `try'-block, so we also report CS0016 etc. there.
846 2006-06-21 Martin Baulig <martin@ximian.com>
848 * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
849 handle SetAssigned() and SetMemberIsUsed() for generic types;
852 2006-06-21 Martin Baulig <martin@ximian.com>
855 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
857 2006-06-21 Martin Baulig <martin@ximian.com>
859 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
860 also report CS1686 for parameters.
862 2006-06-21 Martin Baulig <martin@ximian.com>
864 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
865 instead of an error if the value is not implicitly convertible to
866 the switch types; fixes #77964.
868 2006-06-21 Raja R Harinath <rharinath@novell.com>
871 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
872 FieldBuilder is null.
875 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
876 'left' and 'right' before error-checking.
878 2006-06-19 Martin Baulig <martin@ximian.com>
881 (Convert.ImplicitConversionStandard): Cleanup and correctly
882 implement nullable conversions.
883 (Convert.ImplicitStandardConversionExists): Likewise.
884 (Convert.ExplicitConversion): Likewise.
886 2006-06-19 Martin Baulig <martin@ximian.com>
889 (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
890 methods; make the ctors protected.
892 2006-06-19 Martin Baulig <martin@ximian.com>
894 Fixed #78380; added gtest-273.cs.
897 (Expression.ResolveAsBaseTerminal): Move the constraint checking
898 into ResolveAsTypeTerminal().
901 (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
902 TypeManager.FindMembers() to check for the default ctor.
904 2006-06-18 Marek Safar <marek.safar@seznam.cz>
906 * generic.cs: Fixed NullableInfo accessibility.
908 2006-06-16 Martin Baulig <martin@ximian.com>
911 (Constraints.InflatedConstraints.inflate): Correctly inflate
912 generic types; fixes #78400.
914 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
916 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
918 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
919 (FieldExpr.DoResolve): likewise.
920 (PropertyExpr.InstanceResolve): likewise.
921 (EventExpr.InstanceResolve): likewise.
923 2006-06-15 Martin Baulig <martin@ximian.com>
926 (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
927 argument; always allow a `null' label if true.
928 (Switch.SwitchGoverningType): Take an `Expression expr' argument.
929 (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
930 we have a `null' label and mark the new `null_target' label;
931 default to the `default' label.
932 (Switch.Resolve): Add support for nullable types. Fixes #78630.
934 2006-06-15 Martin Baulig <martin@ximian.com>
936 * class.cs (Operator.Define): Allow an implicit/explicit operator
937 to convert to/from a nullable value of the enclosing type.
939 * generic.cs (TypeManager.IsNullableTypeOf): New public method.
940 (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
943 (Convert.ImplicitStandardConversionExists): Add support for lifted
944 implicit/explicit conversions.
945 (Convert.ImplicitConversionStandard): Likewise.
947 2006-06-13 Martin Baulig <martin@ximian.com>
949 * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
950 type arguments and create a ConstructedType if necessary. Fixes #78400.
952 2006-06-04 Marek Safar <marek.safar@seznam.cz>
954 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
955 attribute applicable tests for attribute argument.
957 2006-06-02 Raja R Harinath <rharinath@novell.com>
960 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
961 (Binary.OverloadResolve_PredefinedIntegral): New.
962 (Binary.OverloadResolve_PredefinedFloating): New.
963 (Binary.OverloadResolve_PredefinedString): New.
964 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
965 Follow the standard more closely, and treat numeric promotions in
966 terms of overload resolution.
967 (Binary.CheckShiftArguments): Simplify.
969 2006-06-01 Raja R Harinath <rharinath@novell.com>
971 * flowanalysis.cs (MyBitVector): Simplify representation.
972 (MyBitVector.Clone): Avoid allocating BitArray.
973 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
974 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
975 (*): Update. Change all references to MyBitVector.And and
976 MyBitVector.Or to &= and |=.
978 2006-05-31 Raja R Harinath <rharinath@novell.com>
980 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
981 Use bne.un instead of ceq+brfalse.
984 * typemanager.cs (IsUnmanagedType): Disallow generic types and
987 2006-05-29 Raja R Harinath <rharinath@novell.com>
990 * cs-parser.jay (formal_parameter_list): Extend the pattern below
991 to param arguments too.
993 2006-05-26 Miguel de Icaza <miguel@novell.com>
995 * cs-parser.jay: Catch another parsing form for arglist being
996 followed by other arguments. Fixes #78313.
998 2006-05-25 Raja R Harinath <rharinath@novell.com>
1001 * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
1002 also when one of the operands is a null literal.
1003 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
1004 to improve clarity, and generate slightly better code.
1006 2006-05-24 Raja R Harinath <rharinath@novell.com>
1008 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1009 checking of out parameters to ...
1010 (FlowBranchingToplevel.Merge): ... here.
1011 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1012 set, propagate the origin upward, and only complain if there was
1014 (FlowBranchingException.AddContinueOrigin): Likewise.
1015 (FlowBranchingException.AddReturnOrigin): Likewise.
1016 (FlowBranchingException.AddGotoOrigin): Likewise.
1018 2006-05-23 Raja R Harinath <rharinath@novell.com>
1020 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1021 unreachable, skip it.
1022 (FlowBranchingException.Merge): Always propagate jumps, even if
1023 the finally block renders subsequent code unreachable.
1025 2006-05-18 Raja R Harinath <rharinath@novell.com>
1028 * statement.cs (Goto.Resolve): Move responsibility for resolving
1029 'goto' to FlowBranching.AddGotoOrigin.
1030 (Goto.SetResolvedTarget): New. Callback to set the
1031 LabeledStatement that's the target of the goto.
1032 (Goto.DoEmit): Use Leave instead of Br when crossing an
1033 unwind-protect boundary.
1034 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1035 LookupLabel and adjust to new semantics.
1036 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1037 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1038 Goto.SetResolvedTarget to update target.
1039 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1040 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1041 AddBreakOrigin & co. Delay propagation until ...
1042 (FlowBranchingException.Merge): ... this.
1044 * statement.cs (Block.Resolve): Always depend on flow-branching to
1045 determine unreachability. Kill workaround that originally emitted
1046 only one statement after an "unreachable" label (see infloop in
1049 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1050 This is still "wrong", but anything better would probably need a
1051 multi-pass algorithm.
1052 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1053 usage vector. Force current usage vector to be reachable, to
1054 optimistically signify backward jumps.
1055 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1057 (FlowBranchingLabeled.Merge): New. If no backward jump was
1058 detected, return the original salted-away usage vector instead,
1059 updated with appropriate changes. Print unreachable warning if
1061 * statement.cs (Block.Resolve): Don't print unreachable warning on
1062 a labeled statement.
1064 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
1066 * driver.cs: Pass filename without path to AssemblyBuilder's
1067 AddResourceFile. Fixes bug #78407.
1069 2006-05-17 Raja R Harinath <rharinath@novell.com>
1071 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1072 * flowanalysis.cs (FlowBranchingLabeled): ... here.
1073 (FlowBranching.MergeChild): Overwrite
1074 reachability information from Labeled branchings too.
1076 2006-05-16 Raja R Harinath <rharinath@novell.com>
1078 * statement.cs (Goto.Resolve): Merge jump origins here ...
1079 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1081 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1082 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
1083 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
1084 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1086 * statement.cs (Goto.Resolve): ... not here.
1087 (Goto.Emit): Remove CS1632 check.
1089 2006-05-14 Marek Safar <marek.safar@seznam.cz>
1091 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1094 2006-05-11 Raja R Harinath <rharinath@novell.com>
1096 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1097 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1098 (FlowBranchingException.Label): Likewise.
1100 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
1102 (MyBitVector.Or): Use it to avoid losing information (Count).
1103 (FlowBranching.MergeOrigins): Likewise.
1105 * flowanalysis.cs (UsageVector.IsDirty): Remove.
1106 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1107 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1108 (UsageVector.ToString): Simplify.
1109 (UsageVector.MergeSiblings): Move here from ...
1110 (FlowBranching.Merge): ... here.
1111 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1114 2006-05-10 Raja R Harinath <rharinath@novell.com>
1116 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1117 null bitvector is treated as all-true.
1119 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1120 (MyBitVector): Rationalize invariants. 'vector != null' implies
1121 that we have our own copy of the bitvector. Otherwise,
1122 'InheritsFrom == null' implies all inherited bits are true.
1124 2006-05-09 Marek Safar <marek.safar@seznam.cz>
1126 * statement.cs (LocalInfo): Add IsConstant.
1127 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1128 local variable for constants.
1130 2006-05-09 Raja R Harinath <rharinath@novell.com>
1132 * flowanalysis.cs (MyBitVector.Empty): New.
1133 (MyBitVector): Don't allow InheritedFrom to be null.
1134 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1135 (UsageVector, FlowBranching): Update to changes.
1137 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1138 recursion. The 'Parent == null' condition isn't sufficient for
1140 (FlowBranching.AddBreakOrigin): Likewise.
1141 (FlowBranching.AddContinueOrigin): Likewise.
1142 (FlowBranching.AddReturnOrigin): Likewise.
1143 (FlowBranching.StealFinallyClauses): Likewise.
1144 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1145 (FlowBranching.CheckOutParameters): Likewise.
1146 (FlowBranchingToplevel): Terminate all the above recursions here.
1147 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1148 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1150 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
1152 (FlowBranchingToplevel): New. Empty for now.
1153 (FlowBranching.MergeTopBlock): Update.
1154 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1155 branching for the anonymous delegate.
1156 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1158 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1159 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1160 information at the start of the merge. Reorganize.
1162 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1164 * class.cs (MethodData.Define): Method cannot implement interface accessor.
1166 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1168 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1169 to newly introduced ctor.
1171 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1172 message to one place.
1173 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1176 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1178 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1180 * ecore.cs (Expression.ResolveAsConstant): Updated.
1182 * statement.cs (ResolveMeta): Updated.
1184 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1186 * cs-parser.jay: __arglist cannot be used in initializer.
1188 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1191 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1194 2006-05-05 Raja R Harinath <rharinath@novell.com>
1196 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1197 (LabeledStatement): Add 'name' parameter.
1198 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1199 (Block.AddLabel): Update to changes.
1200 * cs-parser.jay (labeled_statement): Likewise.
1202 * flowanalysis.cs (BranchingType.Labeled): New.
1203 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1204 (FlowBranchingLabeled): New. Does nothing for now, but will
1205 eventually handle 'goto' flows.
1206 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1207 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1208 that's terminated ...
1209 (Block.Resolve): ... here.
1211 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1212 (UsageVector.MergeFinallyOrigins): Likewise.
1213 (FlowBranching.InTryOrCatch): Likewise.
1214 (FlowBranching.AddFinallyVector): Likewise.
1215 (FlowBranchingException): Update to changes.
1218 * statement.cs (Return.Resolve): Move error checking to ...
1219 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1220 (FlowBranchingException): Handle return origins like break and
1222 (FlowBranching.UsageVector.CheckOutParameters): Remove.
1224 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1227 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1230 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1233 * class.cs (MethodData.Define): Do public accessor check only when method
1234 implements an interface.
1236 2006-05-04 Raja R Harinath <rharinath@novell.com>
1238 Remove special handling of 'break'
1239 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1240 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
1241 (UsageVector.Break): Remove.
1242 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1244 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1246 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1247 UsageVector.Breaks (). Don't set NeedsReturnLabel.
1249 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1252 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1253 be the interface member.
1255 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1258 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1259 for emitting small (int) values.
1261 2006-05-03 Raja R Harinath <rharinath@novell.com>
1264 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1265 control-flow passes through the 'finally' after merging-in all the
1266 control-flows from 'try' and the 'catch' clauses.
1268 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1269 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1270 always true at the only non-recursive entry point.
1271 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1272 FlowBranchingBreakable.
1273 (FlowBranchingLoop): Remove.
1274 * statement.cs (Return.DoResolve): Update to changes.
1277 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1278 (FlowBranching.CreateBranching): Handle it: create a
1279 FlowBranchingContinuable.
1280 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1281 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1282 except that it handles the 'continue' command.
1283 (FlowBranching.UsageVector.MergeOrigins): Rename from
1285 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1286 except that it overrides AddContinueOrigin.
1287 (FlowBranchingException): Override AddContinueOrigin, similar to
1289 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1290 Create a new branching around the embedded statement.
1291 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1292 control flow after the embedded statement.
1293 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1295 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1296 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1297 FlowBranchingBreakable.
1298 (FlowBranchingSwitch): Remove.
1301 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1302 error reporting to ...
1303 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1304 Rename from 'AddBreakVector'. Add new location argument. Return
1305 a bool indicating whether the 'break' crosses an unwind-protect.
1306 (FlowBranchingException.AddBreakOrigin): Add.
1307 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1308 flowbranching after updating with the effects of the 'finally'
1310 (FlowBranchingBreakable): New common base class for
1311 FlowBranchingLoop and FlowBranchingSwitch.
1313 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1315 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1317 2006-05-02 Raja R Harinath <rharinath@novell.com>
1319 * statement.cs (Do.Resolve): If the loop is infinite, set the
1321 (While.Resolve, For.Resolve): Set a barrier after the embedded
1322 statement. There's no direct control flow that goes from the end
1323 of the embedded statement to the end of the loop.
1324 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1325 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1326 above ensure that the reachability is correctly computed.
1328 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1329 (UsageVector.MergeBreakOrigins): If the current path is
1330 unreachable, treat it as if all parameters/locals are initialized.
1331 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1332 infinite loops before merging-in break origins.
1334 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1335 (Reachability.Reachable): Split part into ...
1336 (Reachability.Unreachable): ... this. Simplify.
1337 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1339 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1340 (Reachability.SetThrowsSometimes): Likewise.
1341 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1342 TriState.Always, use corresponding property.
1343 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1344 (Block.Resolve): Likewise. Remove some redundant checks.
1346 2006-05-02 Raja R Harinath <harinath@gmail.com>
1348 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1349 (Reachability.Meet): Don't bother checking AlwaysThrows --
1350 barrier is always set.
1351 (FlowBranchingBlock.Merge): Likewise.
1353 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
1355 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
1356 defined, so it's references should also compile only for NET_2_0
1357 (as occurs in mcs version)
1359 2006-05-01 Raja R Harinath <harinath@gmail.com>
1361 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1362 checks for unreachable.
1364 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1367 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1369 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1370 whether field is really assigned.
1372 2006-04-30 Raja R Harinath <harinath@gmail.com>
1374 * flowanalysis.cs (Reachability): Make 4-argument constructor
1376 (Reachability.Meet): Rename from 'And'. Remove static variant.
1377 (Reachability.Always): Rename from the highly misleading
1378 'Reachability.Never'.
1379 (FlowBranching.Merge): Update to changes. Mark an impossible
1380 situation with a 'throw'.
1381 (*): Update to changes.
1383 2006-04-29 Raja R Harinath <harinath@gmail.com>
1385 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1387 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1388 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1389 (*): Update to changes.
1390 * statement.cs: Update to changes.
1392 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1395 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1397 2006-04-28 Raja R Harinath <harinath@gmail.com>
1399 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1402 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1403 argument to two arguments: an usage-vector and a bool. Move call
1404 to FlowBranching.Merge () ...
1405 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1407 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1408 handling of loop and switch reachability to ...
1409 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1411 2006-04-27 Raja R Harinath <harinath@gmail.com>
1413 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1414 handling to FlowBranchingLoop.InLoop.
1415 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1417 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1420 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1421 anonymous method is allowed from AnonymousContainer here.
1423 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1425 2006-04-24 Raja R Harinath <rharinath@novell.com>
1428 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1430 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1433 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1434 (DoubleConstant.Reduce): Ditto.
1436 2006-04-23 Raja R Harinath <rharinath@novell.com>
1438 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1439 Remove 'lvalue_right_side' argument. Move parts to ...
1440 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1441 (LocalVariable.DoResolveLValue): ... these.
1443 2006-04-21 Raja R Harinath <rharinath@novell.com>
1446 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1447 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1448 (LocalVariableReference.DoResolveBase): Use it to implement new
1450 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1451 (Argument.Resolve): Simplify. Move CS1510 check ...
1452 * ecore.cs (Expression.ResolveLValue): ... here.
1453 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1454 (PropertyExpr.DoResolveLValue): Likewise.
1455 (FieldExpr.Report_AssignToReadonly): Likewise.
1456 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1457 LValueMemberAccess or LValueMemberOutAccess on instance depending
1459 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1460 DoResolve as appropriate.
1462 2006-04-20 Raja R Harinath <rharinath@novell.com>
1465 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1466 implicit conversions on 'out' and 'ref' arguments.
1468 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1469 improve clarity. Remove dead code.
1472 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1473 (Catch.Resolve): Resolve VarBlock if it exists.
1475 2006-04-19 Miguel de Icaza <miguel@novell.com>
1477 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1478 twice, this was some residual code, the enumerator was emitted
1479 properly in the two branche of if later.
1483 Thanks to Martin for finding the source of the problem
1485 2006-04-19 Raja R Harinath <rharinath@novell.com>
1487 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1488 cast is never an lvalue.
1489 (Cast.DoResolve, Cast.ResolveRest): Combine.
1490 (Argument.Emit): Simplify slightly. Move 'Expr is
1491 IMemoryLocation' check ...
1492 (Argument.Resolve): ... here.
1493 (Argument.Error_LValueRequired): Remove. Inline into only user.
1495 Simplifications. Fix cs0191-2.cs
1496 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1497 CS1649 and CS1651 to ...
1498 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1499 the actual selection of the error code and message to a lookup
1500 table. Add a dummy return value to simplify callsites.
1501 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1502 readonly fields of other instances of the same type. Move CS0197
1504 * expression.cs (Argument.Resolve): ... here. Simplify code.
1505 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1506 resolution of an out or ref argument. The code simplification
1507 above uses this invariant.
1509 2006-04-18 Raja R Harinath <rharinath@novell.com>
1511 Possibly fix #77752. Fix cs1690-[4-7].cs.
1512 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1513 CheckMarshallByRefAccess. Drop parameter.
1514 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1516 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1518 * report.cs (AllWarnings): Add CS1690.
1519 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1521 (LocalVariableReference.DoResolveBase): Update.
1523 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1525 * class.cs (MethodOrOperator): Moved common parts from method class.
1526 detect obsolete attributes.
1527 (Method.Define): Simplified as it reuses code from base.
1528 (Constructor.ValidAttributeTargets): Fixed issue found during
1530 (Destructor.ValidAttributeTargets): Fixed issue found during
1532 (Operator): Finished refactoring set off by #78020. Operator class is now
1533 ordinary method class.
1535 * anonymous.cs: Updated.
1537 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1539 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1541 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1543 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1544 detect obsolete attributes.
1545 (Method.CreateEmitContext): Moved to MethodOrOperator.
1547 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1550 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1551 customized exception to make crash detection easier.
1552 (MethodOrOperator): Started to work on new base class for methods and
1554 (Method): Derives from MethodOrOperator.
1555 (Constructor.Emit): Emits its own attributes.
1556 (AbstractPropertyEventMethod.Emit): Ditto.
1557 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1559 (Operator.Emit): It's temporary more tricky than should be.
1561 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1563 * report.cs (InternalErrorException): Add ctor with inner exception.
1565 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1568 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1571 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1574 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1577 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1579 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1580 attribute is present and Guid not.
1581 (Interface.ApplyAttributeBuilder): Ditto.
1583 * attribute.cs: Add error message.
1585 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1589 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1590 sources (it's composite) so hold them in extra array as they are used in
1591 Emit phase only. It worked in the previous versions by mistake.
1592 (Attribute.Emit): Emit attribute for more owners when exist.
1594 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1595 it has now different behaviour.
1597 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1599 * constant.cs (Constant.IsDefaultInitializer): New method.
1601 * class.cs: Updated.
1603 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1604 re-initialize default values. It saves KBs almost for every assembly.
1605 Thanks Zoltan for the idea.
1606 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1607 (ArrayCreation.DoResolve): Resolve only once.
1608 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1609 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1611 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1613 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1616 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1618 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1619 in an embedded statement too.
1621 2006-04-01 Raja R Harinath <rharinath@novell.com>
1624 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1628 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1631 * report.cs (SymbolRelatedToPreviousError): Drop generic type
1632 arguments before checking whether a type is reflected or not.
1635 * expression.cs (Invocation.IsApplicable): Ensure a generic method
1636 definition doesn't take part in overload resolution.
1637 (Invocation.IsParamsMethodApplicable): Likewise.
1638 (Invocation.OverloadResolve): When replacing a reflected override
1639 method with its base definition, ensure that type arguments are
1642 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1646 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1649 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1651 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1653 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1656 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1657 LocalTemporary change.
1659 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1661 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1662 initializers optimization.
1663 (ClassOrStruct.TypeAttr): Moved from modifiers.
1664 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1665 (FieldBase.ResolveInitializer): Resolves initializer.
1666 (FieldBase.HasDefaultInitializer): New property.
1668 * cs-parser.jay: Removed message.
1670 * expression.cs (CompilerGeneratedThis): New specialization.
1672 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1674 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1676 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1678 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1680 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1681 be now EnumConstants only.
1683 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1685 * attribute.cs, driver.cs: Reset more caches.
1687 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1689 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1691 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1693 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1694 for easier reuse. Updated all overrides.
1695 (IntegralConstant): New base class for all integral constants.
1696 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1697 of the constant range, report custom error.
1698 (UIntConstant.Reduce): Fixed uint conversion.
1700 * ecore.cs, literal.cs: Reduce updates.
1702 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1706 * class.cs (Constructor.Define): Removed extra if for default ctors.
1707 A patch from Atsushi Enomoto.
1709 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1711 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1712 GetAttributableValue.
1714 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1717 * convert.cs (ImplicitConversionRequired): Error message moved to
1720 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1721 automatic implicit conversion of an output value.
1722 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1724 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1726 (TypeOf.GetAttributableValue): Add extra handling for object type.
1728 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1729 special error message.
1731 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1733 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1735 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1736 compatible with MS runtime.
1738 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1740 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1741 attribute arguments here.
1743 * class.cs (Indexer.Define): The check was moved to attribute class.
1745 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1747 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1749 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1751 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1753 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1756 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1758 * doc-bootstrap.cs : fix build.
1760 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1762 * expression.cs (StringConcat.Append): Issue a warning when empty string
1765 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1767 * assign.cs (CompoundAssign.ResolveSource): Removed.
1769 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1772 * class.cs (TypeContainer.FindMethods): Removed.
1773 (TypeContainer.CheckMemberUsage): Made static.
1775 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1777 * constant.cs (CheckRange): Removed unused type argument.
1778 (CheckUnsigned): Removed unused type argument.
1780 * cs-parser.jay: Updated after MemberAccess clean up.
1781 Uses Length for empty string test.
1783 * cs-tokenizer.cs: Uses Length for empty string test.
1784 (IsCastToken): Made static.
1785 (is_hex): Made static.
1786 (real_type_suffix): Made static.
1788 * decl.cs (SetupCache): Made static.
1789 (OnGenerateDocComment): Removed unused ds argument.
1791 * delegate.cs (VerifyDelegate): Removed unused argument.
1793 * doc.cs: Uses Length for empty string test.
1795 * driver.cs: Uses Length for empty string test.
1797 * enum.cs (IsValidEnumType): Made static
1799 * expression.cs (EnumLiftUp): Removed unused argument.
1800 (ResolveMethodGroup): Ditto.
1801 (BetterConversion): Ditto.
1802 (GetVarargsTypes): Ditto.
1803 (UpdateIndices): Ditto.
1804 (ValidateInitializers): Ditto.
1805 (MemberAccess.ctor): Ditto.
1806 (GetIndexersForType): Ditto.
1808 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1810 * iterators.cs: Updated after MemberAccess clean up.
1812 * location.cs: Uses Length for empty string test.
1814 * namespace.cs: Uses Length for empty string test.
1816 * report.cs (CheckWarningCode): Made static.
1818 * statement.cs (LabeledStatement): Removed unused argument.
1820 * typemanager.cs (FilterNone): Removed.
1822 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1824 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1827 * class.cs: Updated.
1829 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1831 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1833 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1837 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1839 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1840 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1841 Add more error reporting; Fixed issue with params.
1843 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1845 * cs-parser.jay: AnonymousMethod requires host container.
1847 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1849 2006-03-18 Raja R Harinath <harinath@gmail.com>
1851 * class.cs: Change 'TypeContainer ds' constructor argument to
1852 'DeclSpace parent'. Some classes were missed below due to
1853 different naming convention.
1855 * class.cs (MemberCore.Parent): Delete. This makes the
1856 ParentContainer changes below enforceable by the compiler.
1858 Treat pointers to enclosing declaration space as 'DeclSpace', not
1860 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1861 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1863 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1865 (Block.AddThisVariable): Likewise.
1866 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1867 (AbstractPropertyEventMethod.Emit): Likewise.
1868 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1869 (GetMethod.Define, SetMethod.Define): Likewise.
1870 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1871 (DelegateMethod.EmitMethod): Likewise.
1873 Fix regression test-partial-13.cs.
1874 Rationalize use of PartialContainer. Ensure that the partial
1875 class semantics can be tied to type-correctness, i.e., any
1876 violation will cause a compile error.
1877 * class.cs, const.cs: Access all fields that belong to class
1878 TypeContainer via ParentContainer. Arguments of EmitContexts and
1879 Resolve()-like functions still use 'Parent'.
1881 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1882 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1883 (PropertyMethod.CheckModifiers): Remove unused argument.
1884 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1887 2006-03-28 Raja R Harinath <rharinath@novell.com>
1889 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1891 2006-03-17 Raja R Harinath <harinath@gmail.com>
1893 Make semantics of PartialContainer simpler.
1894 * decl.cs (DeclSpace.IsPartial): Remove.
1895 * class.cs (TypeContainer.IsPartial): Likewise.
1896 (TypeContainer..ctor): Set PartialContainer to point to self.
1897 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1898 (TypeContainer.FindNestedType): Likewise.
1899 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1901 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1903 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1905 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1907 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1910 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1912 * class.cs (Operator.Define): An error for base conversion was not
1915 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1917 A fix for #77593, #77574.
1919 * class.cs (MethodCore.CheckBase): Another if for operator.
1921 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1925 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1926 reporting, it's more tricky than I thought.
1928 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1930 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1933 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1934 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1937 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1940 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1944 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1945 (Event.Define): ditto
1946 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1948 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1949 Removed redundant code and set NewSlot for Invoke method too.
1951 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1952 (Parameters.MergeGenerated): New method. Use this method when you merge
1953 compiler generated argument with user arguments.
1955 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1957 * attribute.cs (ResolveAsTypeTerminal): Removed.
1959 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1960 specialization for predefined types; 30% speed up.
1961 Finally placed obsolete check to right place.
1962 (Expression.ResolveType): Removed.
1964 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1965 Updated after ResolveType was removed.
1967 * expression.cs (Cast.ctor): Check void cast.
1968 (Binary.ResolveAsTypeTerminal): Is never type.
1969 (Conditional.ResolveAsTypeTerminal): Is never type.
1971 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1973 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1975 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1977 2006-03-23 Martin Baulig <martin@ximian.com>
1979 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1980 type check if either of the types is an open generic type.
1982 2006-03-23 Martin Baulig <martin@ximian.com>
1985 (Convert.ExplicitTypeParameterConversion): New method; implement
1986 explicit type parameter conversions.
1988 2006-03-23 Martin Baulig <martin@ximian.com>
1990 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1991 blindly allow all conversions if we do not have any constraints.
1993 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1995 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1996 these two separated members to simplify the code.
1997 (Attribute.Resolve): Refactored to use new fields and methods.
1998 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1999 implemented obsolete attribute checking.
2000 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2001 implemented obsolete checking again. It look line never ending quest ;-)
2002 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2004 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2006 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2008 *class.cs (Property.Define): Add RegisterProperty call.
2010 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2011 argument groups (only 2).
2013 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2014 encoding expression to arguments.
2015 (Expression.ExprClassToResolveFlags): Just turned to property.
2017 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2018 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2019 optimized as well as implemented support for zero-length attributes.
2021 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2022 Add caching of PropertyInfo's.
2024 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2026 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2027 error multiple times.
2029 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2031 New partial class implementation.
2032 A fix for #77027, #77029, #77403
2034 * attribute.cs (Attributable): Made attributes protected.
2036 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2037 the replacements of ClassPart and PartialContainer.
2038 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2039 (TypeContainer.AddInterface): Ditto.
2040 (TypeContainer.AddPartial): The main method for partial classes. It checks
2041 for errors and merges ModFlags and attributes. At the end class is added to
2043 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2045 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2046 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2047 from the rest of partial classes.
2048 (TypeContainer.GetClassBases): Simplified.
2049 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2051 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2052 (TypeContainer.HasExplicitLayout): Uses Flags now.
2053 (PartialContainer): Removed.
2054 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2055 (StaticClass): Was merged with Class.
2056 (Class.GetClassBases): class and static class bases are verified here.
2057 (Class.TypeAttr): Added static attributes when class is static.
2058 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2059 (MemberBase): In some cases we need to call parent container for partial
2060 class. It should be eliminated but it's not easy now.
2062 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2064 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2065 partial classed to accumulate class comments.
2066 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2068 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2070 * driver.cs (MainDriver): Tree.GetDecl was removed.
2072 * modifiers.cs (Modifiers): Add partial modifier.
2074 * tree.cs (Tree.decl): Removed.
2075 (RootTypes): Started to use this class more often for root types
2078 2006-03-23 Raja R Harinath <rharinath@novell.com>
2080 * generic.cs (TypeParameter.UpdateConstraints): Update
2081 'constraints' if null.
2083 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2087 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2088 external interface does not have an attribute.
2090 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2092 Another prerequisites for new partial classs implementation.
2094 * attribute.cs (Attribute.Equal): Implemented.
2095 (Attribute.Emit): Changed as attributes can be applied more than twice.
2096 (Attributes.Emit): Check for duplicate attributes here.
2098 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2099 as a parameter, clean-up.
2101 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2105 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2106 contains obsolete attribute check which can in some cases look for base
2107 type of current class which is not initialized yet.
2108 (TypeContainer.BaseType): Replacement of ptype.
2110 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2112 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2114 First of prerequisites for new partial classs implemention.
2116 * attribute.cs (Attributable): Extended by ResolveContext;
2117 Attributes finally have correct context for resolving in all cases.
2118 (AttachTo): Attribute owner is assigned here.
2120 * codegen.cs (IResolveContext): Introduce new interface to hold
2121 all information needed in resolving phase.
2122 (EmitContext): Implements IResolveContext; more clean-up needed here.
2124 * decl.cs (MemberCore): Implemented IResolveContext.
2126 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2127 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2128 parameter.cs, statement.cs, tree.cs, typemanager.cs:
2129 Refactored to use new IResolveContext instead of EmitContext; cleanup
2131 2006-03-22 Raja R Harinath <rharinath@novell.com>
2133 Support ParameterDefaultValueAttribute in gmcs. Also applied to
2134 mcs to keep code differences small.
2135 * attribute.cs (Attribute.GetParameterDefaultValue): New.
2136 * typemanager.cs (parameter_default_value_attribute_type): New.
2137 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
2140 2006-03-22 Martin Baulig <martin@ximian.com>
2143 (Nullable.NullableLiteral): Derive from `NullLiteral'.
2146 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
2147 instead of the normal `NullLiteral'.
2149 2006-03-21 Martin Baulig <martin@ximian.com>
2152 * generic.cs (TypeManager.InferType): If `pt' is a generic
2153 parameter, don't check whether `pt == at'.
2155 2006-03-20 Raja R Harinath <rharinath@novell.com>
2158 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
2159 (TypeParameter.Resolve): Update to change.
2160 (ConstraintChecker.CheckConstraints): Resolve type-argument
2161 constraints before use.
2163 2006-03-16 Martin Baulig <martin@ximian.com>
2166 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
2167 and don't have any instance constructors, also lookup in the base class.
2168 (TypeManager.IsNullableValueType): New public method.
2170 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
2171 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
2172 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
2174 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
2175 instead of just TypeManager.IsNullableType() to determine whether
2176 a lifted operator exists.
2177 (UnaryMutator.DoResolve): Likewise.
2178 (Conditional.DoResolve): Likewise.
2179 (Binary.DoResolve): A lifted operator only exists if both operands
2180 are valuetypes and at least one of them is a nullable type.
2182 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2184 * iterator.cs : yield break is allowed in try statement which has
2185 catch clauses. Fixed bug #77767.
2187 2006-03-12 Martin Baulig <martin@ximian.com>
2189 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
2190 private IsSignatureEqual() to compare types; see the comment in
2191 that method; fixes #77674.
2193 2006-03-10 Raja R Harinath <rharinath@novell.com>
2195 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
2196 (Expression.ResolveAsTypeTerminal): Likewise.
2197 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
2198 * expression.cs, generic.cs, iterators.cs: Likewise.
2199 * parameter.cs, statement.cs, typemanager.cs: Likewise.
2201 2006-03-09 Martin Baulig <martin@ximian.com>
2203 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
2204 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
2206 2006-03-09 Martin Baulig <martin@ximian.com>
2208 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
2209 `prepared' flag is set.
2211 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
2212 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
2213 issues; see gtest-254.cs.
2215 2006-03-07 Martin Baulig <martin@ximian.com>
2217 * generic.cs (TypeManager.InferType): Allow infering
2218 `IEnumerable<T>' with an array of T; see gtest-251.cs.
2220 2006-03-06 Martin Baulig <martin@ximian.com>
2223 (TypeManager.InferType): Fix gtest-250.cs.
2226 (TypeManager.IsSubclassOf): Also check the base class.
2229 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
2232 2006-03-01 Raja R Harinath <rharinath@novell.com>
2235 * expression.cs (ParameterReference.DoResolveBase): Change return
2237 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2241 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2244 * typemanager.cs (GetFullNameSignature): Don't nullref on
2245 protected accessors.
2247 2006-02-16 Martin Baulig <martin@ximian.com>
2250 (TypeManager.GetGenericFieldDefinition): New public method; use it
2251 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
2253 2006-02-14 Martin Baulig <martin@ximian.com>
2255 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
2257 2006-02-14 Martin Baulig <martin@ximian.com>
2260 (TypeManager.DropGenericMethodArguments): New public method; don't
2261 use GetGenericMethodDefinition() on something which is not a
2264 2006-02-14 Martin Baulig <martin@ximian.com>
2267 (ConstraintChecker.CheckConstraints): If a type parameter has the
2268 `struct' constraint, the type must be a non-nullable valuetype.
2270 2006-02-10 Martin Baulig <martin@ximian.com>
2273 (TypeManager.IsOverride): Make this work for instantiated methods
2274 in a generic class; fixes #77509.
2275 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
2276 rather than calling it directly; fixes #77488.
2278 2006-02-08 Martin Baulig <martin@ximian.com>
2280 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
2281 reporting into CheckConstraint() so we can use the correctly
2284 2006-02-08 Martin Baulig <martin@ximian.com>
2286 * expression.cs (BaseAccess): Add support for generic methods.
2288 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
2289 the new MethodGroupExpr.
2291 2006-02-07 Martin Baulig <martin@ximian.com>
2293 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
2294 also reference types; fixes #77483.
2296 2006-02-07 Martin Baulig <martin@ximian.com>
2299 (TypeManager.IsGenericMethod): We now return whether something is
2300 an instantiated generic method (and not a generic method def).
2301 (TypeManager.IsGenericMethodDefinition): New public method.
2304 (TypeManager.CSharpSignature): Only include type arguments for
2305 "real" generic methods, not for any instantiated method.
2306 (TypeManager.GetMethodName): Likewise, but also allow generic
2307 method definitions here.
2309 2006-02-06 Miguel de Icaza <miguel@novell.com>
2311 * codegen.cs (EmitScopeInitFromBlock): check here the
2312 capture_context, there is no need to make two calls to the
2315 * anonymous.cs: Add some debugging messages that might help me
2316 track other instances of this problem in the future (the
2317 regression of test 467).
2319 * cs-parser.jay: track the variable block, as we need to initalize
2320 any captured variables declared in this block for the "catch"
2321 portion of the "Try" statement.
2323 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2324 scope initialization for captured variables.
2326 Also, move the emit for the variables after the block location has
2329 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2331 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2333 2006-02-06 Martin Baulig <martin@ximian.com>
2335 * class.cs (TypeContainer.DefineType): If we're a struct, pass
2336 `TypeManager.value_type' as parent type to
2337 ModuleBuilder.DefineType(). Fixes #77358.
2339 2006-02-02 Miguel de Icaza <miguel@novell.com>
2341 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2342 commit yesterday, the initialization for the roots is necessary.
2343 What is not necessary is the scope activation.
2345 2006-02-02 Raja R Harinath <rharinath@novell.com>
2347 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2348 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2350 (Argument.Resolve): Remove CS0206 checks.
2352 2006-02-01 Miguel de Icaza <miguel@novell.com>
2354 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2355 scopes for all the roots, the scopes will now be emitted when the
2356 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2358 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2359 code. This reduces a lot of existing cruft.
2361 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2362 that the ScopeInfo is generated as we enter the scope, not at the
2363 time of use, which is what we used to do before.
2365 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2366 every time a Block is about to be emitted if we have a
2369 2006-02-01 Raja R Harinath <rharinath@novell.com>
2371 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
2372 attribute for mscorlib too.
2374 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2376 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2378 * typemanager.cs (cons_param_array_attribute): Make private.
2379 (Reset): Set it to null.
2380 (InitCoreHelpers): Don't initialize it.
2381 (ConsParamArrayAttribute): New. Initialize it as needed.
2382 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2384 2006-01-31 Miguel de Icaza <miguel@novell.com>
2386 * expression.cs: There might be errors reported during the
2387 selection of applicable methods. If there are errors, do not
2388 continue execution as it will lead the compiler to crash.
2390 2006-01-30 Miguel de Icaza <miguel@novell.com>
2392 * expression.cs: Member access is not allowed on anonymous
2393 methods. Fixes #77402.
2395 2006-01-30 Raja R Harinath <rharinath@novell.com>
2398 * cs-parser.jay (VariableDeclaration): Don't set
2399 current_array_type to null.
2400 (field_declaration, event_declaration, declaration_statement):
2401 Set it to null here.
2403 2006-01-29 Raja R Harinath <harinath@gmail.com>
2406 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
2408 2006-01-28 Raja R Harinath <harinath@gmail.com>
2410 * typemanager.cs (GenericParameterPosition): New.
2413 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2415 * doc.cs : To process "include" elements, first we should create
2416 another list than XmlNodeList, because it could result in node
2417 removal, which could result in that the XmlNodeList gives up
2420 2006-01-25 Miguel de Icaza <miguel@novell.com>
2422 * expression.cs: Introduce an error report that we were not
2423 catching before. Gonzalo ran into it.
2425 2006-01-23 Miguel de Icaza <miguel@novell.com>
2427 A fix for bug: #76957
2429 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2430 ComputeMethodHost before creating the method, this is a new
2433 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2434 that this method references (RegisterScope). The actual scope
2435 where the method is hosted is computed with the ComputeMethodHost
2436 before we create the method.
2438 Moved the Deepest routine here.
2440 (AnonymousContainer.ComputeMethodHost): New routine used to
2441 compute the proper ScopeInfo that will host the anonymous method.
2443 (ScopeInfo): Deal with multiple roots. The problem was that we
2444 did not have a unique root where all ScopeInfos could be hanged
2445 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2448 Remove AdjustMethodScope which is now computed at the end. Remove
2449 LinkScope which did a partial link, instead link all ScopeInfos
2450 before code generation from the new "LinkScopes" routine.
2452 Simplify all the Add* routines as they no longer need to maintain
2453 the tree, they just need to record that they are using variables
2456 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2457 routines to produce the forest of ScopeInfo trees.
2459 * class.cs (TypeContainer.AppendMethod): This is just like
2460 AddMethod, but ensures that an interface implementation method
2461 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2462 methods, but at the end.
2464 We use this functionality to ensure that the generated MoveNext
2465 method in the iterator class is resolved/emitted before the
2466 enumerator methods created.
2468 This is required because the MoveNext method computes the right
2469 ScopeInfo for the method. And the other methods will eventually
2470 need to resolve and fetch information computed from the anonymous
2474 2006-01-23 Raja R Harinath <rharinath@novell.com>
2476 Improve implementation of section 14.4.2.2 (Better function member).
2477 * expression.cs (Invocation.MoreSpecific): Compare all type
2478 arguments before deciding if one type is more specific than
2479 another. Handle array types too. Return the more specific type.
2480 (Invocation.BetterFunction): Add more tie-breaking rules from
2481 section 14.4.2.2. Perform "more specific" check after
2482 other tie-breaking rules. Compare all parameter types before
2483 choosing the "more specific" method.
2485 2006-01-21 Raja R Harinath <harinath@gmail.com>
2486 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2489 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2491 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2492 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2494 2006-01-18 Martin Baulig <martin@ximian.com>
2496 * class.cs (TypeContainer.AddToMemberContainer): Use
2497 `symbol.MemberName.MethodName' instead of just `symbol.Name';
2500 2006-01-18 Martin Baulig <martin@ximian.com>
2502 Fix #76417: a generic class may now have methods which may unify
2503 for some type parameter substitutions.
2505 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
2506 for methods which may unify anymore.
2508 * expression.cs (Invocation.MoreSpecific): New private static
2509 method; checks whether one method is more specific than another
2510 according to 14.4.2.2 of the spec.
2511 (Invocation.BetterFunction): Implement the tie-breaking rules from
2512 14.4.2.2 of the spec: if two methods unify for some type parameter
2513 substitution, we need to pick the more specific one.
2515 2006-01-18 Raja R Harinath <rharinath@novell.com>
2517 Fix #76656, cs0231-2.cs.
2518 * cs-parser.jay (formal_parameter_list): Make error case catch
2520 (parenthesized_expression_0): Add CS1026 check.
2521 (invocation_expression): Remove unused { $$ = lexer.Location }.
2523 2006-01-17 Raja R Harinath <rharinath@novell.com>
2526 * cs-parser.jay (statement_expression): Don't list out the
2527 individual statement-expressions. Convert syntax error into
2530 2006-01-16 Raja R Harinath <rharinath@novell.com>
2533 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2534 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2535 CheckIntermediateModification.
2536 (FieldExpr.DoResolve): Add new two-argument version that
2537 allows us to resolve the InstanceExpression as an lvalue.
2538 The one-argument variant is now just a wrapper.
2539 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2540 Resolve the lhs as an lvalue if the it has a value type.
2541 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2542 from Assign.DoResolve.
2543 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2544 resolved as an lvalue.
2545 (PropertyExpr.DoResolve): Update.
2546 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2547 has a value type. Move CS1612 check here from
2548 CheckIntermediateModification.
2549 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2550 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2551 'right_side' of a ResolveLValue on an 'out' argument.
2552 (EmptyExpression.LValueMemberAccess): New. Used as the
2553 'right_side' of a propagated ResolveLValue on a value type.
2554 (LocalVariableReference.DoResolveBase): Recognize
2555 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2557 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2558 EmptyExpression.Null.
2560 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2562 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
2563 Type.IsGenericParameter(). Fixed bug #77183.
2564 * doc.cs : it is now identical to doc.cs in mcs.
2566 2006-01-16 Martin Baulig <martin@ximian.com>
2568 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
2570 2006-01-16 Martin Baulig <martin@ximian.com>
2572 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
2573 ctors; fixes #77250.
2575 2006-01-12 Miguel de Icaza <miguel@novell.com>
2577 This fixes the problem where we used ldfld instead of ldflda to
2578 load the "THIS" pointer on captured parameters, when THIS is a
2579 value type. See bug #77205.
2581 * iterators.cs (CapturedThisReference.Emit): Pass false to
2582 EmitThis (we do not need the address).
2584 * codegen.cs (EmitThis): it needs to know whether we need the
2585 address of `this' or not. This is used by value types.
2587 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2588 every other call passes false.
2590 2006-01-12 Raja R Harinath <rharinath@novell.com>
2593 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2595 * expression.cs (Invocation.OverloadResolve): Update.
2596 (Invocation.DoResolve): Avoid double resolution of invocation.
2598 2006-01-11 Raja R Harinath <rharinath@novell.com>
2601 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2602 unary negation of floating point types as 0-expr; negation cannot
2603 overflow in floating point types.
2606 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2607 on operands of 'void' type.
2610 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2611 and ExclusiveOr for boolean constants too.
2613 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2615 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2617 2006-01-12 Miguel de Icaza <miguel@novell.com>
2619 * cs-tokenizer.cs (Position): New class used to save and restore
2620 the position state in the tokenizer. Before this patch the save
2621 and restore was not complete enough so the line and columns would
2622 start to drift and the debugger and stack traces will get the
2625 2006-01-10 Martin Baulig <martin@ximian.com>
2628 (TypeParameter.InflateConstraints): New public method.
2630 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2631 constraints; fixes #77042.
2633 2006-01-10 Martin Baulig <martin@ximian.com>
2635 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2636 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2639 2006-01-09 Raja R Harinath <rharinath@novell.com>
2642 * expression.cs (Invocation.OverloadResolve): Replace reflected
2643 override methods with their base virtual methods, rather than
2645 * typemanager.cs (TypeManager.GetOverride): New.
2647 2005-12-21 Miguel de Icaza <miguel@novell.com>
2649 * driver.cs: Report the case of no source files and no -out:
2652 2005-12-20 Raja R Harinath <rharinath@novell.com>
2655 * expression.cs (ComposedCast.GetSignatureForError): Define.
2657 2006-01-05 Jb Evain <jbevain@gmail.com>
2659 * class.cs (Property.Define, Indexer.Define): do not tag the
2660 properties as SpecialName | RTSpecialName.
2662 2006-01-04 Miguel de Icaza <miguel@novell.com>
2664 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2665 doing a low-level comparission of parameter types. It was lacking
2666 a check for __argslist.
2668 2005-12-30 Miguel de Icaza <miguel@novell.com>
2670 * expression.cs (ParameterReference.DoResolveBase): Allow
2671 reference parameters if they are local to this block.
2673 This allows the ref and out parameters of a delegate to be used in
2674 an anonymous method, for example:
2676 delegate void set (out int x);
2678 set s = delegate (out int x){
2682 This is used by functionality introduced late in the C# language.
2684 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2685 method that take ref and out parameters.
2687 Fixes #77119 which was a late change in the spec.
2689 2005-12-23 Miguel de Icaza <miguel@novell.com>
2691 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2692 parent if its the same scope. Fixes #77060.
2694 2005-12-22 Marek Safar <marek.safar@seznam.cz>
2696 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2698 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2700 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2701 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
2702 that doesn't contain the full public key. This is a update of the
2703 friend assemblies in .Net 2.0 release.
2705 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2709 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2710 ListDictionary, to contain the ExternAliasEntry entries (in
2711 addition to the NamespaceEntry.aliases hashtable). This field is
2712 shared between the original entry and its doppelganger (bodyless
2714 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2715 extern_aliases field.
2716 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2717 lookup in extern_aliases.
2719 2005-12-16 Raja R Harinath <rharinath@novell.com>
2722 * class.cs (TypeContainer.Mark_HasEquals): New.
2723 (TypeContainer.Mark_HasGetHashCode): New.
2724 (ClassPart): Override them.
2725 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2727 * generic.cs (GenericMethod.DefineMembers): Update to changes.
2728 (TypeParameter.TypeParameter): Change type of 'parent' argument to
2732 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2733 'parent' argument to the base constructor.
2735 Remove all mention of TypeContainer from decl.cs.
2736 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2737 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2738 (DeclSpace.DeclSpace): Likewise.
2739 (DeclSpace.DefineMembers): Remove unused argument.
2740 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2741 debugging check -- we don't care if the debug code throws an
2742 InvalidCastException instead of an InternalErrorException.
2743 * class.cs (TypeContainer.DefineMembers): Update to changes.
2744 (TypeContainer.DoDefineMembers): Likewise.
2745 (TypeContainer.GetMethods): Likewise.
2746 (PropertyMember.Define): Likewise.
2747 (MemberBase.Parent): New property that forwards to
2748 MemberCore.Parent, but ensures that we get a TypeContainer.
2749 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2750 (RootContext.PopulateTypes): Likewise. Remove special case code
2751 for !RootContext.StdLib: DefineMembers is idempotent.
2753 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2755 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2757 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2759 * doc.cs : The search for referenced namespace was insufficient to
2760 get global one as it used to do. Fixed bug #76965.
2762 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2764 * doc.cs : check name in cref in the last phase that whether it is
2767 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2769 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2772 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2774 * doc.cs : so it turned out that we cannot skip override check for
2775 interface members. Fixed bug #76954.
2777 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2779 * cs-tokenizer.cs : fixed bug #75984:
2780 - #warning and #error should not be handled when the source line
2782 - #line is not checked strictly when the source line is disabled.
2783 - #define and #undef is on the other hand checked strictly at any
2786 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2788 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2791 2005-12-15 Raja R Harinath <rharinath@novell.com>
2793 * generic.cs (TypeManager.IsGeneric): Remove unused method.
2795 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2798 2005-12-14 Martin Baulig <martin@ximian.com>
2800 * typemanager.cs (TypeManager.GetFullName): Make this public;
2801 `Type.Fullname' now never returns null.
2803 * class.cs (Method.Define): Use TypeManager.GetFullName() for
2804 explicit interface implementations; we're now using the same
2805 naming convention than csc does.
2807 2005-12-14 Miguel de Icaza <miguel@novell.com>
2809 * convert.cs (ExplicitConversionCore): Check the return value from
2810 ExplicitConversionCore which can return null on failure. Fixes #76914
2812 2005-12-09 Raja R Harinath <rharinath@novell.com>
2814 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2815 instead of IsGenericInstance.
2816 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
2817 code that's now covered by the more general test.
2818 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2820 * generic.cs (DropGenericTypeArguments): New. Captures the common
2821 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2822 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2823 * generic.cs, report.cs, typemanager.cs: Likewise.
2825 2005-12-08 Martin Baulig <martin@ximian.com>
2827 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2829 * typemanager.cs (TypeManager.CSharpSignature): Include type
2830 arguments in the signature of a generic method.
2832 2005-12-07 Martin Baulig <martin@ximian.com>
2834 Add support for custom attributes on type parameters.
2836 * cs-parser.jay (type_arguments): Added `opt_attributes'.
2838 * generic.cs (TypeParameterName): New public class; we use this
2839 instead of a `string' to store the name of a type parameter, so we
2840 can also have `Attributes'.
2841 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2842 array instead of a `string[]' array.
2843 (TypeParameter.ctor): We now also take an `Attributes' argument.
2844 (TypeParameter.EmitAttributes): New public method; emit our
2845 `OptAttributes' here.
2846 (GenericMethod.EmitAttributes): New public method; emit the custom
2847 attributes on all our type parameters.
2849 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2850 our type parameters.
2851 (MethodData.Define): If we're a generic method, call
2852 EmitAttributes() on it.
2854 2005-12-07 Martin Baulig <martin@ximian.com>
2857 (ConstraintChecker): New public abstract class; move the
2858 constraint checking here from `ConstructedType' and also do
2859 constraint checking for generic methods here.
2861 * expression.cs (Invocation.OverloadResolve): Use
2862 ConstraintChecker.CheckConstraints() if we resolved to a generic
2865 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2867 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2869 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2871 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2872 (FieldBase.Initializer): Initializer is now optional.
2873 (EventField.Define): Only event field can have initializer.
2875 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2877 * const.cs (Const): Reuse initializer.
2879 * cs-parser.jay: Updated after FieldBase changes.
2880 Added current_array_type to simplify array initializers.
2882 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2884 * expression.cs, iterators.cs: Updated.
2886 * namespace.cs (NamespaceEntry): Made UsingFound private.
2888 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2890 * parameterCollection.cs: Obsolete, removed.
2891 * parser.cs: Obsolete, removed.
2893 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2896 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2898 * enum.cs (Enum.Define): Set obsolete context here.
2900 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2903 - FindDocumentedMember() now expects 1) paramList as null
2904 when "we don't have to check the number of parameters" and
2905 2) Type.EmptyTypes when "there is no arguments".
2906 - Introduced FoundMember struct to hold the exact type which was
2907 used to find the documented member (the above change broke
2908 test-xml-044; it might be better just to use DeclaringType than
2909 what MS does, like this change does, but it depends on usage.)
2911 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2913 * doc.cs : documented member might be from DeclaringType for nested
2914 types. Fixed bug #76782.
2916 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2918 * anonymous.cs: Have the param code handle leaving copies on the
2919 stack etc. Allows anonymous params to take part in the assignment
2920 code (++, +=, etc). Fixes bug #76550
2922 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2923 it down to the anon code.
2925 * iterators.cs: Use dummy var here
2927 * codegen.cs: Handle new vars
2929 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2932 * class.cs (MethodData.Define): Set proper Obsolete context.
2934 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2936 (FieldExpr.DoResolve): Ditto.
2938 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2941 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2942 parent is not obsolete.
2944 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2946 * doc.cs : (FindDocumentedMember) find parameterless members first
2947 and get CS0419 in the early stage. Fixed first case of bug #76727.
2949 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2952 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2953 no error was reported.
2955 *expression.cs (Binary.DoResolve): left can be null.
2957 2005-12-06 Raja R Harinath <rharinath@novell.com>
2959 * class.cs (MethodCore.CheckGenericOverride): Delete unused
2960 abstract method and all overrides.
2961 * support.cs (ParameterData.GenericConstraints): Delete.
2962 (ReflectionParameters.type_params): Delete.
2963 (ReflectionParameters.ReflectionParameters): Make private.
2964 (ReflectionParameters.GetConstaints): New factory method.
2965 * generic.cs (TypeParameterDefineType): Use it.
2966 (TypeManager.GetTypeParameterConstraints): Likewise.
2968 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2971 * class.cs (MethodData.Emit): Parameters should be labeled first.
2973 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2976 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2978 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2980 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2982 * class.cs (MethodCore): Parameter clean up.
2983 (IMethodData): Added ParameterInfo.
2984 (MethodData): Parameter clean up.
2985 (Indexer.Define): Parameter clean up.
2997 * typemanager.cs: Parameter clean up.
2999 * delegate.cs (Define): Get rid of duplicated code.
3001 * expression.cs (ParameterReference): Removed useless parameters
3003 (Invocation): Ditto.
3005 * parameter.cs (ParamsParameter): New class, params specialization.
3006 (ArglistParameter): Attemp to separate arglist.
3007 (Parameter): Refactored to be reusable and faster.
3008 (Parameter.Modifier): Made understandable.
3009 (Parameters): Changed to be used as a class for `this' assembly
3010 parameters. Refactored to use new specialized classes.
3012 * support.cs (ParameterData): Added Types property.
3013 (InternalParameters): Deleted.
3015 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3017 * doc.cs : the previous patch does not actually fix the bug.
3018 PropertyInfo override check is now implemented and really fixed it.
3019 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3021 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3023 * doc.cs : apply "override filter" also to properties.
3026 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3028 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3029 no need to check overrides. For classes, omit those results from
3030 interfaces since they must exist in the class. Fixed bug #76726.
3032 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3034 * typemanager.cs : (GetFullNameSignature) differentiate indexers
3035 with different parameters. Fixed the second problem in #76685.
3037 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3039 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3040 get expected 'protected' access in CheckValidFamilyAccess()).
3043 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3045 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3046 Fixed bug #76705. CS1569 was incorrectly commented out.
3048 2005-11-23 Martin Baulig <martin@ximian.com>
3050 * generic.cs (Constraints.Define): Removed.
3051 (TypeParameter.DefineConstraints): Removed.
3052 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
3053 on the GenericTypeParameterBuilder here.
3055 2005-11-23 Martin Baulig <martin@ximian.com>
3057 * typemanager.cs (TypeManager.GetProperty): Make this public.
3059 * generic.cs (Nullable.NullableInfo.ctor): Use
3060 TypeManager.GetProperty() rather than using reflection directly.
3062 2005-11-17 Martin Baulig <martin@ximian.com>
3064 * expression.cs (Indexers.GetIndexersForType): Added support for
3065 generic parameters; fixes #76587.
3067 2005-11-17 Martin Baulig <martin@ximian.com>
3070 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3071 inherit the scope from our parent. Fixes #76653.
3073 2005-11-15 Martin Baulig <martin@ximian.com>
3075 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
3076 instead of `ScopeTypeBuilder' to refer to the "current" type.
3077 (AnonymousMethod.CreateScopeType): Correctly create the helper
3078 class if we're inside a generic type definition.
3080 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3082 * doc.cs : use Invocation.IsOverride() to do real override check.
3083 * expression.cs : made Invocation.IsOverride() internal.
3085 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3087 * doc.cs : use TypeManager.FindMembers() instead of (possible)
3088 TypeBuilder.FindMembers() and filter overriden base members out.
3091 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3093 * doc.cs : ref/out parameters are represented as '@' (instead of
3094 '&' in type FullName). Fixed bug #76630 (additionally crefs).
3096 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3098 * doc.cs : when there was no '.' in cref to methods in doc comment,
3099 then parameters were missing in the output. Fixed bug #76691.
3101 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3103 * driver.cs : don't output docs when there is an error.
3106 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3109 Now it should detect indexers. Fixed primary concern in bug #76685.
3110 Fixed CS0419 message to not show the identical member signature in
3113 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3115 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3116 instead of Type.FindMembers() since it does not handle events.
3119 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
3121 * codegen.cs: Fixed typo (speficied -> specified).
3123 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3126 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3128 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3130 * attribute.cs: Changed error message.
3132 * cs-tokenizer.cs: One more check.
3134 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3136 * statement.cs (Block.Resolve): Ignore empty statement.
3138 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3140 * report.cs: Made error/warning methods more strict to avoid
3143 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3144 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3145 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3146 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3148 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3150 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
3151 Use the more explicit AssemblyName.FullName instead of
3152 AssemblyName.Name to report errors.
3154 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3156 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
3159 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3169 * report.cs: Fixed error reporting and typos.
3171 * generic.cs (TypeParameter.GetSignatureForError): New method.
3172 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
3174 * typemanager.cs (GetFullName): Refactored.
3176 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3178 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3179 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3181 * class.cs (TypeContainer.IsComImport): New property.
3182 (Constructor.Define): Create proper ctor for ComImport types.
3184 * expression.cs (New.CheckComImport): Fixed.
3186 2005-11-07 Miguel de Icaza <miguel@novell.com>
3188 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3189 that a parameter has been captured does not mean that we do not
3190 have to do the rest of the processing. This fixes the second part
3191 of #76592. If there was another anonymous method capturing
3192 values in the past, the Scope would never be set for the second
3193 method that captured the same parameter.
3195 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3196 properly manipulate the stack. Second part of fix for #76592.
3198 * expression.cs (New): Add support for invoking "new" on
3199 interfaces that have been flagged with the ComImport attribute and
3200 the CoClass. Fixes #76637
3202 * statement.cs (Try.DoEmit): When a variable is captured, do not
3203 try to emit the vi.LocalBuilder variable as it has been captured.
3204 Create a temporary variable and store the results on the
3205 FieldBuilder. Fixes #76642
3207 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3209 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3211 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3213 * expression.cs (Binary.DoResolve): Added && optimalization.
3215 * typemanager.cs (AddUserType): Removed useless argument.
3217 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3219 * statement.cs (Block.variables): Uses ListDictionary.
3221 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3224 * class.cs (PartialContainer.EmitType): Customized to emit
3225 security attributes.
3226 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3227 for partial classes.
3229 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3232 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3233 access has to be fixed.
3235 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3237 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3240 * ecore.cs (NullCast.Reduce): Implemented.
3242 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3245 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3247 (Foreach.Resolve): Catch null properly.
3249 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3251 * cs-tokenizer.cs: Warning text fix.
3253 * driver.cs: AllWarningNumbers exposed on public interface.
3255 * report.cs (): Reviewed warning numbers.
3256 (IsValidWarning): Use binary search.
3258 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3260 * driver.cs: Implemeted resource visibility.
3261 (Resources): New class for code sharing between /res: and
3264 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3266 decl.cs (CurrentTypeParameters): Fixed to be public.
3268 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3270 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
3272 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3274 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
3276 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
3278 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
3280 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3282 Add friend assembly access support.
3283 * typemanager.cs: assembly_internals_vis_attrs
3284 cache for friend assembly access.
3285 (TypeManager.IsFriendAssembly): New method for
3286 checking friend assembly access.
3287 (TypeManager.Error_FriendAccessNameNotMatching): New
3289 (TypeManager.CompareKeyTokens): Likewise.
3290 (TypeManager.Filter): Handle friend accessible
3293 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
3294 friend accessible types.
3296 * ecore.cs (Expression.IsAccessorAccessible): Handle
3297 friend accessible properties.
3299 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
3302 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3305 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3308 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3311 * ecore.cs (NullCast): Child is contant only.
3313 * literal.cs (NullLiteral.Reduce): null can be converted to any
3316 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3318 * driver.cs: Use Encoding.Default as default code page instead
3321 2005-10-27 Raja R Harinath <rharinath@novell.com>
3324 * expression.cs (Invocation.Error_InvalidArguments): Handle
3325 __arglist parameters.
3326 (Invocation.VerifyArgumentsCompat): Likewise.
3327 * support.cs (ReflectionParameters.GetSignatureForError): Print
3328 __arglist parameters.
3329 (InternalParamters.GetSignatureForError): Likewise.
3330 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3332 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3334 * attribute.cs (GetPropertyValue): Made public.
3336 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3338 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3340 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3343 * driver.cs: Reflect method name change.
3345 * statement.cs (Try.Resolve): Warn when try has both general
3348 * typemanager.cs: runtime_compatibility_attr_type new predefined
3351 2005-10-26 Raja R Harinath <harinath@gmail.com>
3354 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3355 treat it as an empty parameter list.
3357 2005-10-26 Raja R Harinath <rharinath@novell.com>
3360 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3361 ResolveAsTypeStep silent.
3362 * statement.cs (Block.AddConstant): Mark block as used.
3363 (Block.ResolveMeta): Avoid piling on error messages
3364 if a constant initializer resolution fails.
3366 2005-10-25 Raja R Harinath <rharinath@novell.com>
3368 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3370 (NamespaceEntry.VerifyAllUsing): New.
3371 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3372 behaviour. Delegates actual resolution of alias to ...
3373 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3374 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3376 * driver.cs (Driver.MainDriver): Update.
3378 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3379 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3381 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3383 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3384 RootNamespace.DefineNamespacesForAll.
3386 2005-10-24 Raja R Harinath <harinath@gmail.com>
3388 * typemanager.cs (assemblies, external_aliases, modules)
3389 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3390 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3391 overhead. Move resposibility ...
3392 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3393 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3395 2005-10-23 Raja R Harinath <harinath@gmail.com>
3397 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3398 cached_namespaces. Improve usage.
3399 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3400 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3401 Move from GlobalRootNamespace and simplify.
3402 (RootNamespace.Global): Make instance variable.
3403 (RootNamespace.RootNamespace): Add "alias name" parameter.
3404 (GlobalRootNamespace): Simplify drastically.
3405 (Namespace.Lookup): Don't use GetNamespace.
3406 * typemanager.cs (GetRootNamespace): Rename from
3407 ComputeNamespaceForAlias.
3408 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3410 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3412 * anonymous.cs (AnonymousContainer): Don't crash when container
3415 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3417 * expression.cs (Binary.DoResolve): Warn when comparing same
3420 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3423 * expression.cs (Binary.DoResolve): It looks like there are no
3424 convetsion rules in enum context.
3426 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3428 Add support for extern alias qualifiers.
3429 * typemanager.cs: Move some LookupTypeReflection code
3430 to namespace.cs, to have cleaner code. Added some methods
3431 to help us keep track of the extern aliased references.
3432 * driver.cs: Add suport for extern alias assemblies on command
3433 line and check for their warnings/errors. Also keep track of the
3434 extern aliased assemblies.
3435 * namespace.cs: Move the global functionality of Namespace
3436 to GlobalRootNamespace/RootNamespace. Now the global namespace
3437 is GlobalRootNamespace.Globa. Also the code moved from
3438 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3439 Finally added LocalAliasEntry (AliasEntry before) and
3440 ExternAliasEntry, to handle alias statements.
3441 * cs-parser.jay: Add support in the grammar for extern alias
3443 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3444 Update callings to Namespace (now in GlobalRootNamespace).
3446 2005-10-25 Martin Baulig <martin@ximian.com>
3448 * convert.cs (ImplicitTypeParameterConversion): Make base
3449 interfaces actually work; fixes #76557.
3451 2005-10-25 Martin Baulig <martin@ximian.com>
3454 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
3455 all the type parameters; fixes #76551.
3457 2005-10-25 Martin Baulig <martin@ximian.com>
3462 (GenericMethod.ctor): Added `Expression return_type' and
3463 `Parameters parameters' arguments.
3464 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
3465 parameter and return types to check their constraints if they're
3468 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
3471 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3472 constraints of a generic type if `ec.ResolvingGenericMethod'.
3474 * class.cs (MethodCore.DoDefineParameters): Set
3475 `ec.ResolvingGenericMethod' if we're a generic method.
3476 (MemberBase.MemberType): Likewise.
3478 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3480 * typemanager.cs (TypeManager): Added
3481 TypeManager.internals_visible_attr_type to cache
3482 S.R.CompilerServices.InternalsVisibleToAttribute.
3484 * codegen.cs (AssemblyClass): Added checks for
3485 InternalsVisibleToAttribute in new method
3486 CheckInternalsVisibleAttribute () and also cache the
3487 AssemblyName in AssemblyClass.Name.
3489 2005-10-24 Martin Baulig <martin@ximian.com>
3492 (TypeManager.ExpandInterfaces): Added overloaded version which
3493 just takes a `Type[]' array.
3496 (Constraints.Resolve): Don't expand the interfaces here; ie. we
3497 just use the interfaces which were explicitly specified and not
3498 the interfaces they inherit. Fixes #76482.
3499 (TypeParameter.FindMembers): Expand the interfaces here.
3501 2005-10-21 Martin Baulig <martin@ximian.com>
3504 (Constraints.Resolve): Also resolve the actual types here.
3505 (Constraints.ResolveTypes): Just check the constraints here.
3506 Fixes #76363; see gtest-218.cs.
3508 2005-10-21 Martin Baulig <martin@ximian.com>
3511 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
3512 instead of a `BoxedCast'; fixes gtest-217.cs.
3514 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
3516 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
3517 1) "new()" is specified as generic parameter constraint and 2) the
3518 type is TypeBuilder and 3) the type is abstract even if it has a
3519 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
3521 2005-10-20 Martin Baulig <martin@ximian.com>
3524 (GenericConstraints.TypeParameter): New public property.
3525 (TypeParameter.ctor): Also take a `DeclSpace' argument.
3526 (TypeParameter.DeclSpace): New public property.
3527 (TypeParameter.DefineType): Inflate the constraints if our
3528 `DeclSpace' is an `Iterator'.
3530 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
3532 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
3533 GenericMethod argument to compare methods' generic type arguments.
3536 2005-10-19 Martin Baulig <martin@ximian.com>
3538 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
3539 not ResolveType() when resolving the base type, so we're not
3540 checking the constraints here.
3541 (TypeContainer.ResolveType): Call ResolveType() on our base_type
3544 2005-10-19 Martin Baulig <martin@ximian.com>
3546 * generic.cs (ConstructedType.CheckConstraints): Committing
3547 untested fix for #76441.
3549 2005-10-18 Raja R Harinath <rharinath@novell.com>
3552 * class.cs (TypeContainer.DefineType): Move updating of
3553 topological sort earlier in the code.
3554 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3556 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3559 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3561 * constant.cs (Constant.TryReduce): Moved from Cast class.
3562 (Reduce): Made little bit more OO and fixed missing conversions.
3564 * ecore.cs (Reduce): Implemented.
3565 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3567 * literal.cs (Reduce): Implemented.
3569 * class.cs: Reverted Miguel's wrong commit.
3571 2005-10-14 Miguel de Icaza <miguel@novell.com>
3573 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3575 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3577 * cs-parser.jay, expression.cs : CS0214 was missing error location
3578 for constants. Fixed bug #76404.
3580 2005-10-10 Raja R Harinath <rharinath@novell.com>
3582 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3584 (PropertyExpr.EmitCall): Likewise.
3585 * expression.cs (Invocation.EmitArguments): Handle case where
3587 (Invocation.EmitCall): Avoid allocating temporary variable if
3588 there are no arguments.
3590 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3593 * convert.cs (ExplicitConversionCore): Fixed object->enum
3596 2005-10-07 Raja R Harinath <rharinath@novell.com>
3599 * convert.cs (ImplicitConversionStandard): Move conversion of
3600 void* to arbitrary pointer types ...
3601 (ExplicitConversionStandard): .. here.
3602 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3603 error to always print typenames.
3605 2005-10-07 Raja R Harinath <rharinath@novell.com>
3607 * convert.cs (GetConversionOperator): Rename from
3608 GetConversionOperators. Move operator selection code from ...
3609 (UserDefinedConversion): ... here.
3611 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3613 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3616 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3618 * assign.cs (Assign.DoResolve): Error method changed.
3620 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3622 * const.cs (ResolveValue): Reset in_transit immediately.
3624 * constant.cs: Error method changed.
3626 * convert.cs: Removed useless location parameter.
3627 (ExplicitNumericConversion): Don't do double enum check.
3628 (ExplicitConversionCore): Renamed from ExplicitConversion.
3629 (ExplicitUnsafe): Extracted from ExplicitConversion.
3630 (ExplicitConversion): Uses for error reporting.
3632 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3634 (ResolveBoolean): Uses common error method.
3635 (CastToDecimal): Get rid of ec.
3636 (CastFromDecimal): Optimized.
3637 (ConvCast): Get rid of ec.
3639 * enum.cs (ResolveValue): Reset in_transit immediately.
3640 (Emit): Return after first error.
3642 * expression.cs: Convert changes.
3644 * literal.cs: Error method changed.
3646 * statement.cs: Error method changed.
3648 2005-10-06 Raja R Harinath <rharinath@novell.com>
3650 Fix gtest-131.cs and gtest-211.cs.
3651 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3652 Only emit code for a label if it is used. Unreachable code can
3653 violate ECMA evaluation stack invariants.
3655 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3657 * anonymous.cs: Implemented ExprClassName.
3659 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3662 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3665 * class.cs (StaticClass.DefineContainerMembers): Report protected
3668 * codegen.cs: if(ed) PRODUCTION.
3670 * convert.cs (Error_CannotImplicitConversion): Better error
3673 * cs-parser.jay: More error checks.
3675 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3677 * driver.cs (CSCParseOption): Enabled wrong option check.
3679 * ecore.cs (Expression.ExprClassName): Turned to property.
3680 (MemberExpr.CheckIntermediateModification): For checking boxed
3681 value types modification.
3683 * statement.cs (Fixed.Resolve): Expression type must be
3684 convertible to fixed type.
3685 (CollectionForeach.GetEnumeratorFilter,TryType):
3686 Small refactoring for easier error checking.
3688 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3690 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3693 * class.cs (GeneratedBaseInitializer): New class for customization
3694 compiler generated initializers.
3695 (MemberBase.DoDefine): Check Obsolete attribute here.
3696 (FieldMember.DoDefine): Ditto.
3698 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3701 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3702 (MemberCore.GetObsoleteAttribute): Removed argument.
3703 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3704 (MemberCore.CheckObsoleteType): New helper.
3708 * statement.cs: Updates after MemberCore changes.
3710 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3711 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3713 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3714 obsolete attribute for compiler construct.
3715 (As.DoResolve): Cache result.
3717 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3719 2005-10-01 Miguel de Icaza <miguel@novell.com>
3721 * expression.cs (Probe): instead of having a "Type probe_type"
3722 keep the extra information as a TypeExpr probe_type_expr since the
3723 "As" operator needs to perform some type checks.
3725 * (As.DoResolve): If the type is a type parameter, ensure that it
3726 is constrained by a class.
3728 2005-09-22 Miguel de Icaza <miguel@novell.com>
3730 * statement.cs (Lock): Use the TemporaryVariable class instead of
3731 manually using local variables as those do not work when variables
3734 * ecore.cs: Moved the TemporaryVariable class from being a nested
3735 class inside Foreach to be a public class that can be employed in
3738 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3740 * cs-parser.jay: interface_accessors replaced by
3741 accessor_declarations.
3743 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3746 * statement.cs (GotoCase.Resolve): Convert null constant to
3748 (SwitchLabel.ResolveAndReduce): Ditto.
3749 (SwitchLabel.NullStringCase): Custom null stamp.
3750 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3752 typemanager.cs (CSharpSignature): Don't skip first argument
3755 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3757 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3758 expression.cs, iterators.cs, literal.cs: Store constants and
3761 * class.cs (MemberBase.ShortName): Pass location.
3763 * cs-parser.jay: Some location fixes.
3765 * ecore.cs (Expression.Location): Made virtual.
3767 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3770 * const.cs (Const.ResolveValue): Check for assigning non-null
3771 value to reference type.
3773 2005-09-26 Raja R Harinath <rharinath@novell.com>
3776 * expression.cs (This.VerifyFixed): In a value type T, the type of
3777 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3778 value type R, 'this' is treated as a value parameter.
3780 2005-09-05 Miguel de Icaza <miguel@novell.com>
3782 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3783 if the underlying types are the same, otherwise we need to produce
3784 code that will do the proper cast.
3786 This was exposed by Marek's constant rewrite which produced
3787 invalid code for the call site:
3790 void Method (X v) {}
3794 This fixes test-49.cs
3796 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3798 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3799 Type/Object should be allowed as well. Fixed bug #75968.
3801 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3803 * expression.cs : (Binary.DoResolve): when one is enum constant and
3804 another is constant 0, then return enum one *as enum type*.
3807 2005-10-04 Martin Baulig <martin@ximian.com>
3809 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3810 `SetMemberIsUsed()' work for generics, too.
3812 2005-10-04 Martin Baulig <martin@ximian.com>
3814 * expression.cs (DelegateInvocation.EmitStatement): Make this work
3815 for corlib. Fixes #75691.
3817 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3820 * driver.cs: Fix compilation files with full root path.
3822 2005-09-25 Miguel de Icaza <miguel@novell.com>
3824 * report.cs (SymbolRelatedToPreviousError): Format the output so
3825 it does not use an open parenthesis that is never closed.
3827 * driver.cs: Follow coding guidelines
3829 2005-09-18 Miguel de Icaza <miguel@novell.com>
3831 * driver.cs: Set InEmacs based on the environment variable EMACS.
3833 * location.cs (InEmacs): in this mode, do not report column
3834 location as it confuses Emacs.
3836 2005-10-03 Raja R Harinath <rharinath@novell.com>
3838 * support.cs (SeekableStreamReader.Position): Don't error out when
3839 the requested position is just beyond the end of the current
3842 2005-09-28 Raja R Harinath <rharinath@novell.com>
3844 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3845 try to keep in sync with the byte count of the underlying Stream.
3846 However, this limits us to a window size of 2048 characters: i.e.,
3847 the maximum lookahead of our lexer/parser can be 2048 characters.
3849 2005-09-22 Martin Baulig <martin@ximian.com>
3851 * driver.cs: Removed a debugging FIXME.
3853 2005-09-21 Raja R Harinath <rharinath@novell.com>
3855 * cs-parser.jay (type_arguments): Add CS1644 check.
3856 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3858 2005-09-15 Raja R Harinath <rharinath@novell.com>
3860 * Makefile (PROGRAM): Make profile specific.
3861 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3862 the current directory.
3865 * expression.cs (Invocation.EmitCall): Remove optimization on
3866 this_call since it doesn't handle 'this' being a value type.
3868 2005-09-05 Geoff Norton <gnorton@customerdna.com>
3870 * driver.cs: Ensure file handles are closed after parsing
3872 2005-09-05 Miguel de Icaza <miguel@novell.com>
3874 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3875 if the underlying types are the same, otherwise we need to produce
3876 code that will do the proper cast.
3878 This was exposed by Marek's constant rewrite which produced
3879 invalid code for the call site:
3882 void Method (X v) {}
3886 This fixes test-49.cs
3888 2005-09-05 Martin Baulig <martin@ximian.com>
3890 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3891 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3893 * cs-parser.jay (delegate_declaration): Small fix for #75852.
3895 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3897 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3898 to be a pointer type due to the spec 25.2, so check if declaring
3899 type is generic type definition. Fixed bug #75772.
3901 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3904 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3905 both types are not defined by methods.
3906 * expression.cs : (Invocation.IsApplicable): it should work when
3907 the argument type is equal to the parameter type, not only when
3908 ImplicitConversionExists() returns true.
3910 2005-09-02 Raja R Harinath <rharinath@novell.com>
3912 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3916 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3917 flow-branching for LocalVariableReferences in case we were invoked
3918 from a MemberAccess.
3919 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3921 (LocalVariableReference.DoResolveBase): ... this.
3922 (MemberAccess.Resolve): Do the check that was disabled during
3925 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3928 (PartialContainer.Create): check abstract/sealed/static strictly
3929 but abstract/sealed can exist only at one side. Fixed bug #75883.
3931 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3934 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3935 specified, don't default to UnmanagedType.I4.
3937 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3939 * expression.cs : conditional operator should check possibly
3940 incorrect assign expression. Fixed bug #75946.
3942 2005-08-30 Raja R Harinath <rharinath@novell.com>
3945 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3946 (ScopeInfo.EmitScopeType): Use it to construct field names from
3947 names of captured locals.
3950 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3951 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3952 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3953 (ExplicitConversion): Remove enum cases already handled by
3954 implicit conversion. Move implicit conversion check to the beginning.
3955 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3956 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3957 Don't treat System.Enum as a struct.
3959 2005-08-30 Jb Evain <jbevain@gmail.com>
3961 * attribute.cs: handles as expression in parameters.
3963 2005-08-30 Raja R Harinath <rharinath@novell.com>
3966 * class.cs (TypeContainer.VerifyClsName): Don't use a
3967 PartialContainer when verifying CLS compliance.
3968 (AbstractPropertyEventMethod): Set Parent here, ...
3969 (PropertyMethod): ... not here.
3971 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3973 * attribute.cs : escaped attribute name should not be allowed to be
3974 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3976 2005-08-29 Raja R Harinath <rharinath@novell.com>
3979 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3980 when converting a long constant to unsigned long.
3981 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3982 detect where IsApplicable and VerifyArgumentsCompat disagree.
3984 2005-08-29 Raja R Harinath <rharinath@novell.com>
3985 and Carlos Alberto Cortez <carlos@unixmexico.org>
3988 * class.cs (TypeContainer.CanElideInitializer): New helper.
3989 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3990 can safely emitting the initializer of a field.
3992 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3994 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3995 allowed inside a switch (without loop). Fixed bug #75433.
3997 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3999 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4000 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4002 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4004 * driver.cs : kinda reverting the default encoding changes (not exact
4005 revert since I noticed that "codepage:reset" might not work fine).
4007 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4009 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4010 Location. Now getter and setter store location correctly.
4011 (errors/cs0111-12.cs now reports the expected location.)
4013 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4015 * driver.cs : Use default encoding on the environment.
4016 Removed (now that) extra parameter for SeekableStreamReader.
4017 * support.cs : (SeekableStreamReader) third .ctor() argument for
4018 StreamReader is not required (always true). preamble size could
4019 be acquired in simpler and safe way.
4021 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
4023 * cs-parser.jay: report CS0642 at warning level 3
4024 and report CS0642 for an if else statement also
4025 fixes bug #74745. Patch by John Luke (and a bit
4027 Removed extra CS0642 warning check for "while",
4029 * statement.cs: In Block.Resolve(), CS0642 check
4030 is reimplemented to check a sequence of an empty
4031 statement and a block.
4033 Both fix bug #66777.
4035 2005-08-24 Marek Safar <marek.safar@seznam.cz>
4037 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4038 detection until I fix it.
4040 * cs-tokenizer.cs: Changed error message.
4042 * cs-parser.jay: Fixed 2 error locations.
4044 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4045 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4048 * enum.cs (GetSignatureForError): Fixed.
4050 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4054 * typemanager.cs (RegisterProperty): Removed.
4056 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4058 2005-08-24 Raja R Harinath <rharinath@novell.com>
4061 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4062 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4064 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4066 * expression.cs : tiny fix is required for not warning positive ulong.
4069 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4071 * expression.cs : add CS0652 check for constant and integral
4072 expression. Fixed bug #53974.
4074 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4076 * expression.cs : in DoNumericPromotions(), check if there is implicit
4077 conversion overload for string (to check CS0034). Fixed bug #52492.
4079 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4081 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4083 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4085 * ecore.cs : report location when it is *not* Null.
4087 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4093 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4094 correctly. Fixed bug #75721.
4096 2005-08-23 Raja R Harinath <rharinath@novell.com>
4098 * support.cs (SeekableStreamReader.Position): Avoid an expensive
4099 loop that performs 'min (pos, char_count)'.
4102 * expression.cs (Unary.ResolveOperator): Don't discard implicit
4103 converted value in Operator.OnesComplement.
4105 2005-08-22 Ben Maurer <bmaurer@ximian.com>
4107 * anonymous.cs: If the anon method is pulled into a helper class,
4108 it needs to be `internal' not `private'. Fixes runtime behavior on
4111 2005-08-17 Marek Safar <marek.safar@seznam.cz>
4114 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4117 2005-08-16 Marek Safar <marek.safar@seznam.cz>
4119 The big constants rewrite
4120 Fix #75746, #75685 and more
4121 As a side effect saved 1MB for MWF ;-)
4123 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4124 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4125 enum based for corlib compilation.
4127 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4130 * class.cs (FixedField.Define): Use ResolveAsConstant.
4132 * const.cs (IConstant): Interface constants and enums.
4133 (Const.ResolveValue): New method for constant resolvning.
4134 (ExternalConstant): Constants from imported assemblies.
4136 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4137 conversion; like enums.
4138 (Constant.ToType): Converts this constant to different type.
4139 (Constant.Increment): Adds 1.
4141 * convert.cs (ImplicitConversionRequired): Simplified.
4143 * cs-parser.jay: Create EnumMember directly.
4145 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4147 * doc.cs (GenerateEnumDocComment): Removed.
4149 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4150 (ConvertIntLiteral): Removed.
4151 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4153 * enum.cs (EnumMember): Implement IConstant.
4154 (Enum.IsValidEnumConstant): Removed.
4155 (Enum.GetNextDefaultValue): Removed.
4156 (Enum.FindMembers): Updated.
4157 (Enum.GenerateDocComment): Iterate enum members.
4159 * expression.cs (Cast.TryReduce): Handle enums correctly.
4160 (New.Constantify): Made public.
4161 (MemberAccess.DoResolve): Removed contant specific if(s).
4163 * literal.cs (NullLiteral): Implement new abstract methods.
4165 * statement.cs (GotoCase.Resolve): Use new constant methods.
4166 (SwitchLabel.ResolveAndReduce): Use new constant methods.
4168 * typemanager.cs (LookupEnum): Removed.
4169 (IsEnumType): Fixed to work with corlib.
4170 (RegisterConstant): Removed.
4171 (LookupConstant): Removed.
4172 (GetConstant): Changed to work with IConstant.
4174 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4176 * location.cs : Fixed overflown (>255) column number.
4178 2005-08-03 Raja R Harinath <rharinath@novell.com>
4180 First cut of the qualified-alias-member feature.
4181 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4183 * cs-parser.jay (DOUBLE_COLON): New token.
4184 (namespace_or_type_name): Add rule for recognizing
4185 qualified-alias-members.
4186 (primary_expression): Likewise.
4187 (element_access): Allow QualifiedAliasMember as a possible
4188 type-bearing expression.
4189 (local_variable_type, local_variable_pointer_type): Likewise.
4190 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4191 aliases in the current and enclosing namespace declarations.
4192 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4193 * decl.cs (MemberName.is_double_colon): New.
4194 (MemberName.MemberName): Add new constructor for alias-member.
4195 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4196 * expression.cs (QualifiedAliasMember): New expression type.
4198 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4200 * location.cs : it borked when no argument was specified.
4202 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4204 * location.cs : tiny ToString() format fix.
4206 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4208 * statement.cs : oops, it was missing.
4210 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4212 A set of fixes for precise line/column location.
4215 "token" field now holds a file/line "delta", a line number offset
4216 from the segment, and a column number. See also:
4217 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4218 December/009508.html
4219 Removed static IsNull. Use instance IsNull property instead.
4221 For some tokens it stores Location. For Identifier it stores
4222 LocatedToken which is a pair of string name and location.
4223 Column numbers are adjusted only at getChar().
4225 Use Location.ToString() for reporting (it now contains column).
4227 Largely modified to use LocatedToken instead of
4228 string (IDENTIFIER), and to acquire Location from some tokens.
4229 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4230 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4232 Now MemberName holds Location. DeclSpace.ctor() receives Location
4233 as a parameter. Removed extra parameters to all derived classes.
4234 Replaced Location.IsNull() with instance property.
4235 * assign.cs, expression.cs :
4236 Added .ctor() overload that omits Location.
4238 Added "nameEscaped" flag that indicates the identifier was escaped
4239 in the source file. This fixes bug #57047.
4241 2005-09-02 Martin Baulig <martin@ximian.com>
4243 * class.cs: Make CS3005 a warning, not an error.
4245 2005-08-02 Marek Safar <marek.safar@seznam.cz>
4247 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4248 New method, looking for lo-case imported cls type.
4250 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4253 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4255 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4257 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4259 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4261 Optimized to save 3.5 MB for SWF compilation.
4263 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4265 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4266 (PartialContainer.Create): Moved logic AddToContainer.
4267 (PartialContainer.MarkForDuplicationCheck): Shares name.
4269 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4272 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4274 (Namespace.GetSignatureForError): New method.
4276 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4277 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4279 2005-08-01 Raja R Harinath <rharinath@novell.com>
4282 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4283 member lookup rather than qualifier_type, since qualifier_type can
4286 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4288 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4291 2005-07-31 Miguel de Icaza <miguel@novell.com>
4293 * statement.cs: Copy the local exception into the exception
4294 captured local. Fixes 75674
4296 2005-07-31 Raja R Harinath <harinath@gmail.com>
4299 * expression.cs (Invocation.OverloadResolve): Don't report error
4300 CS1501 if error CS1502 has been reported.
4301 (New.DoResolve): Delegate CS1501 reporting to
4302 Invocation.OverloadResolve.
4305 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4306 invariant-meaning-in-block property in an enclosing block if
4309 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4311 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4312 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4313 (Switch.CheckSwitch): Just save 50kb for SWF.
4315 2005-07-27 Martin Baulig <martin@ximian.com>
4317 * anonymous.cs (CaptureContext.AddField): Added
4318 `AnonymousContainer am' argument; compute its toplevel scope if
4319 it's not already computed. Fixes #75649.
4321 2005-07-26 Raja R Harinath <rharinath@novell.com>
4324 * class.cs (Constructor.Emit): Reset block to null if the block
4327 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4329 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4331 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4333 * class.cs (MethodData.Define): Check whether accessor implementing
4334 interface is public.
4336 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4338 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4341 * namespace.cs (LookupType): Moved same type check to...
4343 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4346 2005-07-21 Raja R Harinath <rharinath@novell.com>
4348 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4349 already found a typebuilder.
4350 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4351 MemberNames, not strings.
4353 * const.cs (Error_ExpressionMustBeConst):
4354 Rename from Error_EpressionMustBeConst.
4355 * const.cs, class.cs, statement.cd: Update.
4357 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4361 * const.cs (Const.LookupConstantValue): Report missing contant expression
4363 (Error_EpressionMustBeConstant): Only one error method.
4365 * class.cs, statement.c: Updated.
4367 2005-07-20 Raja R Harinath <rharinath@novell.com>
4369 * statement.cs (Block.Flags): Add back HasVarargs.
4370 (Block.flags): Make protected.
4371 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4373 * typemanager.cs (types, typecontainers, user_types): Remove.
4374 (UserTypes, TypeContainers): Likewise.
4375 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4376 (CleanUp, Reset): Update.
4377 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4378 (GetNestedType): Use Type.GetNestedType.
4379 (CoreLookupType): Take two arguments, the namespace and the
4380 basename of the type. Update to use the Namespace.Lookup
4382 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4383 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4384 string concatenation and substring matches.
4385 * class.cs, enum.cs, delegate.cs: Update to changes.
4387 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4389 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4390 Expression and made virtual.
4392 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4393 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4395 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4397 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4400 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4403 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4406 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4407 AssemblyCultureAttribute is not used on executable.
4410 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4412 2005-07-16 Raja R Harinath <rharinath@novell.com>
4415 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4416 New. Reports CS0252/CS0253.
4417 Mostly taken from preliminary patch by Duncak Mak.
4418 (Binary.DoResolveOperator): Store results of operator lookup.
4419 Use them to detect if we need to warn about unintended reference
4422 2005-07-15 Raja R Harinath <rharinath@novell.com>
4425 * namespace.cs (Namespace.Lookup): Add back location parameter.
4426 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4427 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4429 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4430 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4431 (Namespace.LookupType): ... this.
4432 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4434 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4435 purported to handle pointers.
4436 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4439 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4441 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4444 2005-07-15 Raja R Harinath <rharinath@novell.com>
4446 * namespace.cs (Namespace.Lookup): Drop location parameter.
4447 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4448 (NamespaceEntry.Lookup): ... this.
4449 (NamespaceEntry.Error_AmbiguousTypeReference):
4450 Move here from DeclSpace.
4451 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4453 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4454 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4455 Move to NamespaceEntry.
4456 * delegate.cs, expression.cs: Update to changes.
4458 2005-08-31 Martin Baulig <martin@ximian.com>
4460 Committing a patch from Atsushi Enomoto for #75850.
4462 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
4463 Prefer a generic enumerator over a non-generic one.
4465 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4467 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4468 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4470 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4472 * driver.cs : reverting default encoding change as well as mcs.
4474 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4476 * driver.cs, support.cs : merged r48826.
4478 > could you integrate your mcs changes to gmcs otherwise
4479 > gmcs cannot compile some files.
4481 2005-08-20 Martin Baulig <martin@ximian.com>
4483 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4484 scope if we don't already have it.
4486 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4487 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4490 2005-07-31 Miguel de Icaza <miguel@novell.com>
4492 * statement.cs: Copy the local exception into the exception
4493 captured local. Fixes 75674
4495 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4497 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4500 2005-08-12 Martin Baulig <martin@ximian.com>
4502 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4503 for nested types here to avoid hitting the cache too early.
4505 2005-08-09 Miguel de Icaza <miguel@novell.com>
4507 * enum.cs: On the new compiler CLS error 3005 is now a warning not
4510 2005-08-03 Martin Baulig <martin@ximian.com>
4512 Make iterators in generic methods work; see gtest-191.cs.
4515 (Constraints.Resolve): Protect against being called twice.
4518 (TypeContainer.GetClassBases): Make this `protected virtual'.
4520 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
4521 (Iterator.GetClassBases): Override this and compute the base
4523 (Iterator.DefineNestedTypes): If we're a generic method, all our
4524 method type parameters become class type parameters on the proxy
4528 (ToplevelBlock.Parameters): Make this a property, not a field.
4529 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
4531 2005-08-03 Martin Baulig <martin@ximian.com>
4533 * typemanager.cs (TypeManager.IsSubclassOf): Use
4534 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
4535 (TypeManager.GetFullName_recursed): Improved.
4537 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4540 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
4541 Private accessor case, using TypeManager.IsPrivateAccessible instead of
4542 invocation_type == mi.DeclaringType, since the first one also checks
4543 other condition used by generic instances.
4545 2005-07-27 Martin Baulig <martin@ximian.com>
4547 * anonymous.cs (CaptureContext.AddField): Added
4548 `AnonymousContainer am' argument; compute its toplevel scope if
4549 it's not already computed. Fixes #75649.
4551 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4553 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4554 CheckAttributeType and refactored.
4555 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4556 ResolveAsTypeTerminal error handling.
4557 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4559 (GetSignatureForError): Print errors in same way.
4562 * codegen.cs: Reflect attribute GetSignatureForError change.
4565 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4567 * namespace.cs (UsingEntry): Refactored to make fields private.
4570 statement.cs: Error_UnexpectedKind has extra parameter.
4572 2005-07-14 Raja R Harinath <rharinath@novell.com>
4574 * ecore.cs (IAlias): Remove.
4575 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4576 that implement the interface.
4577 * namespace.cs (Namespace): Likewise.
4578 (Namespace.declspaces): Renamed from 'defined_names'.
4579 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4580 DeclSpace instead of an IAlias.
4581 * tree.cs (Tree.AddDecl): Update.
4583 2005-07-12 Raja R Harinath <rharinath@novell.com>
4585 * statement.cs (Block.Flags); Remove HasVarargs.
4586 (Block.HasVarargs): Move to ToplevelBlock.
4587 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4588 (Block.Variables): Make protected. Initialize variable hashtable
4590 (Block.AddVariable): Update.
4591 (Block.Resolve): Update to changes.
4592 (ToplevelBlock.HasVarargs): New boolean.
4593 (ToplevelBlock.ThisVariable): Move here from Block.
4594 (ToplevelBlock.AddThisVariable): Likewise.
4595 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4596 * expression.cs (This.ResolveBase): Update to changes.
4597 (ArglistAccess.DoResolve): Likewise.
4599 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4602 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4604 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4605 not used and not used & assigned.
4606 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4608 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4611 * expression.cs (Is.DoResolve): null is never provided type.
4613 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4616 * cs-parser.jay: Less strict event error rule to catch more errors.
4618 2005-07-11 Martin Baulig <martin@ximian.com>
4620 * generic.cs (ConstructedType.CheckConstraints): Improve the check
4621 for the constructor constraint: we do not only have to check
4622 whether the class has a public constructor, but also ensure that
4623 it's parameterless. Fixes #75492.
4625 2005-07-11 Martin Baulig <martin@ximian.com>
4627 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4628 between type parameters if they either have the reference type
4629 constraint or the class constraint.
4631 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
4633 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4635 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4638 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4639 (ExtractSecurityPermissionSet): Cope with self referencing security
4640 attributes properly.
4642 * driver.cs (SetOutputFile): Made public property OutputFile.
4644 2005-07-07 Raja R Harinath <rharinath@novell.com>
4647 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4648 has_nonstatic_fields. Make into a FieldBase pointer.
4649 (TypeContainer.AddField): Add CS0282 check.
4650 (TypeContainer.EmitType): Update.
4652 2005-07-06 Miguel de Icaza <miguel@novell.com>
4654 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4655 compare if they start with __.
4657 2005-07-06 Raja R Harinath <rharinath@novell.com>
4659 * statement.cs (Switch.SwitchGoverningType): Only look at
4660 UserCasts that don't need implicit standard conversions to one of
4661 the allowed switch types (Fixes test-322.cs).
4662 (LocalInfo.Resolve): Re-enable sanity-test.
4664 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4666 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4668 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4670 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4672 2005-07-06 Raja R Harinath <rharinath@novell.com>
4675 * ecore.cs (SimpleName.GetSignatureForError): Add.
4676 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4677 (MemberAccess.GetSignatureForError): Add.
4679 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4681 The big error and warning messages review.
4711 * typemanager.cs: Updated.
4713 * class.cs: (MethodCore.SetYields): Moved here to share.
4714 (PropertyMethod.Define): Moved iterator setup here.
4716 * iterators.cs: Add orig_method to have full access to parent
4719 2005-07-05 Raja R Harinath <rharinath@novell.com>
4721 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4722 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4723 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4724 variable of struct type.
4725 * expression.cs (Unary.ResolveOperator): Update to change.
4726 (Indirection.VerifyFixed): Likewise.
4727 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4728 (ParameterReference.VerifyFixed): Value parameters are fixed.
4729 (This.VerifyFixed): Treat 'this' as a value parameter.
4730 * statement.cs (LocalInfo.IsFixed): Remove.
4732 2005-07-01 Martin Baulig <martin@ximian.com>
4734 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4735 `ec.EmitThis ()' to get the correct scope.
4737 2005-07-01 Martin Baulig <martin@ximian.com>
4739 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4740 instance is a ParameterReference; fixes #75299.
4742 2005-06-30 Raja R Harinath <rharinath@novell.com>
4745 * expression.cs (Indexers.map): Remove.
4746 (Indexers.Append): Filter out inaccessible setters and getters.
4747 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4750 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4752 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4753 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4754 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4755 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4757 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4760 * class.cs (FieldBase.GetInitializerExpression): One more field
4763 2005-06-28 Miguel de Icaza <miguel@novell.com>
4765 * pending.cs: Do not define a proxy if the base method is virtual,
4766 it will be picked up by the runtime (bug 75270).
4768 2005-07-08 Martin Baulig <martin@ximian.com>
4770 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4771 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4773 2005-07-07 Martin Baulig <martin@ximian.com>
4775 * generic.cs (ConstructedType.CheckConstraint): Use
4776 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4777 called recursively; fixes #75329.
4779 2005-07-06 Martin Baulig <martin@ximian.com>
4781 * generic.cs (TypeManager.InferTypeArguments): Added support for
4782 anonymous methods; fixes #75461.
4784 2005-07-01 Martin Baulig <martin@ximian.com>
4786 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4787 `ec.EmitThis ()' to get the correct scope.
4789 2005-07-01 Martin Baulig <martin@ximian.com>
4791 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4792 instance is `This'; fixes #75299.
4794 2005-06-30 Martin Baulig <martin@ximian.com>
4796 * class.cs (Indexer): Implement IIteratorContainer; added support
4797 for iterators in indexers.
4800 (EmitContext.CurrentIterator): Make this a property, not a field.
4802 * anonymous.cs (AnonymousContainer.Iterator): New public property.
4804 2005-06-28 Miguel de Icaza <miguel@novell.com>
4806 * pending.cs: Do not define a proxy if the base method is virtual,
4807 it will be picked up by the runtime (bug 75270).
4809 2005-06-28 Martin Baulig <martin@ximian.com>
4811 * cs-parser.jay (interface_method_declaration): Avoid a
4812 reduce/reduce conflict by moving some of the code into a separate
4813 `interface_method_declaration_body' rule; fixes #75368.
4815 2005-06-28 Martin Baulig <martin@ximian.com>
4817 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4818 array check after the check for TypeBuilder's.
4820 2005-06-21 Raja R Harinath <rharinath@novell.com>
4822 * convert.cs (FindMostEncompassedType): Add two trivial special
4823 cases (number_of_types == 0 || number_of_types == 1).
4824 (FindMostEncompasingType): Likewise.
4826 2005-06-17 Raja R Harinath <rharinath@novell.com>
4828 Some cleanups preparing for the fix of #75283.
4829 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4831 (EventExpr.InstanceResolve): Likewise.
4832 (EventExpr.DoResolve): Remove redundant checks.
4834 2005-06-08 Miguel de Icaza <miguel@novell.com>
4836 * class.cs: Small fix.
4838 2005-06-08 Raja R Harinath <rharinath@novell.com>
4841 * class.cs (GetPartialBases): Fix return value check of
4844 2005-06-07 Raja R Harinath <rharinath@novell.com>
4846 Ensure that partial classes are registered in their enclosing
4847 namespace. Initial part of fix of #75160.
4848 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4849 Register declspace with namespace here, not in
4850 DeclSpace.RecordDecl.
4851 * cs-parser.jay: Pass namespace to RecordDecl.
4852 * class.cs (PartialContainer.Create): Likewise.
4853 (ClassPart.DefineType): New sanity-check. Throws an exception if
4855 * decl.cs (Declspace.RecordDecl): Remove.
4856 * namespace.cs (NamespaceEntry.DefineName): Remove.
4858 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4860 * rootcontext.cs: Reset TargetExt as well.
4862 2005-06-03 Raja R Harinath <rharinath@novell.com>
4864 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4867 2005-06-02 Raja R Harinath <rharinath@novell.com>
4869 Fix #75080, cs0119.cs.
4870 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4872 (Expression.Resolve): ... this. Use it. Remove bogus code
4873 allowing ExprClass.Type and ExprClass.Namespace for
4874 ResolveFlags.VariableOrValue.
4875 (Expression.Resolve) [1-argument variant]: Change default resolve
4876 flags based on language version.
4877 (Expression.Error_UnexpectedKind): Use a simple string array
4878 rather than an ArrayList.
4879 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4881 (TypeOfVoid.DoResolve): Likewise.
4882 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4883 flags argument -- it always has the same value.
4885 2005-05-31 Raja R Harinath <rharinath@novell.com>
4888 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4889 Use it in the error message.
4890 * assign.cs, expression.cs, statement.cs: Update.
4892 2005-05-30 Raja R Harinath <rharinath@novell.com>
4895 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4896 the "almostMatchedMember" case too.
4897 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4898 that failed the accessibility checks to 'almost_match'.
4900 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4902 * attribute.cs: Use internal MethodBuilder methods to set
4903 ExactSpelling and SetLastError on PInvoke methods, instead
4904 of passing them via charset. Fixes #75060.
4906 2005-05-27 Raja R Harinath <rharinath@novell.com>
4908 * parameter.cs (Parameter): Remove TODO comment.
4909 (Parameter.DefineParameter): Remove Location parameter.
4910 (Parameters.LabelParameters): Likewise.
4911 * class.cs (Constructor.Emit): Update to change.
4912 (MethodData.Emit): Likewise.
4913 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4914 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4916 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4919 Removed Parameters.Location and added Parameter.Location instead.
4920 Removed Location parameter from Emit() and GetSignature().
4927 Modified all related calls.
4929 2005-06-21 Martin Baulig <martin@ximian.com>
4931 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4932 left-hand side is not a nullable type; fixes #75328.
4934 2005-06-21 Martin Baulig <martin@ximian.com>
4937 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4938 (TypeManager.GetFullNameSignature): Likewise.
4940 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4941 `source.FullName' and `target.FullName' to check whether there are
4942 two conflicting definitions.
4944 2005-06-21 Martin Baulig <martin@ximian.com>
4946 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4947 a BoxedCast - also for reference types - to be compatible with csc.
4949 2005-06-21 Martin Baulig <martin@ximian.com>
4951 * expression.cs (MemberAccess.DoResolve): Add support for nested
4952 types in a generic instance; fixes #75320.
4954 2005-06-20 Martin Baulig <martin@ximian.com>
4956 * generic.cs (TypeManager.InferType): Also walk the class
4957 hierarchy for generic instances; fixes #75261.
4959 2005-06-17 Martin Baulig <martin@ximian.com>
4961 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4962 to make things work for corlib.
4964 2005-06-15 Martin Baulig <martin@ximian.com>
4966 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4967 obsolete `SecurityAction' values.
4969 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4971 * rootcontext.cs: Reset TargetExt as well.
4973 2005-06-09 Martin Baulig <martin@ximian.com>
4975 * delegate.cs (Delegate.VerifyMethod): Added
4976 `MethodGroupExpr old_mg' argument; inherit its
4977 `HasTypeParameters'; fix #75085.
4979 2005-06-09 Martin Baulig <martin@ximian.com>
4981 * expression.cs (Invocation.OverloadResolve): Correctly handle
4982 generic methods for the SetMemberIsUsed(); fix #75064.
4984 2005-06-09 Martin Baulig <martin@ximian.com>
4986 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4989 2005-06-08 Martin Baulig <martin@ximian.com>
4991 * cs-parser.jay (nullable_type_or_conditional): If we put the
4992 nullable back and our `type' is a `ComposedCast', remove the
4993 nullable from it. Fixes #75156.
4995 * expression.cs (ComposedCast.RemoveNullable): New public method.
4997 2005-06-08 Martin Baulig <martin@ximian.com>
4999 The big Iterators rewrite :-)
5001 * iterators.cs: Rewrite this to use the anonymous methods framework.
5003 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5004 before the TypeContainers; see 2test-21.cs.
5007 (TypeContainer.DefineType): Don't create a new EmitContext if we
5008 already have one (this only happens if we're an Iterator).
5009 (TypeContainer.Define): Also call Define() on all our iterators.
5010 (Method.CreateEmitContext): Added support for iterators.
5013 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5014 (AnonymousContainer.CreateMethodHost): Moved here from
5015 AnonymousMethod and made abstract.
5016 (AnonymousContainer.CreateScopeType): New abstract method.
5017 (AnonymousContainer.IsIterator): New public property.
5018 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5019 get the ScopeTypeBuilder rather than manually defining it here.
5020 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5023 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5024 before RootContext.DefineTypes().
5026 * codegen.cs (EmitContext.RemapToProxy): Removed.
5027 (EmitContext.CurrentAnonymousMethod): Changed type from
5028 AnonymousMethod -> AnonymousContainer.
5029 (EmitContext.ResolveTopBlock): Protect from being called twice.
5030 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5031 (EmitContext.EmitThis): Removed the iterators hacks; use the
5032 anonymous methods framework for that.
5035 (ToplevelBlock.Container): Make this a property, not a field.
5036 (ToplevelBlock.ReParent): New public method; move the
5037 ToplevelBlock into a new container.
5038 (Foreach.TemporaryVariable): Simplify.
5040 2005-06-05 Martin Baulig <martin@ximian.com>
5042 * statement.cs (LocalInfo.CompilerGenerated): New flag.
5043 (Block.AddTemporaryVariable): New public method; creates a new
5044 `LocalInfo' for a temporary variable.
5045 (Block.EmitMeta): Create the LocalBuilders for all the temporary
5047 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5048 non-iterator variables.
5050 2005-06-05 Martin Baulig <martin@ximian.com>
5052 * statement.cs (Foreach.TemporaryVariable): Create the
5053 LocalBuilder in the Emit phase and not in Resolve since in some
5054 situations, we don't have an ILGenerator during Resolve; see
5055 2test-19.cs for an example.
5057 2005-06-04 Martin Baulig <martin@ximian.com>
5059 The big Foreach rewrite - Part II.
5061 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5062 with `PropertyInfo ienumerator_getcurrent'.
5064 * codegen.cs (VariableStorage): Removed.
5067 (Foreach): Derive from Statement, not ExceptionStatement.
5068 (Foreach.CollectionForeach): New nested class. Moved all the code
5069 dealing with collection foreach here.
5070 (Foreach.ForeachHelperMethods): Removed.
5071 (Foreach.TemporaryVariable): Implement IMemoryLocation.
5073 2005-05-23 Martin Baulig <martin@ximian.com>
5075 * statement.cs (Try.DoResolve): Don't create a `finally' if we
5076 don't need to. Fix #75014.
5078 2005-05-26 Raja R Harinath <rharinath@novell.com>
5080 Improve user-defined conversion handling.
5081 * convert.cs (GetConversionOperators): Rewrite. Return only the
5082 applicable operators.
5083 (AddConversionOperators): New. Helper for GetConversionOperators.
5084 (FindMostEncompassedType, FindMostEncompassingType): Verify that
5085 there is only one most encompassed/encompassing type.
5086 (FindMostSpecificSource, FindMostSpecificTarget): Remove
5087 "applicable operator" handling.
5088 (UserConversion): Move cache here from GetConversionOperators.
5089 Directly cache the chosen operator, rather than the whole
5091 (ExplicitNumericConversion): Fix buggy implementation of Decimal
5092 case. Allow conversion of decimal to sbyte and byte too.
5093 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5094 New static methods. Used to avoid allocating EmptyExpressions in
5097 2005-05-24 Duncan Mak <duncan@novell.com>
5099 * ecore.cs (CastFromDecimal): New class for casting a decimal to
5100 another class, used in Convert.ExplicitNumericConversion.
5101 (CastToDecimal): New class, similar to above, but casts to
5102 System.Decimal, used in Convert.ImplicitNumericConversion and also
5103 in explicit convesion from double/float to decimal.
5105 * convert.cs (ImplicitNumericConversion): Handle implicit
5106 conversions to System.Decimal.
5107 (ExplicitNumericConversion): handle explicit conversions to
5112 2005-05-20 Miguel de Icaza <miguel@novell.com>
5114 * typemanager.cs: Do not throw an exception in the TypeBuilder
5115 case, we take care of it on the TypeCode.
5117 2005-05-17 Marek Safar <marek.safar@seznam.cz>
5119 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5122 * cs-parser.jay: Catch more lexical errors.
5124 * report.cs: Add one more Error method.
5127 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5129 2005-05-20 Martin Baulig <martin@ximian.com>
5131 * class.cs (TypeContainer.CircularDepException): Removed.
5132 (TypeContainer.DefineType): Removed the `InTransit' stuff.
5133 (TypeContainer.CheckRecursiveDefinition): Check for circular class
5134 (CS0146) and interface (CS0529) dependencies here.
5136 2005-05-20 Martin Baulig <martin@ximian.com>
5138 * expression.cs (New.DoResolve): Move the CS0712 check above the
5139 CS0144 check; otherwise it can never be reached.
5141 2005-05-20 Martin Baulig <martin@ximian.com>
5143 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
5145 2005-05-20 Martin Baulig <martin@ximian.com>
5147 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
5149 * typemanager.cs (TypeManager.IsAttributeType): New public method.
5151 2005-05-19 Martin Baulig <martin@ximian.com>
5154 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5155 to disable error reporting.
5157 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5158 here since we don't want to report an error; see the new test-336.cs.
5160 2005-05-19 Raja R Harinath <rharinath@novell.com>
5162 * statement.cs (ToplevelBlock.GetParameterReference)
5163 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5164 Move here from class Block.
5165 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5166 * expression.cs (ParameterReference.DoResolveBase): Likewise.
5168 2005-05-18 Martin Baulig <martin@ximian.com>
5173 (FlowBranching.Reachability): Add non-static public And() and Or()
5175 (FlowBranchingSwitch): New class; do the `break_origins' thing
5176 like in FlowBranchingLoop.
5177 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5178 reachability, not just locals and parameters.
5179 (FlowBranching.MergeChild): Remove some of the hacks for loop and
5180 switch; MergeBreakOrigins() now takes care of that.
5182 2005-05-18 Martin Baulig <martin@ximian.com>
5184 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5185 a loop and may leave it, reset the barrier; fixes #74974.
5187 2005-05-16 Raja R Harinath <rharinath@novell.com>
5189 Fix test-382.cs. Emit values of decimal constants.
5190 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5192 (TypeContainer.AddField): ... this.
5193 (TypeContainer.EmitFieldInitializers): Allow the list of fields
5194 with initializers to include 'Const's.
5195 (ClassPart.RegisterFieldForInitialization): Forward to
5197 * const.cs (Const.Const): Pass initializer to base class.
5198 (Const.Define): In case of decimal constants, register them for
5199 initialization in a static constructor.
5201 2005-05-14 Martin Baulig <martin@ximian.com>
5203 * statement.cs (Block.Resolve): Correctly handle unreachable code;
5204 do not call ResolveUnreachable() on unreachable statements in
5205 here, see the comment in the source code.
5207 2005-05-13 Raja R Harinath <rharinath@novell.com>
5210 * expression.cs (BinaryResolveOperator): If one of the operands of
5211 an equality comparison is 'null' and the other is a pointer type,
5212 convert the null to a NullPointer.
5213 * convert.cs (ImplicitReferenceConversion): If the expression is a
5214 NullLiteral and the target type is a pointer type, return a
5215 NullPointer instead.
5216 (ImplicitConversionStandard): Likewise.
5218 2005-05-13 Marek Safar <marek.safar@seznam.cz>
5220 * cs-parser.jay: Set readonly context based on special constructs.
5222 * expression.cs (LocalVariableReference.DoResolveBase): Improved
5223 readonly variable error handling.
5225 * rootcontext.cs (EmitCode): Don't verify members when error
5228 * statement.cs (LocalInfo): Add reaodnly context information.
5229 (SetReadOnlyContext, GetReadOnlyContext): New methods.
5231 2005-05-17 Martin Baulig <martin@ximian.com>
5233 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5236 2005-05-13 Martin Baulig <martin@ximian.com>
5238 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
5239 handle unreachable blocks.
5241 2005-05-13 Martin Baulig <martin@ximian.com>
5244 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
5245 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
5248 2005-05-13 Martin Baulig <martin@ximian.com>
5250 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5251 instance variable, not a local. Fix #74873.
5252 (Block.ResolveUnreachable): Set it to true here.
5254 2005-05-12 Martin Baulig <martin@ximian.com>
5256 * cs-parser.jay (property_declaration): Pass the `current_class',
5257 not the `current_container' to Property's .ctor. Fixes #74912.
5259 2005-05-11 Martin Baulig <martin@ximian.com>
5261 * typemanager.cs (Closure): Copy this from MCS and merge all the
5262 GMCS-specific changes into it.
5264 2005-05-12 Raja R Harinath <harinath@gmail.com>
5267 * typemanager.cs (unmanaged_enclosing_types): New.
5268 (IsUnmanagedType): Avoid infloops by using
5269 'unmanaged_enclosing_types' to talk with recursive invocations.
5271 2005-05-11 Duncan Mak <duncan@novell.com>
5273 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5274 continuing to process for 'arg'.
5275 (handle_preprocessing_directive): Check the argument of the #endif
5276 directive and report error CS1025 if there are any trailing
5279 According to the C# spec, having even whitespace after the #endif
5280 directive is illegal; however, because we call arg.TrimEnd ()
5281 beforehand, we have the same behavior as csc, allowing whitespace
5282 after the directive.
5286 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5290 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5291 (Constructor.GetObsoleteAttribute): Implemented correctly.
5293 2005-05-10 Martin Baulig <martin@ximian.com>
5295 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
5296 resolve the type; fixes #74864.
5297 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
5298 in DoResolve(); fixes #74862.
5300 2005-05-10 Martin Baulig <martin@ximian.com>
5302 * support.cs (ReflectionParameters.ParameterModifier): Use
5303 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5304 and `ParameterAttributes.In'. Fixes #74884.
5306 2005-05-10 Martin Baulig <martin@ximian.com>
5308 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
5309 the cache if we're just looking for `MemberTypes.NestedType' in a
5312 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
5313 constraints if we're still resolving the type tree.
5314 (Expression.MemberLookup): If we're resolving the type tree, only
5315 look for `MemberTypes.NestedType' since we're only interested in
5318 * class.cs (TypeContainer.DefineType): Don't resolve the type
5319 parameters here; do this later in ResolveType() after the type
5320 tree has been resolved.
5321 (TypeContainer.ResolveType): New public method; this is called
5322 after the type tree is resolved and before the types are being
5323 populated. We resolve the generic constraints here.
5324 (TypeContainer.DoDefineMember): Check the constraints on our base
5325 class and interfaces.
5327 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
5328 set the `ResolvingTypeTree' flag on the EmitContext.
5330 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
5332 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5334 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5336 * expression.cs (Argument.GetParameterModifier): Turned to property.
5337 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5339 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5342 2005-05-09 Raja R Harinath <rharinath@novell.com>
5345 * decl.cs (MemberCache.AddMethods): Register override methods,
5346 rather than non-override methods.
5347 * typemanager.cs (RegisterOverride): New.
5348 (IsOverride): Update.
5350 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5352 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
5354 2005-05-06 Martin Baulig <martin@ximian.com>
5357 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5358 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
5360 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5364 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5365 recursive declaration.
5367 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5369 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5371 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5373 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5375 2005-05-05 Raja R Harinath <rharinath@novell.com>
5378 * decl.cs (DeclSpace.FamilyAccessible):
5379 Use TypeManager.IsNestedFamilyAccessible.
5381 Fix reopened #64812.
5382 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5385 2005-05-04 Raja R Harinath <rharinath@novell.com>
5386 Abin Thomas <projectmonokochi@rediffmail.com>
5387 Anoob V E <projectmonokochi@rediffmail.com>
5388 Harilal P R <projectmonokochi@rediffmail.com>
5391 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5392 allow access to all static members.
5394 2005-05-04 Martin Baulig <martin@ximian.com>
5396 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5398 2005-05-04 Martin Baulig <martin@ximian.com>
5402 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5403 section at the end; make things work if `default' is not the last
5406 2005-05-04 Martin Baulig <martin@ximian.com>
5410 * statement.cs (Switch): Replaced the `got_default' field with a
5411 `default_section' one.
5412 (Switch.CheckSwitch): Set `default_section' here.
5413 (Switch.Resolve): If we're a constant switch and the constant is
5414 not found, use the default section.
5416 2005-05-03 Martin Baulig <martin@ximian.com>
5418 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5420 * statement.cs (Foreach.ArrayForeach): New nested class.
5421 (Foreach.TemporaryVariable): New nested class.
5422 (Foreach.EmitArrayForeach): Removed; this is now in the new
5425 2005-05-03 Raja R Harinath <rharinath@novell.com>
5427 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5429 (VerifyPendingMethods): Revert change below.
5431 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5432 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5433 that used to trigger warning -28. Remove warning -28.
5434 * expression.cs (Invocation.OverloadResolve): Use
5435 TypeManager.IsOverride to distinguish override methods.
5438 * pending.cs (VerifyPendingMethods): If a base type implements the
5439 requested interface, don't bother checking individual methods of
5440 the base type. As a side-effect, this prevents the creation of
5441 unnecessary proxies.
5443 2005-05-02 Martin Baulig <martin@ximian.com>
5447 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5448 Also `And' the locals if the old vector is null.
5449 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5450 null; in this case we basically reset all the variables.
5452 2005-05-02 Martin Baulig <martin@ximian.com>
5456 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5457 Added `FlowBranching branching' argument; always `and' the
5458 variables instead of `or'ing them unless we're an infinite loop.
5460 * statement.cs (While.Resolve): Create a new sibling unless we're
5463 2005-05-02 Martin Baulig <martin@ximian.com>
5467 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5468 arguments; use it instead of creating a new TopLevelBlock.
5469 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5470 our ConstructorInitializer.
5473 (TopLevelBlock.TopLevelBranching): New public property.
5474 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5475 and create our `TopLevelBranching'.
5477 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5478 anonymous method host, use `block.TopLevelBranching' rather than
5479 creating a new branching.
5481 2005-04-20 Miguel de Icaza <miguel@novell.com>
5483 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5484 a ScopeInfo, if any of the current children is a child of the new
5485 entry, move those children there.
5487 2005-04-30 Martin Baulig <martin@ximian.com>
5489 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5490 at the beginning of a SwitchSection. Fix #73335.
5492 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5495 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5497 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5498 (FieldExpr.DoResolve): Obsolete members are ignored for field
5501 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5503 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5504 of arrays detection.
5506 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5508 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5510 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5513 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5515 * cs-parser.jay: Use the prefered version of -unsafe in error
5518 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5520 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5523 2005-04-20 John Luke <john.luke@gmail.com>
5525 * driver.cs: fix typo in error message, --outout to --output
5527 2005-04-30 Martin Baulig <martin@ximian.com>
5529 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
5530 handle the .NET 2.x security attributes.
5532 2005-04-30 Martin Baulig <martin@ximian.com>
5535 (TypeManager.ExpandInterfaces): Don't add things twice.
5538 (TypeContainer.VerifyClsCompliance): Allow generic instances.
5540 2005-04-29 Martin Baulig <martin@ximian.com>
5542 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
5544 * anonymous.cs: Added support for anonymous generic methods.
5546 2005-04-29 Martin Baulig <martin@ximian.com>
5548 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
5551 2005-04-29 Martin Baulig <martin@ximian.com>
5553 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
5555 * expression.cs (New.DoResolve): Fix the CS0304 check.
5557 2005-04-29 Martin Baulig <martin@ximian.com>
5559 * typemanager.cs (TypeManager.GetFullName): Updated to the new
5562 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
5563 explicit interface implementation, compare the interface types.
5564 (MethodData.Define): Use the new naming scheme from the latest
5566 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
5568 * decl.cs (MemberName.GetMemberName): Removed.
5569 (MemberName.MethodName, FullName): New properties.
5571 2005-04-25 Raja R Harinath <rharinath@novell.com>
5573 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
5575 2005-04-22 Martin Baulig <martin@ximian.com>
5577 * generic.cs (GenericMethod): Create the EmitContext in the
5578 `Define()'; in `Define(MethodBuilder)', create the type parameters
5579 before calling `Define()'. Fixes #73933.
5581 2005-04-22 Martin Baulig <martin@ximian.com>
5584 (Constraints.Resolve): Make things work wrt. the new type lookup system.
5585 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
5587 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
5588 ConstructedType, check its constraints.
5590 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5592 * codegen.cs (InRefOutArgumentResolving): New field.
5594 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5595 fields outside contructor.
5597 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5599 2005-04-19 Miguel de Icaza <miguel@novell.com>
5601 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5602 parameter code was not completed ever, so it was not as up-to-date
5603 as local variables. Must finish it.
5605 The bug fix was to compare the Toplevel of the block, not the
5606 current block. Thanks for Ben for pointing this out.
5608 2005-04-19 Raja R Harinath <rharinath@novell.com>
5610 * decl.cs (AddMethods): Use the declaring type of the problem
5611 method to determine if we want to squash a warning.
5613 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5615 * attribute.cs: Removed debug output.
5617 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5619 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5622 2005-04-18 Raja R Harinath <rharinath@novell.com>
5625 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5626 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5627 all null comparisons against reference types.
5629 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5632 * class.cs (TypeContainer.CircularDepException) New nested
5634 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5635 (TypeContainer.DefineType): Removed error, reset InTransit before
5637 (Class.DefineType): Throw exception when is in Transit.
5638 Catch exception and report error.
5639 (Struct.DefineType): Throw exception when is in Transit.
5640 Catch exception and report error.
5641 (Interface.DefineType): Throw exception when is in Transit.
5642 Catch exception and report error.
5644 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5645 handle nested exception handlers.
5647 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5650 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5651 InFinally and InCatch storage.
5653 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5654 (Catch.Resolve): Set and Restore ec.InCatch.
5655 (Try.Resolve): Set and Restore ec.InFinally.
5656 (Try.HasCatch): True when try has catch.
5658 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5660 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5661 for the same event member, so exclude such cases from warning 419.
5664 2005-04-16 Miguel de Icaza <miguel@novell.com>
5666 * expression.cs (Binary.ResolveOperator): Apply patch from John
5667 Luke to fix bug 59864: operators &, | and ^ on enumerations
5668 require that the same enum type on both sides.
5670 * driver.cs: Add warnings to old flag usage, this is to assist
5671 people who produce Makefiles and hope that the Makefiles will be
5674 * class.cs (TypeContainer.EmitType): Moved the definition of the
5675 special $PRIVATE$ field from the resolve phase to the Emit phase.
5676 During resolve we do not know if we are a struct with
5677 HasExplicitLayout, we know this only after the attributes for the
5680 Set the FieldOffset to zero on the dummy field that we create for
5681 the class. Fixes 74590.
5683 2005-04-16 Raja R Harinath <rharinath@novell.com>
5686 * ecore.cs (PropertyExpr.resolved): New.
5687 (DoResolve): Use it to handle a case of double resolution here.
5688 Handle a case of identical-name-and-type-name.
5689 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5690 resolution by storing the results of expression resolution back
5691 into the "probes" array.
5693 2005-04-15 Raja R Harinath <rharinath@novell.com>
5695 Fix cs0208-7.cs and cs0208-8.cs.
5696 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5697 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5698 error reporting to point out the reason a struct is not unmanaged.
5700 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5702 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5703 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5705 2005-04-13 Raja R Harinath <rharinath@novell.com>
5708 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5709 IdenticalNameAndTypeName here.
5710 (EventExpr.InstanceResolve): Likewise.
5712 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5714 C# 2.0 DefaultCharSetAttribute implementation
5716 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5717 which allows us to set GlobalNamespace for every resolve.
5718 (Attribute.ResolveArguments): Cut from Resolve.
5719 (Attribute.GetCharSetValue): Returns CharSet named argument.
5720 (Attribute.DefinePInvokeMethod): Gets default charset from
5722 (GlobalAttribute.ResolveAsTypeStep): Override.
5723 (GlobalAttribute.ResolveArguments): Override.
5725 * class.cs (TypeAttr): Is protected.
5727 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5728 (ModuleClass.DefaultCharSetType): New memeber.
5729 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5731 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5732 charset from module.
5734 * delegate.cs (TypeAttr): Override.
5735 (Delegate.DefineType): Use this TypeAttr.
5737 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5738 at very early stage (before types are defined) to resolve model
5739 module attributes. It will probably not work with corlib but it
5742 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5743 charset from module.
5745 * typemanager.cs (default_charset_type): New type.
5747 2005-04-13 Raja R Harinath <rharinath@novell.com>
5749 * decl.cs (MemberCache.AddMethods): Don't warn if
5750 System.Object.Finalize has buggy MethodAttributes.
5752 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5755 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5757 * doc.cs : detect ambiguous reference to overloaded members.
5758 Fixed bug #71603. MS 1.1 csc does not detect it.
5760 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5762 * doc.cs : delegates must not be referenced with parameters.
5765 2005-04-12 Miguel de Icaza <miguel@novell.com>
5767 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5769 2005-04-10 Miguel de Icaza <miguel@novell.com>
5771 * driver.cs (MainDriver): Stop processing if the CLS stage found
5774 (CompilerCallableEntryPoint.InvokeCompiler): Always
5775 reset after execution; Take a TextWriter argument for the
5778 * report.cs: Use the error stream instead of hardcoding stderr.
5780 2005-04-09 Miguel de Icaza <miguel@novell.com>
5782 * class.cs: Reduce code paths to test, too small of an
5783 optimization to make it worth the extra testing. Always perform
5786 2005-04-08 Raja R Harinath <rharinath@novell.com>
5789 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5790 operators that had errors reported on them.
5792 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5794 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5796 (Attribute.Resolve): Add named argument type checking.
5798 * class.cs (FixedField.Define): Use IsPrimitiveType
5800 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5802 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5803 unsafe parameter types.
5805 * statement.cs (Using.ResolveExpression): Add better error description.
5807 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5809 2005-04-08 Raja R Harinath <rharinath@novell.com>
5812 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5813 AttributeUsageAttribute in the emitcontext of the attribute class,
5814 not in the emitcontext of the attributable entity it was attached to.
5815 * cs-parser.jay: Use 'current_class', not 'current_container',
5816 when creating a GlobalAttribute.
5818 2005-04-08 Alp Toker <alp@atoker.com>
5820 * pending.cs: The fix to #58413 failed to compile methods implementing
5821 interfaces with/without params modifiers and vice versa, even though
5822 params modifiers aren't part of the signature. Make the modifier check
5823 less strict as in csc.
5825 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5826 Anoob V E <projectmonokochi@rediffmail.com>
5827 Harilal P R <projectmonokochi@rediffmail.com>
5830 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5831 modifiers of pending methods.
5832 (PendingImplementation.PendingImplementation): Initialize it.
5833 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5834 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5835 with ParameterData. Add check for modifiers.
5836 * class.cs (MethodData.Define): Update to changes.
5838 2005-04-07 Raja R Harinath <rharinath@novell.com>
5840 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5842 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5844 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5847 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5850 * typemanager.cs: Registered RequiredAttributeAttribute.
5852 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5854 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5855 Warning CS0169 is back at level 3.
5856 (IMethodData.SetMemberIsUsed): New method.
5858 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5859 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5861 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5863 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5865 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5868 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5871 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5872 to avoid the problems with nested types.
5874 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5875 Anoob V.E <projectmonokochi@rediffmail.com>
5876 Harilal P.R <projectmonokochi@rediffmail.com>
5877 Raja R Harinath <rharinath@novell.com>
5880 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5882 * typemanager (GetConstructor): Make public.
5884 2005-04-05 John Luke <john.luke@gmail.com>
5885 Raja R Harinath <rharinath@novell.com>
5888 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5889 struct too. Return false quicker in a few cases.
5890 (VerifyUnManaged): Use it.
5892 2005-04-05 Raja R Harinath <rharinath@novell.com>
5895 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5896 not 'unreachable_seen'.
5898 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5900 * attribute.cs (Attribute.GetValue): Removed unused.
5902 * codegen.cs (CodeGen.TrimExt): Removed unused.
5904 * cs-parser.jay (output): Removed unused.
5906 * cs-tokenizer.cs (hex_digits): Removed unused.
5908 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5910 * expression.cs (Indirection.LoadExprValue): Removed unused.
5911 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5913 * iterators.cs (Iterator.param_types): Removed unused.
5915 * statement.cs (Goto.block): Removed unused.
5916 (ToplevelBlock.did): Removed unused.
5917 (Switch.ResolveConstantSwitch): Removed unused.
5919 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5921 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5924 2005-04-19 Martin Baulig <martin@ximian.com>
5926 Merged r42462 from MCS and made it work for GMCS.
5928 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5930 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5932 2005-04-01 Raja R Harinath <rharinath@novell.com>
5934 Fix #74232 and cs0208-3.cs.
5935 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5936 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5937 unmanaged type. Don't use FieldBuilders when 't' is a
5938 TypeBuilder. Use ModFlags and MemberType fields.
5939 * class.cs (MemberBase.member_type): Rename from MemberType.
5940 (MemberBase.MemberType): New property. Determines member_type on
5942 (MemberBase.DoDefine): Don't initialize MemberType here.
5943 (FieldMember.Define): Likewise.
5945 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5948 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5949 Attributes are emitted there.
5951 2005-04-01 Raja R Harinath <rharinath@novell.com>
5953 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5954 keyword in 'partial enum' too.
5955 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5957 Report from Kamil Skalski <nazgul@omega.pl>.
5960 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5961 have partial containers too.
5963 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5964 in block' checks to Block.CheckInvariantMeaningInBlock.
5965 * statement.cs (Block.GetKnownVariableInfo): Make private.
5966 (Block.IsVariableUsedInChildBlock): Remove.
5967 (Block.IsVariableUsedInBlock): Likewise.
5968 (Block.CheckInvariantMeaningInBlock): New. Show location of
5969 conflicting declaration.
5970 (Block.AddVariable): Make error messages less long-winded and more
5971 specific. Show location of conflicting declaration.
5972 * parameter.cs (Parameters.Location): New readonly property.
5974 2005-03-31 Raja R Harinath <rharinath@novell.com>
5976 Clean up semantics of invoking ResolveMemberAccess.
5977 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5978 can have an instance, ensure that we pass in a non-TypeExpression
5979 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5980 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5981 argument. Update to changes and simplify.
5982 (FieldExpr.Emitinstance): Remove CS0120 check.
5983 (PropertyExpr.EmitInstance): Likewise.
5984 * expression.cs (Argument.Resolve): Likewise.
5985 (Invocation.DoResolve): Update to changes in semantics of
5988 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5991 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5994 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5996 2005-03-31 Raja R Harinath <rharinath@novell.com>
5998 Fix difference in behaviour with commandline invocation.
5999 * driver.cs (Driver.Reset): New.
6000 (CompilerCallableEntryPoint): Call it.
6002 * statement.cs (If.Resolve): Avoid spurious "uninitialized
6003 variable" warnings if the boolean expression failed to resolve.
6005 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
6007 * attribute.cs: Fix the union of several permissions when some of them
6008 are unrestricted (so the result isn't an unrestricted permission set).
6011 2005-03-30 Raja R Harinath <rharinath@novell.com>
6013 * ecore.cs (MemberExpr): New class. Convert from interface
6015 (MemberExpr.ResolveMemberAccess): Refactor and move here from
6016 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
6018 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6019 (MethodGroupExpr.IsExplicitImpl): Remove.
6020 (Expression.GetFieldFromEvent): Remove.
6021 (SimpleName.MemberStaticCheck): Remove.
6022 (SimpleName.DoSimpleNameResolve): Update to changes.
6023 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6024 (MemberAccess.IdenticalNameAndTypeName): Remove.
6025 (MemberAccess.error176): Move to MemberExpr.
6026 (MemberAccess.DoResolve): Update to changes.
6027 (BaseAccess.DoResolve): Likewise.
6029 2005-03-30 Marek Safar <marek.safar@seznam.cz>
6031 C# 2.0 Conditional attribute class implementation
6033 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6034 Analyzes class whether it has attribute which has ConditionalAttribute
6035 and its condition is not defined.
6037 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6038 (Class.IsExcluded): New method. Search for at least one defined
6039 condition in ConditionalAttribute of attribute class.
6041 2005-03-30 Raja R Harinath <rharinath@novell.com>
6043 * ecore.cs (PropertyExpr): Derive from Expression, not
6044 ExpressionStatement.
6045 (PropertyExpr.EmitStatement): Remove.
6047 2005-03-29 Raja R Harinath <rharinath@novell.com>
6050 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6051 internal field "value__" of an enum be private. The examples for
6052 "value__" that I found on MSDN all used FieldAttributes.Private.
6054 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6055 Don't mention IL method attribute names.
6057 Fix #47991. Remove a TODO.
6058 * statement.cs (Block.Toplevel): Make into a field.
6059 (Block.Parameters): Move into ToplevelBlock.
6060 (Block.known_variables): Rename from child_variable_names.
6061 (Block.Block): Remove variants that take Parameters. Initialize
6062 'Toplevel' with the immediately surrounding toplevel block.
6063 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
6064 LocalInfo parameter.
6065 (Block.GetKnownVariableInfo): New.
6066 (Block.IsVariableNameUsedInChildBlock): Update.
6067 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
6068 the block, even though it may not be in scope.
6069 (Block.AddVariable): Remove Parameters parameter. Use
6070 Toplevel.Parameters instead.
6071 (Block.AddConstant): Remove Parameters parameter.
6072 (Block.GetParameterReference): Update to use Toplevel.Parameters.
6073 (Block.IsParamaterReference): Likewise.
6074 (Block.IsLocalParameter): Likewise. Simplify a lot.
6075 (ToplevelBlock.Parameters): New. Moved from Block.
6076 (ToplevelBlock.ToplevelBlock): Update to changes. Always
6077 initialize Parameters to a non-null value.
6078 * cs-parser.jay: Update to changes.
6079 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6080 simple names that mean different things in the same block. Use
6081 Block.IsVariableNameUsedInBlock.
6083 2005-03-28 Raja R Harinath <rharinath@novell.com>
6085 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6087 2005-03-26 Raja R Harinath <harinath@acm.org>
6090 * assign.cs (Assign.DoResolve): When the RHS of an assignment
6091 fails to resolve, ensure that the LHS is still resolved as an
6094 2005-03-25 Raja R Harinath <harinath@acm.org>
6096 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6098 (Enum.current_ec): Remove.
6099 (Enum.LookupEnumValue): Remove EmitContext argument.
6100 Just uses the one created during DefineType.
6101 (Enum.FindMembers): Update.
6102 * expression.cs (MemberAccess.DoResolve): Update.
6104 2005-03-22 Marek Safar <marek.safar@seznam.cz>
6106 * assign.cs (Assign.DoResolve): Check for CS1717 when
6107 source and target are same (uses Equals).
6109 * expression.cs (LocalVariableReference, ParameterReference,
6110 This): Implemented Equals, GetHashCode.
6112 * statement.cs (Block.GetParameterReference): Removed useless
6115 2005-03-22 Raja R Harinath <rharinath@novell.com>
6118 * statement.cs (Block.AddVariable): Ensure that we skip implicit
6119 blocks before deciding whether the error is cs0136 or cs0128.
6121 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6122 (using_alias_directive, using_namespace_directive): Pass
6123 MemberName, not an expression to Namespace.UsingAlias and
6125 (MakeName): Use the MemberName of the namespace.
6126 * namespace.cs (Namespace.MemberName): New.
6127 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6128 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6130 * decl.cs (MemberName.Name): Make readonly.
6131 (MemberName.FromDotted): New "constructor".
6132 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6133 (MemberCore.Name): Compute from MemberName on demand.
6134 (MemberCore.SetMemberName): Provide a way to change the
6136 (MemberCore.AddToContainer): Don't take a fullname parameter.
6137 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6138 fully qualified name of the container to the member name.
6139 (TypeContainer.AddToTypeContainer): Use a fully qualified name
6140 only if the type is a member of the root container.
6141 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6142 MemberName.Left rather than searching for an embedded ".".
6143 (PartialContainer.CreatePart): Update to changes in RootContext.
6144 (MemberBase.ShortName): Turn into a property. Use
6145 MemberCore.SetMemberName.
6146 (MemberBase.ExplicitInterfaceName): Remove.
6147 (MemberBase.UpdateMemberName): Remove.
6148 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6149 (PropertyBase.SetMemberName): New override.
6150 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6151 (Tree.GetDecl): New.
6152 (Tree.AllDecls): Rename from Decls.
6153 * attribute.cs, enum.cs, report.cs: Update to changes.
6154 * driver.cs (MainDriver): Use MemberName.FromDotted on
6155 RootContext.MainClass.
6157 2005-03-21 Marek Safar <marek.safar@seznam.cz>
6159 * class.cs (FixedField.Define): Check for CS1664 and more sanity
6162 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6164 2005-03-18 Marek Safar <marek.safar@seznam.cz>
6166 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6167 property accessor modifiers.
6169 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6170 fixed buffer attribute (CS1716).
6171 (PropertyMethod.HasCustomAccessModifier): When property accessor
6172 has custom modifier.
6174 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6176 (PropertyExpr.DoResolveLValue): Add CS0272.
6178 2005-03-17 Miguel de Icaza <miguel@novell.com>
6180 * convert.cs: When converting to a pointer, use the proper Conv.U
6181 or Conv.I depending on the source data type.
6183 * cs-tokenizer.cs: Make the size for large decimal constants,
6186 2005-03-17 Martin Baulig <martin@ximian.com>
6188 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6189 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6191 2005-03-17 Martin Baulig <martin@ximian.com>
6193 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6194 to bool so we can return an error condition.
6195 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6198 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
6200 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6203 2005-03-16 Raja R Harinath <rharinath@novell.com>
6205 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6206 Refactor to avoid traversing the list of assemblies, and to avoid
6207 string concatenation.
6208 * typemanager.cs (guid_attr_type): Remove.
6209 (negative_hits, pointers, references): Remove hashes.
6211 (GetConstructedType): New. Uses type_hash to handle constructed
6212 types (arrays, references, pointers).
6213 (GetReferenceType, GetPointerType): Use it.
6214 (GetNestedType): New. Uses type_hash to handle nested types of
6216 (LookupType, LookupTypeDirect): Remove.
6217 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
6218 'types' hash and LookupTypeReflection directly.
6219 (params_string, params_object): Use GetConstructedType.
6220 * namespace.cs (Namespace.cached_types): New. Cache of reflected
6222 (Namespace.Lookup): Use cached_types.
6223 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6224 provided by old TypeManager.LookupType.
6225 * rootcontext.cs (MakeFQN): Remove.
6226 * decl.cs (DeclSpace.MakeFQN): Likewise.
6227 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6228 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6229 TypeManager.GetConstructedType.
6230 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6232 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
6234 * cs-parser.jay: Fix build.
6236 2005-03-15 Marek Safar <marek.safar@seznam.cz>
6238 * class.cs (TypeContainer.CircularDepException) New nested
6239 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
6241 * cs-parser.jay: Reports CS1527 for any namespace element.
6243 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6246 * expression.cs (ParameterReference.IsAssigned): Changed error to
6248 (Error_WrongNumArguments): Moved CS0245 detection here.
6250 * statement.cs (Return.Resolve): Add CS1622 report.
6252 2005-03-11 Marek Safar <marek.safar@seznam.cz>
6254 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6256 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
6258 * attribute.cs expression.cs: Get rid of some allocations.
6260 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
6262 * doc.cs : just eliminate the latest change.
6264 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6266 * doc.cs : commented out the latest change. It breaks xml-030.cs
6268 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6270 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6271 fail. So invoke CreateType() in FindDocumentedType().
6273 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6275 * cs-tokenizer.cs : added IsKeyword().
6276 * doc.cs : Detect keyword incorrectly used as identifier.
6277 Allow identifiers prefixed by @.
6279 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6281 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6282 It caused exception in namespace resolving (again!).
6284 * class.cs (Class.ctor): Removed exit.
6285 (PropertyMethod.ctor): ditto.
6287 * codegen.cs (Codegen.Reset): Reset static data.
6288 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6290 * cs-tokenizer.cs (Cleanup): Removed.
6292 * driver.cs (GetSystemDir): Rewrote to one line command.
6293 It caused problem with unloaded dynamic modules.
6294 (UnixParseOption): Removed Exit.
6295 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6296 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6297 Now can be mcs used as library.
6299 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6302 * location.cs (Reset): Reset static data.
6304 * namespace.cs (Reset): Reset static data.
6306 * report.cs (Report.Reset): Reset static data.
6308 * rootcontext.cs (RootContext.Reset): Reset static data.
6310 * tree.cs (RootTypes.ctor): Use Location.Null
6312 * typemanager.cs (TypeManager.Reset): Reset static data.
6313 (CoreLookupType): Removed Exit.
6314 (TypeHandle.Reset): Reset static data.
6316 2005-03-10 Raja R Harinath <rharinath@novell.com>
6319 * typemanager.cs (ComputeNamespaces): Import namespaces from
6320 referenced modules too.
6322 2005-03-09 Raja R Harinath <rharinath@novell.com>
6324 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6327 2005-03-09 Raja R Harinath <rharinath@novell.com>
6329 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6330 enclosing DeclSpace. This ensures that a name-lookup populates
6331 more caches and there are fewer 'TypeExpression's. Carve out
6332 nested type lookup into ...
6333 (LookupNestedTypeInHierarchy): ... this.
6335 2005-04-15 Martin Baulig <martin@ximian.com>
6337 Merged r41590 from MCS and make it work in the generics land.
6339 * generic.cs (TypeParameter.UpdateConstraints): Removed the
6342 * class.cs (PartialContainer.UpdateConstraints): Removed.
6343 (PartialContainer.CheckConstraints): Removed.
6344 (PartialContainer.SetParameterInfo): Store the constraints here.
6345 (PartialContainer.DefineTypeParameters): New public method;
6346 resolve the type parameter's constraints here. Note that the
6347 PartialContainer doesn't have an EmitContext anymore, so we must
6348 do this in the ClassPart.
6350 2005-03-09 Raja R Harinath <rharinath@novell.com>
6352 Clean up a few partial-class semantics.
6353 Fixes test-357.cs and cs1618-2.cs.
6354 * cs-parser.jay (struct_declaration): Use 'current_class' as
6355 parent of newly-created struct. Remove call to Register ().
6356 Use 'pop_current_class' to complete handing the current struct.
6357 (interface_declaration): Likewise.
6358 (class_declaration): Likewise.
6359 (enum_declaration): Use 'current_class' as parent of newly created
6361 (delegate_declaration): Likewise.
6362 (pop_current_class): New function. This is used to handle closing
6363 up the 'current_class' and 'current_container', and pointing them
6364 to the enclosing class/container.
6365 (CSharpParser): Initialize 'current_class' too.
6366 * decl.cs (MemberCore): Add check for invariant: a partial
6367 container is not a parsed entity, and thus does not enclose any
6369 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6370 (DeclSpace.BaseTypeExpr): Use it.
6371 (DeclSpace.LookupType): Add check for invariant.
6372 * class.cs (TypeContainer): Add check for invariant: a nested
6373 class should have the same NamespaceEntry as its enclosing class.
6374 (TypeContainer.EmitFieldInitializers): Make virtual.
6375 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6377 (TypeContainer.Register): Remove.
6378 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6379 null. Use TypeResolveEmitContext for resolving base types and
6380 interfaces. Move initialization of Parts.TypeBuilder here from
6382 (TypeContainer.DefineNestedTypes): ... here.
6383 (PartialContainer): Take a Namespace not a NamespaceEntry.
6384 (PartialContainer.Create): Don't use Register. Call the
6385 appropriate Add... function directly.
6386 (ClassPart): Take both the PartialContainer and the enclosing
6387 class as constructor arguments.
6388 (ClassPart.EmitFieldInitializers): Override.
6389 (ClassPart.PartFindNestedTypes): Remove.
6390 (FieldBase.GetInitializerExpression): Resolve the initializer
6391 expression in the emit context of the enclosing class.
6392 * tree.cs (RootTypes): Remove Register ().
6394 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6396 * cs-parser.jay: Removed CS0134.
6398 * driver.cs: Removed CS1901.
6400 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6401 for predefined types.
6403 2005-03-07 Duncan Mak <duncan@novell.com>
6405 * codegen.cs (Save): Catch UnauthorizedAccessException as
6406 well. Fixes bug #73454.
6408 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6410 * cs-tokenizer.cs (xtoken): Add CS1035.
6412 * class.cs (MethodData.Define): Add CS0683.
6413 (FieldMember.ctor): Add CS0681.
6415 2005-03-07 Raja R Harinath <rharinath@novell.com>
6417 * ecore.cs (SimpleName.DoResolve): Rename from
6418 SimpleName.DoResolveAllowStatic.
6419 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6420 Pass 'intermediate' flag to MemberStaticCheck.
6421 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6422 of "intermediate" lookups via MemberAccess.
6423 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6424 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6426 2005-03-07 Raja R Harinath <rharinath@novell.com>
6429 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6430 slipped in because of variable names that are identical to a
6431 builtin type's BCL equivalent ('string String;', 'int Int32;').
6432 (PropertyExpr.EmitInstance): Likewise.
6434 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6436 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6438 * report.cs (warning_ignore_table): Made public.
6440 2005-03-04 Raja R Harinath <rharinath@novell.com>
6443 * class.cs (MethodData.Emit): Pass 'container' to
6444 container.GetObsoleteAttribute instead of 'container.Parent'.
6446 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6448 * cs-parser.jay: Add 1534 error test.
6450 * iterators.cs (Yield.CheckContext): Add error 1629.
6451 (Iterator.ctor): Save unsafe modifier.
6452 (MoveNextMethod.DoEmit): Restore unsafe context.
6454 * namespace.cs (UsingAlias): Better error message.
6456 2005-03-03 Dan Winship <danw@novell.com>
6458 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6459 the warning message [#73219]
6461 2005-03-03 Raja R Harinath <rharinath@novell.com>
6463 Fix compile with MCS 1.0.0.0.
6464 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6465 w_restore to not depend on string constant folding.
6467 2005-03-03 Raja R Harinath <rharinath@novell.com>
6469 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6470 CS0246 check to users who passed 'silent = false'.
6471 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6473 (SimpleName.SimpleNameResolve): Update.
6474 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6475 (MemberAccess.IdenticalNameAndTypeName): Update.
6476 * doc.cs (FindDocumentedTypeNonArray): Update.
6478 2005-03-03 Raja R Harinath <rharinath@novell.com>
6480 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6481 * parameters.cs (ComputeAndDefineParameters): Remove.
6482 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6483 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6484 Use GetParameterInfo.
6486 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6488 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6490 2005-03-02 Raja R Harinath <rharinath@novell.com>
6492 Unify DeclSpace.LookupType and DeclSpace.FindType.
6493 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6494 is in charge of defining nested types on demand.
6495 (DeclSpace.LookupType): Use it when the current_type is a
6496 TypeBuilder. Use LookupTypeDirect for reflected types.
6497 (DeclSpace.FindType): Remove.
6498 (DeclSpace.LookupInterfaceOrClass): Likewise.
6499 (DeclSpace.DefineTypeAndParents): Likewise.
6500 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6501 DeclSpace.LookupType.
6502 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6503 * typemanager.cs (LookupType): Simplify.
6504 (AddUserType): Remove type from negative_hits.
6505 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6506 * class.cs (TypeContainer.FindMembers): Move handling of nested
6508 (TypeContainer.FindMembers_NestedTypes): ... here.
6509 (TypeContainer.FindNestedType): Implement override.
6510 (ClassPart.FindNestedType): Delegate to PartialContainer.
6511 (ClassPart.PartFindNestedType): Looks up the nested types of the
6514 2005-04-14 Martin Baulig <martin@ximian.com>
6516 * generic.cs (ConstructedType): Moved all the type lookup and
6517 nested class logic into SimpleName.
6518 (ConstructedType.ResolveConstructedType): Our underlying type is
6519 already fully resolved; all the type lookup stuff is in
6522 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
6523 constructed types here instead of in ConstructedType.
6525 * decl.cs (MemberName.GetTypeExpression): Always create a
6526 SimpleName, not a ConstructedType.
6527 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
6529 2005-03-02 Martin Baulig <martin@ximian.com>
6531 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6532 static constructor in static classes.
6534 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6536 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6537 sizeParamIndex is not specified.
6539 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6542 * report.cs (WarningMessage.IsEnabled): Missing null check.
6544 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6546 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6547 in the fields and not in the properties.
6549 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6551 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6554 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6556 * attribute.cs: Small refactoring (improved robustness).
6557 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6558 (ValidateGuid): Removed.
6559 (Resolve): Removed referenced to above mentioned.
6560 (GetAttributeUsage): Made private and changed to work without
6562 (GetIndexerAttributeValue): Don't crash.
6563 (GetConditionalAttributeValue): Ditto.
6564 (GetClsCompliantAttributeValue): Ditto.
6565 (ExtractSecurityPermissionSet): All attributes exceptions are
6567 (GetPropertyValue): New helper.
6568 (GetMethodImplOptions): New method.
6569 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6570 some missing properties.
6572 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6573 (Method.ApplyAttributeBuilder): Updated.
6575 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6578 2005-02-28 Raja R Harinath <rharinath@novell.com>
6581 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6582 non-simple types (array, pointer, reference).
6584 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6586 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6588 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6590 (Method.CheckBase): Catch wrong destructor here.
6591 (MethodData.Define): Add errors 550, 668.
6593 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6595 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6597 * pending.cs (VerifyPendingMethods): Add error 551.
6599 * typemanager.cs (CSharpName): Next error report helper.
6601 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6603 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6604 attributes. Removed useless attribute double check.
6605 It saves almost 2MBs for corlib.
6607 2005-02-25 Raja R Harinath <rharinath@novell.com>
6610 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6611 called twice in case of error.
6613 2005-02-23 Chris Toshok <toshok@ximian.com>
6615 Fix compiler portions of #72827.
6616 * statement.cs (Block.Emit): call Begin/EndScope on the
6617 EmitContext instead of the ILGenerator.
6619 * codegen.cs (EmitContext.BeginScope): new method, call
6620 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6622 (EmitContext.BeginScope): same, but EndScope and CloseScope
6624 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6625 offset and call the superclass's OpenScope(int) with it.
6626 (SymbolWriter.CloseScope): get the current il
6627 offset and call superclass's CloseScope(int) with it.
6629 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6631 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6632 CS1677 for out and ref as well.
6634 * class.cs (Method.Define): Add error CS1599 detection.
6636 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6638 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6640 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6642 * support.cs.cs (ModifierDesc): New helper method.
6644 2005-02-23 Raja R Harinath <rharinath@novell.com>
6645 Abin Thomas <projectmonokochi@rediffmail.com>
6646 Anoob V E <projectmonokochi@rediffmail.com>
6647 Harilal P R <projectmonokochi@rediffmail.com>
6650 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6651 MemberLookup (used for error reporting) actually returns a result.
6652 Fix error report number (122, not 112).
6654 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6655 Anoob V E <projectmonokochi@rediffmail.com>
6656 Harilal P R <projectmonokochi@rediffmail.com>
6659 * pending.cs (PendingImplementation.GetAbstractMethods):
6660 Find NonPublic members too.
6662 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6664 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6667 * class.cs (MethodCore.CheckMethodAgainstBase):
6668 Add error 239 report.
6670 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6672 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6674 * class.cs (Operator.Define): Add error 217 report.
6676 2005-02-21 Raja R Harinath <rharinath@novell.com>
6679 * expression.cs (Invocation.IsApplicable): Make public.
6680 (Invocation.IsParamsMethodApplicable): Likewise.
6681 * delegate.cs (Delegate.VerifyApplicability): Don't use
6682 Invocation.VerifyArgumentCompat for parameter applicability
6683 testing. Use Invocation.IsApplicable and
6684 Invocation.IsParamsMethodApplicable.
6686 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6688 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6690 * class.cs (Operator.Define): Add error 217 report.
6692 2005-02-21 Raja R Harinath <rharinath@novell.com>
6694 * namespace.cs (UsingEntry.Resolve): Undo change below.
6696 2005-02-21 Raja R Harinath <rharinath@novell.com>
6699 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6700 disable the error message when the extended MemberLookup also
6702 (Expression.MemberLookupFinal): Update.
6703 (SimpleName.DoSimpleNameResolve): Update.
6704 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6705 Don't use MemberLookupFinal.
6706 (New.DoResolve): Update.
6707 (BaseAccess.CommonResolve): Update.
6709 2005-02-21 Raja R Harinath <rharinath@novell.com>
6712 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6713 occured previously, don't resolve again.
6715 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6718 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6719 argument. Call ResolveAttributeUsage for unresolved.
6720 when types doesn't match ctor arguments.
6722 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6723 for nested attribute classes.
6724 (Class.attribute_usage): Removed.
6725 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6726 for attribute class.
6728 * ecore.cs (IsAttribute): Removed.
6730 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6732 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6734 (attribute_types): Removed.
6735 (EmitCode): Global attributes are emited as the latest.
6737 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6739 * class.cs (EmitFieldInitializers): Don't emit field initializer
6740 for default values when optimilization is on.
6742 * constant.cs (Constant.IsDefaultValue): New property.
6744 * driver.cs: Add /optimize handling.
6748 * literal.cs: Implement new IsDefaultValue property.
6750 * rootcontext.cs (Optimize): New field, holds /optimize option.
6752 2005-02-18 Raja R Harinath <rharinath@novell.com>
6754 Fix crasher in re-opened #72347.
6755 * namespace.cs (Namespace.Lookup): Return null if
6756 DeclSpace.DefineType returns null.
6759 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6761 2005-02-18 Raja R Harinath <rharinath@novell.com>
6763 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6764 now returns null if it cannot resolve to an lvalue.
6765 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6766 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6767 returned null. Remove check for SimpleName.
6768 (EventExpr.DoResolveLValue): New.
6769 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6770 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6772 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6774 (Unary.ResolveOperator): Move CS0211 check ...
6775 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6777 (Unary.DoResolveLValue): Simplify.
6778 (AddressOf.DoResolveLValue): New.
6779 (ArrayAccess.DoResolveLValue): New.
6781 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6783 * attribute.cs (Attribute.Resolve): Add arguments casting for
6784 when types doesn't match ctor arguments.
6786 2005-02-16 Raja R Harinath <rharinath@novell.com>
6788 Fix parts of #63202.
6789 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6790 lookup of operator in base type. Ensure that all checks happen
6791 when the operator resolves to an "op_..." method.
6793 2005-02-15 Raja R Harinath <rharinath@novell.com>
6796 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6797 'ignore_cs0104' parameter. Pass it to ...
6798 (NamespaceEntry.Lookup): ... this.
6799 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6800 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6801 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6802 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6803 Update. Request that cs0104 errors be ignored.
6804 (ComposedCast.ResolveAsTypeStep): Update.
6806 2005-02-14 Raja R Harinath <rharinath@novell.com>
6809 * expression.cs (Invocation.BetterFunction): Remove support for
6810 comparing virtual functions and their overrides.
6811 (Invocation.IsOverride): New.
6812 (Invocation.OverloadResolve): Don't consider 'override' functions
6813 during candidate selection. Store them in a lookaside list.
6814 If the selected method is a 'virtual' function, use the list to
6815 find any overrides that are closer to the LHS type.
6817 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6819 * expression.cs (New.DoResolve): Add complex core type reduction.
6820 (New.Constantify): Converts complex core type syntax like 'new int ()'
6823 2005-02-14 Raja R Harinath <rharinath@novell.com>
6825 * decl.cs (EntryType.EntryType): New constructor to create an
6826 updated copy of a cache entry.
6827 (MemberCache.AddMethods): Use it.
6828 (MemberCache.ClearDeclaredOnly): Remove.
6829 (MemberCache.MemberCache): Update.
6831 2005-02-11 Miguel de Icaza <miguel@novell.com>
6833 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6834 variable. This one is represents the actual low-level declaration
6835 of the method, as opposed to the semantic level `IsStatic'.
6837 An anonymous method which is hosted into a static method might be
6838 actually an instance method. IsStatic would reflect the
6839 container, while MethodIsStatic represents the actual code
6842 * expression.cs (ParameterReference): Use the new MethodIsStatic
6843 instead of IsStatic.
6845 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6846 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6847 set on the current EmitContext.
6849 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6850 resolve our casted expression as an LValue. This triggers the
6851 proper LValue processing that is later required by Assign.
6855 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6857 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6859 C# 2.0 Fixed buffer implementation
6861 * anonymous.cs: Update after RegisterHelperClass renaming.
6863 * attribute.cs (AttributeTester.fixed_buffer_cache):
6864 Cache of external fixed buffers.
6865 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6866 implementation if field is fixed buffer else null.
6869 (TypeContainer.AddField): Accept FieldMember instead of Field.
6870 (FieldBase.IsFieldClsCompliant): Extracted code from
6871 VerifyClsCompliance descendant customization.
6872 (FixedField): New class handles fixed buffer fields.
6873 (FixedFieldExternal): Keeps information about imported fixed
6875 (IFixedField): Make access to internal or external fixed buffer
6878 * cs-parser.jay: Add fixed buffer parsing.
6880 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6883 * expression.cs (Indirection): Extended implementation to accept
6885 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6886 (ElementAccess.MakePointerAccess): Get type as parameter.
6887 (DoResolve): Add fixed buffer field expression conversion.
6888 (DoResolveLValue): Ditto.
6889 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6890 (ArrayPtr): Derives from FixedBufferPtr.
6891 (ArrayPtr.Emit): Add extra emit for array elements.
6893 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6895 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6896 for compiler generated types.
6897 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6899 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6900 and consume less memory.
6901 (Fixed.Resolve): Add fixed buffer case.
6903 * typemanager.cs (compiler_generated_attr_ctor,
6904 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6905 (HasElementType): Add our own implementation to work on every
6908 2005-02-11 Miguel de Icaza <miguel@novell.com>
6910 * anonymous.cs (CaptureContext): Track whether `this' has been
6913 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6914 only captured `this' if it was implicitly done (instance
6915 methods/variables were used).
6917 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6918 `this' must be captured.
6920 2005-01-30 Miguel de Icaza <miguel@novell.com>
6922 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6923 is null it means that there has been no need to capture anything,
6924 so we just create a sibling.
6926 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6928 Just a partial fix. The other half is fairly elusive.
6930 2005-02-10 Raja R Harinath <rharinath@novell.com>
6932 Fix #52586, cs0121-4.cs.
6933 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6934 and return a hashtable.
6935 (MemberCache.ClearDeclaredOnly): New.
6936 (MemberCache.MemberCache): Update to change. Make a deep copy of
6937 the method_hash of a base type too.
6938 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6939 type methods. Overwrite entries with the same MethodHandle so
6940 that the ReflectedType is correct. The process leaves in base
6941 virtual functions and their overrides as distinct entries.
6942 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6943 matters since it was boxed in a ArrayList before.
6944 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6946 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6947 case of a virtual function and its override (choose the overload
6949 (Invocation.OverloadResolve): Avoid 'override' members during
6950 'applicable_type' calculation.
6952 2005-03-28 Raja R Harinath <rharinath@novell.com>
6954 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6955 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6956 GetTypeHandle. It is possible for a reflected type to derive from
6957 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6958 System.Array during mscorlib compilation).
6959 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6960 contain a method_hash, don't create one either. Don't create a
6961 deep copy of the base cache's method_hash.
6962 (MemberCache.SetupCache): Rename back from DeepCopy.
6963 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6964 already initialized. If we see an override function, add its
6965 underlying base virtual function to the member_hash too.
6967 2005-02-09 Raja R Harinath <rharinath@novell.com>
6969 Combine two near-redundant caches.
6970 * typemanager.cs (method_params): Rename from method_internal_params.
6971 (TypeManager.GetParameterData): New. Replace
6972 Invocation.GetParameterData.
6973 (TypeManager.LookupParametersByBuilder): Remove.
6974 * expression.cs (Invocation.method_parameter_cache): Remove.
6975 (Invocation.GetParameterData): Remove.
6977 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6980 2005-02-08 Raja R Harinath <rharinath@novell.com>
6983 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6984 TypeManager.multicast_delegate_type is null, resolve it by looking
6985 up "System.MulticastDelegate".
6986 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6988 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6989 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6990 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6993 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6994 (LabeledStatement.AddReference): New. Set 'referenced'.
6995 (Goto.Resolve): Use it.
6997 2005-02-05 John Luke <john.luke@gmail.com>
6999 * driver.cs: remove duplicate -doc line in Usage ()
7001 2005-02-04 Raja R Harinath <rharinath@novell.com>
7003 * location.cs (Location.AddFile): Fix CS2002 error report.
7005 2005-02-02 Martin Baulig <martin@ximian.com>
7007 * delegate.cs (Delegate.DefineType): Report an internal error if
7008 TypeManager.multicast_delegate_type is null. See bug #72015 for
7011 2005-02-02 Raja R Harinath <rharinath@novell.com>
7013 Fix a crasher in a variant of #31984.
7014 * const.cs (Constant.CheckBase): New override that defers the
7015 new-or-override check in case the base type hasn't been populated
7017 (Constant.Define): Ensure the new-or-override check is performed.
7019 2005-02-01 Duncan Mak <duncan@ximian.com>
7021 * const.cs (LookupConstantValue): Check that `ce' is not null
7022 before calling GetValue ().
7024 2005-02-01 Raja R Harinath <rharinath@novell.com>
7026 Fix test-334.cs (#69519).
7027 * cs-parser.jay (using_alias_directive): Pass in an expression to
7028 NamespaceEntry.UsingAlias.
7029 (using_namespace_directive): Pass in an expression to
7030 NamespaceEntry.Using.
7031 (namespace_name): Don't flatten to a string.
7032 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7033 (NamespaceEntry.AliasEntry.Resolve): Lookup using
7035 (NamespaceEntry.UsingEntry): Likewise.
7036 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7038 (NamespaceEntry.LookupForUsing): Remove.
7039 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7041 (NamespaceEntry.Lookup): Remove support for dotted names.
7043 2005-02-01 Raja R Harinath <rharinath@novell.com>
7045 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7047 (NamespaceEntry.ImplicitParent): Compute on demand.
7048 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7049 parallels the current.
7050 (NamespaceEntry.LookupForUsing): Use it.
7051 (NamespaceEntry.Lookup): If the current namespace-entry is
7052 implicit, don't search aliases and using tables.
7054 2005-02-01 Raja R Harinath <rharinath@novell.com>
7057 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7059 (TypeContainer.BaseCache): Compute on demand.
7060 (TypeContainer.FindMembers): Define constants and types if they're
7061 not already created.
7062 (FieldMember.Define): Move resetting of ec.InUnsafe before error
7064 * const.cs (Constant.Define): Make idempotent.
7066 2005-01-29 Miguel de Icaza <miguel@novell.com>
7068 * pending.cs: Produce better code (no nops produced by using Ldarg
7071 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7072 i - 1' it should be arg + 1.
7076 2005-01-28 Raja R Harinath <rharinath@novell.com>
7078 * attribute.cs (Attribute.CheckAttributeType): Make private
7080 (Attribute.ResolveType): Make virtual.
7081 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7082 handling of RootContext.Tree.Types.
7084 2005-01-27 Raja R Harinath <rharinath@novell.com>
7086 Update attribute-handling to use the SimpleName/MemberAccess
7088 * cs-parser.jay (attribute): Pass in an expression to the
7089 constructors of Attribute and GlobalAttribute.
7090 * attribute.cs (Attribute): Take an expression for the name.
7091 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
7092 passed in attribute name expression.
7093 (Attribute.CheckAttributeType): Use it.
7094 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7095 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7096 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
7097 argument to prevent error messages if the lookup fails.
7099 2005-01-27 Marek Safar <marek.safar@seznam.cz>
7101 * expression.cs (Indirection): Implemented IVariable interface
7102 to support indirection in AddressOf operator.
7103 (PointerArithmetic.Emit): Add optimalization for case where
7104 result can be precomputed.
7106 2005-01-26 Martin Baulig <martin@ximian.com>
7108 * class.cs (TypeContainer.AttributeTargets): Return the correct
7109 AttributeTargets depending on our `Kind' instead of throwing an
7110 exception; fixes #71632.
7112 2005-01-26 Marek Safar <marek.safar@seznam.cz>
7115 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7118 2005-03-17 Martin Baulig <martin@ximian.com>
7120 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7121 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
7123 2005-03-17 Martin Baulig <martin@ximian.com>
7125 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7126 to bool so we can return an error condition.
7127 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7130 2005-03-17 Martin Baulig <martin@ximian.com>
7132 * generic.cs (TypeMananager.IsIEnumerable): New public method.
7134 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
7135 converting from an array-type of T to `IEnumerable<T>'.
7137 2005-03-16 Martin Baulig <martin@ximian.com>
7139 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
7140 (Nullable.LiftedUnaryMutator): New public class.
7142 * expression.cs (UnaryMutator.DoResolve): Added support for
7145 2005-03-14 Martin Baulig <martin@ximian.com>
7147 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
7149 2005-03-14 Martin Baulig <martin@ximian.com>
7151 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
7152 the comparision operators `<', `>', `<=' and `>='.
7154 2005-03-13 Martin Baulig <martin@ximian.com>
7157 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
7158 avoid confusion with the `NullLiteral'.
7159 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
7161 2005-03-13 Martin Baulig <martin@ximian.com>
7163 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
7164 comparing arbitrary types with the null literal.
7166 2005-03-13 Martin Baulig <martin@ximian.com>
7168 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
7169 boolean operators '&&', '||', '&' and '|'.
7170 (Nullable.OperatorTrueOrFalse): New public class.
7172 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
7173 instead of a `StaticCallExpr'; added support for nullables.
7175 2005-03-10 Martin Baulig <martin@ximian.com>
7178 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
7179 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
7181 2005-03-07 Martin Baulig <martin@ximian.com>
7183 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
7184 it work if `expr' is not an IMemoryLocation.
7185 (Nullable.Lifted): Implement IMemoryLocation.
7186 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
7189 2005-03-05 Martin Baulig <martin@ximian.com>
7191 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
7192 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
7193 (Nullable): Added support for lifted unary and binary operators.
7195 * expression.cs (Unary.DoResolve): Added support for nullable types.
7196 (Binary.DoResolve): Likewise.
7197 (Conditional.DoResolve): Likewise.
7199 2005-03-02 Martin Baulig <martin@ximian.com>
7201 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
7203 * class.cs (ClassPart.SetParameterInfo): Override this.
7204 (PartialContainer.SetParameterInfo): Override this.
7205 (TypeContainer.CheckConstraints): New protected method.
7206 (PartialContainer.CheckConstraints): Override this and check
7207 whether the same contraints were specified in all parts of a
7208 partial generic type definition.
7209 (PartialContainer.UpdateConstraints): New public method.
7211 * generic.cs (TypeParameter.UpdateConstraints): New public method.
7213 2005-03-02 Martin Baulig <martin@ximian.com>
7215 Committing a patch from Carlos Alberto Cortez to fix #72887.
7217 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
7218 casts from `T []' to `int []'.
7220 2005-03-02 Martin Baulig <martin@ximian.com>
7222 * generic.cs (TypeManager.IsEqual): Make this symmetric.
7224 * expression.cs (Binary.ResolveOperator): When resolving a
7225 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
7226 `=='. Fixes #71866. See gen-127.cs.
7228 2005-03-02 Martin Baulig <martin@ximian.com>
7230 * class.cs (TypeContainer.DoDefineMembers): We also need a default
7231 static constructor in static classes.
7233 2005-03-02 Martin Baulig <martin@ximian.com>
7236 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
7237 (Nullable.LiftedConversion): Added support for user-defined
7240 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
7242 * cs-parser.jay: Use ComposedCast everywhere instead of
7243 NullableType, so we don't need to check for NullableType
7245 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
7246 case where we'll be resolved into a `parenthesized_expression_0'
7250 (Convert.UserDefinedConversion): Added nullable conversions.
7252 2005-02-28 Martin Baulig <martin@ximian.com>
7254 * generic.cs (TypeManager.IsNullableType): New static method.
7255 (Nullable): New abstract class.
7256 (Nullable.NullLiteral): New public class.
7257 (Nullable.LiftedConversion): New public class.
7259 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
7260 `builtin_types opt_nullable'.
7263 (Convert.ImplicitConversionStandard): Added nullable conversions.
7264 (Convert.ExplicitConversionStandard): Likewise.
7265 (Convert.ExplicitConversion): Likewise.
7267 2005-02-26 Martin Baulig <martin@ximian.com>
7269 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
7270 begin with a "?", for instance "?[]". Don't do a type lookup if
7273 2005-02-25 Martin Baulig <martin@ximian.com>
7275 The first part of Nullable Types :-)
7277 * generic.cs (NullableType): New public class.
7278 (NullCoalescingOperator): New public class.
7279 (TypeArguments.Resolve): Add a CS0306 check.
7281 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
7282 (opt_nullable): New rule.
7283 (type): Added `opt_nullable' to `namespace_or_type_name',
7284 `builtin_types' and `pointer_type'.
7285 (array_type): Added `opt_nullable'.
7286 (opt_rank_specifier_or_nullable): New rule; this is the
7287 combination of `opt_rank_specifier' and `opt_nullable'.
7288 (opt_error): New rule; catch errors here.
7289 (nullable_type_or_conditional): New rule; we use this to check for
7290 nullable and still detect the conditional operator.
7291 (local_variable_type): Use `opt_rank_specifier_or_nullable'
7292 instead `opt_rank_specifier'.
7294 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
7297 2005-02-24 Martin Baulig <martin@ximian.com>
7299 * README, README.Changes: Removed; they're old and obsolete.
7301 2005-02-22 Martin Baulig <martin@ximian.com>
7303 * generic.cs (TypeParameter.Resolve): If resolving the constraints
7304 returned an error, set `constraints' to null to avoid a crash
7306 (TypeParameter.ResolveType): Likewise.
7308 2005-02-22 Martin Baulig <martin@ximian.com>
7311 (Constraints.ResolveTypes): Protect against being called twice.
7312 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
7313 (TypeParameter.ResolveType): New public method; calls
7314 constraints.ResolveTypes().
7315 (TypeParameter.DefineType): Moved constraints.ResolveType() out
7316 into the new ResolveType().
7317 (GenericMethod.Define): Call ResolveType() on all our
7320 2005-02-21 Martin Baulig <martin@ximian.com>
7323 (TypeManager.generic_nullable_type): New static public field.
7324 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
7327 (RootContext.ResolveCore): Resolve "System.Nullable`1".
7329 2005-02-15 Martin Baulig <martin@ximian.com>
7331 * generic.cs (ConstructedType.Constraints): Correctly check
7332 constraints if the argument type is a type parameter; fixes
7335 2005-02-02 Martin Baulig <martin@ximian.com>
7337 * delegate.cs (Delegate.DefineType): Report an internal error if
7338 TypeManager.multicast_delegate_type is null. See bug #72015 for
7341 2005-01-29 Miguel de Icaza <miguel@novell.com>
7343 * pending.cs: Produce better code (no nops produced by using Ldarg
7346 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7347 i - 1' it should be arg + 1.
7351 2005-01-26 Martin Baulig <martin@ximian.com>
7353 * cs-parser.jay (indexer_declarator): Don't report an error if we
7354 have type parameters since we can be an explicit interface
7355 implementation; fixes #71449.
7357 2005-01-26 Martin Baulig <martin@ximian.com>
7359 * class.cs (TypeContainer.AttributeTargets): Return the correct
7360 AttributeTargets depending on our `Kind' instead of throwing an
7361 exception; fixes #71632.
7363 2005-01-26 Martin Baulig <martin@ximian.com>
7365 * delegate.cs (Delegate.DefineType): Correctly define our type
7366 parameters. Fixes #71483.
7368 2005-01-25 Raja R Harinath <rharinath@novell.com>
7371 * expression.cs (MemberAccess.DoResolve): Don't complain with
7372 cs0572 when the LHS of a member access has identical name and type
7375 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7378 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7380 Create custom PermissionSet only for PermissionSetAttribute.
7382 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7385 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7386 delegates in static class.
7388 2005-01-24 Martin Baulig <martin@ximian.com>
7390 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7391 merging an implicit block, just use its reachability.
7393 * statement.cs (Block.Resolve): Make the unreachable code check
7394 work wrt. implicit blocks; see test-337 from #63842.
7396 2005-01-21 Alp Toker <alp@atoker.com>
7398 * cs-parser.jay: destructor_declaration's container is PartialContainer
7399 not Class when partial types are used, so use Kind prop instead of
7402 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7404 * cs-parser.jay: Improve error reporting when an interface
7407 2005-01-20 Dick Porter <dick@ximian.com>
7409 * support.cs: SeekableStreamReader fix from Sandor Dobos
7410 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7411 chars are read. Fixes bug 70369.
7413 2005-01-20 Raja R Harinath <rharinath@novell.com>
7415 * cs-parser.jay (catch_clause): Simplify current_block handling
7418 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7420 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7421 code with ImplicitStandardConversion to handle the implicit
7422 conversion of method groups into valid delegate invocations.
7424 The problem is that in parameter handling we were using this code
7425 path. Fixes bug #64698
7427 2005-01-19 Raja R Harinath <rharinath@novell.com>
7429 * cs-parser.jay: Fix several infelicities.
7430 - Avoid assigning to the parser value stack. Code like
7431 '$3 = null' is unclean. Synthesize a value for the code block
7433 - Avoid using oob_stack for storing location information. Use ...
7434 (_mark_): ... this. New (empty) rule. Saves the current location
7436 (foreach_statement): Avoid using oob_stack for current_block
7437 handling. Use technique used in for_statement and
7438 using_statement. Synthesize a value for the code block to store
7439 additional intermediate information.
7441 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7443 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7444 of a different type is only allowed to private fields of a
7445 containing type, not on fields of a base class.
7447 See test-174.cs and error cs0122-9.cs
7449 2005-01-13 Raja R Harinath <rharinath@novell.com>
7451 Fix test-335.cs (bug #58126).
7452 * cs-parser.jay (argument): Split out non-expression parts of the
7453 rule into 'non_simple_argument'.
7454 (invocation_expression): Support parenthesized invocations with
7455 multiple arguments, and with single non-simple arguments.
7457 2005-01-13 Raja R Harinath <rharinath@novell.com>
7459 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7462 2005-01-12 Raja R Harinath <rharinath@novell.com>
7464 Fix cs0038-1.cs, cs1640-6.cs.
7465 * ecore.cs (Expression.Resolve): Remove special-case for
7466 SimpleName in error-handling.
7467 (Expression.almostMatchedMembers): Relax access permission to
7469 (Expression.MemberLookupFailed): Handle duplicates in
7470 almostMatchedMembers list.
7471 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7472 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7473 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7474 overload if the passed in MemberInfo is a MethodBase.
7476 2005-01-25 Martin Baulig <martin@ximian.com>
7479 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
7481 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7484 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7485 for non-CAS & merge permission sets properly.
7487 2005-01-11 Raja R Harinath <rharinath@novell.com>
7489 Improve standard-compliance of simple name and member access
7490 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7491 * ecore.cs (FullNamedExpression): New abstract base class
7492 for Namespaces and TypeExpressions.
7493 (ResolveFlags.SimpleName): Remove.
7494 (SimpleName): Remove support for dotted names.
7495 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7496 DeclSpace.FindType and DeclSpace.LookupType.
7497 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7498 (Expression.ExprClassName): Make member function.
7499 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7500 a namespace. Remove creation of dotted "SimpleName"s.
7501 (MemberAccess.DoResolve): Likewise.
7502 * decl.cs (DeclSpace.Cache): Make private.
7503 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7504 (DeclSpace.FindType): Update.
7505 (DeclSpace.LookupType): Move here from RootContext. Return a
7506 FullNamedExpression.
7507 * namespace.cs (Namespace): Derive from FullNamedExpression
7508 so that it can be part of expression resolution.
7509 (Namespace.Lookup): Return an FullNamedExpression.
7510 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7512 * rootcontext.cs (NamespaceLookup): Remove.
7513 (LookupType): Move to DeclSpace.
7514 * attribute.cs (CheckAttributeType): Update.
7515 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7516 (FindDocumentedTypeNonArray): Likewise.
7518 2005-01-11 Raja R Harinath <rharinath@novell.com>
7520 Fix cs0509.cs, cs1632.cs.
7521 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7522 is the same as IsInterface.
7523 (TypeContainer.GetClassBases): Likewise.
7524 * statement.cs (LabeledStatement.ig): New field.
7525 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7527 (LabeledStatement.DoEmit): Check that the label was created with
7528 the same ILGenerator.
7530 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7533 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7534 accessors to its properties.
7536 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7537 from accessors to property.
7539 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7542 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7545 2005-01-08 Miguel de Icaza <miguel@ximian.com>
7547 * attribute.cs: Check for null and empty strings.
7549 I have lost another battle to Paolo.
7551 2005-01-07 Marek Safar <marek.safar@seznam.cz>
7554 * class.cs (PropertyMethod): Set Parent field in ctors.
7555 (SetMethod.InternalParameters): Add unsafe switch hack.
7556 Override MarkForDuplicationCheck where it is appropriate.
7558 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7559 It says whether container allows members with the same name.
7561 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7562 Removed is_method parameter.
7564 2005-01-06 Duncan Mak <duncan@ximian.com>
7566 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7567 because the previous change led to incorrect reporting of CS1032
7568 ("Cannot define/undefine preprocessor symbols after first token in
7569 file"). Instead of using `tokens_seen' as the only flag that
7570 triggers CS1040, introduce `comments_seen'. This new flag is used
7571 to signify having seen comments on the current line, so it is
7572 unset after a newline.
7574 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7576 * doc.cs : When searching for a type, find nested type too.
7577 This fixes bug #71040.
7579 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7582 - Warn missing member comment on those classes which also does not
7583 have doc comments. Fixed bug #71041.
7584 - Don't warn missing doc comment on default constructor.
7587 2005-01-06 Duncan Mak <duncan@ximian.com>
7589 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7590 comments, set `tokens_seen' to true. This allows us to detect
7591 misplaced preprocessor directives (i.e. not at the beginning of
7592 the a line, nor after whitespaces). In that case, report error
7593 CS1040. This fixes bug #56460.
7595 * cs-parser.jay (interface_member_declaration): Add checks for
7596 IsExplicitImpl, and report CS0541 error if an interface member is
7597 defined as an explicit interface declaration.
7599 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7602 * class.cs (PropertyMethod): Set Parent field in ctors.
7603 (SetMethod.InternalParameters): Add unsafe switch hack.
7605 * decl.cs (MemberCore.Parent): Cannot be readonly.
7607 2005-01-06 Raja R Harinath <rharinath@novell.com>
7609 * decl.cs (DeclSpace.ResolveType): Remove.
7610 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7611 Merge in code from ...
7612 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7613 * class.cs, enum.cs: Update to changes.
7615 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7617 * anonymous.cs: Ensure that we init the scope of our parent if it
7618 has not been initialized yet.
7620 2004-12-30 Duncan Mak <duncan@ximian.com>
7622 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7623 if field.FieldBuilder is null. Fixes #70758.
7625 * convert.cs: Fixed some typos and updated some of the comments.
7626 (ImplicitStandardConversionExists):
7627 (TryImplicitIntConversion): If `target_type' is an interface and
7628 the type of `ic' implements this interface, return true or a new
7629 BoxedCast instead of null. This fixes #70468.
7631 2004-12-29 Duncan Mak <duncan@ximian.com>
7633 * expression.cs (Argument.Emit): Check that Expr is
7634 IMemoryLocation before casting to it, and report CS1510 otherwise.
7638 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7640 * statement.cs (Block.ThisVariable): remove the recursion here, to
7641 make the --profile more sane.
7643 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7645 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7646 assembly, by JB Evain.
7648 2004-12-17 Raja R Harinath <rharinath@novell.com>
7650 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7651 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7652 "parent" refers to enclosing type/class. "base" refers to superclass.
7654 2004-12-17 Raja R Harinath <rharinath@novell.com>
7656 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7657 Ensure that we only have GlobalAttributes.
7658 * attribute.cs (Attribute.Emit): Make non-virtual.
7659 (GlobalAttribute.Emit): Remove.
7660 (Attribute.Resolve): Make virtual.
7661 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7662 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7663 the argument. Don't create one.
7664 (Attribute.GetObsoleteAttribute): Likewise.
7665 (Attribute.GetClsCompliantAttributeValue): Likewise.
7666 * class.cs, decl.cs: Update to changes.
7668 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7670 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7672 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7674 * statement.cs (Foreach.Resolve): Add error 186 report.
7676 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7678 * expression.cs (Conditional.DoResolve): Add warning 429.
7680 * statement.cs (If.Resolve): Add warning 665.
7682 2004-12-16 Raja R Harinath <rharinath@novell.com>
7684 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7685 except when in the parser, and in GlobalAttribute.
7686 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7687 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7688 RootContext.Tree.Types.NamespaceEntry once work is done.
7689 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7690 and resets RootContext.Tree.Types.NamespaceEntry.
7692 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7694 * cs-parser.jay: Don't create a block for every variable.
7696 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7698 * location.cs: Provide extra information.
7700 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7701 variables from the captured environment, it is the ldarg_0.
7703 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7705 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7708 * class.cs: Changed warning level for 169 to avoid developer
7709 displeasure from warning flooding. It will be changed back when they
7710 fix most of current BCL warnings.
7712 * RootContext.cs: Pushed default WarningLevel to 3.
7714 * statement.cs: Removed unused variable.
7716 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7718 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7719 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7720 Add error 502 report.
7721 (StaticClass.DefineType): Add error 441 report.
7722 (Class.AllowedModifiersProp): New virtual property as temporary
7723 extension to AllowedModifiers.
7724 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7725 to share implementation with StaticClass and don't call virtual
7728 * driver.cs (MainDriver): Add error 1558 test.
7730 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7731 report. Moved error 36 test here.
7733 * statement.cs (Throw.Resolve): Add error 724 report.
7735 * typemanager.cs: Add out_attribute_type core type.
7737 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7739 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7741 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7743 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7746 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7748 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7749 Add error 3023 report.
7750 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7752 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7755 2004-12-12 John Luke <john.luke@gmail.com>
7757 * driver.cs (AddArgs): take -- into account when
7758 adding arguments, fixes bug 65710
7760 2004-12-12 Martin Baulig <martin@ximian.com>
7762 * expression.cs (Unary.TryReduceNegative): Added support for
7763 SByteConstant and ByteConstant.
7764 (Unary.Reduce): Check error values from TryReduceNegative().
7766 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7768 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7769 and report exception as error 182.
7771 2004-12-10 Raja R Harinath <rharinath@novell.com>
7773 * driver.cs (Main): Fix message when there are warnings.
7775 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7777 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7779 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7781 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7782 Reduced number of warnings.
7784 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7786 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7788 * driver.cs: Removed message.
7790 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7792 2004-12-08 <vargaz@freemail.hu>
7794 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7796 2004-12-08 Martin Baulig <martin@ximian.com>
7798 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7799 instead of a CS3002 for properties and indexer.
7801 2004-12-08 Martin Baulig <martin@ximian.com>
7803 * decl.cs (MemberName.ToString): Make this work again.
7805 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7807 * attribute.cs (Resolve): Add error 591 detection.
7809 * class.cs (FieldMember.Define): Add error 1547 detection.
7810 (Indexer.Define): Add error 620 detection.
7811 (Operator.Define): Add error 590 detection.
7813 * ecore.cs: Missing argument for error 79.
7815 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7818 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7821 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7824 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7826 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7827 Some operator comments were suppressed.
7828 * doc.cs : Implicit/explicit operator name in doc comments are like
7829 "op_Explicit(type)~returnType", so added suffix handling.
7831 2005-01-21 Alp Toker <alp@atoker.com>
7833 * cs-parser.jay: destructor_declaration's container is PartialContainer
7834 not Class when partial types are used, so use Kind prop instead of 'is'.
7836 2004-12-12 Martin Baulig <martin@ximian.com>
7838 * expression.cs (Unary.TryReduceNegative): Added support for
7839 SByteConstant and ByteConstant.
7840 (Unary.Reduce): Check error values from TryReduceNegative().
7842 2004-12-11 Martin Baulig <martin@ximian.com>
7844 * support.cs (ReflectionParameters.ParameterName): If we have a
7845 `gpd', call `ParameterName' on it.
7847 * parameter.cs (Parameter.GetParameterAttributes): New static method.
7849 * pending.cs (PendingImplementation.DefineProxy): Call
7850 DefineParameter() for all of the MethodBuilder's arguments.
7852 2004-12-09 Martin Baulig <martin@ximian.com>
7854 * doc.cs (DocUtil): Make this a static class.
7856 2004-12-09 Martin Baulig <martin@ximian.com>
7858 * expression.cs (Invocation.InferType): Moved the type inference
7859 implementation into TypeManager.
7861 * generics.cs (TypeManager): Moved the type inference
7862 implementation here.
7864 2004-12-09 Martin Baulig <martin@ximian.com>
7866 * typemanager.cs (TypeManager): Make this a partial class.
7869 (TypeManager): Move the generics part of `TypeManager' here.
7871 2004-12-08 Martin Baulig <martin@ximian.com>
7873 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7874 instead of a CS3002 for properties and indexer. Added CS3024
7875 check for generic interfaces.
7877 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7878 instances are not CLS-compliant.
7880 2004-12-08 Martin Baulig <martin@ximian.com>
7883 (void_pointer_expression): New rule for `void*', `void**' etc.
7884 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
7886 2004-12-08 Martin Baulig <martin@ximian.com>
7888 * expression.cs (Invocation.InferType): Removed the hack for
7889 MethodCore.MayUnify().
7891 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7894 * class.cs (MethodCore.MayUnify): Use
7895 TypeManager.MayBecomeEqualGenericTypes().
7897 2004-12-08 Martin Baulig <martin@ximian.com>
7899 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7900 parameter, box it. Fixes #69233.
7902 2004-12-08 Martin Baulig <martin@ximian.com>
7904 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7905 have the ctor constraint. Fixes #68326.
7907 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7909 * cs-parser.jay : interface comment was not consumed because of
7910 extra opt_semicolon before doc handling.
7912 2004-12-03 Raja R Harinath <rharinath@novell.com>
7914 Fix test-327.cs, test-328.cs, and put in early infrastructure
7915 for eventually fixing #52697.
7916 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7917 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7919 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7920 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7921 (VerifyUsing, error246): Update.
7922 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7923 'NamespaceEntry.LookupNamespaceOrType'.
7925 2004-12-07 Martin Baulig <martin@ximian.com>
7927 * driver.cs: Call it "BETA SOFTWARE" :-)
7929 2004-12-06 Raja R Harinath <rharinath@novell.com>
7931 Fix crash on cs0657-17.cs.
7932 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7933 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7934 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7935 the case where the NamespaceEntry gets overwritten.
7937 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7939 Fixed #69195, #56821
7940 * ecore.cs (ResolveBoolean): Tiny refactoring.
7942 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7943 of right expression resolving when left is false constant and
7944 operator is LogicalAnd OR true constant and operator is LogicalOr.
7946 * statement.cs (ResolveUnreachable): Always reports warning.
7948 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7950 * class.cs: Distinguish between 1721 and 1722 (just a little help
7951 for the programmer).
7953 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7955 * delegate.cs: Only allow this on new versions of the language.
7957 2004-12-02 Duncan Mak <duncan@ximian.com>
7959 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7961 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7962 here as a static method. Take an additional bool out parameter
7963 `must_do_cs1540_check' for signaling to InstanceResolve.
7964 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7965 member field from PropertyExpr class and made it an argument of
7967 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7968 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7969 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7970 and `remove_accessor' as well as InstanceResolve: report CS0122
7975 2004-12-07 Martin Baulig <martin@ximian.com>
7977 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7978 and CS0692 where appropriate.
7980 2004-12-06 Martin Baulig <martin@ximian.com>
7982 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7983 IsDuplicateImplementation() and improved it.
7985 * expression.cs (Invocation.InferTypeArguments): Added
7986 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7987 and removed the "ref" modifier from `infered_types'.
7989 * decl.cs (MemberName.ToString): Removed the exception.
7991 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7993 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7994 comments are allowed.
7996 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7998 * delegate.cs: Add checks for subtypes in paramaters and return values
7999 in VerifyMethod () to add support for Covariance/Contravariance
8002 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8004 * report.cs: Remove extra closing parenthesis.
8006 * convert.cs (Error_CannotImplicitConversion): If the name of the
8007 types are the same, provide some extra information.
8009 2004-12-02 Marek Safar <marek.safar@seznam.cz>
8012 * attribute.cs (Resolve): Improved implementation of params
8013 attribute arguments.
8015 * support.cs (ParameterData): Add HasParams to be faster.
8017 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
8019 all things are for /doc support:
8021 * doc.cs: new file that supports XML documentation generation.
8022 * mcs.exe.sources: added doc.cs.
8024 Handle /doc command line option.
8025 Report error 2006 instead of 5 for missing file name for /doc.
8026 Generate XML documentation when required, after type resolution.
8028 Added support for picking up documentation (/// and /** ... */),
8029 including a new XmlCommentState enumeration.
8031 Added lines to fill Documentation element for field, constant,
8032 property, indexer, method, constructor, destructor, operator, event
8033 and class, struct, interface, delegate, enum.
8034 Added lines to warn incorrect comment.
8036 Added Documentation field (passed only when /doc was specified).
8038 Added DocComment, DocCommentHeader, GenerateDocComment() and
8039 OnGenerateDocComment() and some supporting private members for
8040 /doc feature to MemberCore.
8042 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8044 Added overriden DocCommentHeader.
8046 Added overriden DocCommentHeader and GenerateDocComment().
8048 2004-12-01 Miguel de Icaza <miguel@ximian.com>
8050 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8051 unwrapping the enumeration values, chain to
8052 DoConstantNumericPromotions again, so we can promote things to the
8053 fundamental types (takes care of enums that are bytes, sbytes).
8057 2004-12-01 Raja R Harinath <rharinath@novell.com>
8059 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8060 Fix long-standing bug in type-lookup. Use FindType instead of
8061 LookupType when ec.ResolvingTypeTree.
8062 (Attribute.ResolveType, Attribute.Resolve)
8063 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8065 (Attributes.Search): Remove internal version. Update.
8066 (Attributes.SearchMulti): Update.
8067 (Attributes.GetClsCompliantAttribute): Remove.
8068 (Attributes.GetIndexerNameAttribute): Remove.
8069 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8070 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8071 * class.cs (Indexer.Define): Likewise.
8073 2004-12-01 Marek Safar <marek.safar@seznam.cz>
8076 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8077 MarshallByReference members access.
8079 * expression.cs: Use CheckMarshallByRefAccess;
8080 Better error CS0197 message.
8082 * report.cs: Print whole related error message.
8084 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8086 * class (GetClassBases): Better error 60 report.
8087 (EventProperty): Disabled warning 67 detection.
8089 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8092 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8094 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8097 2004-11-29 Marek Safar <marek.safar@seznam.cz>
8100 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8102 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8104 2004-11-26 Miguel de Icaza <miguel@ximian.com>
8106 * attribute.cs (Attribute.Resolve): Refine error reporting and
8107 report a cs0117 if the identifier does not exist, to distinguish
8108 from 0617 which is a miss-use of the actual identifier.
8110 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8111 between cs0070 and cs0079.
8113 * class.cs (MemberBase.DoDefine): When reporting a wrong
8114 accessibility level, we use MethodCore to compare instead of
8115 Method (this was a regression in some refactoring effort).
8117 So now we correctly report cs0056 again.
8119 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8120 testing the target_type (which was known to be object_type) and
8121 not the source type (which is anonymous_method).
8123 Fixed reporting of error cs1660.
8125 * expression.cs (UserCast.Source): Expose the underlying cast.
8127 * statement.cs (Switch.SwitchGoverningType): Sort the list of
8128 allowed types to find a match to int32 first (most common).
8130 In addition, it ignores any ImplicitUserConversions that did an
8131 internal implicit conversion (as the switch statement allows only
8132 one integral conversion to exist).
8134 * class.cs (PartialContainer.Create): rename `name' to
8135 `member_name' for clarity. Then replace the string calls with a
8136 call to MemberName.GetPartialName, as now using
8137 MemberName.ToString is an error (this is due to the side effects
8138 it had, that were fixed in the past).
8140 This will restore the error reporting on a number of partial class
8141 errors that were missusing this (and getting an exception as a
8142 results, which is now just a plain textual warning, because
8143 yyparse debug output would crash otherwise).
8145 2004-11-26 Raja R Harinath <rharinath@novell.com>
8147 * Makefile (PROGRAM_INSTALL_DIR): Remove.
8149 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8151 * rootcontext.cs (LookupType): Make sure to cache lookups that
8152 don't give us a negative result. This saves about 5% of corlib
8155 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8157 * report.cs (AbstractMessage.Print): messages are sent to stderr
8159 * class.cs (TypeContainer.GetClassBases): It is an error to have a
8160 non-interface in the list of interfaces (at this point, either
8161 parent was properly set, or a base class is being listed in the
8162 interfaces section).
8164 This flags error 1722, and resolves the crash from bug 69259.
8166 2004-11-25 Ben Maurer <bmaurer@ximian.com>
8168 * statement.cs (Using.EmitExpressionFinally): make this work right
8169 for valuetypes. Fixes 69926.
8171 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8173 * const.cs (Const.ChangeType): Cope with the "0 literal can be
8174 converted to an enum" here, before we try to change the underlying
8175 type. This code exists, but it is a different code path than the
8176 one used while encoding constants.
8178 (ImplicitReferenceConversionExists): In addition, resynchronized
8179 the code here, so it matches the same code in
8180 ImplicitReferenceConversionExists for the `from any class-type S
8181 to any interface-type T'.
8183 2004-11-25 Marek Safar <marek.safar@seznam.cz>
8185 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8187 2004-11-24 Miguel de Icaza <miguel@ximian.com>
8189 * cs-parser.jay: Use verbosity accordingly.
8191 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8193 * expression.cs (Unary.ResolveOperator): Do not report warning;
8194 AddressOf reads from variable.
8196 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8198 2004-11-24 Marek Safar <marek.safar@seznam.cz>
8202 * attribute.cs (Attributable): Removed CheckTargets.
8203 (Attributes.Emit): Explicit attribute targets are tested here.
8205 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8206 not enabled for interfaces.
8208 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8209 (GetAssemblyName): Ouch next bug there.
8211 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
8213 * expression.cs: Error 275 added.
8215 2004-11-23 Marek Safar <marek.safar@seznam.cz>
8217 Fix bug #69177 (Implemented decimal constant support)
8219 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8220 (BinaryFold): Add DecimalConstant.
8222 * const.cs (Define): Decimal constant
8224 (ChangeType): Add decimal type handling.
8225 (LookupConstantValue): Don't set value for decimal type but
8226 emit DecimalConstantAttribute. Needed for constant optimization.
8228 * constant.cs (ToDecimal): New method.
8229 (ConvertToDecimal): New method.
8230 (IntConstant): Implemented ConvertToDecimal.
8231 (DecimalConstant.Emit): Emit optimized version for decimals in
8234 * expression.cs (ResolveOperator): Changed order of constant
8235 reduction to work correctly with native types which have
8236 overloaded operators.
8237 (ResolveMemberAccess): Extract constant value from attribute
8240 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8242 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8243 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8244 (ChangeType): Decimal is special.
8245 (TypeToCoreType): Add decimal type.
8247 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8249 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8252 2004-11-22 Marek Safar <marek.safar@seznam.cz>
8254 * class.cs (EventField.ApplyAttributeBuilder): Fix error
8257 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8259 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8261 * pending.cs (PendingImplementation): Grab only interfaces.
8263 2004-11-19 Marek Safar <marek.safar@seznam.cz>
8265 * statement.cs (ForeachHelperMethods): Add location member and
8266 error 202 detection.
8268 2004-11-18 Marek Safar <marek.safar@seznam.cz>
8270 * expression.cs (DoResolveBase): Fixed wrong warning for out
8273 2004-12-04 Martin Baulig <martin@ximian.com>
8275 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
8276 to check whether the conversion is ok.
8278 * typemanager.cs (TypeManager.GetTypeArguments): Just return
8279 `Type.EmptyTypes' if we're not a generic TypeContainer.
8281 2004-11-25 Miguel de Icaza <miguel@ximian.com>
8283 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8284 old bug: when converting from the null literal to a pointer,
8285 return an EmptyCast, not the NullLiteral.
8287 This fixes #69921, the recent null_type changes probably made this
8290 2004-12-03 Martin Baulig <martin@ximian.com>
8292 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8293 method as our child, call AnonymousMethod.Compatible() on it.
8295 2004-12-02 Miguel de Icaza <miguel@ximian.com>
8297 * class.cs (FieldBase): Use an unused bit field from the field to
8298 encode the `has_offset' property from the FieldMember. This saves
8299 a couple of Ks on bootstrap compilation.
8301 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8302 method as our child, return the AnonymousMethod resolved
8305 * expression.cs (New.DoResolve): Allow return values from
8306 NewDelegate to also include AnonymousMethods.
8310 2004-11-29 Raja R Harinath <rharinath@novell.com>
8312 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
8314 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
8315 System.Runtime.InteropServices._Exception, since it's a base
8316 interface of the core type System.Exception in the net_2_0 profile.
8318 2004-11-27 Martin Baulig <martin@ximian.com>
8320 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
8322 2004-11-26 Raja R Harinath <rharinath@novell.com>
8324 * Makefile: Convert to use executable.make.
8325 * gmcs.exe.sources: New.
8327 2004-11-25 Martin Baulig <martin@ximian.com>
8329 * expression.cs (Invocation.InferType): Added support for byref types.
8331 2004-11-25 Martin Baulig <martin@ximian.com>
8333 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
8334 in TypeManager.TypeToCoreType().
8336 2004-11-25 Martin Baulig <martin@ximian.com>
8338 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
8339 "Dispose" method from the `current_type'.
8340 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
8341 DoDefineMembers() instead of using the MethodBuilder; this is
8342 required for generic iterators.
8344 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
8346 2004-11-24 Martin Baulig <martin@ximian.com>
8348 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
8350 2004-11-20 Martin Baulig <martin@ximian.com>
8352 * expression.cs (Invocation.InferType): Correctly infer generic
8353 instances; see gen-103.cs.
8354 (Invocation.InferTypeArguments): If a generic method doesn't have
8355 any unbound type parameters, we don't need to infer anything.
8357 2004-11-19 Raja R Harinath <rharinath@novell.com>
8359 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
8361 2004-11-17 Raja R Harinath <rharinath@novell.com>
8363 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8364 (TypeHandle.GetMemberCache): New.
8365 (TypeHandle.TypeHandle): Update.
8366 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8367 (TypeManager.LookupParentInterfacesCache):
8368 Rename from LookupInterfaceCache. Optimize slightly.
8369 (TypeManager.MemberLookup_FindMembers): Update.
8370 * decl.cs (MemberCache.MemberCache): Set Container to null in the
8372 (AddCacheContents): Rename from AddHashtable.
8373 * class.cs (TypeContainer.parent_container): Remove.
8374 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8375 (TypeContainer.DoDefineMembers): Don't initialize it.
8376 Update to name changes.
8378 2004-11-17 Miguel de Icaza <miguel@ximian.com>
8380 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8381 that factors the code to check access modifiers on override.
8383 (PropertyBase): Use the code here.
8385 Patch from Lluis S'anchez, fixes bug #69361.
8387 2004-11-15 Miguel de Icaza <miguel@ximian.com>
8389 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8390 routine that is used to report the use of a captured variable
8391 whose address has been taken.
8393 There are two checks: one when variables are being captured and
8394 the other check is when the address of a variable is taken.
8396 (because an anonymous methods might be resolved before *or* after
8397 the address has been taken) and
8399 * expression.cs (Conditional.DoResolve): Remove the special
8400 casing that Martin added to trueExpr and falseExpr being both
8401 NullLiteral. We get the right behavior now just by introducing
8402 the null_type into the compiler.
8404 * convert.cs (ExplicitConversion): Change the code to use
8405 null_type instead of testing `expr is NullLiteral'.
8406 (ImplicitConversionStandard): use null_type too.
8407 (ImplicitReferenceConversionExists): use null_type too.
8408 (ImplicitReferenceConversion): use null_type too.
8410 * literal.cs: The type of `NullLiteral' is now null_type instead
8412 (Resolve): Set the type here.
8414 * typemanager.cs: Introduce null_type.
8416 2004-11-18 Martin Baulig <martin@ximian.com>
8419 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
8421 2004-11-18 Martin Baulig <martin@ximian.com>
8423 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
8425 2004-11-18 Martin Baulig <martin@ximian.com>
8427 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
8428 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
8429 call ResolveConstructedType() on it to resolve it without checking
8431 (Constraints.ResolveTypes): Check them here.
8432 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
8433 but don't check constraints.
8434 (ConstructedType.ResolveAsTypeTerminal): Override this and also
8435 check constraints here.
8436 (ConstructedType.ResolveConstructedType): New public method. This
8437 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
8438 resolve ourselves without checking constraints.
8440 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
8442 2004-11-18 Martin Baulig <martin@ximian.com>
8445 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
8447 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
8449 2004-11-18 Martin Baulig <martin@ximian.com>
8451 * ecore.cs (TypeExpr.ResolveType): Removed.
8452 (Expression.ResolveAsTypeTerminal): We always return a fully
8453 resolved `TypeExpr', so we can just access its `Type'.
8455 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
8457 2004-11-17 Martin Baulig <martin@ximian.com>
8459 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
8460 sure we don't return any unresolved TypeExpr's.
8461 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
8463 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
8465 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
8466 unresolved `ConstructedType's.
8468 2004-11-17 Martin Baulig <martin@ximian.com>
8470 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
8472 2004-11-17 Martin Baulig <martin@ximian.com>
8475 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
8477 * decl.cs (DeclSpace.ResolveType): Removed.
8478 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
8480 2004-11-17 Martin Baulig <martin@ximian.com>
8482 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8483 direction, like FindMembers() does. Fixes #69546, testcase is in
8486 2004-11-16 Martin Baulig <martin@ximian.com>
8488 This is based on a patch from Marek Safar, see bug #69082.
8489 Fixes bugs #63705 and #67130.
8491 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8492 method; create a MemberCache for an interface type and cache the
8495 * decl.cs (IMemberContainer.ParentContainer): Removed.
8496 (IMemberContainer.ParentCache): New property.
8497 (MemberCache.SetupCacheForInterface): Removed.
8498 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8499 to create a cache for an interface's "parent".
8501 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8504 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8506 * statement.cs: Avoid adding bools to a hashtable.
8508 2004-11-15 Martin Baulig <martin@ximian.com>
8510 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
8512 2004-11-11 Martin Baulig <martin@ximian.com>
8514 * typemanager.cs (TypeManager.GetMethodName): New method.
8516 * class.cs (MethodData.Define): Include the generic arity in the
8517 name of an explicit interface; also add it to the method name.
8519 * pending.cs (PendingImplementation.InterfaceMethod): The method
8520 name now includes the generic arity.
8522 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8524 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8525 calling an unsafe method from a safe location.
8527 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8530 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8532 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8534 * namespace.cs (VerifyUsing): use GetPartialName instead of
8537 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8539 * statement.cs (Return.Resolve): Fix regression in typo: if
8540 `in_exc', we have to request a NeedReturnLabel, this was a typo
8541 introduced in the anonymous method check-in. Fixes #69131.
8543 * Indexers were using the ShortName when defining themselves,
8544 causing a regression in the compiler bootstrap when applying the
8545 patch from 2004-11-02 (first part), now they use their full name
8546 and the bug is gone.
8548 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8550 * driver.cs: Strip the path from the names of embedded resources. Fixes
8553 2004-11-04 Raja R Harinath <rharinath@novell.com>
8555 Fix error message regression: cs0104-2.cs.
8556 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8557 (AliasEntry.Resolve): Update.
8558 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8560 (RootContext.LookupType): Update.
8562 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8564 * cs-parser.jay: Add support for handling accessor modifiers
8565 * class: Add support port accessor modifiers and error checking,
8566 define PropertyMethod.Define as virtual (not abstract anymore)
8567 * ecore.cs: Add checking for proeprties access with access modifiers
8568 * iterators.cs: Modify Accessor constructor call based in the modified
8570 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8572 * expression.cs (StringConcat): Handle being called twice,
8573 as when we have a concat in a field init with more than two
8576 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8578 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8579 special case explicit implementations, we should always produce
8580 the .property or .event declaration.
8582 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8583 since it will not return correct data if people use this
8584 unresolved in the presence of using statements (see test-313).
8586 * class.cs (MethodData.Define): If we are an explicit interface
8587 implementation, set the method name to the full name of the
8588 interface plus the name of the method.
8590 Notice that using the method.MethodName.GetFullName() does not
8591 work, as it will only contain the name as declared on the source
8592 file (it can be a shorthand in the presence of using statements)
8593 and not the fully qualifed type name, for example:
8597 class D : ICloneable {
8598 object ICloneable.Clone () {
8602 Would produce a method called `ICloneable.Clone' instead of
8603 `System.ICloneable.Clone'.
8605 * namespace.cs (Alias.Resolve): Use GetPartialName.
8607 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8609 * cs-parser.jay: Add error 1055 report.
8611 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8613 * assign.cs (Assign.DoResolve): Only do the transform of
8614 assignment into a New if the types are compatible, if not, fall
8615 through and let the implicit code deal with the errors and with
8616 the necessary conversions.
8618 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8620 * cs-parser.jay: Add error 1031 report.
8622 * cs-tokenizer.cs: Add location for error 1038.
8624 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8626 * cs-parser.jay: Add error 1016 report.
8628 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8630 * cs-parser.jay: Add errors 1575,1611 report.
8632 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8634 * cs-parser.jay: Add error 1001 report.
8636 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8639 * attribute.cs (GetMarshal): Add method argument for
8640 caller identification.
8642 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8643 agument for GetMarshal and RuntimeMissingSupport.
8645 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8647 * attribute.cs (ExtractSecurityPermissionSet): Removed
8648 TypeManager.code_access_permission_type.
8650 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8652 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8654 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8655 for obsolete use of a variable here. Fixes regression on errors
8656 cs0619-25 and cs0619-26.
8658 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8660 Fix #62358, implemented security attribute encoding.
8662 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8663 Tests permitted SecurityAction for assembly or other types.
8664 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8665 data from SecurityPermissionAttribute to PermisionSet class.
8667 * class.cs (ApplyAttributeBuilder): Added special handling
8668 for System.Security.Permissions.SecurityAttribute based types.
8670 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8671 special handling for System.Security.Permissions.SecurityAttribute
8674 * enum.cs (ApplyAttributeBuilder): Added special handling
8675 for System.Security.Permissions.SecurityAttribute based types.
8677 * parameter.cs (ApplyAttributeBuilder): Added special handling
8678 for System.Security.Permissions.SecurityAttribute based types.
8680 * rootcontext.cs: Next 2 core types.
8682 * typemanager.cs (TypeManager.security_permission_attr_type):
8683 Built in type for the SecurityPermission Attribute.
8684 (code_access_permission_type): Build in type.
8686 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8688 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8689 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8690 all of this information into
8691 EmitContext.EmitCapturedVariableInstance.
8693 * codegen.cs (EmitCapturedVariableInstance): move here the
8694 funcionality of emitting an ldarg.0 in the presence of a
8695 remapping. This centralizes the instance emit code.
8697 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8698 then emit a load of this: it means that we have reached the
8699 topmost ScopeInfo: the one that contains the pointer to the
8700 instance of the class hosting the anonymous method.
8702 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8703 captures to the topmost CaptureContext.
8705 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8707 * expression.cs (LocalVariableReference): Move the knowledge about
8708 the iterators into codegen's EmitCapturedVariableInstance.
8710 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8712 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8713 all code paths return a value from an anonymous method (it is the
8714 same as the 161 error, but for anonymous methods).
8716 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8718 The introduction of anonymous methods in the compiler changed
8719 various ways of doing things in the compiler. The most
8720 significant one is the hard split between the resolution phase
8721 and the emission phases of the compiler.
8723 For instance, routines that referenced local variables no
8724 longer can safely create temporary variables during the
8725 resolution phase: they must do so from the emission phase,
8726 since the variable might have been "captured", hence access to
8727 it can not be done with the local-variable operations from the runtime.
8731 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8732 is a toplevel block.
8734 (ToplevelBlock): A new kind of Block, these are the blocks that
8735 are created by the parser for all toplevel method bodies. These
8736 include methods, accessors and anonymous methods.
8738 These contain some extra information not found in regular blocks:
8739 A pointer to an optional CaptureContext (for tracking captured
8740 local variables and parameters). A pointer to the parent
8743 (Return.Resolve): Catch missmatches when returning a value from an
8744 anonymous method (error 1662).
8745 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8748 (Break.Resolve): ditto.
8750 (SwitchLabel): instead of defining the labels during the
8751 resolution phase, we now turned the public ILLabel and ILLabelCode
8752 labels into methods called GetILLabelCode() and GetILLabel() that
8753 only define the label during the Emit phase.
8755 (GotoCase): Track the SwitchLabel instead of the computed label
8756 (its contained therein). Emit the code by using
8757 SwitchLabel.GetILLabelCode ().
8759 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8760 whether the Local has been captured or not.
8762 (LocalInfo.IsCaptured): New property, used to tell whether the
8763 local has been captured.
8765 * anonymous.cs: Vastly updated to contain the anonymous method
8768 The main classes here are: CaptureContext which tracks any
8769 captured information for a toplevel block and ScopeInfo used to
8770 track the activation frames for various local variables.
8772 Each toplevel block has an optional capture context associated
8773 with it. When a method contains an anonymous method both the
8774 toplevel method and the anonymous method will create a capture
8775 context. When variables or parameters are captured, they are
8776 recorded on the CaptureContext that owns them, for example:
8780 MyDelegate d = delegate {
8785 Here `a' will be recorded as captured on the toplevel
8786 CapturedContext, the inner captured context will not have anything
8787 (it will only have data if local variables or parameters from it
8788 are captured in a nested anonymous method.
8790 The ScopeInfo is used to track the activation frames for local
8791 variables, for example:
8793 for (int i = 0; i < 10; i++)
8794 for (int j = 0; j < 10; j++){
8795 MyDelegate d = delegate {
8800 At runtime this captures a single captured variable `i', but it
8801 captures 10 different versions of the variable `j'. The variable
8802 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8803 recorded on a child.
8805 The toplevel ScopeInfo will also track information like the `this'
8806 pointer if instance variables were referenced (this is necessary
8807 as the anonymous method lives inside a nested class in the host
8808 type of the method).
8810 (AnonymousMethod): Expanded to track the Toplevel, implement
8811 `AnonymousMethod.Compatible' to tell whether an anonymous method
8812 can be converted to a target delegate type.
8814 The routine now also produces the anonymous method content
8816 (AnonymousDelegate): A helper class that derives from
8817 DelegateCreation, this is used to generate the code necessary to
8818 produce the delegate for the anonymous method that was created.
8820 * assign.cs: API adjustments for new changes in
8821 Convert.ImplicitStandardConversionExists.
8823 * class.cs: Adjustments to cope with the fact that now toplevel
8824 blocks are of type `ToplevelBlock'.
8826 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8827 insteda of standard blocks.
8829 Flag errors if params arguments are passed to anonymous methods.
8831 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8832 `CurrentAnonymousMethod' which points to the current Anonymous
8833 Method. The variable points to the AnonymousMethod class that
8834 holds the code being compiled. It is set in the new EmitContext
8835 created for the anonymous method.
8837 (EmitContext.Phase): Introduce a variable and an enumeration to
8838 assist in enforcing some rules about when and where we are allowed
8839 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8840 only one that enfonces this right now).
8842 (EmitContext.HaveCaptureInfo): new helper method that returns
8843 whether we have a CapturedContext initialized.
8845 (EmitContext.CaptureVariable): New method used to register that a
8846 LocalInfo must be flagged for capturing.
8848 (EmitContext.CapturedParameter): New method used to register that a
8849 parameters must be flagged for capturing.
8851 (EmitContext.CapturedField): New method used to register that a
8852 field must be flagged for capturing.
8854 (EmitContext.HaveCapturedVariables,
8855 EmitContext.HaveCapturedFields): Return whether there are captured
8856 variables or fields.
8858 (EmitContext.EmitMethodHostInstance): This is used to emit the
8859 instance for the anonymous method. The instance might be null
8860 (static methods), this (for anonymous methods that capture nothing
8861 and happen to live side-by-side with the current method body) or a
8862 more complicated expression if the method has a CaptureContext.
8864 (EmitContext.EmitTopBlock): Routine that drives the emission of
8865 code: it will first resolve the top block, then emit any metadata
8866 and then emit the code. The split is done so that we can extract
8867 any anonymous methods and flag any captured variables/parameters.
8869 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8870 during this phase, the ILGenerator should not be used as labels
8871 and local variables declared here might not be accessible to any
8872 code that is part of an anonymous method.
8874 Exceptions to this include the temporary variables that are
8875 created by some statements internally for holding temporary
8878 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8881 (EmitContext.TemporaryReturn): This method is typically called
8882 from the Emit phase, and its the only place where we allow the
8883 ReturnLabel to be defined other than the EmitMeta. The reason is
8884 that otherwise we would have to duplicate a lot of logic in the
8885 Resolve phases of various methods that today is on the Emit
8888 (EmitContext.NeedReturnLabel): This no longer creates the label,
8889 as the ILGenerator is not valid during the resolve phase.
8891 (EmitContext.EmitThis): Extended the knowledge in this class to
8892 work in anonymous methods in addition to iterators.
8894 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8895 code is necessary on the stack to access the instance to a local
8896 variable (the variable will be accessed as a field).
8898 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8899 EmitContext.EmitAddressOfParameter): Routines to support
8900 parameters (not completed at this point).
8902 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8903 will also remove the parameters.
8905 * convert.cs (Convert): Define a `ConstantEC' which points to a
8906 null. This is just to prefity some code that uses
8907 ImplicitStandardConversion code and do not have an EmitContext
8910 The idea is to flag explicitly that at that point in time, it is
8911 known that the conversion will not trigger the delegate checking
8912 code in implicit conversions (which requires a valid
8915 Everywhere: pass new EmitContext parameter since
8916 ImplicitStandardConversionExists now requires it to check for
8917 anonymous method conversions.
8919 (Convert.ImplicitStandardConversionExists): If the type of an
8920 expression is the anonymous_method_type, and the type is a
8921 delegate, we invoke the AnonymousMethod.Compatible method to check
8922 whether an implicit conversion is possible.
8924 (Convert.ImplicitConversionStandard): Only do implicit method
8925 group conversions if the language level is not ISO_1.
8927 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8928 MethodInfo for the Invoke method. used by Delegate and
8931 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8932 method conversions if the target type is a delegate.
8934 Removed extra debugging nops.
8936 (LocalVariableReference): Turn the `local_info' into a public
8939 Add `prepared' field, the same hack used for FieldExprs to cope
8940 with composed assignments, as Local variables do not necessarily
8941 operate purely on the stack as they used to: they can be captured
8944 Add `temp' for a temporary result, like fields.
8946 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8948 It now copes with Local variables that are captured and emits the
8949 proper instance variable to load it from a field in the captured
8952 (ParameterReference.DoResolveBase): During the resolve phase,
8953 capture parameters if we are in an anonymous method.
8955 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8956 anonymous method, use the EmitContext helper routines to emit the
8957 parameter reference.
8959 * iterators.cs: Set RemapToProxy to true/false during the
8962 * parameters.cs (GetParameterByName): New helper method.
8964 * typemanager.cs (anonymous_method_type) a new type that
8965 represents an anonyous method. This is always an internal type,
8966 used as a fencepost to test against the anonymous-methodness of an
8969 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8971 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8973 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8975 2004-11-10 Martin Baulig <martin@ximian.com>
8977 * expression.cs (Invocation.BetterFunction): If two methods have
8978 equal parameter types, but only one of them is generic, the
8979 non-generic one wins.
8980 (New.DoResolve): Don't set `is_struct' to false if we're a generic
8981 instance; just use `Type.IsValueType' to determine whether
8982 something is a struct or not.
8983 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8984 so we can be called multiple times.
8986 2004-11-10 Martin Baulig <martin@ximian.com>
8988 * generic.cs (TypeParameter.DefineConstraints): New public method.
8989 (TypeParameter.CheckAccessLevel): Override this and return true.
8990 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8991 override ResolveType() anymore.
8992 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8994 2004-11-10 Martin Baulig <martin@ximian.com>
8996 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8997 call DeclSpace.ResolveNestedType() on it.
8999 2004-11-10 Martin Baulig <martin@ximian.com>
9001 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
9002 non-null, call ParameterModifier() on it.
9004 2004-11-10 Martin Baulig <martin@ximian.com>
9007 (Iterators): Added `current_type' and `this_type' fields.
9008 (Iterators.DefineIterator): Create a new EmitContext and store it
9009 in `ec'; compute `this_type'.
9011 2004-11-10 Martin Baulig <martin@ximian.com>
9014 (TypeManager.IsPrivateAccessible): New public method.
9015 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
9017 2004-11-10 Martin Baulig <martin@ximian.com>
9019 * class.cs (TypeContainer.DefineType): Call
9020 TypeBuilder.DefineGenericParameters() before resolving the type
9022 (MethodData.parent_method): New protected field.
9023 (MethodData..ctor): Added `MethodInfo parent_method' argument.
9024 (MethodData.Define): Compute `parent_method'.
9027 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
9028 (MemberCore.GetClsCompliantAttributeValue): Likewise.
9029 (DeclSpace.ec): New protected field; store the EmitContext here.
9030 (DeclSpace.EmitContext): New public property.
9031 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
9032 (DeclSpace.ResolveNestedType): New public method.
9033 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
9034 (DeclSpace.NestedAccessible): Added `Type tb' argument.
9035 (DeclSpace.FamilyAccessible): Likewise.
9036 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
9037 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
9040 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
9043 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
9044 (Enum.Emit): Don't create a new EmitContext.
9046 2004-10-18 Martin Baulig <martin@ximian.com>
9048 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9049 `Type' directly, but call ResolveType() on it.
9050 (Catch.Resolve): Likewise.
9051 (Foreach.Resolve): Likewise.
9053 2004-10-18 Martin Baulig <martin@ximian.com>
9055 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9056 `Type' directly, but call ResolveType() on it.
9057 (Probe.DoResolve): Likewise.
9058 (ArrayCreation.LookupType): Likewise.
9059 (TypeOf.DoResolve): Likewise.
9060 (SizeOf.DoResolve): Likewise.
9062 2004-10-18 Raja R Harinath <rharinath@novell.com>
9064 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9067 2004-10-17 John Luke <john.luke@gmail.com>
9069 * class.cs (Operator.GetSignatureForError): use CSharpName
9071 * parameter.cs (Parameter.GetSignatureForError): Returns
9072 correct name even if was not defined.
9074 2004-10-13 Raja R Harinath <rharinath@novell.com>
9077 * class.cs (TypeContainer.EmitContext): New property.
9078 (DefineNestedTypes): Create an emitcontext for each part.
9079 (MethodCore.DoDefineParameters): Use container's emitcontext.
9080 Pass type array to InternalParameters.
9081 (MemberBase.DoDefine): Use container's emitcontext.
9082 (FieldMember.Define): Likewise.
9083 (Event.Define): Likewise.
9084 (SetMethod.GetParameterInfo): Change argument to EmitContext.
9085 Pass type array to InternalParameters.
9086 (SetIndexerMethod.GetParameterInfo): Likewise.
9087 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9088 * delegate.cs (Define): Pass emitcontext to
9089 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
9090 array to InternalParameters.
9091 * expression.cs (ParameterReference.DoResolveBase): Pass
9092 emitcontext to GetParameterInfo.
9093 (ComposedCast.DoResolveAsTypeStep): Remove check on
9094 ec.ResolvingTypeTree.
9095 * parameter.cs (Parameter.Resolve): Change argument to
9096 EmitContext. Use ResolveAsTypeTerminal.
9097 (Parameter.GetSignature): Change argument to EmitContext.
9098 (Parameters.ComputeSignature): Likewise.
9099 (Parameters.ComputeParameterTypes): Likewise.
9100 (Parameters.GetParameterInfo): Likewise.
9101 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9102 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9103 * support.cs (InternalParameters..ctor): Remove variant that takes
9105 * typemanager.cs (system_intptr_expr): New.
9106 (InitExpressionTypes): Initialize it.
9108 2004-10-12 Chris Toshok <toshok@ximian.com>
9110 * cs-parser.jay: fix location for try_statement and catch_clause.
9112 2004-10-18 Martin Baulig <martin@ximian.com>
9114 * class.cs (FieldMember.Define): Don't access the TypeExpr's
9115 `Type' directly, but call ResolveType() on it.
9116 (MemberBase.DoDefine): Likewise.
9118 * expression.cs (New.DoResolve): Don't access the TypeExpr's
9119 `Type' directly, but call ResolveType() on it.
9120 (ComposedCast.DoResolveAsTypeStep): Likewise.
9122 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9123 `Type' directly, but call ResolveType() on it.
9125 2004-10-17 John Luke <john.luke@gmail.com>
9127 * class.cs (Operator.GetSignatureForError): use CSharpName
9129 * parameter.cs (Parameter.GetSignatureForError): Returns
9130 correct name even if was not defined.
9132 2004-10-13 Raja R Harinath <rharinath@novell.com>
9135 * class.cs (TypeContainer.EmitContext): New property.
9136 (DefineNestedTypes): Create an emitcontext for each part.
9137 (MethodCore.DoDefineParameters): Use container's emitcontext.
9138 Pass type array to InternalParameters.
9139 (MemberBase.DoDefine): Use container's emitcontext.
9140 (FieldMember.Define): Likewise.
9141 (Event.Define): Likewise.
9142 (SetMethod.GetParameterInfo): Change argument to EmitContext.
9143 Pass type array to InternalParameters.
9144 (SetIndexerMethod.GetParameterInfo): Likewise.
9145 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9146 * delegate.cs (Define): Pass emitcontext to
9147 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
9148 array to InternalParameters.
9149 * expression.cs (ParameterReference.DoResolveBase): Pass
9150 emitcontext to GetParameterInfo.
9151 (ComposedCast.DoResolveAsTypeStep): Remove check on
9152 ec.ResolvingTypeTree.
9153 * parameter.cs (Parameter.Resolve): Change argument to
9154 EmitContext. Use ResolveAsTypeTerminal.
9155 (Parameter.GetSignature): Change argument to EmitContext.
9156 (Parameters.ComputeSignature): Likewise.
9157 (Parameters.ComputeParameterTypes): Likewise.
9158 (Parameters.GetParameterInfo): Likewise.
9159 (Parameters.ComputeAndDefineParameterTypes): Likewise.
9160 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
9161 * support.cs (InternalParameters..ctor): Remove variant that takes
9163 * typemanager.cs (system_intptr_expr): New.
9164 (InitExpressionTypes): Initialize it.
9166 2004-10-12 Chris Toshok <toshok@ximian.com>
9168 * cs-parser.jay: fix location for try_statement and catch_clause.
9170 2004-10-07 Raja R Harinath <rharinath@novell.com>
9172 More DeclSpace.ResolveType avoidance.
9173 * decl.cs (MemberCore.InUnsafe): New property.
9174 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
9175 with newly created EmitContext.
9176 (FieldMember.Define): Likewise.
9177 * delegate.cs (Delegate.Define): Likewise.
9178 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9179 only if normal name-lookup fails.
9180 (TypeExpr.DoResolve): Enable error-checking.
9181 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9182 (SizeOf.DoResolve): Likewise.
9183 (ComposedCast.DoResolveAsTypeStep): Likewise.
9184 (StackAlloc.DoResolve): Likewise.
9185 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9186 (Block.Unsafe): New property.
9187 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9188 (Unsafe): Set 'unsafe' flag of contained block.
9189 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9190 (Fixed.Resolve): Likewise.
9191 (Catch.Resolve): Likewise.
9192 (Using.ResolveLocalVariableDecls): Likewise.
9193 (Foreach.Resolve): Likewise.
9195 2004-10-05 John Luke <john.luke@gmail.com>
9197 * cs-parser.jay: add location to error CS0175
9199 2004-10-04 Miguel de Icaza <miguel@ximian.com>
9201 * ecore.cs (Expression.Constantity): Add support for turning null
9204 * const.cs (Const.Define): Allow constants to be reference types
9205 as long as the value is Null.
9207 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
9209 * namespace.cs (NamespaceEntry.Using): No matter which warning
9210 level is set, check if this namespace name has already been added.
9212 2004-10-03 Ben Maurer <bmaurer@ximian.com>
9214 * expression.cs: reftype [!=]= null should always use br[true,false].
9217 2004-10-03 Marek Safar <marek.safar@seznam.cz>
9220 * attribute.cs: Enum conversion moved to
9221 GetAttributeArgumentExpression to be applied to the all
9224 2004-10-01 Raja R Harinath <rharinath@novell.com>
9226 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9227 * class.c (TypeContainer.DefineType): Flag error if
9228 base types aren't accessible due to access permissions.
9229 * decl.cs (DeclSpace.ResolveType): Move logic to
9230 Expression.ResolveAsTypeTerminal.
9231 (DeclSpace.ResolveTypeExpr): Thin layer over
9232 Expression.ResolveAsTypeTerminal.
9233 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9234 Refactor code into NestedAccess. Use it.
9235 (DeclSpace.NestedAccess): New.
9236 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9237 argument to silence errors. Check access permissions.
9238 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9239 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9240 (Cast.DoResolve): Likewise.
9241 (New.DoResolve): Likewise.
9242 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9243 (TypeOf.DoResolve): Likewise.
9245 * expression.cs (Invocation.BetterConversion): Return the Type of
9246 the better conversion. Implement section 14.4.2.3 more faithfully.
9247 (Invocation.BetterFunction): Make boolean. Make correspondence to
9248 section 14.4.2.2 explicit.
9249 (Invocation.OverloadResolve): Update.
9250 (Invocation): Remove is_base field.
9251 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
9252 (Invocation.Emit): Likewise.
9254 2004-09-24 Marek Safar <marek.safar@seznam.cz>
9256 * cs-parser.jay: Reverted 642 warning fix.
9258 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9261 * decl.cs (FindMemberWithSameName): Indexer can have more than
9264 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9266 * expression.cs (LocalVariableReference.DoResolveLValue):
9267 Do not report warning 219 for out values.
9268 (EmptyExpression.Null): New member to avoid extra allocations.
9270 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9272 * cs-parser.jay: Fix wrong warning 642 report.
9274 * cs-tokenizer.cs (CheckNextToken): New helper;
9275 Inspect next character if is same as expected.
9277 2004-09-23 Martin Baulig <martin@ximian.com>
9279 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9280 (Convert.ImplicitReferenceConversionExists): Likewise.
9282 2004-11-09 Raja R Harinath <rharinath@novell.com>
9284 * Makefile (DISTFILES): Comment out a few missing files.
9286 2004-10-29 Raja R Harinath <rharinath@novell.com>
9288 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
9289 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
9290 (gmcs.exe): Invoke bootstrap-libs.
9291 (clean-local): Clean the net_2_0_bootstrap profile too.
9292 (PROGRAM_INSTALL_DIR): New.
9293 (install-local): Use it.
9295 2004-10-13 Martin Baulig <martin@ximian.com>
9297 * generic.cs (TypeManager.InflatedConstraints): New nested class.
9298 (TypeParameter.DefineType): If we're a method type parameter and
9299 that method is overriding something, "inflate" its constraints.
9301 2004-10-12 Martin Baulig <martin@ximian.com>
9303 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
9304 and have type arguments, create and resolve a ConstructedType.
9306 2004-10-12 Martin Baulig <martin@ximian.com>
9308 * decl.cs (MemberCache.FindMemberToOverride): Use
9309 TypeManager.IsEqual() to compare the parameters and Type.Equals()
9310 to compare the invocationType.
9312 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
9313 When comparing two type parameters, only do the signature-only
9314 comparision for method type parameters.
9316 2004-10-11 Martin Baulig <martin@ximian.com>
9318 * report.cs: Don't make --fatal abort on warnings, we have
9319 -warnaserror for that.
9321 2004-10-11 Martin Baulig <martin@ximian.com>
9324 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
9325 (TypeManager.IsEqual): Call ourself recursively instead of using
9328 2004-10-11 Martin Baulig <martin@ximian.com>
9330 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
9331 on our own type parameters, not on the ones we inherit from a containing
9334 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
9337 * generic.cs (TypeParameter.Define): We may only be called once.
9339 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
9340 instead of TypeManager.IsEqual().
9342 2004-09-28 Martin Baulig <martin@ximian.com>
9345 (GenericConstraints.EffectiveBaseClass): New public property.
9346 (TypeParameter.GenericConstraints): New public property.
9347 (ConstructedType.CheckConstraints): Improved.
9349 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
9350 (Convert.TypeParameterConversion): New private method; use this in
9351 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
9352 for all conversions related to type parameters.
9354 2004-09-24 Martin Baulig <martin@ximian.com>
9356 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
9357 type parameter conversions for type parameters which are known to
9360 2004-09-24 Martin Baulig <martin@ximian.com>
9362 * generic.cs (GenericConstraints): Added `IsReferenceType' and
9363 `IsValueType' properties.
9365 * support.cs (ReflectionConstraints): Use
9366 Type.GetGenericParameterConstraints() instead of the old hack.
9368 2004-09-24 Martin Baulig <martin@ximian.com>
9370 * generic.cs (GenericConstraints): Moved here and made it an
9373 * support.cs (GenericConstraints): Moved to generic.cs.
9375 2004-09-24 Martin Baulig <martin@ximian.com>
9378 (ReflectionConstraints): Un-nested this class and made it public.
9381 (TypeManager.GetTypeParameterConstraints): New public method.
9382 (TypeManager.HasConstructorConstraint): Use the attributes.
9384 2004-09-24 Martin Baulig <martin@ximian.com>
9386 * support.cs (GenericConstraints): Replaced `HasConstructor',
9387 `IsReferenceType' and `IsValueType' with `Attributes'.
9388 (ReflectionParameters.ReflectionConstraints): Removed the Create()
9389 method and made the .ctor public.
9391 * generic.cs (Constraints.Attributes): New public property.
9392 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
9393 `IsReferenceType' -> `HasReferenceTypeConstraint' and
9394 `IsValueType' -> `HasValueTypeConstraint'.
9396 2004-09-23 Martin Baulig <martin@ximian.com>
9398 * generic.cs (Constraints): Reflect latest runtime changes.
9400 2004-09-23 Martin Baulig <martin@ximian.com>
9402 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9403 (Convert.ImplicitReferenceConversionExists): Likewise.
9405 2004-09-23 Marek Safar <marek.safar@seznam.cz>
9407 * class.cs (Operator.Define): Add error 448 and 559 report.
9409 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9411 * class.cs (MemberBase.IsTypePermitted): New protected
9412 method for checking error CS0610.
9414 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9416 * class.cs (TypeContainer.HasExplicitLayout): New property
9417 Returns whether container has StructLayout attribute set Explicit.
9418 (FieldMember): New abstract class for consts and fields.
9419 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9420 (Field): Reuse FieldMember.
9422 * const.cs (Const): Reuse FieldMember.
9424 * rootcontext.cs: EmitConstants call moved to class.
9426 2004-09-22 Martin Baulig <martin@ximian.com>
9428 Marek and me just fixed one of our oldest bugs: #28562 :-)
9430 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9432 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9433 we're an EnumConstant, just return that.
9434 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9435 an EnumConstant. In this case, we need to use GetValueAsEnumType()
9436 to get the value which'll actually be written into the attribute.
9437 However, we have to use GetValue() to access the attribute's value
9440 2004-09-22 Marek Safar <marek.safar@seznam.cz>
9442 * constant.cs (Constant.IsNegative): New abstract property
9445 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9446 (StackAlloc.DoResolve): Reused IsNegative.
9448 2004-09-22 Martin Baulig <martin@ximian.com>
9450 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
9451 public method; like LookupTypeContainer, but also works for
9454 * report.cs (Report.SymbolRelatedToPreviousError): Use
9455 TypeManager.LookupGenericTypeContainer().
9457 2004-09-22 Martin Baulig <martin@ximian.com>
9459 Thanks to Peter Sestoft for this bug report.
9461 * expression.cs (Conditional): If both the `trueExpr' and the
9462 `falseExpr' is a NullLiteral, return a NullLiteral.
9464 2004-09-22 Martin Baulig <martin@ximian.com>
9466 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9467 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9468 for the "get_Current" call.
9470 2004-09-21 Martin Baulig <martin@ximian.com>
9472 * convert.cs (Convert.ImplicitReferenceConversion): When
9473 converting to an interface type, first check whether we're
9474 converting from a reference type.
9476 2004-09-14 Martin Baulig <martin@ximian.com>
9478 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9480 2004-09-14 Marek Safar <marek.safar@seznam.cz>
9483 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9484 called and is obsolete then this member suppress message
9485 when call is inside next [Obsolete] method or type.
9487 * expression.cs: Use TestObsoleteMethodUsage member.
9489 2004-09-14 Martin Baulig <martin@ximian.com>
9491 * genericparser.cs: Removed.
9493 2004-09-13 Marek Safar <marek.safar@seznam.cz>
9495 * class.cs (MethodCore.CheckBase): Fix bug #65757.
9497 2004-09-12 Marek Safar <marek.safar@seznam.cz>
9499 * attribute.cs (Attribute.Resolve): Add error 653 report.
9501 * class.cs (Class.ApplyAttributeBuilder): Add error 641
9503 (Method.ApplyAttributeBuilder): Add error 685 report.
9504 (Operator.Define): Add error 564 report.
9506 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9508 * expression.cs (Invocation.DoResolve): Add error
9511 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9514 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9516 * class.cs (ConstructorInitializer.Resolve):
9517 Wrong error number (515->516).
9519 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9521 * class.cs (Indexer.Define): Add error 631 report.
9523 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9525 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9527 2004-09-11 Marek Safar <marek.safar@seznam.cz>
9529 * expression.cs (Probe.DoResolve): Add error CS0241 report.
9531 2004-09-10 Marek Safar <marek.safar@seznam.cz>
9533 * cs-parser.jay: Added error CS0241 report.
9535 2004-09-10 Raja R Harinath <rharinath@novell.com>
9537 * cs-parser.jay (fixed_statement): Introduce a scope for the
9538 declaration in the 'fixed' statement.
9540 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9542 * cs-parser.jay: Added CS0230 error report.
9544 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9546 * cs-parser.jay: Added errors CS0231 and CS0257 report.
9548 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9550 * expression.cs (Argument.Resolve): Added error CS0192 and
9553 2004-09-09 Marek Safar <marek.safar@seznam.cz>
9555 C# 2.0 #pragma warning feature
9557 * cs-tokenizer.cs (PreProcessPragma): New method;
9558 Handles #pragma directive.
9560 * report.cs (WarningRegions): New class; Support
9561 class for #pragma warning directive. It tests whether
9562 warning is enabled for a given line.
9564 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9566 * const.cs: Add more descriptive error report, tahnks to
9569 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9571 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9573 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9575 * expression.cs: Apply patch from Ben: Remove dead code from
9576 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9577 as that code just threw an exception anwyays.
9579 * const.cs: Remove the call to the turnintoconstant, for details
9582 * literal.cs: The type of the null-literal is the null type; So
9583 we use a placeholder type (literal.cs:System.Null, defined here)
9586 * expression.cs (Conditional.DoResolve): Remove some old code that
9587 is no longer needed, conversions have been fixed.
9589 (ArrayCreationExpression.DoResolve): Return false if we fail to
9590 resolve the inner expression.
9592 2004-09-07 Raja R Harinath <rharinath@novell.com>
9595 * cs-parser.jay (delegate_declaration): Record a delegate
9596 declaration as a type declaration.
9597 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9599 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9601 * parameter.cs: Do not crash if the type can not be resolved.
9603 * expression.cs: Report errors with unsafe pointers, fixes #64896
9605 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9607 * expression.cs: Pointer arith always needs to do a conv.i
9608 if the operand is a long. fix 65320
9610 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9612 Fixed cs0619-37.cs, cs0619-38.cs
9614 * enum.cs (GetObsoleteAttribute): Removed.
9616 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9617 on Enum member is double staged. The first is tested member
9620 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9622 Fixed #56986, #63631, #65231
9624 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9625 adds member to name container.
9626 (TypeContainer.AddToTypeContainer): New method, adds type to
9628 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9629 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9630 AddOperator): Simplified by reusing AddToMemberContainer.
9631 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9633 (Method.CheckForDuplications): Fixed implementation to test all
9635 (MemberBase): Detection whether member is explicit interface
9636 implementation is now in constructor.
9637 (MemberBase.UpdateMemberName): Handles IndexerName.
9638 (Accessor): Changed to keep also location information.
9639 (AbstractPropertyEventMethod): Is derived from MemberCore.
9640 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9641 will be emited or not.
9642 (PropertyBase.AreAccessorsDuplicateImplementation):
9643 Tests whether accessors are not in collision with some method.
9644 (Operator): Is derived from MethodCore to simplify common
9647 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9649 (DeclSpace.AddToContainer): Adds the member to defined_names
9650 table. It tests for duplications and enclosing name conflicts.
9652 * enum.cs (EnumMember): Clean up to reuse the base structures
9654 2004-09-03 Martin Baulig <martin@ximian.com>
9656 Merged latest changes into gmcs. Please keep this comment in
9657 here, it makes it easier for me to see what changed in MCS since
9658 the last time I merged.
9660 2004-09-03 Martin Baulig <martin@ximian.com>
9662 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9663 into TypeContainer, to make partial classes work again.
9665 2004-09-03 Martin Baulig <martin@ximian.com>
9667 * rootcontext.cs (RootContext.V2): Removed.
9669 2004-03-23 Martin Baulig <martin@ximian.com>
9671 * expression.cs (Invocation.OverloadResolve): Added `bool
9672 may_fail' argument and use it instead of the Location.IsNull() hack.
9674 2004-09-09 Martin Baulig <martin@ximian.com>
9676 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9678 2004-09-09 Martin Baulig <martin@ximian.com>
9680 * generic.cs (TypeParameter.DefineType): Added support for
9681 explicit interface methods.
9683 2004-09-09 Martin Baulig <martin@ximian.com>
9685 * README.Changes: New document. Started to list important changes
9686 between MCS and GMCS here.
9688 2004-09-08 Martin Baulig <martin@ximian.com>
9691 (TypeContainer.CheckRecursiveDefinition): New protected method.
9692 (TypeContainer.DefineType): Move the CS0146 check into
9693 CheckRecursiveDefinition().
9695 2004-09-06 Martin Baulig <martin@ximian.com>
9697 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9698 types for the constructor constraint.
9700 2004-09-03 Martin Baulig <martin@ximian.com>
9702 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9703 into TypeContainer, to make partial classes work again.
9705 2004-09-03 Martin Baulig <martin@ximian.com>
9707 * rootcontext.cs (RootContext.V2): Removed.
9709 2004-03-23 Martin Baulig <martin@ximian.com>
9711 * expression.cs (Invocation.OverloadResolve): Added `bool
9712 may_fail' argument and use it instead of the Location.IsNull() hack.
9714 2004-09-03 Martin Baulig <martin@ximian.com>
9716 Merged latest changes into gmcs. Please keep this comment in
9717 here, it makes it easier for me to see what changed in MCS since
9718 the last time I merged.
9720 2004-09-03 Raja R Harinath <rharinath@novell.com>
9723 * expression.cs (BetterConversion): Don't allow either conversion
9724 to be null. Remove redundant implicit conversion test when 'q ==
9725 null' -- when this function is invoked, we already know that the
9726 implicit conversion exists.
9727 (BetterFunction): Assume that 'best' is non-null. Remove
9728 redundant reimplementation of IsApplicable when 'best' is null.
9729 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9730 number of arguments.
9731 (IsAncestralType): Extract from OverloadResolve.
9732 (OverloadResolve): Make robust to the MethodGroupExpr being
9733 unsorted. Implement all the logic of Section 14.5.5.1, and
9734 support overloading of methods from multiple applicable types.
9735 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9737 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9738 (RealError, Warning): Append type of report to related symbol.
9740 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9742 * enum.cs: Fixed CLS-Compliance checks for enum members.
9743 Error tests cs3008-8.cs, cs3014-8.cs
9745 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9747 Fixed bug #62342, #63102
9748 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9749 like ImplementMethod.
9751 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9753 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9756 2004-09-02 Martin Baulig <martin@ximian.com>
9758 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9759 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9762 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9764 C# 2.0 Static classes implemented
9766 * class.cs (TypeContainer): instance_constructors,
9767 initialized_fields, initialized_static_fields,
9768 default_constructor, base_inteface_types are protected to be
9769 accessible from StaticClass.
9770 (TypeContainer.DefineDefaultConstructor): New virtual method
9771 for custom default constructor generating
9772 (StaticClass): New class to handle "Static classes" feature.
9774 * cs-parser.jay: Handle static keyword on class like instance
9777 * driver.cs: Added "/langversion" command line switch with two
9778 options (iso-1, default).
9780 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9782 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9784 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9786 * delegate.cs: Style.
9788 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9790 * delegate.cs: Add seperate instance expr field for miguel.
9792 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9794 * PointerArithmetic (Resolve): make sure we are not doing
9795 pointer arith on void*. Also, make sure we are resolved
9796 by not setting eclass until resolve.
9798 All callers: Make sure that PointerArithmetic gets resolved.
9800 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9802 * ArrayCreation (LookupType): If the type does not resolve
9803 to an array, give an error.
9805 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9807 * statement.cs (Try.Resolve): Fixed bug #64222
9809 2004-08-27 Martin Baulig <martin@ximian.com>
9812 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9815 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9817 * ecore.cs (Constantify): Get underlying type via
9818 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9819 Windows in special cases.
9821 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9823 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9824 for obtaining also private methods.
9825 (GetRemoveMethod): Used GetRemoveMethod (true)
9826 for obtaining also private methods.
9828 2004-09-02 Martin Baulig <martin@ximian.com>
9830 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9831 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9834 2004-08-27 Martin Baulig <martin@ximian.com>
9837 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9840 2004-08-25 Martin Baulig <martin@ximian.com>
9842 * support.cs (ReflectionParameters..ctor): If this is a generic
9843 method, retrieve and store its type parameters.
9844 (InternalParameters..ctor): Added `TypeParameter[]' argument.
9845 (ReflectionParameters.GenericConstraints): The argument specifies
9846 the type parameter, not the method parameter.
9847 (InternalParameters.GenericConstraints): Likewise.
9849 * generic.cs (TypeParameter.DefineType): Correctly handle
9850 constraints wrt. generic methods in interfaces and their
9853 2004-08-24 Martin Baulig <martin@ximian.com>
9855 * generic.cs (TypeParameter.IsSubclassOf): New public method.
9856 (Constraints.IsSubclassOf): New internal method.
9858 * typemanager.cs (TypeManager.FindMembers): Added special support
9859 for GenericTypeParameterBuilder's.
9860 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9863 2004-08-24 Martin Baulig <martin@ximian.com>
9866 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9867 this for accessibility checks.
9868 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9869 IsNestedFamilyAccessible.
9870 (TypeManager.IsSubclassOf): New method, do what the name actually
9873 2004-08-24 Martin Baulig <martin@ximian.com>
9875 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9876 as a SimpleName, include the generic arity.
9878 2004-08-24 Martin Baulig <martin@ximian.com>
9880 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9881 MethodAttributes.HideBySig for operators.
9883 2004-08-23 Martin Baulig <martin@ximian.com>
9885 Back to the old error reporting system :-)
9887 * report.cs (Message): Removed.
9888 (Report.MessageData, ErrorData, WarningData): Removed.
9889 (Report.Error, Warning): Back to the old system.
9891 2004-08-23 Martin Baulig <martin@ximian.com>
9893 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9895 * class.cs (TypeContainer.ParentContainer): New public virtual
9896 method; replaces the explicit interface implementation.
9897 (ClassPart.ParentContainer): Override.
9899 2004-08-23 Martin Baulig <martin@ximian.com>
9901 * statement.cs (Switch): Added support for constant switches; see
9902 #59428 or test-285.cs.
9904 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9907 * statement.cs (GetEnumeratorFilter): Removed useless
9908 logic because C# specs is strict. GetEnumerator must be
9911 2004-08-22 Martin Baulig <martin@ximian.com>
9913 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9914 a switch and may break, reset the barrier. Fixes #59867.
9916 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9918 CLS-Compliance speed up (~5% for corlib)
9920 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9921 New method. Tests container for CLS-Compliant names
9923 * class.cs (TypeContainer.VerifyClsName): New method.
9924 Checks whether container name is CLS Compliant.
9925 (Constructor): Implements IMethodData.
9927 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9928 low-case table for CLS Compliance test.
9929 (MemberCache.VerifyClsParameterConflict): New method.
9930 Checks method parameters for CS3006 error.
9932 * enum.cs (EnumMember): Is derived from MemberCore.
9933 (Enum.VerifyClsName): Optimized for better performance.
9935 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9937 * report.cs: Renamed Error_T to Error and changed all
9940 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9942 * class.cs (TypeContainer.IndexerArrayList): New inner class
9943 container for indexers.
9944 (TypeContainer.DefaultIndexerName): New constant for default
9945 indexer name. Replaced all "Item" with this constant.
9946 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9948 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9949 DefaultMemberAttribute constructor.
9951 2004-08-05 Martin Baulig <martin@ximian.com>
9953 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9956 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9958 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9959 multi platforms problem.
9961 * compiler.csproj: Included shared files.
9963 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9965 Fix bug 60333, 55971 in the more general way
9966 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9967 Added arg_type argument for constant conversion.
9968 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9970 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9973 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9974 OperatorArrayList, MethodCoreArrayList for typecontainer
9975 containers. Changed class member types to these new types.
9976 (MethodArrayList.DefineMembers): Added test for CS0659.
9978 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9980 * cfold.cs: Synchronize the folding with the code in expression.cs
9981 Binary.DoNumericPromotions for uint operands.
9983 * attribute.cs: Revert patch from Raja, it introduced a regression
9984 while building Blam-1.2.1 (hard to isolate a test case).
9986 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9990 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9992 (MethodCore.parent_method): New member. The method we're overriding
9993 if this is an override method.
9994 (MethodCore.CheckBase): Moved from Method class and made common.
9995 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9997 (MethodCore.CheckForDuplications): New abstract method. For custom
9998 member duplication search in a container
9999 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10000 method and its return type.
10001 (Event.conflict_symbol): New member. Symbol with same name in the
10005 (MemberCache.FindMemberWithSameName): New method. The method
10006 is looking for conflict with inherited symbols.
10008 2004-08-04 Martin Baulig <martin@ximian.com>
10010 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10012 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10014 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10016 * report.cs (Message): New enum for better error, warning reference in
10018 (MessageData): New inner abstract class. It generally handles printing of
10019 error and warning messages.
10020 Removed unused Error, Warning, Message methods.
10022 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10024 Fix for cs0592-8.cs test
10026 (Attributable.ValidAttributeTargets): Made public.
10027 (Attribute.ExplicitTarget): New member for explicit target value.
10028 (Attribute.CheckTargets): Now we translate explicit attribute
10029 target to Target here.
10031 2004-08-03 Ben Maurer <bmaurer@ximian.com>
10033 * ecore.cs (MethodGroupExpr): new IsBase property.
10035 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10037 * delegate.cs (DelegateCreation): store a MethodGroupExpr
10038 rather than an instance expr.
10040 (DelegateCreation.Emit): Use the method group rather than
10041 the instance expression. Also, if you have base.Foo as the
10042 method for a delegate, make sure to emit ldftn, not ldftnvirt.
10044 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
10046 (NewDelegate.DoResolve): Only check for the existance of Invoke
10047 if the method is going to be needed. Use MethodGroupExpr.
10049 (NewDelegate.Emit): Remove, DelegateCreation implements this.
10051 * expression.cs: For pointer arith., make sure to use
10052 the size of the type, not the size of the pointer to
10055 2004-08-03 Marek Safar <marek.safar@seznam.cz>
10058 * class.cs (Class): Added error CS0502 test.
10060 2004-08-03 John Luke <jluke@cfl.rr.com>
10061 Raja R Harinath <rharinath@novell.com>
10064 * attribute.cs (Attribute.complained_before): New flag.
10065 (Attribute.ResolveType, Attribute.Resolve),
10066 (Attribute.DefinePInvokeMethod): Set it.
10067 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10069 2004-08-03 Martin Baulig <martin@ximian.com>
10071 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10072 use a user-defined operator; we still need to do numeric
10073 promotions in case one argument is a builtin type and the other
10074 one has an implicit conversion to that type. Fixes #62322.
10076 2004-08-18 Martin Baulig <martin@ximian.com>
10078 * class.cs (Method.Define): Use the correct method name when
10079 creating the MethodBuilder for a generic method.
10081 2004-08-17 Martin Baulig <martin@ximian.com>
10083 * generic.cs (Constraints): Support type parameter constraints.
10085 2004-08-16 Martin Baulig <martin@ximian.com>
10087 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
10088 (Token.GENERIC_DIMENSION): New token; this is returned if we
10089 encounter an unbound generic type in a typeof() expression.
10091 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
10092 this token is only generated while parsing a typeof() expression.
10093 (typeof_expression): Removed the old unbound_type hack.
10095 * generic.cs (TypeArguments.IsUnbound): New public property.
10097 * decl.cs (MemberName): Added support for unbound types.
10099 2004-08-14 Martin Baulig <martin@ximian.com>
10102 (TypeManager.IsEqualGenericInstance): New static method.
10103 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
10104 just used to check accessibility, so follow the rules of 26.1.6.
10106 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
10107 ConstructedType instead of a TypeExpression if we have type arguments.
10109 * cs-parser.jay (typeof_expression): Support unbound generic types.
10111 * ecore.cs (UnboundTypeExpression): New public class.
10113 2004-08-12 Martin Baulig <martin@ximian.com>
10115 * typemanager.cs (TypeManager.IsNestedChildOf): Use
10116 TypeManager.IsEqual() rather than `=='.
10118 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
10119 generic instances as well.
10121 2004-08-12 Martin Baulig <martin@ximian.com>
10123 * expression.cs (Invocation.InferType): We can only infer method
10124 type parameters. Fixes #62647.
10126 2004-08-11 Martin Baulig <martin@ximian.com>
10128 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
10129 before resolving the base classes.
10131 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10133 * Makefile: install .mdb file too.
10135 2004-08-05 Martin Baulig <martin@ximian.com>
10137 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
10138 initializer, the current type is just the TypeBuilder, not the
10139 instantiated generic type.
10140 (FieldExpr.IsFieldInitializer): New public property.
10142 2004-08-04 Martin Baulig <martin@ximian.com>
10144 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10146 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10148 2004-08-03 Martin Baulig <martin@ximian.com>
10150 * class.cs (MethodData.Define): If we're an explicit
10151 implementation, remove the generic arity from the type name.
10153 2004-08-03 Martin Baulig <martin@ximian.com>
10155 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10156 use a user-defined operator; we still need to do numeric
10157 promotions in case one argument is a builtin type and the other
10158 one has an implicit conversion to that type. Fixes #62322.
10160 2004-08-02 Martin Baulig <martin@ximian.com>
10162 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
10163 `TypeExpr[]' array.
10164 (TypeContainer.GetClassBases): Return the unexpanded list of
10165 interfaces; we expand them later.
10166 (TypeContainer.DefineType): After creating the TypeBuilder, call
10167 TypeManager.ExpandInterfaces() to get an expanded and resolved
10168 list of interfaces.
10170 * ecore.cs (TypeExpr.GetInterfaces): Removed
10172 * generics.cs (Constraints.InterfaceConstraints): Remove.
10173 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
10174 register the interface constraints.
10177 (TypeManager.AddUserType): Removed the `ifaces' argument.
10178 (TypeManager.AddTypeParameter): Likewise.
10179 (TypeManager.AddUserInterface): Removed, was unused.
10180 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
10181 `TypeExpr[]' array for the interfaces.
10182 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
10183 has been defined, returns a list of the resolved interfaces types.
10184 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
10185 (TypeManager.GetExplicitInterfaces): Likewise.
10187 2004-08-02 Martin Baulig <martin@ximian.com>
10189 * expression.cs (Invocation.EmitCall): If we're invoking a method
10190 on a type parameter, use the new `Constrained' prefix opcode.
10192 2004-08-02 Martin Baulig <martin@ximian.com>
10194 * statement.cs (LocalInfo.Flags): Added `IsThis'.
10195 (LocalInfo.IsThis): New public property.
10196 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10198 2004-08-01 Martin Baulig <martin@ximian.com>
10200 * class.cs (TypeContainer.GetClassBases): Don't set the default
10201 here since we may get called from GetPartialBases().
10202 (TypeContainer.DefineType): If GetClassBases() didn't return a
10203 parent, use the default one.
10205 2004-07-30 Martin Baulig <martin@ximian.com>
10207 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10209 * class.cs (SourceMethod): New public class, derive from the
10210 symbol writer's ISourceMethod.
10211 (Method): Use the new symbol writer API.
10213 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10214 as argument and use the new symbol writer.
10217 (SourceFile): Implement the symbol writer's ISourceFile.
10218 (Location.SymbolDocument): Removed.
10219 (Location.SourceFile): New public property.
10221 * symbolwriter.cs: Use the new symbol writer API.
10223 2004-07-30 Raja R Harinath <rharinath@novell.com>
10225 * Makefile (install-local): Remove. Functionality moved to
10228 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
10230 * Makefile: Install mcs.exe.config file together with mcs.exe.
10231 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10232 correct runtime version.
10234 2004-07-25 Martin Baulig <martin@ximian.com>
10237 (TypeContainer.RegisterOrder): Removed, this was unused.
10238 (TypeContainer, interface_order): Removed.
10239 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10240 TypeContainer as argument since we can also be called with a
10241 `PartialContainer' for a partial class/struct/interface.
10242 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10243 of checking whether we're an `Interface' - we could be a
10244 `PartialContainer'.
10245 (PartialContainer.Register): Override; call
10246 AddClass()/AddStruct()/AddInterface() on our parent.
10248 * cs-parser.jay (interface_member_declaration): Add things to the
10249 `current_container', not the `current_class'.
10251 * rootcontext.cs (RegisterOrder): The overloaded version which
10252 takes an `Interface' was unused, removed.
10254 * typemanager.cs (TypeManager.LookupInterface): Return a
10255 `TypeContainer', not an `Interface'.
10256 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10257 contain a `PartialContainer' for an interface, so check it's
10258 `Kind' to figure out what it is.
10260 2004-07-25 Martin Baulig <martin@ximian.com>
10262 * class.cs (Class.DefaultTypeAttributes): New public constant.
10263 (Struct.DefaultTypeAttributes): Likewise.
10264 (Interface.DefaultTypeAttributes): Likewise.
10265 (PartialContainer.TypeAttr): Override this and add the
10266 DefaultTypeAttributes.
10268 2004-07-25 Martin Baulig <martin@ximian.com>
10270 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10271 we can just use the `Parent' field instead.
10273 2004-07-25 Martin Baulig <martin@ximian.com>
10275 * class.cs (TypeContainer.Emit): Renamed to EmitType().
10277 2004-07-25 Martin Baulig <martin@ximian.com>
10279 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10280 our parts before defining any methods.
10281 (TypeContainer.VerifyImplements): Make this virtual.
10282 (ClassPart.VerifyImplements): Override and call VerifyImplements()
10283 on our PartialContainer.
10285 2004-07-25 Martin Baulig <martin@ximian.com>
10287 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10289 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10290 argument, we can just use the `Parent' field instead.
10293 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
10294 (MemberBase.DoDefine): Likewise.
10296 2004-07-24 Martin Baulig <martin@ximian.com>
10298 * decl.cs (MemberCore.Parent): New public field.
10299 (DeclSpace.Parent): Moved to MemberCore.
10301 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10302 (MemberBase.ctor): Added TypeContainer argument, pass it to our
10304 (FieldBase, Field, Operator): Likewise.
10305 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10306 (EventField, Event): Likewise.
10308 2004-07-23 Martin Baulig <martin@ximian.com>
10310 * class.cs (PartialContainer): New public class.
10311 (ClassPart): New public class.
10312 (TypeContainer): Added support for partial classes.
10313 (TypeContainer.GetClassBases): Splitted some of the functionality
10314 out into GetNormalBases() and GetPartialBases().
10316 * cs-tokenizer.cs (Token.PARTIAL): New token.
10317 (Tokenizer.consume_identifier): Added some hacks to recognize
10318 `partial', but only if it's immediately followed by `class',
10319 `struct' or `interface'.
10321 * cs-parser.jay: Added support for partial clases.
10323 2004-07-23 Martin Baulig <martin@ximian.com>
10325 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10326 a `DeclSpace' and also made it readonly.
10327 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10328 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10329 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10331 * cs-parser.jay: Pass the `current_class', not the
10332 `current_container' (at the moment, this is still the same thing)
10333 to a new Method, Property, Event, Indexer or Constructor.
10335 2004-07-23 Martin Baulig <martin@ximian.com>
10337 * cs-parser.jay (CSharpParser): Added a new `current_class' field
10338 and removed the `current_interface' one.
10339 (struct_declaration, class_declaration, interface_declaration):
10340 Set `current_class' to the newly created class/struct/interface;
10341 set their `Bases' and call Register() before parsing their body.
10343 2004-07-23 Martin Baulig <martin@ximian.com>
10345 * class.cs (Kind): New public enum.
10346 (TypeContainer): Made this class abstract.
10347 (TypeContainer.Kind): New public readonly field.
10348 (TypeContainer.CheckDef): New public method; moved here from
10350 (TypeContainer.Register): New public abstract method.
10351 (TypeContainer.GetPendingImplementations): New public abstract
10353 (TypeContainer.GetClassBases): Removed the `is_class' and
10354 `is_iface' parameters.
10355 (TypeContainer.DefineNestedTypes): Formerly known as
10357 (ClassOrStruct): Made this class abstract.
10359 * tree.cs (RootTypes): New public type.
10361 2004-07-20 Martin Baulig <martin@ximian.com>
10363 * tree.cs (Tree.RecordNamespace): Removed.
10364 (Tree.Namespaces): Removed.
10366 * rootcontext.cs (RootContext.IsNamespace): Removed.
10368 * cs-parser.jay (namespace_declaration): Just create a new
10369 NamespaceEntry here.
10371 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
10373 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
10374 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
10375 entry to make sure it runs in the correct runtime version.
10377 2004-07-18 Martin Baulig <martin@ximian.com>
10379 * generic.cs (ConstructedType.CheckConstraints): Improved
10380 constraints checking.
10382 2004-07-18 Martin Baulig <martin@ximian.com>
10384 * expression.cs (Invocation.BetterMethod): Call
10385 TypeManager.TypeToCoreType() on all types and removed my previous
10386 hack; we're already doig the right thing here.
10388 2004-07-17 Martin Baulig <martin@ximian.com>
10390 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
10392 2004-07-16 Martin Baulig <martin@ximian.com>
10394 * iterators.cs: Added generics support.
10396 2004-07-16 Martin Baulig <martin@ximian.com>
10398 * iterators.cs: Rewrote this. We're now using one single Proxy
10399 class for both the IEnumerable and the IEnumerator interface and
10400 `Iterator' derives from Class so we can use the high-level API.
10402 * class.cs (TypeContainer.AddIterator): New method.
10403 (TypeContainer.DoDefineType): New protected virtual method, which
10404 is called from DefineType().
10405 (TypeContainer.DoDefineMembers): Call DefineType() and
10406 DefineMembers() on all our iterators.
10407 (TypeContainer.Emit): Call Emit() on all our iterators.
10408 (TypeContainer.CloseType): Call CloseType() on all our iterators.
10410 * codegen.cs (EmitContext.CurrentIterator): New public field.
10412 2004-07-15 Martin Baulig <martin@ximian.com>
10415 (TypeManager.not_supported_exception_type): New type.
10417 2004-07-14 Martin Baulig <martin@ximian.com>
10420 (TypeManager.generic_ienumerable_type): New type.
10421 (TypeManager.generic_ienumerator_type): New type.
10424 (RootContext.interfaces_first_stage): Added
10425 "System.Collections.Generic.IEnumerator`1" and
10426 "System.Collections.Generic.IEnumerable`1".
10428 2004-07-14 Martin Baulig <martin@ximian.com>
10430 * iterators.cs: Use real error numbers.
10432 2004-07-14 Martin Baulig <martin@ximian.com>
10434 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10435 requires this to be a System.Collection.IEnumerable and not a
10436 class implementing that interface.
10437 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
10439 2004-07-13 Marek Safar <marek.safar@seznam.cz>
10441 * class.cs: Fixed previous fix, it broke some error tests.
10443 2004-07-12 Martin Baulig <martin@ximian.com>
10445 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10448 2004-07-14 Martin Baulig <martin@ximian.com>
10450 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
10451 an exclamation mark (!) for the generic arity to reflect the
10452 latest spec changes; ie. use "System.Collections.Generic.IList`1".
10454 2004-07-13 Martin Baulig <martin@ximian.com>
10456 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
10457 specifiers being part of a type argument.
10459 2004-07-13 Martin Baulig <martin@ximian.com>
10461 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
10462 name for generic types.
10464 2004-07-13 Martin Baulig <martin@ximian.com>
10466 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
10469 2004-07-09 Miguel de Icaza <miguel@ximian.com>
10471 * assign.cs (LocalTemporary): Add new argument: is_address,If
10472 `is_address' is true, then the value that we store is the address
10473 to the real value, and not the value itself.
10475 * ecore.cs (PropertyExpr): use the new local temporary
10476 stuff to allow us to handle X.Y += z (where X is a struct)
10478 2004-07-08 Martin Baulig <martin@ximian.com>
10480 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10481 not always return, just like we're doing in Using.Resolve().
10483 2004-07-07 Miguel de Icaza <miguel@ximian.com>
10485 * cs-parser.jay (fixed_statement): flag this as Pinned.
10487 2004-07-06 Miguel de Icaza <miguel@ximian.com>
10489 * typemanager.cs (TypeManager): Removed MakePinned method, this
10490 mechanism is replaced with the .NET 2.x compatible mechanism of
10491 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10493 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
10494 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10495 `IsFixed' property which has a different meaning.
10497 2004-07-02 Raja R Harinath <rharinath@novell.com>
10499 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10500 visible from inside a nested class, not just the names of the
10501 immediately enclosing class.
10502 Fix for bug #60730.
10504 2004-06-24 Raja R Harinath <rharinath@novell.com>
10506 * expression.cs (BetterConversion): Remove buggy special-case
10507 handling of "implicit constant expression conversions". At this
10508 point, we already know that the conversion is possible -- we're
10509 only checking to see which is better.
10511 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10513 * cs-parser.jay: Added error CS0210 test.
10515 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10517 * cs-parser.jay: Added error CS0134 test.
10519 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10522 * cs-parser.jay: Added error CS0145 test.
10524 2004-06-24 Marek Safar <marek.safar@seznam.cz>
10526 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10528 2004-06-23 Ben Maurer <bmaurer@ximian.com>
10530 * expression.cs (StackAlloc.Resolve): The argument may not
10531 be a constant; deal with this case.
10533 2004-06-23 Marek Safar <marek.safar@seznam.cz>
10535 * attribute.cs (IndexerName_GetIndexerName): Renamed to
10536 GetIndexerAttributeValue.
10537 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10539 * class.cs (Indexer.Define): Added error tests for CS0415,
10542 2004-06-23 Miguel de Icaza <miguel@ximian.com>
10544 * attribute.cs (Attribute.Resolve): Keep field code in sync with
10547 2004-06-23 Martin Baulig <martin@ximian.com>
10549 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10550 neither return nor throw, reset the barrier as well. Fixes #60457.
10552 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
10554 * class.cs : EventAttributes is now set to None by default.
10555 This fixes bug #60459.
10557 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10560 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10561 Don't throw exception but return null (it's sufficient now).
10563 2004-06-18 Marek Safar <marek.safar@seznam.cz>
10565 * typemanager.cs (GetArgumentTypes): Faster implementation.
10567 2004-06-18 Martin Baulig <martin@ximian.com>
10569 * attribute.cs (Attribute.Resolve): Check whether we're an
10570 EmptyCast which a Constant child. Fixes #60333.
10572 2004-06-17 Ben Maurer <bmaurer@ximian.com>
10574 * statement.cs (EmitCollectionForeach): Account for the fact that
10575 not all valuetypes are in areas which we can take the address of.
10576 For these variables, we store to a temporary variable. Also, make
10577 sure that we dont emit a `callvirt' on a valuetype method.
10579 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10581 * expression.cs (StackAlloc.DoReSolve): Added test for
10582 negative parameter (CS0247).
10584 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10587 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10589 2004-06-15 Marek Safar <marek.safar@seznam.cz>
10592 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10595 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10597 Fix bug #58254 & cs1555.cs, cs1556.cs
10598 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10600 2004-06-14 Marek Safar <marek.safar@seznam.cz>
10602 * cs-parser.jay: Added error CS1669 test for indexers.
10604 2004-06-18 Martin Baulig <martin@ximian.com>
10606 * generics.cs (GenericMethod.ctor): Don't take an Attributes
10607 argument. Fixes #60441.
10609 2004-06-16 Ben Maurer <bmaurer@ximian.com>
10610 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
10611 The name needs to have the actual name of the method in order
10612 for other tests (such as the one in OverloadResolve for Invoke
10613 on a delegate) to work. As well, it does not really help
10614 error reporting because the method group had multiple methods.
10615 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10616 Make profiling work.
10618 2004-06-13 Martin Baulig <martin@ximian.com>
10620 * cs-parser.jay: Don't allow generic attributes.
10622 2004-06-13 Martin Baulig <martin@ximian.com>
10624 * class.cs (MemberBase.DoDefineBase): New protected method.
10625 (MemberBase.DoDefine): Compute the `flags' in the new
10626 DoDefineBase() which must be called first.
10627 (Method.Define): Call DoDefineBase() first so we have the flags
10628 when defining the generic method.
10630 * cs-parser.jay (interface_method_declaration): Support generic methods.
10632 2004-06-13 Martin Baulig <martin@ximian.com>
10634 * decl.cs (TypeName): Removed.
10635 (MemberName): Removed TypeName and MemberNow; now we just have
10638 * cs-parser.jay: Don't distinguish between type arguments and type
10639 parameters in the grammar and simplified the rules a bit. The
10640 reduce/reduce conflicts are now gone (except the one we inherited
10643 2004-06-11 Martin Baulig <martin@ximian.com>
10645 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10646 call this twice: for params and varargs methods.
10648 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10651 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10653 2004-06-11 Marek Safar <marek.safar@seznam.cz>
10655 * attribute.cs (Attribute.GetValidTargets): Made public.
10658 (AbstractPropertyEventMethod): New class for better code sharing.
10659 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10661 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10663 2004-06-09 Martin Baulig <martin@ximian.com>
10665 * cs-parser.jay: Removed a reduce/reduce conflict.
10667 2004-06-03 Martin Baulig <martin@ximian.com>
10669 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10670 GetSimpleName() and return a SimpleName.
10672 * ecore.cs (SimpleName.Arguments): New public field.
10673 (SimpleName): Added overloaded ctor which takes an additional
10674 TypeArguments argument.
10675 (SimpleName.SimpleNameResolve): Added support for generic methods.
10676 (MethodGroupExpr.ResolveGeneric): New public method. The code was
10677 formerly in MemberAccess.DoResolve(), but we also need it in
10678 SimpleNameResolve().
10680 * expression.cs (MemberAccess.DoResolve): Use the new
10681 MethodGroupExpr.ResolveGeneric().
10683 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10685 * decl.cs: If possible, use lookuptypedirect here. We can only do
10686 this if there is no `.' after the namespace. Avoids using
10687 LookupType, which does lots of slow processing.
10688 (FindNestedType) New method, does what it says :-).
10689 * namespace.cs: use LookupTypeDirect.
10690 * rootcontext.cs: use membercache, if possible.
10691 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10693 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10696 According to the spec,
10698 In a member access of the form E.I, if E is a single identifier,
10699 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10700 field, property, localvariable, or parameter with the same type as
10701 the meaning of E as a type-name (§3.8), then both possible
10702 meanings of E are permitted.
10704 We did not check that E as a simple-name had the same type as E as
10707 This trivial check gives us 5-7% on bootstrap time.
10709 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10711 * expression.cs (Invocation.OverloadResolve): Avoid the
10712 use of hashtables and boxing here by allocating on demand.
10714 2004-05-30 Martin Baulig <martin@ximian.com>
10716 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10717 we're doing a silent lookup. Don't try to lookup nested types in
10718 TypeManager.object_type (thanks to Ben Maurer).
10720 2004-05-30 Martin Baulig <martin@ximian.com>
10722 Committing a patch from Ben Maurer.
10724 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10726 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10728 * convert.cs: add a trivial cache for overload operator resolution.
10730 2004-05-31 Marek Safar <marek.safar@seznam.cz>
10733 (AttributeTester.GetObsoleteAttribute): Returns instance of
10734 ObsoleteAttribute when type is obsolete.
10737 (TypeContainer.VerifyObsoleteAttribute): Override.
10738 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10739 (MethodCode.VerifyObsoleteAttribute): Override.
10740 (MemberBase.VerifyObsoleteAttribute): Override.
10743 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10744 and report proper error.
10747 (Delegate.VerifyObsoleteAttribute): Override.
10750 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10751 and report proper error.
10752 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10755 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10759 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10760 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10761 Added test for ObsoleteAttribute.
10764 (Catch): Derived from Statement.
10766 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10768 * decl.cs: If possible, use lookuptypedirect here. We can only do
10769 this if there is no `.' after the namespace. Avoids using
10770 LookupType, which does lots of slow processing.
10771 (FindNestedType) New method, does what it says :-).
10772 * namespace.cs: use LookupTypeDirect.
10773 * rootcontext.cs: use membercache, if possible.
10774 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10776 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10779 According to the spec,
10781 In a member access of the form E.I, if E is a single identifier,
10782 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10783 field, property, localvariable, or parameter with the same type as
10784 the meaning of E as a type-name (§3.8), then both possible
10785 meanings of E are permitted.
10787 We did not check that E as a simple-name had the same type as E as
10790 This trivial check gives us 5-7% on bootstrap time.
10792 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10794 Fixed bug #59071 & cs0160.cs
10795 * statement.cs (Try.Resolve): Check here whether order of catch
10796 clauses matches their dependencies.
10798 2004-05-30 Marek Safar <marek.safar@seznam.cz>
10801 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10804 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10806 * expression.cs (Invocation.OverloadResolve): Avoid the
10807 use of hashtables and boxing here by allocating on demand.
10809 2004-05-30 Martin Baulig <martin@ximian.com>
10811 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10812 we're doing a silent lookup. Don't try to lookup nested types in
10813 TypeManager.object_type (thanks to Ben Maurer).
10815 2004-05-30 Martin Baulig <martin@ximian.com>
10817 Committing a patch from Ben Maurer.
10819 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10821 2004-05-29 Martin Baulig <martin@ximian.com>
10823 * class.cs (IMethodData.ShouldIgnore): New method.
10825 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10826 `Location' argument, we don't need it anywhere. Use
10827 `IMethodData.ShouldIgnore ()' instead of
10828 `MethodData.GetMethodFlags ()'.
10829 (TypeManager.AddMethod): Removed.
10830 (TypeManager.AddMethod2): Renamed to AddMethod.
10832 2004-05-29 Martin Baulig <martin@ximian.com>
10834 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10836 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10837 converting from a class type S to an interface type and we already
10838 have an object on the stack, don't box it again. Fixes #52578.
10840 2004-05-29 Martin Baulig <martin@ximian.com>
10842 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10843 Added support for `params' parameters. Fixes #59267.
10845 2004-05-29 Martin Baulig <martin@ximian.com>
10847 * literal.cs (NullPointer): Provide a private .ctor which sets
10848 `type' to TypeManager.object_type. Fixes #59048.
10850 2004-05-29 Martin Baulig <martin@ximian.com>
10852 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10853 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10855 * ecore.cs (EventExpr.instance_expr): Make the field private.
10857 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10859 Fixed bug #50080 & cs0214-2.cs
10860 * expression.cs (Cast.DoResolve): Check unsafe context here.
10862 * statement.cs (Resolve.DoResolve): Likewise.
10864 2004-05-26 Martin Baulig <martin@ximian.com>
10866 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10868 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10869 (RootContext.LookupType): Pass down the `silent' flag.
10871 2004-05-25 Martin Baulig <martin@ximian.com>
10874 (MethodGroupExpr.IdenticalTypeName): New public property.
10875 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10876 expression actually refers to a type.
10878 2004-05-25 Martin Baulig <martin@ximian.com>
10880 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10881 for #56176 and made it actually work.
10883 2004-05-25 Martin Baulig <martin@ximian.com>
10885 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10886 (FieldExpr, PropertyExpr): Override and implement
10887 CacheTemporaries. Fixes #52279.
10889 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10891 * location.cs: In the new compiler listing a file twice is a
10892 warning, not an error.
10894 2004-05-24 Martin Baulig <martin@ximian.com>
10896 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10897 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10899 2004-05-24 Martin Baulig <martin@ximian.com>
10901 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10902 walking the `using' list. Fixes #53921.
10904 2004-05-24 Martin Baulig <martin@ximian.com>
10906 * const.cs (Const.LookupConstantValue): Added support for
10907 EmptyCast's; fixes #55251.
10909 2004-05-24 Martin Baulig <martin@ximian.com>
10911 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10912 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10913 which does the CS0135 check. The reason is that we first need to
10914 check whether the variable actually exists.
10916 2004-05-24 Martin Baulig <martin@ximian.com>
10918 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10919 than RootContext.LookupType() to find the explicit interface
10920 type. Fixes #58584.
10922 2004-05-24 Raja R Harinath <rharinath@novell.com>
10924 * Makefile: Simplify. Use executable.make.
10925 * mcs.exe.sources: New file. List of sources of mcs.exe.
10927 2004-05-24 Anders Carlsson <andersca@gnome.org>
10931 Use the invariant culture when doing String.Compare for CLS case
10934 2004-05-23 Martin Baulig <martin@ximian.com>
10936 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10937 don't have any dots. Fixes #52622, added cs0246-8.cs.
10939 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10941 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10943 * class.cs (MemberBase.Define): Reuse MemberType member for
10944 resolved type. Other methods can use it too.
10946 2004-05-23 Martin Baulig <martin@ximian.com>
10948 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10949 the variable also exists in the current block (otherwise, we need
10950 to report a CS0103). Fixes #58670.
10952 2004-05-23 Martin Baulig <martin@ximian.com>
10954 * flowanalysis.cs (Reachability.Reachable): Compute this
10955 on-the-fly rather than storing it as a field.
10957 2004-05-23 Martin Baulig <martin@ximian.com>
10959 * flowanalysis.cs (Reachability.And): Manually compute the
10960 resulting `barrier' from the reachability.
10962 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10965 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10966 instance of ObsoleteAttribute when symbol is obsolete.
10969 (IMethodData): Extended interface for ObsoleteAttribute support.
10971 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10973 * attribute.cs: Fix bug #55970
10975 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10979 (GetObsoleteAttribute): New method. Creates the instance of
10981 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10982 ObsoleteAttribute when member is obsolete.
10983 (AttributeTester.Report_ObsoleteMessage): Common method for
10984 Obsolete error/warning reporting.
10987 (TypeContainer.base_classs_type): New member for storing parent type.
10990 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10991 for this MemberCore.
10993 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10995 * attribute.cs, const.cs: Fix bug #58590
10997 2004-05-21 Martin Baulig <martin@ximian.com>
10999 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11000 out parameters if the end of the method is unreachable. Fixes
11003 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11005 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11006 Hari was right, why extra method.
11008 2004-05-21 Marek Safar <marek.safar@seznam.cz>
11010 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11012 2004-05-20 Martin Baulig <martin@ximian.com>
11014 * delegate.cs: Convert this file to Unix mode - like the original
11017 2004-05-20 Martin Baulig <martin@ximian.com>
11019 * attribute.cs: Convert this file to Unix mode - like the original
11022 2004-05-19 Marek Safar <marek.safar@seznam.cz>
11024 Fix bug #58688 (MCS does not report error when the same attribute
11027 * attribute.cs (Attribute.Emit): Distinction between null and default.
11029 2004-05-19 Raja R Harinath <rharinath@novell.com>
11031 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11032 of a top-level attribute without an attribute target.
11033 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
11035 (Attribute.Conditional_GetConditionName),
11036 (Attribute.Obsolete_GetObsoleteMessage): Update.
11037 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
11038 part of ScanForIndexerName.
11039 (Attribute.CanIgnoreInvalidAttribute): New function.
11040 (Attribute.ScanForIndexerName): Move to ...
11041 (Attributes.ScanForIndexerName): ... here.
11042 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11043 (Attributes.Search): New internal variant that can choose not to
11044 complain if types aren't resolved. The original signature now
11046 (Attributes.GetClsCompliantAttribute): Use internal variant, with
11047 complaints suppressed.
11048 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11049 only if it not useful.
11050 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11051 top-level for attributes that are shared between the assembly
11052 and a top-level class.
11053 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11054 * class.cs: Update to reflect changes.
11055 (DefineIndexers): Fuse loops.
11056 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
11057 a couple more variants of attribute names.
11059 2004-05-18 Marek Safar <marek.safar@seznam.cz>
11061 Fix bug #52585 (Implemented explicit attribute declaration)
11064 (Attributable.ValidAttributeTargets): New abstract method. It gets
11065 list of valid attribute targets for explicit target declaration.
11066 (Attribute.Target): It holds target itself.
11067 (AttributeSection): Removed.
11068 (Attribute.CheckTargets): New method. It checks whether attribute
11069 target is valid for the current element.
11072 (EventProperty): New class. For events that are declared like
11073 property (with add and remove accessors).
11074 (EventField): New class. For events that are declared like field.
11077 * cs-parser.jay: Implemented explicit attribute target declaration.
11079 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
11080 Override ValidAttributeTargets.
11083 (ReturnParameter): Class for applying custom attributes on
11085 (ParameterAtribute): New class. Class for applying custom
11086 attributes on the parameter type.
11088 2004-05-17 Miguel de Icaza <miguel@ximian.com>
11090 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11093 (Method): Allow UNSAFE here.
11095 * modifiers.cs: Support unsafe reporting.
11097 2004-05-17 Marek Safar <marek.safar@seznam.cz>
11099 * decl.cs: Fix bug #58478.
11101 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11103 * statement.cs: When checking for unreachable code on an EmptyStatement,
11104 set the location. Fixes bug #58488.
11106 2004-05-13 Miguel de Icaza <miguel@ximian.com>
11108 * driver.cs: Add -pkg handling.
11110 From Gonzalo: UseShelLExecute=false
11112 2004-05-12 Marek Safar <marek.safar@seznam.cz>
11115 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11117 (Attribute.IsClsCompliaceRequired): Moved to base for better
11119 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11120 when attribute is AttributeUsageAttribute.
11121 (Attribute.GetValidTargets): Simplified.
11122 (Attribute.GetAttributeUsage): New method returns AttributeUsage
11123 attribute for this type.
11124 (Attribute.ApplyAttributes): Method renamed to Emit and make
11126 (GlobalAttributeSection): New class for special handling of global
11127 attributes (assembly, module).
11128 (AttributeSection.Emit): New method.
11130 * class.cs: Implemented Attributable abstract methods.
11131 (MethodCore.LabelParameters): Moved to Parameter class.
11132 (Accessor): Is back simple class.
11133 (PropertyMethod): Implemented Attributable abstract class.
11134 (DelegateMethod): Implemented Attributable abstract class.
11135 (Event): New constructor for disctintion between normal Event
11136 and Event with accessors.
11138 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11140 * codegen.cs, const.cs, decl.cs, delegate.cs:
11141 (CommonAssemblyModulClass): Implemented Attributable abstract class
11144 * enum.cs: Implement IAttributeSupport interface.
11145 (EnumMember): New class for emum members. Implemented Attributable
11149 (ParameterBase): Is abstract.
11150 (ReturnParameter): New class for easier [return:] attribute handling.
11152 * typemanager.cs: Removed builder_to_attr.
11154 2004-05-11 Raja R Harinath <rharinath@novell.com>
11157 * attribute.cs (Attribute.GetPositionalValue): New function.
11158 * class.cs (TypeContainer.VerifyMembers): New function.
11159 (TypeContainer.Emit): Use it.
11160 (ClassOrStruct): New base class for Class and Struct.
11161 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
11162 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11164 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11165 then each non-static field should have a FieldOffset attribute.
11166 Otherwise, none of the fields should have a FieldOffset attribute.
11167 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
11168 and FieldOffset attributes.
11169 * typemanager.cs (TypeManager.struct_layout_attribute_type)
11170 (TypeManager.field_offset_attribute_type): New core types.
11171 (TypeManager.InitCoreTypes): Initialize them.
11173 2004-05-11 Michal Moskal <malekith@pld-linux.org>
11175 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11176 Return correct type.
11179 2004-05-09 Miguel de Icaza <miguel@ximian.com>
11181 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11182 be implicitly converted to ulong.
11184 * expression.cs: The logic for allowing operator &, | and ^ worked
11185 was wrong, it worked before because we did not report an error in
11186 an else branch. Fixes 57895.
11188 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11189 allow volatile fields to be reference types.
11191 2004-05-07 Miguel de Icaza <miguel@ximian.com>
11193 * driver.cs: Add support for /debug-
11195 2004-05-07 Raja R Harinath <rharinath@novell.com>
11197 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
11198 Add a 'complain' parameter to silence errors.
11199 (Attribute.Resolve): Update to changes. Put in sanity check to catch
11200 silently overlooked type-resolutions.
11201 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11202 to reflect changes.
11203 (Attributes.Search): New function.
11204 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11205 (Attributes.GetAttributeFullName): Remove hack.
11206 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
11207 Update to reflect changes.
11208 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11209 Use Attributes.Search instead of nested loops.
11211 2004-05-07 Marek Safar <marek.safar@seznam.cz>
11214 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11215 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11216 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11218 * report.cs: (Report.Warning): Renamed to Warning_T because of
11219 parameter collision.
11221 2004-05-05 Raja R Harinath <rharinath@novell.com>
11223 * expression.cs (MemberAccess.ResolveMemberAccess):
11224 Exit with non-zero status after Report.Error.
11225 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11227 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11229 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11231 * support.cs: Don't hang when the file is empty.
11233 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
11235 * support.cs: In SeekableStreamReader, compute the preamble size of the
11236 underlying stream. Position changes should take into account that initial
11239 2004-05-03 Todd Berman <tberman@sevenl.net>
11241 * driver.cs: remove unused GetSysVersion function.
11243 2004-05-03 Todd Berman <tberman@sevenl.net>
11245 * driver.cs: Remove the hack from saturday, as well as the hack
11246 from jackson (LoadAssemblyFromGac), also adds the CWD to the
11247 link_paths to get that bit proper.
11249 2004-05-01 Todd Berman <tberman@sevenl.net>
11251 * driver.cs: Try a LoadFrom before a Load, this checks the current
11252 path. This is currently a bug in mono that is be fixed, however, this
11253 provides a workaround for now. This will be removed when the bug
11256 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
11258 * CryptoConvert.cs: Updated to latest version. Fix issue with
11259 incomplete key pairs (#57941).
11261 2004-05-01 Todd Berman <tberman@sevenl.net>
11263 * driver.cs: Remove '.' from path_chars, now System.* loads properly
11266 2004-04-30 Jackson Harper <jackson@ximian.com>
11268 * codegen.cs: Open keys readonly.
11270 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11272 * typemanager.cs: don't report cyclic struct layout when a struct
11273 contains 2 or more fields of the same type. Failed for Pango.AttrShape
11274 which has 2 Pango.Rectangle fields.
11276 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
11278 * expression.cs: Handle IntPtr comparisons with IL code
11279 rather than a method call.
11281 2004-04-29 Martin Baulig <martin@ximian.com>
11283 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
11284 the list of PropertyInfo's in class hierarchy and find the
11285 accessor. Fixes #56013.
11287 2004-04-29 Martin Baulig <martin@ximian.com>
11289 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11291 2004-04-29 Martin Baulig <martin@ximian.com>
11293 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11295 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11297 2004-04-29 Martin Baulig <martin@ximian.com>
11299 * class.cs (ConstructorInitializer.Resolve): Check whether the
11300 parent .ctor is accessible. Fixes #52146.
11302 2004-04-29 Martin Baulig <martin@ximian.com>
11304 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11306 * statement.cs (Using.EmitLocalVariableDecls): Use
11307 TypeManager.idisposable_type, not typeof (IDisposable).
11308 (Foreach.EmitCollectionForeach): Added support for valuetypes.
11310 2004-04-29 Martin Baulig <martin@ximian.com>
11312 * class.cs (Event.Define): Don't emit the field and don't set
11313 RTSpecialName and SpecialName for events on interfaces. Fixes
11316 2004-04-29 Raja R Harinath <rharinath@novell.com>
11318 Refactor Attribute.ApplyAttributes.
11319 * attribute.cs (Attributable): New base class for objects that can
11320 have Attributes applied on them.
11321 (Attribute): Make AttributeUsage fields public.
11322 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11323 (Attribute.IsInternalCall): New property.
11324 (Attribute.UsageAttr): Convert to a public read-only property.
11325 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11326 (Attribute.ResolveType, Attribute.Resolve)
11327 (Attribute.ScanForIndexerName): Update to reflect changes.
11328 (Attribute.CheckAttributeTarget): Re-format.
11329 (Attribute.ApplyAttributes): Refactor, to various
11330 Attributable.ApplyAttributeBuilder methods.
11331 * decl.cs (MemberCore): Make Attributable.
11332 * class.cs (Accessor): Make Attributable.
11333 (MethodData.ApplyAttributes): Use proper attribute types, not
11335 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11336 (TypeContainer.ApplyAttributeBuilder)
11337 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11338 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
11339 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11340 (Operator.ApplyAttributeBuilder): New factored-out methods.
11341 * const.cs (Const.ApplyAttributeBuilder): Likewise.
11342 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11343 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11344 * parameter.cs (ParameterBase): New Attributable base class
11345 that can also represent Return types.
11346 (Parameter): Update to the changes.
11348 2004-04-29 Jackson Harper <jackson@ximian.com>
11350 * driver.cs: Prefer the corlib system version when looking for
11351 assemblies in the GAC. This is still a hack, but its a better hack
11354 2004-04-29 Marek Safar <marek.safar@seznam.cz>
11356 * decl.cs, enum.cs: Improved error 3005 reporting.
11358 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11359 (related_symbols): New private member for list of symbols
11360 related to reported error/warning.
11362 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11364 2004-04-29 Martin Baulig <martin@ximian.com>
11366 * ecore.cs (Expression.Constantify): If we're an enum and
11367 TypeManager.TypeToCoreType() doesn't give us another type, use
11368 t.UnderlyingSystemType. Fixes #56178.
11370 2004-04-29 Martin Baulig <martin@ximian.com>
11372 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11373 interfaces and for each interface, only add members directly
11374 declared in that interface. Fixes #53255.
11376 2004-04-28 Martin Baulig <martin@ximian.com>
11378 * expression.cs (ConditionalLogicalOperator): Use a temporary
11379 variable for `left' to avoid that we evaluate it more than once;
11382 2004-04-28 Martin Baulig <martin@ximian.com>
11384 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11387 2004-04-28 Martin Baulig <martin@ximian.com>
11389 * statement.cs (LocalInfo.Resolve): Check whether the type is not
11392 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11393 whether the type is not void (CS1547).
11395 2004-04-28 Martin Baulig <martin@ximian.com>
11397 * expression.cs (Unary.DoResolveLValue): Override this and report
11398 CS0131 for anything but Operator.Indirection.
11400 2004-04-28 Martin Baulig <martin@ximian.com>
11402 Committing a patch from Ben Maurer; see bug #50820.
11404 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11407 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11410 2004-04-28 Martin Baulig <martin@ximian.com>
11412 Committing a patch from Ben Maurer; see bug #50820.
11414 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11417 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11420 2004-04-28 Martin Baulig <martin@ximian.com>
11422 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11423 (Block.AddLabel): Call DoLookupLabel() to only search in the
11426 2004-04-28 Martin Baulig <martin@ximian.com>
11428 * cfold.cs (ConstantFold.BinaryFold): Added special support for
11429 comparing StringConstants and NullLiterals in Equality and Inequality.
11431 2004-04-28 Jackson Harper <jackson@ximian.com>
11433 * driver.cs: Attempt to load referenced assemblies from the
11434 GAC. This is the quick and dirty version of this method that
11435 doesnt take into account versions and just takes the first
11436 canidate found. Will be good enough for now as we will not have more
11437 then one version installed into the GAC until I update this method.
11439 2004-04-28 Martin Baulig <martin@ximian.com>
11441 * typemanager.cs (TypeManager.CheckStructCycles): New public
11442 static method to check for cycles in the struct layout.
11444 * rootcontext.cs (RootContext.PopulateTypes): Call
11445 TypeManager.CheckStructCycles() for each TypeContainer.
11446 [Note: We only need to visit each type once.]
11448 2004-04-28 Martin Baulig <martin@ximian.com>
11450 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11452 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11453 success and added `out object value'. Use a `bool resolved' field
11454 to check whether we've already been called rather than
11455 `ConstantValue != null' since this breaks for NullLiterals.
11457 2004-04-28 Raja R Harinath <rharinath@novell.com>
11459 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11460 setting of this flag, since the 'set' method may be non-public.
11462 2004-04-28 Raja R Harinath <rharinath@novell.com>
11464 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11465 check on current_vector.Block.
11467 2004-04-27 Martin Baulig <martin@ximian.com>
11469 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11470 a field initializer. Fixes #56459.
11472 2004-04-27 Martin Baulig <martin@ximian.com>
11474 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11475 we're not attempting to use an indexer. Fixes #52154.
11477 2004-04-27 Martin Baulig <martin@ximian.com>
11479 * statement.cs (Return): Don't create a return label if we don't
11480 need it; reverts my change from January 20th. Thanks to Ben
11483 2004-04-27 Martin Baulig <martin@ximian.com>
11485 According to the spec, `goto' can only leave a nested scope, but
11488 * statement.cs (Block.LookupLabel): Only lookup in the current
11489 block, don't recurse into parent or child blocks.
11490 (Block.AddLabel): Check in parent and child blocks, report
11491 CS0140/CS0158 if we find a duplicate.
11492 (Block): Removed this indexer for label lookups.
11493 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11494 this already does the error reporting for us.
11497 (FlowBranching.UsageVector.Block): New public variable; may be null.
11498 (FlowBranching.CreateSibling): Added `Block' argument.
11499 (FlowBranching.LookupLabel): New public virtual method. Lookup a
11500 label for the target of a `goto' and check whether we're not
11501 leaving a `finally'.
11503 2004-04-27 Martin Baulig <martin@ximian.com>
11505 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11506 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11509 2004-04-27 Martin Baulig <martin@ximian.com>
11511 * statement.cs (Block.AddLabel): Also check for implicit blocks
11512 and added a CS0158 check.
11514 2004-04-27 Martin Baulig <martin@ximian.com>
11516 * flowanalysis.cs (FlowBranchingLoop): New class.
11517 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11518 UsageVector's instead of an ArrayList.
11519 (FlowBranching.Label): Likewise.
11520 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11521 (FlowBranching.AddBreakVector): New method.
11523 2004-04-27 Miguel de Icaza <miguel@ximian.com>
11525 * attribute.cs: Small regression fix: only convert the type if we
11526 the type is different, fixes System.Drawing build.
11528 2004-04-27 Martin Baulig <martin@ximian.com>
11530 * attribute.cs (Attribute.Resolve): If we have a constant value
11531 for a named field or property, implicity convert it to the correct
11534 2004-04-27 Raja R Harinath <rharinath@novell.com>
11536 * statement.cs (Block.Block): Implicit blocks share
11537 'child_variable_names' fields with parent blocks.
11538 (Block.AddChildVariableNames): Remove.
11539 (Block.AddVariable): Mark variable as "used by a child block" in
11540 every surrounding block.
11541 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11542 been used in a child block, complain about violation of "Invariant
11543 meaning in blocks" rule.
11544 * cs-parser.jay (declare_local_variables): Don't use
11545 AddChildVariableNames.
11546 (foreach_statement): Don't create an implicit block: 'foreach'
11547 introduces a scope.
11549 2004-04-23 Miguel de Icaza <miguel@ximian.com>
11551 * convert.cs (ImplicitNumericConversion): 0 is also positive when
11552 converting from 0L to ulong. Fixes 57522.
11554 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11556 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11557 derived class hides via 'new' keyword field from base class (test-242.cs).
11558 TODO: Handle this in the more general way.
11560 * class.cs (CheckBase): Ditto.
11562 2004-04-22 Marek Safar <marek.safar@seznam.cz>
11564 * decl.cs (caching_flags): New member for storing cached values
11566 (MemberCore.Flags): New enum where bit flags for caching_flags
11568 (MemberCore.cls_compliance): Moved to caching_flags.
11569 (DeclSpace.Created): Moved to caching_flags.
11571 * class.cs: Use caching_flags instead of DeclSpace.Created
11573 2004-04-21 Miguel de Icaza <miguel@ximian.com>
11575 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11576 if we are only a derived class, not a nested class.
11578 * typemanager.cs: Same as above, but do this at the MemberLookup
11579 level (used by field and methods, properties are handled in
11580 PropertyExpr). Allow for the qualified access if we are a nested
11583 2004-04-21 Marek Safar <marek.safar@seznam.cz>
11585 * class.cs: Refactoring.
11586 (IMethodData): New inteface; Holds links to parent members
11587 to avoid member duplication (reduced memory allocation).
11588 (Method): Implemented IMethodData interface.
11589 (PropertyBase): New inner classes for get/set methods.
11590 (PropertyBase.PropertyMethod): Implemented IMethodData interface
11591 (Event): New inner classes for add/remove methods.
11592 (Event.DelegateMethod): Implemented IMethodData interface.
11594 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11595 EmitContext (related to class.cs refactoring).
11597 2004-04-21 Raja R Harinath <rharinath@novell.com>
11599 * delegate.cs (Delegate.VerifyApplicability): If the number of
11600 arguments are the same as the number of parameters, first try to
11601 verify applicability ignoring any 'params' modifier on the last
11605 2004-04-08 Martin Baulig <martin@ximian.com>
11607 Merged latest changes into gmcs. Please keep this comment in
11608 here, it makes it easier for me to see what changed in MCS since
11609 the last time I merged.
11611 2004-04-16 Raja R Harinath <rharinath@novell.com>
11613 * class.cs (TypeContainer.AddIndexer): Use
11614 'ExplicitInterfaceName' to determine if interface name was
11615 explicitly specified. 'InterfaceType' is not initialized at this time.
11616 (TypeContainer.DefineIndexers): Remove use of temporary list. The
11617 Indexers array is already in the required order. Initialize
11618 'IndexerName' only if there are normal indexers.
11619 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11620 (TypeContainer.Emit): Emit DefaultMember attribute only if
11621 IndexerName is initialized.
11624 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
11626 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11629 2004-04-15 Raja R Harinath <rharinath@novell.com>
11631 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11635 * attribute.cs (Attribute.Resolve): Check for duplicate named
11639 2004-04-15 Miguel de Icaza <miguel@ximian.com>
11641 * iterators.cs (MarkYield): track whether we are in an exception,
11642 and generate code accordingly. Use a temporary value to store the
11643 result for our state.
11645 I had ignored a bit the interaction of try/catch with iterators
11646 since their behavior was not entirely obvious, but now it is
11647 possible to verify that our behavior is the same as MS .NET 2.0
11651 2004-04-14 Miguel de Icaza <miguel@ximian.com>
11653 * iterators.cs: Avoid creating temporaries if there is no work to
11656 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11657 Enumerations, use TypeManager.EnumToUnderlying and call
11660 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11663 (This.Emit): Use EmitContext.EmitThis to emit our
11666 (This.EmitAssign): Ditto.
11668 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11669 codepaths, we will move all the functionality into
11672 (FieldExpr.EmitAssign): Ditto.
11674 This fixes several hidden bugs that I uncovered while doing a code
11675 review of this today.
11677 * codegen.cs (EmitThis): reworked so the semantics are more clear
11678 and also support value types "this" instances.
11680 * iterators.cs: Changed so that for iterators in value types, we
11681 do not pass the value type as a parameter.
11683 Initialization of the enumerator helpers is now done in the caller
11684 instead of passing the parameters to the constructors and having
11685 the constructor set the fields.
11687 The fields have now `assembly' visibility instead of private.
11689 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11691 * expression.cs (Argument.Resolve): Check if fields passed as ref
11692 or out are contained in a MarshalByRefObject.
11694 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11695 another compiler type.
11697 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11699 * class.cs (Indexer.Define): use the new name checking method.
11700 Also, return false on an error.
11701 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11702 (is_identifier_[start/part]_character): make static.
11704 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11706 * expression.cs (Binary.ResolveOperator): Do no append strings
11707 twice: since we can be invoked more than once (array evaluation)
11708 on the same concatenation, take care of this here. Based on a fix
11709 from Ben (bug #56454)
11711 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11713 * codegen.cs: Fix another case where CS1548 must be reported (when
11714 delay-sign isn't specified and no private is available #56564). Fix
11715 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11716 error when MCS is used on the MS runtime and we need to delay-sign
11717 (which seems unsupported by AssemblyBuilder - see #56621).
11719 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11721 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11722 (TypeManager.ComputeNamespaces): Faster implementation for
11725 * compiler.csproj: Updated AssemblyName to mcs.
11727 2004-05-11 Jackson Harper <jackson@ximian.com>
11729 * Makefile: Preserve MONO_PATH
11731 2004-05-11 Jackson Harper <jackson@ximian.com>
11733 * Makefile: Use mono and mcs to build gmcs
11735 2004-05-03 Miguel de Icaza <miguel@ximian.com>
11737 * codegen.cs: Add patch from Robert Shade
11738 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11741 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
11743 * CryptoConvert.cs: Updated to latest version. Fix issue with
11744 incomplete key pairs (#57941).
11746 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11748 * codegen.cs: Fix another case where CS1548 must be reported (when
11749 delay-sign isn't specified and no private is available #56564). Fix
11750 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11751 error when MCS is used on the MS runtime and we need to delay-sign
11752 (which seems unsupported by AssemblyBuilder - see #56621).
11754 2004-04-29 Jackson Harper <jackson@ximian.com>
11756 * Makefile: Set MONO_PATH to use the bootstrap corlib
11757 * driver.cs: Check the GAC for referenced assemblies.
11759 2004-04-29 Martin Baulig <martin@ximian.com>
11761 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11763 2004-04-07 Martin Baulig <martin@ximian.com>
11765 * expression.cs (Binary.ResolveOperator): Added special case for
11766 Equality/Inequality between a type parameter and a null literal.
11768 2004-04-07 Martin Baulig <martin@ximian.com>
11770 * convert.cs: Check null literal -> type parameter conversions.
11772 2004-04-07 Martin Baulig <martin@ximian.com>
11774 * generic.cs (ConstructedType.CheckConstraints): Enforce the
11775 `class' and `struct' constraints.
11777 2004-04-07 Martin Baulig <martin@ximian.com>
11779 * generic.cs (SpecialConstraint): New public enum.
11780 (Constraints.Resolve): Added support for the `class' and `struct'
11783 * cs-parser.jay (type_parameter_constraint): Added support for the
11784 `class' and `struct' constraints.
11786 2004-04-07 Martin Baulig <martin@ximian.com>
11788 * support.cs (GenericConstraints): Replaced `Types' by
11789 `ClassConstraint' and `InterfaceConstraints'; added
11790 `HasClassConstraint'.
11792 2004-04-07 Martin Baulig <martin@ximian.com>
11795 (Constraints.InterfaceConstraints): New public property.
11796 (Constraints.Types): Make this property public
11797 (TypeParameter): Implement IMemberContainer.
11798 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11799 instead of a TypeBuilder/MethodBuilder; pass the interface
11800 constraints to TypeManager.AddTypeParameter().
11801 (TypeParameter.DefineType): Just take an EmitContext and no
11802 TypeBuilder/MethodBuilder. Use the new public API.
11804 * typemanager.cs (TypeManager.AddTypeParameter): Added
11805 `TypeExpr[]' argument; add the interfaces to the
11806 `builder_to_ifaces' hash.
11807 (TypeManager.LookupMemberContainer): For
11808 GenericTypeParameterBuilders, get the TypeParameter from the
11809 `builder_to_type_param'.
11810 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11811 the TypeParameter and call FindMembers on it.
11813 2004-04-07 Martin Baulig <martin@ximian.com>
11816 (MethodCore.GenericMethod): Moved this field here from Method.
11817 (MethodCore.IsDuplicateImplementation): Take the number of type
11818 parameters into account if we're a generic method.
11820 * expression.cs (Invocation.InferTypeArguments): Don't return true
11821 if `arguments' is null; we still need to check whether we actually
11822 don't need to infer anything in this case.
11823 (MemberAccess): Merged the functionality from GenericMemberAccess
11826 * generic.cs (GenericMemberAccess): Removed.
11828 2004-04-05 Martin Baulig <martin@ximian.com>
11830 * decl.cs (MemberCore): For generic classes, interfaces and
11831 structs, `Name' now includes the number of type parameters
11832 ("Stack!1.Node!1").
11833 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11834 encode the number of type arguments in the type name.
11836 * expression.cs (Expression.MemberLookup): Removed the
11837 `num_type_args' argument; we now encode the number of type
11838 arguments in the type name.
11840 * ecore.cs (SimpleName): Encode the number of type arguments in
11841 the type name itself.
11843 * generic.cs (ConstructedType): Likewise.
11845 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11846 `MemberName'; we now include the number of type parameters in the
11849 * typemanager.cs (TypeManager.CheckGeneric): Removed.
11850 (TypeManager.MemberLookup): Removed the
11851 `num_type_args' argument; we now encode the number of type
11852 arguments in the type name.
11854 2004-04-03 Martin Baulig <martin@ximian.com>
11856 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11857 (MemberCore.MemberName): Moved here from MemberBase.
11858 (DeclSpace.SetParameterInfo): Just take the constraints as an
11859 ArrayList; we already have the type parameters in our
11860 `MemberName'; also do the CS0080 reporting here.
11862 * cs-parser.jay (struct_declaration): Use `member_name' instead of
11863 `IDENTIFIER opt_type_parameter_list'; when constructing our
11864 `MemberName', it'll already include our type parameters.
11865 (class_declaration, interface_declaration): Likewise.
11866 (delegate_declaration): Likewise.
11867 (MakeName): Take a MemberName and return a MemberName.
11868 The following two changes are required to avoid shift/reduce conflicts:
11869 (member_name): Don't include a TypeName anymore; ie. this is now
11870 just 'IDENTIFIER opt_type_parameter_list'.
11871 (property_declaration, event_declaration): Use a
11872 `namespace_or_type_name' instead of a `member_name'.
11874 2004-04-03 Martin Baulig <martin@ximian.com>
11876 * decl.cs (MemberName): Renamed to `TypeName' and created a new
11877 `MemberName' class.
11878 (TypeName): Formerly known as MemberName.
11880 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11881 instead of a `MemberName'.
11883 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11884 (member_name): New rule; create a MemberName.
11886 2004-04-02 Martin Baulig <martin@ximian.com>
11888 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11889 (CS0305 and CS0308).
11891 2004-04-02 Martin Baulig <martin@ximian.com>
11893 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11894 support for nested types.
11896 2004-04-02 Martin Baulig <martin@ximian.com>
11898 * ecore.cs (IAlias): New public interface.
11899 (TypeExpr, TypeExpression): Implement IAlias.
11900 (TypeAliasExpression): New public class.
11902 * namespace.cs (Namespace): Implement IAlias.
11903 (Namespace.Lookup): Return an IAlias instead on an object.
11904 (Namespace.DefineName): Take an IAlias instead of an object.
11905 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11907 (NamespaceEntry.UsingAlias): Take a Membername instead of an
11909 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11911 (NamespaceEntry.Lookup): Likewise.
11913 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11916 * decl.cs (DeclSpace): Implement IAlias.
11917 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11919 * generic.cs (ConstructedType): Improved error checking.
11921 2004-04-02 Martin Baulig <martin@ximian.com>
11923 * convert.cs: Added type parameter conversions.
11926 (UnboxCast.Emit): Emit an `unbox.any' for type params.
11927 (ClassCast.Emit): If the source type is a type parameter, box it.
11928 If the target type is a type parameter, emit an `unbox.any'
11929 instead of a `classcast'.1
11931 2004-04-01 Martin Baulig <martin@ximian.com>
11933 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11935 2004-04-01 Martin Baulig <martin@ximian.com>
11937 * generic.cs (ConstructedType.CheckConstraints): Use
11938 Convert.ImplicitStandardConversionExists(); user-defined implicit
11939 conversions are not allowed according to the spec.
11941 2004-03-30 Martin Baulig <martin@ximian.com>
11943 * expression.cs (New): Added support for type parameters.
11946 (TypeManager.activator_type): New public static field.
11947 (TypeManager.activator_create_instance): Likewise.
11949 2004-03-30 Martin Baulig <martin@ximian.com>
11951 * typemanager.cs (TypeManager.HasConstructorConstraint): New
11954 2004-03-30 Martin Baulig <martin@ximian.com>
11956 * generic.cs (ConstructedType.CheckConstraints): Actually follow
11957 the spec here: the argument type must be convertible to the
11960 2004-03-30 Martin Baulig <martin@ximian.com>
11963 (TypeParameter.Define, TypeParameter.DefineMethod): Call
11964 TypeManager.AddTypeParameter().
11965 (ConstructedType.CheckConstraints): Re-enable this and actually
11966 check whether we have a constructor constraint.
11969 (TypeManager.builder_to_type_param): New static field.
11970 (TypeManager.AddTypeParameter): New static method.
11971 (TypeManager.LookupTypeParameter): New public method.
11973 2004-03-30 Martin Baulig <martin@ximian.com>
11975 * generic.cs (TypeParameter.DefineType): Return a boolean and use
11976 the new API to actually define the constructor constraint.
11979 (TypeManager.new_constraint_attr_type): New static field.
11980 (TypeManager.InitCoreTypes): Initialize it.
11982 2004-03-30 Martin Baulig <martin@ximian.com>
11984 * generic.cs (Constraints): Completed error checking, use correct
11987 2004-03-29 Martin Baulig <martin@ximian.com>
11989 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11991 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11992 public version which takes a `ParameterData pd' instead of an
11995 2004-03-29 Martin Baulig <martin@ximian.com>
11997 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
12000 2004-03-29 Martin Baulig <martin@ximian.com>
12002 * expression.cs (Argument.ResolveMethodGroup): If we're a
12003 ConstructedType, call GetMemberAccess() on it.
12005 2004-03-29 Martin Baulig <martin@ximian.com>
12007 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
12008 (MethodCore.CheckGenericOverride): When overriding a generic
12009 method, check whether the constraints match.
12011 * support.cs (GenericConstraints): New public interface.
12012 (ParameterData.GenericConstraints): New public method.
12014 * parameter.cs (Parameter.Resolve): Check whether we're a generic
12015 method parameter and compute our constraints if appropriate.
12016 (Parameter.GenericConstraints): New public property.
12018 * generic.cs (Constraints): Implement GenericConstraints.
12020 2004-03-29 Martin Baulig <martin@ximian.com>
12022 * decl.cs (MemberCache.FindMemberToOverride): Use
12023 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
12025 2004-03-29 Martin Baulig <martin@ximian.com>
12027 * generic.cs (GenericMethod.Define): Resolve our type parameters.
12029 2004-03-29 Martin Baulig <martin@ximian.com>
12031 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
12032 not allowed on non-generic declarations").
12034 2004-03-29 Martin Baulig <martin@ximian.com>
12036 * expression.cs (Invocation.InferTypeArguments): Added overloaded
12037 public version of this method.
12039 * class.cs (MethodCore.IsDuplicateImplementation): Use
12040 Invocation.InferTypeArguments() to check this.
12042 2004-03-29 Martin Baulig <martin@ximian.com>
12044 * convert.cs: Use TypeManager.IsDelegateType() instead of
12045 comparing types correctly.
12047 2004-03-29 Martin Baulig <martin@ximian.com>
12049 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
12050 types directly to make it work for generic instances.
12052 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
12054 2004-03-29 Martin Baulig <martin@ximian.com>
12056 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
12057 support for arrays.
12059 2004-03-24 Martin Baulig <martin@ximian.com>
12061 * decl.cs (DeclSpace.FindType): Also use
12062 TypeManager.CheckGeneric() for types from the using clauses.
12064 2004-03-23 Martin Baulig <martin@ximian.com>
12066 * expression.cs (Invocation.OverloadResolve): Added `bool
12067 may_fail' argument and use it instead of the Location.IsNull() hack.
12069 2004-03-23 Martin Baulig <martin@ximian.com>
12071 * expression.cs (Invocation.InferType): Use correct type inference
12074 2004-03-23 Martin Baulig <martin@ximian.com>
12076 * ecore.cs (MethodGroupExpr.Name): Use
12077 TypeManager.CSharpSignature() instead of just the name.
12079 * expression.cs (Invocation.OverloadResolve): Provide better error
12081 (Invocation.DoResolve): OverloadResolve() never returns null
12082 without reporting an error, so removed the error -6 reporting here.
12084 2004-03-23 Martin Baulig <martin@ximian.com>
12086 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
12089 * cs-parser.jay (delegate_declaration): Support generic delegates.
12091 * delegate.cs: Support generic delegates.
12093 2004-03-22 Martin Baulig <martin@ximian.com>
12095 * expression.cs (Invocation.InferParamsTypeArguments): New static
12096 method; does type inference for params arguments.
12098 2004-03-21 Martin Baulig <martin@ximian.com>
12100 * typemanager.cs (TypeManager.IsGenericMethod): New public static
12101 method; checks whether a method is a generic method.
12103 * expression.cs (Invocation.InferTypeArguments): New static method;
12104 infer type arguments for generic method invocation.
12106 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
12107 property; we set this to true if we're resolving a generic method
12108 invocation and the user specified type arguments, ie. we're not
12109 doing type inference.
12111 2004-03-20 Martin Baulig <martin@ximian.com>
12113 * class.cs (MethodData.DeclaringType): New public property.
12114 (MethodData.Define): Set DeclaringType here.
12115 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
12116 instead of OperatorMethodBuilder.DeclaringType.
12118 2004-03-20 Martin Baulig <martin@ximian.com>
12120 * cs-tokenizer.cs (xtoken): Return a special
12121 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
12123 * cs-parser.jay (default_value_expression): Switch to the new
12126 2004-03-19 Martin Baulig <martin@ximian.com>
12128 * decl.cs (MemberName): New class. We use this to "construct"
12129 namespace_or_type_name's.
12131 * generics.cs (TypeArguments.GetDeclarations): New public method;
12132 returns the type arguments as a string[] and reports a CS0081 if
12133 one of them is not an identifier.
12135 * class.cs (MemberBase): The .ctor now takes the name as a
12136 MemberName instead of a string.
12137 (MemberBase.ExplicitInterfaceName): Changed type from string to
12139 (MemberBase.DoDefine): If we're an explicit implementation, the
12140 InterfaceType may be a generic instance.
12142 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
12143 (namespace_name): Call MemberName.GetName () to transform the
12144 MemberName into a string and ensure we don't have any type
12146 (type_name): Call MemberName.GetTypeExpression() to transfrom the
12147 MemberName into an expression.
12148 (method_header): Use namespace_or_type_name instead of member_name.
12150 2004-04-07 Miguel de Icaza <miguel@ximian.com>
12152 * rootcontext.cs: Add new types to the boot resolution.
12154 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12155 MulticastDelegate is not allowed.
12157 * typemanager.cs: Add new types to lookup: System.TypedReference
12160 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12161 check for TypedReference or ArgIterator, they are not allowed.
12163 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12164 makes us properly catch 1510 in some conditions (see bug 56016 for
12167 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
12169 * CryptoConvert.cs: update from corlib version
12172 2004-04-05 Miguel de Icaza <miguel@ximian.com>
12174 * class.cs (Indexer.Define): Check indexername declaration
12176 2004-04-05 Marek Safar <marek.safar@seznam.cz>
12178 * attribute.cs (IsClsCompliant): Fixed problem with handling
12179 all three states (compliant, not-compliant, undetected).
12181 2004-03-30 Marek Safar <marek.safar@seznam.cz>
12183 * attribute.cs (Attribute): Location is now public.
12184 (Resolve): Store resolved arguments (pos_values) in attribute class.
12185 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12186 (GetClsCompliantAttributeValue): New method that gets
12187 CLSCompliantAttribute value.
12188 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12189 if exists else null.
12190 (AttributeTester): New class for CLS-Compliant verification routines.
12192 * class.cs (Emit): Add CLS-Compliant verification.
12193 (Method.GetSignatureForError): Implemented.
12194 (Constructor.GetSignatureForError): Implemented
12195 (Constructor.HasCompliantArgs): Returns if constructor has
12196 CLS-Compliant arguments.
12197 (Constructor.Emit): Override.
12198 (Construcor.IsIdentifierClsCompliant): New method; For constructors
12199 is needed to test only parameters.
12200 (FieldBase.GetSignatureForError): Implemented.
12201 (TypeContainer): New member for storing base interfaces.
12202 (TypeContainer.FindMembers): Search in base interfaces too.
12204 * codegen.cs (GetClsComplianceAttribute): New method that gets
12205 assembly or module CLSCompliantAttribute value.
12206 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12208 (ModuleClass.Emit): Add error 3012 test.
12210 * const.cs (Emit): Override and call base for CLS-Compliant tests.
12212 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12213 state for all decl types.
12214 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12215 if CLS-Compliant tests are required.
12216 (IsClsCompliaceRequired): New method. Analyze whether code
12217 must be CLS-Compliant.
12218 (IsExposedFromAssembly): New method. Returns true when MemberCore
12219 is exposed from assembly.
12220 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12221 value or gets cached value.
12222 (HasClsCompliantAttribute): New method. Returns true if MemberCore
12223 is explicitly marked with CLSCompliantAttribute.
12224 (IsIdentifierClsCompliant): New abstract method. This method is
12225 used to testing error 3005.
12226 (IsIdentifierAndParamClsCompliant): New method. Common helper method
12227 for identifier and parameters CLS-Compliant testing.
12228 (VerifyClsCompliance): New method. The main virtual method for
12229 CLS-Compliant verifications.
12230 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12231 null. I don't know why is null (too many public members !).
12232 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12233 and get value of first CLSCompliantAttribute that found.
12235 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12236 (VerifyClsCompliance): Override and add extra tests.
12238 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12239 clscheck- disable CLS-Compliant verification event if assembly is has
12240 CLSCompliantAttribute(true).
12242 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12243 ApllyAttribute is now called in emit section as in the other cases.
12244 Possible future Emit integration.
12245 (IsIdentifierClsCompliant): New override.
12246 (VerifyClsCompliance): New override.
12247 (GetEnumeratorName): Returns full enum name.
12249 * parameter.cs (GetSignatureForError): Implemented.
12251 * report.cs (WarningData): New struct for Warning message information.
12252 (LocationOfPreviousError): New method.
12253 (Warning): New method. Reports warning based on the warning table.
12254 (Error_T): New method. Reports error based on the error table.
12256 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12257 verifications are done here.
12259 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12261 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12262 CLSCompliantAttribute.
12263 (all_imported_types): New member holds all imported types from other
12265 (LoadAllImportedTypes): New method fills static table with exported types
12266 from all referenced assemblies.
12267 (Modules): New property returns all assembly modules.
12269 2004-03-30 Miguel de Icaza <miguel@ximian.com>
12271 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12272 throwing a parser error.
12274 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12275 which removes the hardcoded get_/set_ prefixes for properties, as
12276 IL allows for the properties to be named something else.
12280 * expression.cs: Do not override operand before we know if it is
12281 non-null. Fix 56207
12283 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12285 * typemanager.cs: support for pinned variables.
12287 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12289 * decl.cs, typemanager.cs: Avoid using an arraylist
12290 as a buffer if there is only one result set.
12292 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
12294 * expression.cs: Make sure you cant call a static method
12295 with an instance expression, bug #56174.
12297 2004-03-29 Miguel de Icaza <miguel@ximian.com>
12299 * class.cs (IsDuplicateImplementation): Improve error reporting to
12300 flag 663 (method only differs in parameter modifier).
12302 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12303 in preprocessor directives.
12305 * location.cs (LookupFile): Allow for the empty path.
12307 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
12308 better approach for some of that patch, but its failing with the
12309 CharSet enumeration. For now try/catch will do.
12311 * typemanager.cs: Do not crash if a struct does not have fields.
12314 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12316 * expression.cs: cs0213, cant fix a fixed expression.
12319 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12321 * cs-parser.jay: detect invalid embeded statements gracefully.
12324 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
12326 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12329 the invocation type may not be a subclass of the tye of the item/
12330 The type of the item must be a subclass of the invocation item.
12335 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
12337 * attribute.cs: Added methods to get a string and a bool from an
12338 attribute. Required to information from AssemblyKeyFileAttribute,
12339 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12340 * codegen.cs: Modified AssemblyName creation to include support for
12341 strongnames. Catch additional exceptions to report them as CS1548.
12342 * compiler.csproj: Updated include CryptoConvert.cs.
12343 * compiler.csproj.user: Removed file - user specific configuration.
12344 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
12345 Mono.Security assembly. The original class is maintained and tested in
12346 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12347 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12348 like CSC 8.0 (C# v2) supports.
12349 * Makefile: Added CryptoConvert.cs to mcs sources.
12350 * rootcontext.cs: Added new options for strongnames.
12352 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
12354 * driver.cs: For --expect-error, report error code `2'
12355 if the program compiled with no errors, error code `1' if
12356 it compiled with an error other than the one expected.
12358 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
12360 * compiler.csproj: Updated for Visual Studio .NET 2003.
12361 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12362 * compiler.sln: Updated for Visual Studio .NET 2003.
12364 2004-03-24 Ravi Pratap M <ravi@ximian.com>
12366 * expression.cs: Fix bug #47234. We basically need to apply the
12367 rule that we prefer the conversion of null to a reference type
12368 when faced with a conversion to 'object' (csc behaviour).
12370 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12372 * statement.cs: Shorter form for foreach, eliminates
12373 a local variable. r=Martin.
12375 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12377 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12378 checks if we can use brtrue/brfalse to test for 0.
12379 * expression.cs: use the above in the test for using brtrue/brfalse.
12380 cleanup code a bit.
12382 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12384 * expression.cs: Rewrite string concat stuff. Benefits:
12386 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12387 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12388 rather than a concat chain.
12390 * typemanager.cs: Add lookups for more concat overloads.
12392 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
12394 * expression.cs: Emit shorter il code for array init.
12411 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
12413 * statement.cs: Before, two switch blocks would be merged if the
12414 total size of the blocks (end_item - begin_item + 1) was less than
12415 two times the combined sizes of the blocks.
12417 Now, it will only merge if after the merge at least half of the
12422 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
12424 * class.cs : csc build fix for GetMethods(). See bug #52503.
12426 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
12428 * expression.cs: Make sure fp comparisons work with NaN.
12429 This fixes bug #54303. Mig approved this patch a long
12430 time ago, but we were not able to test b/c the runtime
12433 2004-03-19 Miguel de Icaza <miguel@ximian.com>
12435 * ecore.cs (TypExpr.GetHashCode): implement this overload.
12437 2004-03-19 Martin Baulig <martin@ximian.com>
12439 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
12440 two overloads may unify for some type parameter substitutions and
12441 report a CS0408 if appropriate.
12443 2004-03-19 Martin Baulig <martin@ximian.com>
12445 * class.cs (MemberCore.IsDuplicateImplementation): Report the
12446 error here and not in our caller.
12448 2004-03-19 Martin Baulig <martin@ximian.com>
12450 * interface.cs: Completely killed this file.
12451 (Interface): We're now a TypeContainer and live in class.cs.
12453 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12454 argument; we're now also called for interfaces.
12455 (TypeContainer.DefineMembers): Allow this method being called
12457 (TypeContainer.GetMethods): New public method; formerly known as
12458 Interface.GetMethod(). This is used by PendingImplementation.
12459 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12460 it's now private and non-static.
12461 (Interface): Moved this here; it's now implemented similar to
12463 (Method, Property, Event, Indexer): Added `bool is_interface'
12464 argument to their .ctor's.
12465 (MemberBase.IsInterface): New public field.
12467 * cs-parser.jay: Create normal Method, Property, Event, Indexer
12468 instances instead of InterfaceMethod, InterfaceProperty, etc.
12469 (opt_interface_base): Removed; we now use `opt_class_base' instead.
12470 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12472 2004-03-19 Martin Baulig <martin@ximian.com>
12474 * class.cs (MethodCore.IsDuplicateImplementation): New private
12475 method which does the CS0111 checking.
12476 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12477 Use IsDuplicateImplementation().
12479 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
12481 * decl.cs (FindMemberToOverride): New method to find the correct
12482 method or property to override in the base class.
12484 - Make Method/Property use the above method to find the
12485 version in the base class.
12486 - Remove the InheritableMemberSignatureCompare as it is now
12489 This patch makes large code bases much faster to compile, as it is
12490 O(n) rather than O(n^2) to do this validation.
12492 Also, it fixes bug 52458 which is that nested classes are not
12493 taken into account when finding the base class member.
12495 Reviewed/Approved by Martin.
12497 2004-03-17 Martin Baulig <martin@ximian.com>
12499 * expression.cs (MemberAccess.DoResolve): Take the parent's number
12500 of type arguments into account; use the `real_num_type_args'
12501 approach like in DoResolveAsTypeStep().
12503 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
12506 2004-03-17 Marek Safar <marek.safar@seznam.cz>
12508 * interface.cs: In all interface classes removed redundant
12509 member initialization.
12511 2004-03-16 Martin Baulig <martin@ximian.com>
12513 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12515 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12517 * decl.cs (DefineTypeAndParents): New helper method to define a
12518 type's containers before the type itself is defined; This is a
12519 bug exposed by the recent changes to Windows.Forms when an
12520 implemented interface was defined inside a class that had not been
12523 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12525 (Check): Loop correctly to report errors modifiers
12526 (UNSAFE was not in the loop, since it was the same as TOP).
12528 * interface.cs: Every interface member now takes a ModFlags,
12529 instead of a "is_new" bool, which we set on the base MemberCore.
12531 Every place where we called "UnsafeOk" in the interface, now we
12532 call the proper member (InterfaceMethod.UnsafeOK) instead to get
12533 the unsafe settings from the member declaration instead of the
12534 container interface.
12536 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
12538 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12539 `set_indexer_name' to the pending bits (one per type).
12541 We fixed a bug today that was picking the wrong method to
12542 override, since for properties the existing InterfaceMethod code
12543 basically ignored the method name. Now we make sure that the
12544 method name is one of the valid indexer names.
12546 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
12548 * support.cs (SeekableStreamReader): Keep track of stream byte
12549 positions and don't mix them with character offsets to the buffer.
12551 Patch from Gustavo Giráldez
12553 2004-03-15 Marek Safar <marek.safar@seznam.cz>
12555 * interface.cs (InterfaceSetGetBase): Removed double member
12556 initialization, base class does it as well.
12558 2004-03-13 Martin Baulig <martin@ximian.com>
12560 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12561 when compiling corlib.
12563 2004-03-13 Miguel de Icaza <miguel@ximian.com>
12565 * convert.cs (ExplicitConversion): We were reporting an error on
12566 certain conversions (object_type source to a value type, when the
12567 expression was `null') before we had a chance to pass it through
12568 the user defined conversions.
12570 * driver.cs: Replace / and \ in resource specifications to dots.
12573 * class.cs: Add check for duplicate operators. Fixes 52477
12575 2004-03-11 Miguel de Icaza <miguel@ximian.com>
12577 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12578 that are in the middle of the statements, not only at the end.
12581 * class.cs (TypeContainer.AddField): No longer set the
12582 `HaveStaticConstructor' flag, now we call it
12583 `UserDefineStaticConstructor' to diferentiate the slightly
12584 semantic difference.
12586 The situation is that we were not adding BeforeFieldInit (from
12587 Modifiers.TypeAttr) to classes that could have it.
12588 BeforeFieldInit should be set to classes that have no static
12593 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12595 And most importantly Zoltan's comment:
12597 http://bugzilla.ximian.com/show_bug.cgi?id=44229
12599 "I think beforefieldinit means 'it's ok to initialize the type sometime
12600 before its static fields are used', i.e. initialization does not need
12601 to be triggered by the first access to the type. Setting this flag
12602 helps the JIT to compile better code, since it can run the static
12603 constructor at JIT time, and does not need to generate code to call it
12604 (possibly lots of times) at runtime. Unfortunately, mcs does not set
12605 this flag for lots of classes like String.
12607 csc sets this flag if the type does not have an explicit static
12608 constructor. The reasoning seems to be that if there are only static
12609 initalizers for a type, and no static constructor, then the programmer
12610 does not care when this initialization happens, so beforefieldinit
12613 This bug prevents the AOT compiler from being usable, since it
12614 generates so many calls to mono_runtime_class_init that the AOT code
12615 is much slower than the JITted code. The JITted code is faster,
12616 because it does not generate these calls if the vtable is type is
12617 already initialized, which is true in the majority of cases. But the
12618 AOT compiler can't do this."
12620 2004-03-10 Miguel de Icaza <miguel@ximian.com>
12622 * class.cs (MethodData.Emit): Refactor the code so symbolic
12623 information is generated for destructors; For some reasons we
12624 were taking a code path that did not generate symbolic information
12627 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
12629 * class.cs: Create a Constructor.CheckBase method that
12630 takes care of all validation type code. The method
12631 contains some code that was moved from Define.
12633 It also includes new code that checks for duplicate ctors.
12634 This fixes bug #55148.
12636 2004-03-09 Joshua Tauberer <tauberer@for.net>
12638 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12639 a { ... }-style array creation invokes EmitStaticInitializers
12640 which is not good for reference-type arrays. String, decimal
12641 and now null constants (NullCast) are not counted toward
12642 static initializers.
12644 2004-03-05 Martin Baulig <martin@ximian.com>
12646 * location.cs (SourceFile.HasLineDirective): New public field;
12647 specifies whether the file contains or is referenced by a "#line"
12649 (Location.DefineSymbolDocuments): Ignore source files which
12650 either contain or are referenced by a "#line" directive.
12652 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
12654 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12655 direct access to our parent, so check the method inline there.
12657 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
12659 * expression.cs (Invocation.EmitCall): Miguel's last commit
12660 caused a regression. If you had:
12665 In Foo the implict this would be null.
12667 2004-02-27 Miguel de Icaza <miguel@ximian.com>
12669 * expression.cs (Invocation.EmitCall): If the method is not
12670 virtual, do not emit a CallVirt to it, use Call.
12672 * typemanager.cs (GetFullNameSignature): Improve the method to
12673 cope with ".ctor" and replace it with the type name.
12675 * class.cs (ConstructorInitializer.Resolve): Now the method takes
12676 as an argument the ConstructorBuilder where it is being defined,
12677 to catch the recursive constructor invocations.
12679 2004-03-16 Martin Baulig <martin@ximian.com>
12681 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12682 ConstructedType, call ResolveType() on it to get the type rather
12683 than just using `expr.Type'.
12685 2004-03-16 Martin Baulig <martin@ximian.com>
12687 * generics.cs (ConstructedType.GetMemberAccess): Take the
12688 EmitContext instead on the TypeExpr and use
12689 ec.TypeContainer.CurrentType/ec.ContainerType.
12691 2004-03-16 Martin Baulig <martin@ximian.com>
12693 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12694 parameters before aliases.
12696 2004-03-16 Martin Baulig <martin@ximian.com>
12698 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12699 New oublic function; checks whether two generic instances may become
12700 equal under some instantiations (26.3.1).
12702 * class.cs (TypeContainer.Define): Call
12703 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12706 2004-03-16 Martin Baulig <martin@ximian.com>
12708 * class.cs (TypeContainer.GetClassBases): Moved
12709 Error_TypeParameterAsBase() here and also check whether the base
12710 class is not an attribute.
12712 2004-03-16 Martin Baulig <martin@ximian.com>
12714 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12716 2004-03-16 Martin Baulig <martin@ximian.com>
12718 * class.cs (Error_TypeParameterAsBase): Use correct error number
12721 2004-03-16 Martin Baulig <martin@ximian.com>
12723 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12726 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12729 2004-03-15 Martin Baulig <martin@ximian.com>
12731 * typemanager.cs (TypeManager.GetFullName): New public method.
12732 (TypeManager.MemberLookup): Added `int_num_type_arguments'
12733 argument; only return members with the correct number of type
12735 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12736 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12737 whether the number of type arguments matches.
12739 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12740 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12742 * expression.cs (MemberAccess): Added public `NumTypeArguments'
12743 field; it's set by the protected .ctor when we're actually a
12744 GenericMemberAccess.
12745 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12746 arguments and pass it to MemberLookupFinal ().
12748 * ecore.cs (Expression.MemberLookup): Added `int
12749 num_type_arguments' argument; only return members with the correct
12750 number of type arguments.
12751 (Expression.MemberLookupFailed): Check whether the MemberLookup
12752 failed because we did not have the correct number of type
12753 arguments; report CS0305 in this case.
12755 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12756 `e.ResolveAsTypeTerminal()' already did so.
12758 2004-03-15 Martin Baulig <martin@ximian.com>
12760 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12761 we're a ConstructedType; in this case, the caller must report an
12762 error (for instance CS0131).
12764 * generic.cs (TypeArguments): Added Location argument to the .ctor.
12765 (TypeArguments.Resolve): Actually report errors here.
12767 2004-03-15 Miguel de Icaza <miguel@ximian.com>
12769 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12770 `set_indexer_name' to the pending bits (one per type).
12772 We fixed a bug today that was picking the wrong method to
12773 override, since for properties the existing InterfaceMethod code
12774 basically ignored the method name. Now we make sure that the
12775 method name is one of the valid indexer names.
12777 2004-03-15 Martin Baulig <martin@ximian.com>
12779 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12780 for generic instances.
12782 2004-03-13 Martin Baulig <martin@ximian.com>
12784 * class.cs (TypeContainer.DefineType): Call
12785 TypeManager.AddUserType() immediately after creating the
12786 TypeBuilder; pass all type parameters when creating the
12789 * decl.cs (DeclSpace.FindNestedType): New public method.
12790 (DeclSpace.FindType): Added `int num_type_args' argument; only
12791 return types with the correct number of type parameters.
12792 (DeclSpace.CountTypeParams): New public property.
12794 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12795 the number of type parameters; defaults to zero.
12797 * generic.cs (TypeArguments.Count): New public property.
12798 (ConstructedType.DoResolveAsTypeStep): First call
12799 ds.FindNestedType() to find out whether we're nested in the
12800 current generic type; in this case, we inherit all type parameters
12801 from the current class.
12803 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12804 num_type_args' argument.
12805 (RootContext.LookupType): Added overloaded version which takes the
12806 number of type arguments; only return types with the correct
12807 number of type arguments.
12809 * typemanager.cs (TypeManager.CheckGeneric): New public function;
12810 checks whether `Type t' has `int num_type_args'.
12812 2004-03-13 Martin Baulig <martin@ximian.com>
12814 * generic.cs (GenericMethod.DefineType): New method; calls
12815 DefineType() on all the type parameters.
12817 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12818 (MethodData.Define): If we're a generic method, call
12819 GenericMethod.DefineType() to define the type parameters.
12821 2004-03-10 Martin Baulig <martin@ximian.com>
12823 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12824 instead of IsAssignableFrom.
12826 2004-03-10 Martin Baulig <martin@ximian.com>
12828 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12830 * support.cs (ParameterData.HasArrayParameter): New property.
12831 (ReflectionParameters.ctor): Take a MethodBase instead of a
12832 ParameterInfo[]. If we have any type parameters, get the generic
12833 method definition and ask it whether we have variable arguments.
12835 2004-02-26 Miguel de Icaza <miguel@ximian.com>
12837 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12838 routines to check if a type is an enumerable/enumerator allow
12839 classes that implement the IEnumerable or IEnumerator interfaces.
12841 * class.cs (Property, Operator): Implement IIteratorContainer, and
12842 implement SetYields.
12844 (Property.Define): Do the block swapping for get_methods in the
12845 context of iterators. We need to check if Properties also
12846 include indexers or not.
12848 (Operator): Assign the Block before invoking the
12849 OperatorMethod.Define, so we can trigger the Iterator code
12852 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
12853 Property and Operator classes are not created when we parse the
12854 declarator but until we have the block completed, so we use a
12855 singleton SimpleIteratorContainer.Simple to flag whether the
12856 SetYields has been invoked.
12858 We propagate this setting then to the Property or the Operator to
12859 allow the `yield' to function.
12861 2004-02-25 Marek Safar <marek.safar@seznam.cz>
12863 * codegen.cs: Implemented attribute support for modules.
12864 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12865 Assembly/Module functionality.
12867 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12868 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12869 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12871 2004-02-16 Marek Safar <marek.safar@seznam.cz>
12873 * interface.cs (FindMembers): The operation is performed on all base
12874 interfaces and not only on the first. It is required for future CLS Compliance patch.
12876 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
12878 * statement.cs, codegen.cs:
12879 This patch deals with patterns such as:
12881 public class List : IEnumerable {
12883 public MyEnumerator GetEnumerator () {
12884 return new MyEnumerator(this);
12887 IEnumerator IEnumerable.GetEnumerator () {
12891 public struct MyEnumerator : IEnumerator {
12896 Before, there were a few things we did wrong:
12897 1) we would emit callvirt on a struct, which is illegal
12898 2) we emited ldarg when we needed to emit ldarga
12899 3) we would mistakenly call the interface methods on an enumerator
12900 type that derived from IEnumerator and was in another assembly. For example:
12902 public class MyEnumerator : IEnumerator
12904 Would have the interface methods called, even if there were public impls of the
12905 method. In a struct, this lead to invalid IL code.
12907 2004-02-11 Marek Safar <marek.safar@seznam.cz>
12909 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12912 * delegate.cs (Define): Fixed crash when delegate type is undefined.
12914 2004-02-11 Miguel de Icaza <miguel@ximian.com>
12916 * cs-parser.jay: Fix small regression: we were not testing V2
12917 compiler features correctly.
12919 * interface.cs: If the emit context is null, then create one
12921 2004-02-09 Marek Safar <marek.safar@seznam.cz>
12923 * decl.cs (GetSignatureForError): New virtual method to get full name
12924 for error messages.
12926 * attribute.cs (IAttributeSupport): New interface for attribute setting.
12927 Now it is possible to rewrite ApplyAttributes method to be less if/else.
12929 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12930 Duplicated members and code in these classes has been removed.
12931 Better encapsulation in these classes.
12933 2004-02-07 Miguel de Icaza <miguel@ximian.com>
12935 * assign.cs (Assign.DoResolve): When dealing with compound
12936 assignments, there is a new rule in ECMA C# 2.4 (might have been
12937 there before, but it is documented here) that states that in:
12941 If b is of type int, and the `op' is a shift-operator, then the
12942 above is evaluated as:
12946 * expression.cs (Binary.ResolveOperator): Instead of testing for
12947 int/uint/long/ulong, try to implicitly convert to any of those
12948 types and use that in pointer arithmetic.
12950 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12951 method to print information for from the type, not from the
12952 null-method we were given.
12954 2004-02-01 Duncan Mak <duncan@ximian.com>
12956 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12957 parsing for cmd, fixes bug #53694.
12959 2004-02-04 Marek Safar <marek.safar@seznam.cz>
12961 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12962 in the member name duplication tests. Property and operator name duplication
12963 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12965 2004-02-03 Marek Safar <marek.safar@seznam.cz>
12967 * interface.cs (PopulateMethod): Fixed crash when interface method
12968 returns not existing type (error test cs0246-3.cs).
12970 2004-02-02 Ravi Pratap M <ravi@ximian.com>
12972 * cs-parser.jay (interface_accessors): Re-write actions to also
12973 store attributes attached to get and set methods. Fix spelling
12976 (inteface_property_declaration): Modify accordingly.
12978 (InterfaceAccessorInfo): New helper class to store information to pass
12979 around between rules that use interface_accessors.
12981 * interface.cs (Emit): Apply attributes on the get and set
12982 accessors of properties and indexers too.
12984 * attribute.cs (ApplyAttributes): Modify accordingly to use the
12985 right MethodBuilder when applying attributes to the get and set accessors.
12987 2004-01-31 Miguel de Icaza <miguel@ximian.com>
12989 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12991 2004-01-26 Miguel de Icaza <miguel@ximian.com>
12993 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12995 2004-01-25 Miguel de Icaza <miguel@ximian.com>
12997 * cs-parser.jay: Remove YIELD token, instead use the new grammar
12998 changes that treat `yield' specially when present before `break'
12999 or `return' tokens.
13001 * cs-tokenizer.cs: yield is no longer a keyword.
13003 2004-01-23 Marek Safar <marek.safar@seznam.cz>
13005 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
13006 setting for default constructors.
13007 For default constructors are almost every time set wrong Modifier. The
13008 generated IL code has been alright. But inside mcs this values was
13009 wrong and this was reason why several of my CLS Compliance tests
13012 2004-02-27 Martin Baulig <martin@ximian.com>
13014 * generics.cs (ConstructedType.ResolveType): Make the nested type
13015 stuff actually work.
13017 2004-02-25 Martin Baulig <martin@ximian.com>
13019 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
13020 property; returns the type parameters just from the current type,
13021 ie. with the ones from outer classes.
13022 (DeclSpace.LookupGeneric): First search in the current class, then
13024 (DeclSpace.initialize_type_params): When hiding a type parameter
13025 from an outer class, put it into the `type_param_list' anyways.
13027 * expression.cs (MemberAccess.expr): Made this field protected.
13029 * class.cs (TypeContainer.Define): The `CurrentType' just contains
13030 the type parameters from the current class.
13032 * generic.cs (ConstructedType.ResolveType): Support nested generic
13033 types by taking the type parameters which we inherit from outer
13034 classes into account.
13035 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
13036 support for nested generic types.
13038 2004-02-23 Martin Baulig <martin@ximian.com>
13040 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
13041 field and check whether we're nested inside a generic type.
13042 (DeclSpace.ResolveType): If we're resolving to a generic type
13043 definition, create a ConstructedType and return its resolved type.
13044 (DeclSpace.initialize_type_params): New private method;
13045 initializes the `type_param_list' field from the type parameters
13046 from this and all enclosing classes.
13047 (DeclSpace.TypeParameters): Call initialize_type_params() unless
13048 we're already initialized.
13050 2004-02-23 Martin Baulig <martin@ximian.com>
13052 * class.cs (Method.Define): Create the generic method before
13053 calling DoDefine().
13054 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
13055 the TypeContainer one); we use this for generic methods.
13057 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
13058 parent's TypeBuilder.
13060 2004-02-18 Martin Baulig <martin@ximian.com>
13062 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
13063 to check for equality.
13065 2004-02-05 Martin Baulig <martin@ximian.com>
13067 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
13068 `ec.TypeContainer.CurrentType', use it instead of
13069 `ec.ContainerType' to check whether we're in the type's ctor.
13071 2004-01-29 Martin Baulig <martin@ximian.com>
13073 * expression.cs (Invocation.DoResolve): If we're a
13074 `ConstructedType', then we're actually a generic method, so
13075 rewrite the expr as a GenericMemberAccess.
13077 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
13078 here; manually parse it into a string.
13080 2004-01-28 Martin Baulig <martin@ximian.com>
13082 * typemanager.cs (TypeManager.IsEqual): New static method.
13083 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
13084 check for equality instead of using `=='.
13086 2004-01-26 Martin Baulig <martin@ximian.com>
13088 * decl.cs (DeclSpace.CurrentType): New public field.
13090 * expression.cs (This.ResolveBase): If we have an
13091 `ec.TypeContainer.CurrentType', use it instead of
13092 `ec.ContainerType'.
13094 * class.cs (TypeContainer.DefineType): If we're a generic type,
13095 create the `CurrentType' (unresolved).
13096 (TypeContainer.GenericType): New private field.
13097 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
13098 it and store it in `GenericType' before creating the MemberCache.
13099 (TypeContainer.GetMembers): If we have a `GenericType', call
13100 TypeManager.FindMembers() on it.
13102 * interface.cs (Interface.GenericType): New private field.
13103 (Interface.DefineType): If we're a generic type, create the
13104 `CurrentType' (unresolved).
13105 (Interface.DefineMembers): If we have a `CurrentType', resolve it
13106 and store it in `GenericType' before creating the MemberCache.
13107 (Interface.GetMembers): If we have a `GenericType', call
13108 TypeManager.FindMembers() on it.
13110 2004-01-22 Martin Baulig <martin@ximian.com>
13112 * cs-parser.jay (namespace_or_type_name): Return an Expression,
13113 not a QualifiedIdentifier. This is what `type_name_expression'
13114 was previously doing.
13115 (type_name_expression): Removed; the code is now in
13116 `namespace_or_type_name'.
13117 (qualified_identifier): Removed, use `namespace_or_type_name'
13119 (QualifiedIdentifier): Removed this class.
13121 2004-01-22 Martin Baulig <martin@ximian.com>
13123 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
13124 not a string as alias name.
13126 2004-01-21 Miguel de Icaza <miguel@ximian.com>
13128 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
13129 #52730 bug, and instead compute correctly the need to use a
13130 temporary variable when requesting an address based on the
13131 static/instace modified of the field and the constructor.
13133 2004-01-21 Martin Baulig <martin@ximian.com>
13135 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
13136 class and namespace before looking up aliases. Fixes #52517.
13138 2004-01-21 Martin Baulig <martin@ximian.com>
13140 * flowanalysis.cs (UsageVector.Merge): Allow variables being
13141 assinged in a 'try'; fixes exception4.cs.
13143 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13144 * class.cs : Implemented parameter-less constructor for TypeContainer
13146 * decl.cs: Attributes are now stored here. New property OptAttributes
13148 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
13150 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
13152 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13154 * typemanager.cs (CSharpSignature): Now reports also inner class name.
13155 (CSharpSignature): New method for indexer and property signature.
13157 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13159 * pending.cs (IsVirtualFilter): Faster implementation.
13161 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13163 * typemanager.cs: Avoid inclusion of same assembly more than once.
13165 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13167 * cs-parser.jay: Fixed problem where the last assembly attribute
13168 has been applied also to following declaration (class, struct, etc.)
13170 2004-01-21 Marek Safar <marek.safar@seznam.cz>
13172 * class.cs: Added error CS0538, CS0539 reporting.
13173 Fixed crash on Microsoft runtime when field type is void.
13175 * cs-parser.jay: Added error CS0537 reporting.
13177 * pending.cs: Added error CS0535 reporting.
13178 Improved error report for errors CS0536, CS0534.
13180 2004-01-20 Miguel de Icaza <miguel@ximian.com>
13182 Merge a few bits from the Anonymous Method MCS tree.
13184 * statement.cs (ToplevelBlock): New class for toplevel methods,
13185 will hold anonymous methods, lifted variables.
13187 * cs-parser.jay: Create toplevel blocks for delegates and for
13188 regular blocks of code.
13190 2004-01-20 Martin Baulig <martin@ximian.com>
13192 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13193 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13194 and `NeedExplicitReturn'; added `IsLastStatement'.
13195 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13196 have a `ReturnLabel' or we're not unreachable.
13198 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13199 child's reachability; don't just override ours with it. Fixes
13200 #58058 (lluis's example).
13201 (FlowBranching): Added public InTryOrCatch(), InCatch(),
13202 InFinally(), InLoop(), InSwitch() and
13203 BreakCrossesTryCatchBoundary() methods.
13205 * statement.cs (Return): Do all error checking in Resolve().
13206 Unless we are the last statement in a top-level block, always
13207 create a return label and jump to it.
13208 (Break, Continue): Do all error checking in Resolve(); also make
13209 sure we aren't leaving a `finally'.
13210 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13211 statement in a top-level block.
13212 (Block.Flags): Added `IsDestructor'.
13213 (Block.IsDestructor): New public property.
13215 2004-01-20 Martin Baulig <martin@ximian.com>
13217 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13219 2004-01-20 Martin Baulig <martin@ximian.com>
13221 * statement.cs (Statement.ResolveUnreachable): New public method.
13222 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13223 (Block.Resolve): Resolve unreachable statements.
13225 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13227 * expression.cs: We need to fix the case where we do
13228 not have a temp variable here.
13230 * assign.cs: Only expression compound assignments need
13231 temporary variables.
13233 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
13235 * flowanalysis.cs: Reduce memory allocation in a few ways:
13236 - A block with no variables should not allocate a bit
13238 - A method with no out parameters does not need any tracking
13239 for assignment of the parameters, so we need not allocate
13242 public readonly Type[] VariableTypes;
13243 public readonly string[] VariableNames;
13244 Are redundant. The data is already stored in the variable
13245 map, so we need not allocate another array for it.
13246 - We need to add alot of checks for if (params | locals) == null
13247 due to the first two changes.
13249 2004-01-18 Miguel de Icaza <miguel@ximian.com>
13251 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13252 implement IMemoryLocation, we store a copy on a local variable and
13253 take the address of it. Patch from Benjamin Jemlich
13255 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13256 to use a special "type_name_expression" rule which reduces the
13257 number of "QualifiedIdentifier" classes created, and instead
13258 directly creates MemberAccess expressions.
13260 2004-01-17 Miguel de Icaza <miguel@ximian.com>
13262 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13263 that fixes #52853. Null literal assignment to ValueType
13265 * class.cs (MethodData.Emit): Instead of checking the name of the
13266 method to determine if its a destructor, create a new derived
13267 class from Method called Destructor, and test for that.
13269 * cs-parser.jay: Create a Destructor object instead of a Method.
13271 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13275 2004-01-16 Miguel de Icaza <miguel@ximian.com>
13277 * expression.cs (Binary.ResolveOperator): Perform an implicit
13278 conversion from MethodGroups to their delegate types on the
13279 Addition operation.
13281 * delegate.cs: Introduce a new class DelegateCreation that is the
13282 base class for `NewDelegate' and `ImplicitDelegateCreation',
13283 factor some code in here.
13285 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13286 conversion from MethodGroups to compatible delegate types.
13288 * ecore.cs (Expression.Resolve): Do not flag error 654
13289 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13290 we allow conversions from MethodGroups to delegate types now.
13292 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13293 assignments in v2 either.
13295 2004-01-10 Miguel de Icaza <miguel@ximian.com>
13297 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13298 static read-only fields in ctors.
13300 Applied patch from Benjamin Jemlich
13302 * expression.cs (UnaryMutator): Avoid leaking local variables.
13304 2004-01-09 Miguel de Icaza <miguel@ximian.com>
13306 * cs-tokenizer.cs (IsCastToken): Allow the various native types
13307 here to return true, as they can be used like this:
13309 (XXX) int.MEMBER ()
13311 Fixed 49836 and all the other dups
13313 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
13315 * driver.cs: Implement /win32res and /win32icon.
13317 2004-01-08 Miguel de Icaza <miguel@ximian.com>
13319 * cs-parser.jay: Add a rule to improve error handling for the
13320 common mistake of placing modifiers after the type.
13322 2004-01-07 Miguel de Icaza <miguel@ximian.com>
13324 * cs-parser.jay (interface_event_declaration): Catch
13325 initialization of events on interfaces, and report cs0068
13327 * cs-parser.jay (interface_event_declaration): Catch
13328 initialization of events.
13330 * ecore.cs: Better report missing constructors.
13332 * expression.cs (Binary.ResolveOperator): My previous bug fix had
13333 the error reporting done in the wrong place. Fix.
13335 * expression.cs (Binary.ResolveOperator): Catch the
13336 operator + (E x, E y) error earlier, and later allow for implicit
13337 conversions in operator +/- (E e, U x) from U to the underlying
13340 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13341 52596, if the container class is abstract, the default constructor
13342 is protected otherwise its public (before, we were always public).
13344 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13347 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13348 Jemlich that fixes bug #52597, MCS was generating invalid code for
13349 idisposable structs. Thanks to Ben for following up with this
13352 2004-01-06 Miguel de Icaza <miguel@ximian.com>
13354 * driver.cs: Allow assemblies without code to be generated, fixes
13357 2004-01-07 Nick Drochak <ndrochak@gol.com>
13359 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13361 2004-01-05 Miguel de Icaza <miguel@ximian.com>
13363 * cs-parser.jay: Add rules to improve error reporting if fields or
13364 methods are declared at the namespace level (error 116)
13366 * Add rules to catch event add/remove
13368 2004-01-04 David Sheldon <dave-mono@earth.li>
13370 * expression.cs: Added matching ")" to error message for
13373 2004-01-03 Todd Berman <tberman@gentoo.org>
13375 * ecore.cs, attribute.cs:
13376 Applying fix from #52429.
13378 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13380 * ecore.cs, expression.cs, statement.cs:
13381 Total rewrite of how we handle branching. We
13382 now handle complex boolean expressions with fewer
13383 jumps. As well if (x == 0) no longer emits a ceq.
13385 if (x is Foo) is much faster now, because we generate
13388 Overall, we get a pretty big improvement on our benchmark
13389 tests. The code we generate is smaller and more readable.
13391 I did a full two-stage bootstrap. The patch was reviewed
13392 by Martin and Miguel.
13394 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13396 * cs-parser.jay: Make primary_expression not take a QI.
13397 we dont need this because the member_access rule covers
13398 us here. So we replace the rule with just IDENTIFIER.
13400 This has two good effects. First, we remove a s/r conflict.
13401 Second, we allocate many fewer QualifiedIdentifier objects.
13403 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13405 * attribute.cs: Handle MarshalAs attributes as pseudo, and
13406 set the correct information via SRE. This prevents
13407 hanging on the MS runtime. Fixes #29374.
13409 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
13411 * convert.cs: correctly handle conversions to value types
13412 from Enum and ValueType as unboxing conversions.
13414 Fixes bug #52569. Patch by Benjamin Jemlich.
13416 2004-01-02 Ravi Pratap <ravi@ximian.com>
13418 * expression.cs (BetterConversion): Prefer int -> uint
13419 over int -> ulong (csc's behaviour). This fixed bug #52046.
13421 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
13423 * decl.cs (MemberCache.FindMembers): now returns a
13426 * typemanager.cs: In general, go with with ^^.
13427 (CopyNewMethods): take an IList.
13428 (RealMemberLookup): Only allocate an arraylist
13429 if we copy from two sets of methods.
13431 This change basically does two things:
13432 1) Fewer array lists allocated due to CopyNewMethods.
13433 2) the explicit cast in MemberList costed ALOT.
13435 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
13437 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13438 a hashtable to avoid needless string allocations when an identifier is
13439 used more than once (the common case).
13441 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13443 * pending.cs: MS's TypeBuilder.GetInterfaces ()
13444 is broken, it will not return anything. So, we
13445 have to use the information we have in mcs to
13448 * typemanager.cs: Add a cache for GetInterfaces,
13449 since this will now be used more often (due to ^^)
13451 (GetExplicitInterfaces) New method that gets the
13452 declared, not effective, interfaces on a type
13453 builder (eg, if you have interface IFoo, interface
13454 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13457 This patch makes MCS able to bootstrap itself on
13460 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
13462 * expression.cs: Remove the Nop's that Miguel put
13465 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13467 * report.cs, codegen.cs: Give the real stack trace to
13468 the error when an exception is thrown.
13470 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13472 * decl.cs: only allocate hashtables for ifaces if
13475 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
13477 * expression.cs: fix the error from cs0121-2.cs
13478 (a parent interface has two child interfaces that
13479 have a function with the same name and 0 params
13480 and the function is called through the parent).
13482 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
13484 * class.cs, rootcontext.cs, typmanager.cs: do not
13487 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
13489 * codegen.cs: remove stack for the ec flow branching.
13490 It is already a linked list, so no need.
13492 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
13494 * Makefile: Allow custom profiler here.
13496 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13498 * typemanager.cs (LookupType):
13499 - Use a static char [], because split takes
13500 a param array for args, so it was allocating
13502 - Do not store true in a hashtable, it boxes.
13504 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
13506 * flowanalysis.cs: bytify common enums.
13508 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13510 * modifiers.cs: Add a new set of flags for the
13511 flags allowed on explicit interface impls.
13512 * cs-parser.jay: catch the use of modifiers in
13513 interfaces correctly.
13514 * class.cs: catch private void IFoo.Blah ().
13516 All related to bug #50572.
13518 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13520 * decl.cs: Rewrite the consistant accessability checking.
13521 Accessability is not linear, it must be implemented in
13522 a tableish way. Fixes #49704.
13524 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
13526 * expression.cs: Handle negation in a checked context.
13527 We must use subtraction from zero. Fixes #38674.
13529 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13531 * class.cs: Ignore static void main in DLLs.
13532 * rootcontext.cs: Handle the target type here,
13533 since we are have to access it from class.cs
13534 * driver.cs: account for the above.
13536 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
13538 * report.cs: Give line numbers and files if available.
13540 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
13542 * driver.cs: Implement /addmodule.
13544 * typemanager.cs: Change 'modules' field so it now contains Modules not
13547 2003-12-20 Martin Baulig <martin@ximian.com>
13549 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13550 (FieldBase.IsAssigned): Removed this field.
13551 (FieldBase.SetAssigned): New public method.
13552 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13554 2003-12-20 Martin Baulig <martin@ximian.com>
13556 * expression.cs (LocalVariableReference.DoResolve): Don't set
13557 `vi.Used' if we're called from DoResolveLValue().
13559 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13560 returns the usage vector it just merged into the current one -
13561 pass this one to UsageWarning().
13562 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13563 of the `EmitContext', don't call this recursively on our children.
13565 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
13567 * driver.cs: Implement /target:module.
13569 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
13571 * support.cs (CharArrayHashtable): New helper class.
13573 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
13574 char arrays, not strings, so we can avoid creating a string in
13575 consume_identifier if the identifier is a keyword.
13577 2003-12-16 Martin Baulig <martin@ximian.com>
13579 * statement.cs (LocalInfo.Assigned): Removed this property.
13580 (LocalInfo.Flags): Removed `Assigned'.
13581 (LocalInfo.IsAssigned): New public method; takes the EmitContext
13582 and uses flow analysis.
13583 (Block.UsageWarning): Made this method private.
13584 (Block.Resolve): Call UsageWarning() if appropriate.
13586 * expression.cs (LocalVariableReference.DoResolve): Always set
13587 LocalInfo.Used here.
13589 2003-12-13 Martin Baulig <martin@ximian.com>
13591 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13592 any value here; we're now using flow analysis to figure out
13593 whether a statement/block returns a value.
13595 2003-12-13 Martin Baulig <martin@ximian.com>
13597 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13599 (FlowBranching.MergeFinally): Don't call
13600 `branching.CheckOutParameters()' here, this is called in
13602 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13603 when adding the `finally' vector.
13605 2003-12-13 Martin Baulig <martin@ximian.com>
13608 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13609 actually work and also fix #48962.
13611 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
13613 * decl.cs: Do not check System.Object for nested types,
13614 since we know it does not have any. Big bang for buck:
13617 Run 1: 8.35 seconds
13618 Run 2: 8.32 seconds
13619 corlib: 17.99 seconds
13621 Run 1: 8.17 seconds
13622 Run 2: 8.17 seconds
13623 corlib: 17.39 seconds
13625 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
13627 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13628 time we are returning 0 members, so we save alot here.
13630 2003-12-11 Martin Baulig <martin@ximian.com>
13632 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13633 `MergeChild()', also just take the `FlowBranching' as argument;
13634 call Merge() on it and return the result.
13635 (FlowBranching.Merge): We don't need to do anything if we just
13638 2003-12-11 Martin Baulig <martin@ximian.com>
13640 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13641 them in an `ArrayList' to reduce memory usage. Thanks to Ben
13642 Maurer for this idea.
13644 2003-12-11 Martin Baulig <martin@ximian.com>
13646 * flowanalysis.cs (MergeResult): This class is now gone; we now
13647 use the `UsageVector' for this. The reason for this is that if a
13648 branching just has one sibling, we don't need to "merge" them at
13649 all - that's the next step to do.
13650 (FlowBranching.Merge): We now return a `UsageVector' instead of a
13653 2003-12-11 Martin Baulig <martin@ximian.com>
13655 Reworked flow analyis and made it more precise and bug-free. The
13656 most important change is that we're now using a special `Reachability'
13657 class instead of having "magic" meanings of `FlowReturns'. I'll
13658 do some more cleanups and optimizations and also add some more
13659 documentation this week.
13661 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13662 largely reworked this class.
13663 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13664 the new `Reachability' class instead of having "magic" values here.
13665 (FlowBranching): We're now using an instance of `Reachability'
13666 instead of having separate `Returns', `Breaks' etc. fields.
13668 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13669 based on flow analysis; ignore the return value of block.Emit ().
13671 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
13673 * driver.cs typemanager.cs: Find the mono extensions to corlib even
13674 if they are private.
13676 2003-12-09 Martin Baulig <martin@ximian.com>
13678 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13679 call them directly on the UsageVector.
13681 2003-12-09 Martin Baulig <martin@ximian.com>
13683 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13684 Changed return type from `FlowReturns' to `Reachability'.
13686 2003-12-09 Martin Baulig <martin@ximian.com>
13688 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13689 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13690 `Reachable' fields with a single `Reachability' one.
13692 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13694 * class.cs (FindMembers): Remove foreach's.
13699 Run 1: 8.74 seconds
13700 Run 2: 8.71 seconds
13703 Run 1: 8.64 seconds
13704 Run 2: 8.58 seconds
13707 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13712 This patch does a few things:
13713 1. EmptyStatement is now a singleton, so it is never reallocated.
13714 2. All blah is EmptyStatement constructs have been changed to
13715 blah == EmptyStatement.Value, which is much faster and valid
13716 now that EmptyStatement is a singleton.
13717 3. When resolving a block, rather than allocating a new array for
13718 the non-empty statements, empty statements are replaced with
13719 EmptyStatement.Value
13720 4. Some recursive functions have been made non-recursive.
13721 Mainly the performance impact is from (3), however (1) and (2) are needed for
13722 this to work. (4) does not make a big difference in normal situations, however
13723 it makes the profile look saner.
13728 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13729 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13730 Total memory allocated: 56397 KB
13733 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13734 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13735 Total memory allocated: 55666 KB
13737 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13739 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13740 than the hashtable in a hashtable version
13742 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13743 we always end up concating a string. This results in a huge perf
13744 loss, because many strings have to be tracked by the GC. In this
13745 patch, we first use a hashtable that works with two keys, so that
13746 the strings do not need to be concat'ed.
13750 Run 1: 8.74 seconds
13751 Run 2: 8.71 seconds
13754 Run 1: 8.65 seconds
13755 Run 2: 8.56 seconds
13757 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
13759 * Makefile: Add a new target `do-time' that does a quick and simple
13760 profile, leaving easy to parse output.
13762 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
13764 * codegen.cs (Init): Create the dynamic assembly with
13765 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13767 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
13769 * support.cs: Make the PtrHashtable use only one
13770 instance of its comparer.
13772 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
13774 * typemanager.cs: Fix lookup of GetNamespaces.
13776 2003-11-29 Miguel de Icaza <miguel@ximian.com>
13778 * expression.cs: Removed redundant line.
13780 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13781 ArrayLists, use for loops with bounds.
13783 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13786 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13787 arraylists, use for loop with bounds.
13789 The above three changes give us a 0.071 second performance
13790 improvement out of 3.294 seconds down to 3.223. On my machine
13791 the above changes reduced the memory usage by 1,387 KB during
13792 compiler bootstrap.
13794 * cs-parser.jay (QualifiedIdentifier): New class used to represent
13795 QualifiedIdentifiers. Before we created a new string through
13796 concatenation, and mostly later on, the result would be
13797 manipulated by DecomposeQI through string manipulation.
13799 This reduced the compiler memory usage for bootstrapping from
13800 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13801 compile times in 0.05 seconds.
13803 2003-11-28 Dick Porter <dick@ximian.com>
13805 * support.cs: Do string compares with the Invariant culture.
13813 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13814 the comparison is done with the Invariant culture.
13816 2003-11-27 Miguel de Icaza <miguel@ximian.com>
13818 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13819 GetEnumerator method.
13821 (ProbeCollectionType): Iterate starting at the most specific type
13822 upwards looking for a GetEnumerator
13824 * expression.cs: Shift count can be up to 31 for int/uint and 63
13827 2003-11-26 Miguel de Icaza <miguel@ximian.com>
13829 * statement.cs (Block.LookupLabel): Also look for the label on the
13830 children blocks. Use a hash table to keep track of visited
13833 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13834 we actually did transform the other operand, otherwise fall back
13835 to the common codepath that casts to long.
13837 * cs-tokenizer.cs: Use the same code pattern as the int case.
13838 Maybe I should do the parsing myself, and avoid depending on the
13839 Parse routines to get this done.
13841 2003-11-25 Miguel de Icaza <miguel@ximian.com>
13843 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13844 which fixes bug 51347. This time test it.
13846 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13847 attributes for example can not tell the difference between these.
13848 The difference was only a syntax feature of the language.
13850 * attribute.cs: Apply attributes to delegates.
13852 * delegate.cs: Call the apply attributes method.
13854 2003-11-24 Miguel de Icaza <miguel@ximian.com>
13856 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13857 comparing 0 vs Byte.MinValue, not the value
13859 (ImplicitConversionRequired): When reporting a conversion error,
13860 use error 31 to print out the constant error instead of the
13863 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
13864 which fixes bug 51347.
13866 2003-11-22 Miguel de Icaza <miguel@ximian.com>
13868 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
13869 which fixes the -warnaserror command line option.
13871 2003-11-21 Miguel de Icaza <miguel@ximian.com>
13873 * cfold.cs (DoNumericPromotions): During constant folding of
13874 additions on UIntConstant, special case intconstants with
13875 IntConstants like we do on the expression binary operator.
13877 2003-11-12 Miguel de Icaza <miguel@ximian.com>
13879 * convert.cs (ImplicitReferenceConversion): We were missing a case
13880 (System.Enum are not value types or class types, so we need to
13881 classify them separatedly).
13883 * driver.cs: We do not support error 2007.
13885 2003-11-12 Jackson Harper <jackson@ximian.com>
13887 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13888 system directory. Also use the full file name so users can
13889 libraries names mscorlib-o-tron.dll in a non system dir.
13891 2004-01-04 David Sheldon <dave-mono@earth.li>
13893 * expression.cs: Added matching ")" to error message for CS0077.
13895 2003-12-19 Martin Baulig <martin@ximian.com>
13897 * typemanager.cs (TypeManager.IsEqualGenericType): New public
13898 static method; see documentation in the method.
13899 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13901 * convert.cs (Convert.ImplicitReferenceConversion,
13902 Convert.ImplicitReferenceConversionExists): Add support for
13903 generic type declarations; see gen-36.cs.
13905 2003-12-19 Martin Baulig <martin@ximian.com>
13907 * pending.cs (Pending.InterfaceMethod): Use
13908 `Type.IsAssignableFrom()' instead of `=='.
13910 2003-12-18 Martin Baulig <martin@ximian.com>
13912 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13915 * convert.cs (Convert.ImplicitStandardConversionExists): Use
13916 `expr_type.Equals (target_type)' instead of `=='.
13918 2003-12-08 Martin Baulig <martin@ximian.com>
13920 * generics.cs (Constraints.Types): Removed.
13921 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13923 (Constraints.ResolveTypes): New public method; resolves the
13924 TypeExpr's to Type's.
13925 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13926 longer takes the constraints.
13927 (TypeParameter.DefineMethod): Likewise.
13928 (TypeParameter.DefineType): New public method. Calls
13929 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13932 2003-12-08 Martin Baulig <martin@ximian.com>
13934 * convert.cs (Convert.ImplicitConversionStandard): Use
13935 `expr_type.Equals (target_type)' instead of `=='.
13937 2003-12-08 Martin Baulig <martin@ximian.com>
13939 * typemanager.cs (TypeManager.GetReferenceType): Call
13940 `Type.MakeByRefType ()'.
13942 2003-12-08 Martin Baulig <martin@ximian.com>
13944 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13945 just has some special meaning in some situations. For instance,
13946 it is allowed to use `where' as the name of a variable etc.
13948 2003-12-04 Martin Baulig <martin@ximian.com>
13950 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13951 `Type.MakeArrayType()' for array types.
13953 2003-11-18 Miguel de Icaza <miguel@ximian.com>
13955 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13958 (SizeOf.DoResolve): assign the `type_queried' field. This gets
13961 2003-11-16 Martin Baulig <martin@ximian.com>
13963 * codegen.cs (EmitContext.IsGeneric): Removed.
13965 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13966 ResolveGeneric() on the DeclSpace.
13968 2003-11-16 Martin Baulig <martin@ximian.com>
13970 * generic.cs (TypeArguments.Resolve):
13971 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13972 `ResolveType()' on it to get the Type.
13974 2003-11-15 Martin Baulig <martin@ximian.com>
13976 * generic.cs (ConstructedType.GetInterfaces): Override this.
13978 2003-11-14 Martin Baulig <martin@ximian.com>
13980 * interface.cs (Interface.DefineType): Define all type parameters
13981 before adding the interfaces we inherit.
13983 2003-11-11 Martin Baulig <martin@ximian.com>
13985 * generic.cs (ConstructedType.ResolveType): Always call
13986 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13988 2003-11-10 Martin Baulig <martin@ximian.com>
13990 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13991 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13992 calling `ResolveType()' on them, directly assign their `Type'.
13994 2003-11-08 Martin Baulig <martin@ximian.com>
13996 * generic.cs (ConstructedType): Override `IsClass' etc.
13998 2003-11-08 Martin Baulig <martin@ximian.com>
14000 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
14001 return value and the `out parent' parameter.
14002 (TypeContainer.DefineType): Moved the CS0644 check into
14003 GetClassBases(). Don't pass the interface types to the
14004 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
14005 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
14007 * ecore.cs (TypeExpr.IsAttribute): New property.
14008 (TypeExpr.GetInterfaces): New method.
14010 * interface.cs (Interface.GetInterfaceTypeByName): Return a
14011 TypeExpr instead of a Type.
14012 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
14013 (Interface.DefineType): Don't pass the interface types to the
14014 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
14015 them later and then call `TypeBulider.AddInterfaceImplementation()'.
14017 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
14018 instead of a `Type[]'.
14019 (TypeManager.RegisterBuilder): Likewise.
14020 (TypeManager.AddUserInterface): Likewise.
14021 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
14022 `Type[]' and also return a `TypeExpr[]'.
14023 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
14025 2003-11-08 Martin Baulig <martin@ximian.com>
14027 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
14030 2003-11-08 Martin Baulig <martin@ximian.com>
14032 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
14033 TypeManager.ResolveExpressionTypes().
14035 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
14036 instead of an Expression.
14037 (TypeExpr): This is now an abstract base class for `TypeExpression'.
14038 (TypeExpression): New public class; formerly known as `TypeExpr'.
14040 * expression.cs (ComposedCast): Derive from TypeExpr.
14042 * typemanager.cs (TypeManager.system_*_expr): These are now
14043 TypExpr's instead of Expression's.
14044 (TypeManager.ResolveExpressionTypes): New public static function;
14045 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
14048 2003-11-06 Miguel de Icaza <miguel@ximian.com>
14050 * expression.cs (New.DoResolve): Do not dereference value that
14051 might be a null return.
14053 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
14054 sure that the constant value has the right type. Fixes an
14055 unreported bug, similar to 50425.
14057 * const.cs (Const.LookupConstantValue): Call
14058 ImplicitStandardConversionExists before doing a conversion to
14059 avoid havng the TypeManager.ChangeType do conversions.
14061 Reduced the number of casts used
14063 (Const.ChangeType): New routine to enable reuse of the constant
14064 type changing code from statement.
14066 * typemanager.cs (ChangeType): Move common initialization to
14067 static global variables.
14071 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
14072 every value type to go through, even if it was void. Fix that.
14074 * cs-tokenizer.cs: Use is_identifier_start_character on the start
14075 character of the define, and the is_identifier_part_character for
14076 the rest of the string.
14078 2003-11-05 Miguel de Icaza <miguel@ximian.com>
14080 * expression.cs (UnaryMutator.EmitCode): When I updated
14081 LocalVariableReference.DoResolve, I overdid it, and dropped an
14082 optimization done on local variable references.
14084 2003-11-04 Miguel de Icaza <miguel@ximian.com>
14086 * ecore.cs: Convert the return from Ldlen into an int.
14088 2003-10-20 Miguel de Icaza <miguel@ximian.com>
14090 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
14091 the accessibility, this is a special case for toplevel non-public
14092 classes (internal for instance).
14094 2003-10-20 Nick Drochak <ndrochak@gol.com>
14096 * ecore.cs: Fix typo and build. Needed another right paren.
14098 2003-10-19 Miguel de Icaza <miguel@ximian.com>
14100 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
14101 `internal' case regular and protected, but not allowing protected
14102 to be evaluated later. Bug 49840
14104 2003-10-15 Miguel de Icaza <miguel@ximian.com>
14106 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
14107 to kb.Nlast, and not the kb.nFirst to isolate the switch
14110 Extract the underlying type, so enumerations of long/ulong are
14111 treated like long/ulong.
14113 2003-10-14 Miguel de Icaza <miguel@ximian.com>
14115 * expression.cs (New): Overload the meaning of RequestedType to
14116 track the possible creation of the NewDelegate type, since
14117 DoResolve is invoked more than once for new constructors on field
14120 See bugs: #48800 and #37014
14122 * cs-parser.jay (declare_local_constants): Take an arraylist
14123 instead of a single constant.
14125 (local_constant_declaration): It should take a
14126 constant_declarators, not a constant_declarator. Fixes 49487
14128 * convert.cs: Fix error report.
14130 2003-10-13 Jackson Harper <jackson@ximian.com>
14132 * typemanager.cs (TypeToCoreType): Add float and double this fixes
14135 2003-11-03 Martin Baulig <martin@ximian.com>
14137 * expression.cs (ArrayAccess.GetStoreOpcode): Added
14138 `out bool has_type_arg'; if set, we need to pass the type to
14140 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
14141 Stelem_Any/Ldelem_Any for generic parameters.
14143 2003-11-02 Martin Baulig <martin@ximian.com>
14145 * expression.cs (Invocation.EmitCall): Use
14146 `TypeManager.IsValueType()' to check whether it's a value type.
14147 Don't set `struct_call' when calling a method on a type parameter.
14149 2003-11-02 Martin Baulig <martin@ximian.com>
14151 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
14152 and removed the TypeBuilder argument.
14154 * typemanager.cs (TypeManager.IsValueType): Return
14155 `t.IsGenericParameter || t.IsValueType'.
14157 2003-10-25 Martin Baulig <martin@ximian.com>
14159 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
14160 call ConstructedType.Resolve() on it.
14162 * generic.cs (ConstructedType.Resolve): Set `type' on success.
14164 2003-10-25 Martin Baulig <martin@ximian.com>
14166 * class.cs (TypeContainer.GetClassBases): Changed
14167 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
14168 CS8214 reporting here.
14169 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
14170 instead of a `Type' for our parent. In case of a recursive
14171 declaration (see tests/gen-23.cs for an example), our parent is a
14172 ConstructedType and it doesn't have its type set. So, first
14173 create our own TypeBuilder, then call constructed.Resolve() to get
14174 the parent's type and finally TypeBuilder.SetParent() it.
14176 * ecore.cs (TypeExpr.Name): New public virtual property.
14179 (ConstructedType): We're now a TypeExpr and not just an Expression.
14180 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
14181 arguments here; this is done later.
14182 (ConstructedType.Resolve): New public method to resolve the type
14183 arguments and bind them.
14185 2003-10-21 Martin Baulig <martin@ximian.com>
14187 * convert.cs: Use `TypeManager.IsValueType' instead of
14188 'type.IsValueType' everywhere.
14190 * typemanager.cs (TypeManager.IsValueType): Return true for type
14191 parameters. The reason for this is that we need to box a type
14192 parameter when converting it to a reference type.
14194 * cs-parser.jay: Added support for default value expressions.
14196 * generics.cs (DefaultValueExpression): New public class.
14198 2003-10-17 Martin Baulig <martin@ximian.com>
14200 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
14201 TypeContainer so we can also use this for Interfaces.
14202 (TypeParameter.Resolve): Likewise.
14204 * interface.cs (Interface.DefineType): Added support for generic
14207 * cs-parser.jay: Added support for generic structs and interfaces.
14209 2003-10-17 Martin Baulig <martin@ximian.com>
14211 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
14212 call generic methods :-)
14214 2003-10-16 Martin Baulig <martin@ximian.com>
14216 * cs-parser.jay (namespace_or_type_name): Only create a
14217 GenericMemberAccess if we actually have type arguments.
14219 2003-10-13 Martin Baulig <martin@ximian.com>
14221 * class.cs (Method.Define): If we're a generic method, call
14222 TypeBuilder.DefineGenericMethod () before resolving
14224 (MethodData): Added .ctor which takes an additional MethodBuilder
14225 argument; this is used for generic methods.
14226 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
14227 we already have a MethodBuilder.
14229 2003-10-10 Martin Baulig <martin@ximian.com>
14231 * class.cs (Method): Added .ctor which takes a `GenericMethod'
14232 instead of a `DeclSpace'. This is used for generic methods.
14234 * cs-parser.jay (method_header): Added support for generic
14235 methods; create a `GenericMethod' instance and pass it to the
14236 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
14237 parameters and locals.
14239 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
14240 since we already have the location. Check whether we're a generic
14241 type declaration or a generic method and create the correct type
14244 * generic.cs (TypeParameter.DefineMethod): New public method.
14245 (GenericMethod): New public class; derives from DeclSpace and is
14246 used for generic methods.
14248 2003-10-09 Martin Baulig <martin@ximian.com>
14250 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
14252 (MethodCore.DoDefineParameters): Removed the TypeContainer
14253 argument; use the DeclSpace which was passed to the .ctor instead.
14254 (MethodCore.CheckParameter): Take a DeclSpace instead of a
14255 TypeContainer; we only need a DeclSpace here.
14257 2003-10-09 Martin Baulig <martin@ximian.com>
14259 * class.cs (MethodData): Added additional `DeclSpace ds' argument
14261 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
14262 EmitContext's .ctor.
14264 2003-10-09 Martin Baulig <martin@ximian.com>
14266 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
14267 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
14268 AsAccessible(), moved them as well.
14270 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
14272 2003-10-07 Miguel de Icaza <miguel@ximian.com>
14274 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
14275 generation for >=, as spotted by Paolo, bug 48679.
14276 Patch from David Waite.
14278 * cs-tokenizer.cs: Add handling for #pragma.
14280 * cs-parser.jay: Allow for both yield and yield return in the
14281 syntax. The anti-cobolization of C# fight will go on!
14283 * class.cs (TypeBuilder.DefineType): Catch error condition here
14284 (Parent.DefineType erroring out and returning null).
14286 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14287 coping with enumerations variables, we were mistakenly processing
14288 them as a regular value type instead of built-in types. Fixes the
14291 * typemanager.cs (IsBuiltinOrEnum): New method.
14293 2003-09-30 Miguel de Icaza <miguel@ximian.com>
14295 * cs-parser.jay: Upgrade: yield now needs the return clause.
14297 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
14299 * cs-parser.jay : Renamed yyName to yyNames related to jay.
14301 2003-09-29 Martin Baulig <martin@ximian.com>
14303 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
14304 inflated generic methods.
14306 * generics.cs (ConstructedType): Distinguish between open and
14307 closed constructed types; correctly resolve the arguments.
14309 2003-09-22 Martin Baulig <martin@ximian.com>
14311 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
14312 all type arguments meet their constraints.
14314 2003-09-19 Martin Baulig <martin@ximian.com>
14316 * decl.cs (MemberCache.SetupCacheForInterface): Take a
14317 `MemberCache parent' argument. Normally, an interface doesn't
14318 have a parent type except System.Object, but we use this in gmcs
14319 for generic type parameters.
14321 2003-09-18 Martin Baulig <martin@ximian.com>
14323 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
14324 on `type.IsInterface'; don't check whether the type has a parent
14325 to determine whether it's an interface.
14327 2003-09-17 Martin Baulig <martin@ximian.com>
14329 * generic.cs (ConstructedType.ToString): Always use `name' as the
14332 2003-09-15 Martin Baulig <martin@ximian.com>
14334 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
14336 * generic.cs (Constraints.Resolve): New public method; this is
14337 called to resolve the constraint types and to check whether all
14338 the constraints are correct.
14339 (Constraints.Types): New public property.
14340 (TypeParameter.Resolve): New public method; resolves all the
14341 type's constraints.
14343 * class.cs (TypeContainer.DefineType): Call
14344 TypeParameter.Resolve() before actually defining the type.
14346 2003-09-15 Martin Baulig <martin@ximian.com>
14348 * class.cs (TypeContainer.DefineType): Added an error flag to
14349 avoid reporting duplicate CS0146's ("class definition is
14352 * driver.cs (Driver.MainDriver): Abort if
14353 RootContext.ResolveTree() reported any errors.
14355 2003-09-07 Martin Baulig <martin@ximian.com>
14357 * report.cs (Error, Warning): Added overloaded versions which take
14358 a `params object[] args' and call String.Format().
14360 2003-09-07 Martin Baulig <martin@ximian.com>
14362 * decl.cs (DeclSpace..ctor): Don't call
14363 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
14364 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
14365 (DeclSpace.RecordDecl): New method.
14367 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
14369 2003-09-02 Ravi Pratap <ravi@ximian.com>
14371 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
14372 value attributes to be applied to ParameterBuilders.
14374 * class.cs (MethodCore.LabelParameters): Make static and more
14375 generic so that it can be used from other places - like interface
14376 methods, for instance.
14378 * interface.cs (Interface.Emit): Call LabelParameters before
14379 emitting attributes on the InterfaceMethod.
14381 2003-09-07 Martin Baulig <martin@ximian.com>
14383 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
14384 if the number of type parameters doesn't match.
14386 2003-09-04 Martin Baulig <martin@ximian.com>
14388 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
14389 for arrays of generic type params (ie. `!0[]').
14391 2003-09-04 Martin Baulig <martin@ximian.com>
14393 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
14396 2003-09-04 Martin Baulig <martin@ximian.com>
14398 * decl.cs (DeclSpace.LookupGeneric): New method.
14399 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
14402 * generic.cs (TypeParameterExpr): Take a TypeParameter as
14403 argument, not just a string.
14404 (TypeParameter.Define): New public method; this is called to
14405 actually define the generic parameter; after this, you can use the
14406 new `Type' property to get the type.
14408 2003-09-04 Martin Baulig <martin@ximian.com>
14410 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
14411 is now an ArrayList; initialize the result of the `TypeParameters'
14413 (DeclSpace.GetGenericData): Removed.
14414 (DeclSpace.LookupGeneric): Temporarily removed; we need to
14415 implement this in a different way.
14416 (DeclSpace.GetTypeParameters): Removed; there's now a
14417 `TypeParameters' property.
14418 (DeclSpace.TypeParameters): New public property.
14420 * generic.cs (Constraints): Make this class public.
14421 (TypeParameter): New public class.
14423 2003-09-04 Martin Baulig <martin@ximian.com>
14425 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
14426 generic parameters.
14428 * class.cs (TypeContainer.DefineType): Call
14429 TypeBuilder.DefineGenericParameter () on all generic parameters if
14430 this is a generic type.
14432 2003-08-28 Martin Baulig <martin@ximian.com>
14434 * sample-stack.il: Compile this with ilasm: "ilasm /dll
14437 * sample-hello.cs: Compile this with gmcs: "gmcs
14438 /r:sample-stack.dll sample-hello.cs".
14440 2003-08-28 Martin Baulig <martin@ximian.com>
14442 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
14443 the parameters to the generic type.
14445 2003-08-28 Martin Baulig <martin@ximian.com>
14447 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
14449 2003-08-28 Martin Baulig <martin@ximian.com>
14451 * cs-parser.jay (opt_type_argument_list): Use
14452 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
14453 (primary_expression): Replace `qualified_identifier' with `type_name'.
14454 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
14456 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
14457 parser to check whether it is syntactically a type parameter list;
14458 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
14461 2003-08-26 Martin Baulig <martin@ximian.com>
14463 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
14464 resolving aliases; fixes #47927.
14466 2003-08-26 Martin Baulig <martin@ximian.com>
14468 * statement.cs (Using.DoResolve): This is internally emitting a
14469 try/finally clause, so we need to set ec.NeedExplicitReturn if we
14470 do not always return. Fixes #47681.
14472 2003-08-26 Martin Baulig <martin@ximian.com>
14474 * decl.cs (MemberCore): Moved WarningNotHiding(),
14475 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
14477 (AdditionResult): Make this nested in DeclSpace.
14478 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
14479 argument; call NamespaceEntry.Define() unless we're nested in a
14482 * namespace.cs (Namespace.DefineName): New public function. This
14483 is called from DeclSpace's .ctor to add
14484 (Namespace.Lookup): Include DeclSpaces in the lookup.
14486 * class.cs (Operator): Derive from MemberBase, not MemberCore.
14488 * const.cs (Const): Derive from MemberBase, not MemberCore.
14490 2003-08-25 Martin Baulig <martin@ximian.com>
14492 * convert.cs (Convert.ExplicitReferenceConversion): When
14493 converting from an interface type to a class, unbox if the target
14494 type is a struct type. Fixes #47822.
14496 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14498 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14501 2003-08-22 Martin Baulig <martin@ximian.com>
14503 * class.cs (TypeManager.DefineType): When defining a nested type,
14504 call DefineType() on our parent; fixes #47801.
14506 2003-08-22 Martin Baulig <martin@ximian.com>
14508 * class.cs (MethodData.Define): While checking if a method is an
14509 interface implementation, improve the test a bit more to fix #47654.
14511 2003-08-22 Martin Baulig <martin@ximian.com>
14513 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14514 correctly; fixes #47722.
14516 2003-08-22 Martin Baulig <martin@ximian.com>
14518 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14519 LocalVariableReference, ensure it's not read-only. Fixes #47536.
14521 * statement.cs (Fixed.DoResolve): Make all variables read-only.
14523 2003-08-22 Martin Baulig <martin@ximian.com>
14525 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14526 can only be assigned in static constructors. Fixes #47161.
14528 2003-08-22 Martin Baulig <martin@ximian.com>
14530 Rewrote and improved the flow analysis code.
14532 * flowbranching.cs (FlowBranching): Make this class abstract.
14533 (FlowBranching.CreateBranching): New static function to create a
14534 new flow branching.
14535 (FlowBranchingBlock, FlowBranchingException): New classes.
14536 (FlowBranching.UsageVector.Type): New public readonly field.
14537 (FlowBranching.UsageVector.Breaks): Removed the setter.
14538 (FlowBranching.UsageVector.Returns): Removed the setter.
14539 (FlowBranching.UsageVector): Added Break(), Return(),
14540 NeverReachable() and Throw() methods to modify the reachability.
14541 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14542 done by FlowBranching.Merge().
14543 (FlowBranching.UsageVector.MergeChild): New method; merges the
14544 merge result into the current vector.
14545 (FlowBranching.Merge): New abstract method to merge a branching.
14547 2003-08-12 Martin Baulig <martin@ximian.com>
14549 * expression.cs (Indirection.CacheTemporaries): Create the
14550 LocalTemporary with the pointer type, not its element type.
14552 2003-08-10 Miguel de Icaza <miguel@ximian.com>
14554 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14555 token was a keyword or not.
14557 Add `error' options where an IDENTIFIER was expected; Provide
14558 CheckToken and CheckIdentifierToken convenience error reporting
14561 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14563 * decl.cs: Rename `NamespaceEntry Namespace' public field into
14564 NameSpaceEntry NameSpaceEntry.
14566 (LookupInterfaceOrClass): Avoid creating a full qualified name
14567 from namespace and name: avoid doing lookups when we know the
14568 namespace is non-existant. Use new Tree.LookupByNamespace which
14569 looks up DeclSpaces based on their namespace, name pair.
14571 * driver.cs: Provide a new `parser verbose' to display the
14572 exception thrown during parsing. This is turned off by default
14573 now, so the output of a failure from mcs is more graceful.
14575 * namespace.cs: Track all the namespaces defined in a hashtable
14578 (IsNamespace): New method
14580 2003-08-09 Miguel de Icaza <miguel@ximian.com>
14582 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
14583 we know that we need to concatenate (full typename can never be
14588 * statement.cs: Use a bitfield; Do not initialize to null things
14589 which are done by the constructor by default.
14591 * cs-parser.jay: bug fix, parameter was 4, not 3.
14593 * expression.cs: Just use the property;
14595 * statement.cs: No need for GetVariableInfo method.
14597 2003-08-08 Martin Baulig <martin@ximian.com>
14599 * flowanalysis.cs (FlowReturns): This is now nested in the
14600 `FlowBranching' class.
14601 (MyBitVector): Moved this here from statement.cs.
14602 (FlowBranching.SiblingType): New enum type.
14603 (FlowBranching.CreateSibling): Added `SiblingType' argument.
14605 2003-08-07 Martin Baulig <martin@ximian.com>
14607 * flowanalysis.cs (FlowBranchingType): This is now nested in the
14608 `FlowBranching' class and called `BranchingType'.
14610 2003-08-07 Martin Baulig <martin@ximian.com>
14612 * flowanalysis.cs: Moved all the control flow analysis code into
14615 2003-08-07 Martin Baulig <martin@ximian.com>
14617 * assign.cs (Assign.DoResolve): `target' must either be an
14618 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
14621 2003-08-07 Miguel de Icaza <miguel@ximian.com>
14623 * expression.cs (BinaryMethod): This kind of expression is created by the
14624 Binary class if it determines that the operator has to be handled
14627 (BinaryDelegate): This kind of expression is created if we are
14628 dealing with a + or - operator on delegates.
14630 (Binary): remove method, argumetns, and DelegateOperator: when
14631 dealing with methods,
14633 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14635 * statement.cs (Block): use bitfields for the three extra booleans
14636 we had in use. Remove unused topblock parameter.
14638 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14640 * assign.cs: Drop extra unneeded tests.
14642 2003-08-06 Miguel de Icaza <miguel@ximian.com>
14644 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14646 * statement.cs (Foreach): Use VariableStorage instead of
14649 * codegen.cs (VariableStorage): New class used by clients that
14650 require a variable stored: locals or fields for variables that
14651 need to live across yield.
14653 Maybe provide a convenience api for EmitThis+EmitLoad?
14655 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14658 2003-08-05 Miguel de Icaza <miguel@ximian.com>
14660 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14661 RemapParameterLValue): New methods that are used to turn a
14662 precomputed FieldInfo into an expression like this:
14666 The idea is to use this instead of making LocalVariableReference
14667 have more than one meaning.
14669 * cs-parser.jay: Add error production to BASE.
14671 * ecore.cs: Deal with TypeManager.GetField returning null, which
14672 is now a valid return value.
14674 (FieldExprNoAddress): New expression for Fields whose address can
14677 * expression.cs (LocalVariableReference): During the resolve
14678 phases, create new expressions if we are in a remapping context.
14679 Remove code that dealt with remapping here.
14681 (ParameterReference): same.
14683 (ProxyInstance): New expression, like the `This' expression, but
14684 it is born fully resolved. We know what we are doing, so remove
14685 the errors that are targeted to user-provided uses of `this'.
14687 * statement.cs (Foreach): our variable is now stored as an
14688 Expression; During resolution, follow the protocol, dont just
14689 assume it will return this.
14691 2003-08-06 Martin Baulig <martin@ximian.com>
14693 * support.cs (SeekableStreamReader.cs): New public class.
14695 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14696 SeekableStreamReader instead of the normal StreamReader.
14698 2003-08-04 Martin Baulig <martin@ximian.com>
14700 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14701 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14702 deambiguate casts and delegate invocations.
14703 (parenthesized_expression): Use the new tokens to ensure this is
14704 not a cast of method invocation.
14706 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14707 when reading a `)' and Deambiguate_CloseParens () was previously
14710 * expression.cs (ParenthesizedExpression): New class. This is
14711 just used for the CS0075 test.
14712 (Binary.DoResolve): Check for CS0075.
14714 2003-07-29 Ravi Pratap <ravi@ximian.com>
14716 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14717 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14718 reference comparison.
14720 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14721 examine the ReturnType for equality - this is necessary in the
14722 cases of implicit and explicit operators whose signature also
14723 includes the return type.
14725 2003-07-26 Miguel de Icaza <miguel@ximian.com>
14727 * namespace.cs: Cache the result of the namespace computation,
14728 instead of computing it every time.
14730 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14732 * decl.cs: Use a global arraylist that we reuse over invocations
14733 to avoid excesive memory consumption. Reduces memory usage on an
14734 mcs compile by one meg (45 average).
14736 * typemanager.cs (LookupTypeReflection): In .NET pointers are
14737 private, work around that.
14739 2003-07-23 Miguel de Icaza <miguel@ximian.com>
14741 * literal.cs (IntLiteral): Define Zero and One static literals.
14743 * cs-parser.jay (integer_literal): use static literals to reduce
14744 memory usage for the most used literals (0, 1 and -1). 211kb
14745 reduced in memory usage.
14747 Replace all calls to `new ArrayList' with `new
14748 ArrayList(4)' which is a good average number for most allocations,
14749 and also requires only 16 bytes of memory for its buffer by
14752 This reduced MCS memory usage in seven megabytes for the RSS after
14755 2003-07-28 Ravi Pratap <ravi@ximian.com>
14757 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14758 handle params methods the correct way by forming only one
14759 applicable set with params and normal methods in them. Earlier we
14760 were looking at params methods only if we found no normal methods
14761 which was not the correct thing to do.
14763 (Invocation.BetterFunction): Take separate arguments indicating
14764 when candidate and the best method are params methods in their
14767 This fixes bugs #43367 and #46199.
14769 * attribute.cs: Documentation updates.
14771 (CheckAttribute): Rename to CheckAttributeTarget.
14772 (GetValidPlaces): Rename to GetValidTargets.
14774 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14775 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14779 2003-07-28 Miguel de Icaza <miguel@ximian.com>
14781 * codegen.cs: Compute IsGeneric correctly.
14783 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14786 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14787 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
14788 regressions, and I was chasing more bugs than I required.
14790 * interface.cs: Use expressions for base type names (like classes
14791 and structs have been doing for a while now), and resolve that.
14792 This patch should probably go into head as well.
14794 This makes it one less user of FindType.
14796 2003-07-24 Miguel de Icaza <miguel@ximian.com>
14798 This compiler can not self host currently. Need to fix that.
14800 * Makefile: compile to `gmcs.exe'
14802 * driver.cs: Turn on v2 by default on gmcs.
14804 * generic.cs (ConstructedType): Does no longer take a container
14805 type argument; That will be taken care of later.
14807 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14808 Use SimpleName to resolve for now, so we can continue the work on
14809 the parser, until we get Type.GetType that understands generics.
14811 (ConstructedType.ToString): Implement
14813 (TypeArguments.Resolve): Resolve the child expressions as types.
14815 * cs-parser.jay: Rename interface_constraints to
14816 type_parameter_constraints
14818 (namespace_or_type_name): Only use constructed types for the basic
14819 construction, we will deal with identifier<...> later.
14821 (type/type_name): No longer call DecomposeQI, as
14822 namespace_or_type_name is always decoded now.
14824 2003-07-22 Ravi Pratap <ravi@ximian.com>
14826 * expression.cs (Invocation.OverloadResolve): Follow the spec more
14827 closely: we eliminate methods in base types when we have an
14828 applicable method in a top-level type.
14830 Please see section 14.5.5.1 for an exact description of what goes
14833 This fixes bug #45127 and a host of other related to corlib compilation.
14835 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14836 array is the method corresponding to the top-level type (this is
14837 because of the changes made to icall.c) so we change this
14840 (MethodGroupExpr.Name): This too.
14842 * typemanager.cs (GetElementType): New method which does the right
14843 thing when compiling corlib.
14845 * everywhere: Make use of the above in the relevant places.
14847 2003-07-22 Martin Baulig <martin@ximian.com>
14849 * cs-parser.jay (invocation_expression): Moved
14850 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14851 `cast_expression', but create a InvocationOrCast which later
14852 resolves to either an Invocation or a Cast.
14854 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14855 method; call this before EmitStatement() to make sure that this
14856 expression can be used as a statement.
14858 * expression.cs (InvocationOrCast): New class; resolves to either
14859 an Invocation or a Cast.
14861 * statement.cs (StatementExpression): Call ResolveStatement() on
14862 the ExpressionStatement before emitting it.
14864 2003-07-21 Martin Baulig <martin@ximian.com>
14866 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14867 `ref' and `out' attributes match; fixes #46220.
14868 (MemberAccess.ResolveMemberAccess): You can't reference a type
14869 through an expression; fixes #33180.
14870 (Indexers.GetIndexersForType): Don't return the indexers from
14871 interfaces the class implements; fixes #46502.
14873 2003-07-21 Martin Baulig <martin@ximian.com>
14875 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14876 CS0661 checks; fixes bug #30442.
14878 2003-07-21 Martin Baulig <martin@ximian.com>
14880 * decl.cs (AdditionResult): Added `Error'.
14882 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14884 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14885 cs0031.cs actually work.
14887 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14889 * cs-parser.jay (namespace_name): do not use
14890 namespace_or_type_name, use qualified_identifier, because
14891 namespace_or_type_name will soon return a composed expression
14892 instead of a string.
14894 (namespace_or_type_name): Instead of returning a string, now this
14895 production returns an expression.
14897 * codegen.cs (EmitContext): Setup IsGeneric property based on
14898 whether our DeclSpace is generic, our the method is generic.
14900 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14901 the method is generic.
14903 * cs-parser.jay (type_arguments, opt_type_argument_list,
14904 type_parameters, type_parameter_list, opt_type_parameter_list,
14905 type_parameter,, opt_type_parameter_constraints_clauses,
14906 type_parameter_constraints_clauses,
14907 type_parameter_constraint_clause, type_parameter_constraint,
14908 interface_constraints): Add new production
14910 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14911 DeclSpace is generic or not.
14913 (DeclSpace.SetParameterInfo): New routine, used to set the
14914 parameter info for a type.
14916 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14917 returns a GenericTypeExpr
14919 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14920 generic, lookup the generic argument.
14922 * attribute.cs: Do not allow TypeParameterExpressions in
14925 * class.cs: Do not allow the Main method to be defined in a
14928 * expression.cs (SizeOf): Do not allow generic types to be used as
14929 arguments to sizeof.
14931 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14932 it: whether a type is generic or not. Only works for types we are
14933 currently building for now.
14935 2003-07-20 Martin Baulig <martin@ximian.com>
14937 * namespace.cs: Fixed that bug which caused a crash when compiling
14938 the debugger's GUI.
14940 2003-07-20 Miguel de Icaza <miguel@ximian.com>
14942 * typemanager.cs (LookupTypeReflection): Never expose types which
14943 are NotPublic, NestedPrivate, NestedAssembly, or
14944 NestedFamANDAssem. We used to return these, and later do a check
14945 that would report a meaningful error, but the problem is that we
14946 would not get the real match, if there was a name override.
14948 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14950 * namespace.cs (Namespace, Name): Do not compute the namespace
14951 name dynamically, compute it in the constructor. This reduced
14952 memory usage by 1697 KB.
14954 * driver.cs: Use --pause to pause at the end.
14956 2003-07-17 Peter Williams <peter@newton.cx>
14958 * Makefile: Change the name of the test target so that it doesn't
14959 conflict with the recursive test target.
14961 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14963 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14964 AddressOf): Do not use EmitThis, that was wrong, use the actual
14967 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14969 * class.cs (MethodData.Define): While checking if a method is an
14970 interface implementation, improve the test: If we are not public
14971 (use new test here: use the computed MethodAttributes directly,
14972 instead of the parsed modifier flags) check if the `implementing'
14973 method comes from an interface or not.
14975 * pending.cs (VerifyPendingMethods): Slightly better error
14978 * makefile: add test target that does the mcs bootstrap.
14980 2003-07-16 Ravi Pratap <ravi@ximian.com>
14982 * interface.cs (Define): Do nothing here since there are no
14983 members to populate etc. Move the attribute emission out of here
14984 since this was just totally the wrong place to put it. Attribute
14985 application happens during the 'Emit' phase, not in the 'Define'
14988 (Emit): Add this method and move the attribute emission here
14990 * rootcontext.cs (EmitCode): Call the Emit method on interface
14993 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14995 * expression.cs (OverloadResolve): Report error only if Location
14996 is not 'Null' which means that there was a probe going on.
14998 2003-07-14 Martin Baulig <martin@ximian.com>
15000 * expression.cs (ConditionalLogicalOperator): New public class to
15001 implement user defined conditional logical operators.
15002 This is section 14.11.2 in the spec and bug #40505.
15004 2003-07-14 Martin Baulig <martin@ximian.com>
15006 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
15008 2003-07-14 Martin Baulig <martin@ximian.com>
15010 * codegen.cs (EmitContext.InFixedInitializer): New public field.
15012 * ecore.cs (IVariable.VerifyFixed): New interface method.
15014 * expression.cs (Unary.ResolveOperator): When resolving the `&'
15015 operator, check whether the variable is actually fixed. Fixes bug
15016 #36055. Set a variable definitely assigned when taking its
15017 address as required by the spec.
15019 * statement.cs (LocalInfo.IsFixed): New field.
15020 (LocalInfo.MakePinned): Set `IsFixed' to true.
15022 2003-07-14 Ravi Pratap M <ravi@ximian.com>
15024 * attribute.cs (Attribute.Resolve): While doing a Member lookup
15025 for .ctors, ensure that we only ask for members declared in the
15026 attribute type (BindingFlags.DeclaredOnly).
15030 * expression.cs (Error_WrongNumArguments): Report error 1501
15031 correctly the way CSC does.
15033 2003-07-13 Martin Baulig <martin@ximian.com>
15035 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
15036 lookup on the fully qualified name, to make things like "X.X" work
15037 where "X.X" is a fully qualified type name, but we also have a
15038 namespace "X" in the using list. Fixes #41975.
15040 2003-07-13 Martin Baulig <martin@ximian.com>
15042 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
15043 function. If we're a CompoundAssign, we need to create an embedded
15044 CompoundAssign, not an embedded Assign.
15045 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
15048 2003-07-13 Martin Baulig <martin@ximian.com>
15050 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
15051 work to fix bug #46088.
15053 2003-07-13 Ravi Pratap <ravi@ximian.com>
15055 * class.cs (Operator.Emit): Do not emit attributes here - it is
15056 taken care of by the Method class that we delegate too. This takes
15057 care of bug #45876.
15059 2003-07-10 Martin Baulig <martin@ximian.com>
15061 * expression.cs (TypeOfVoid): New class.
15062 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
15064 2003-07-10 Martin Baulig <martin@ximian.com>
15066 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
15069 2003-07-10 Martin Baulig <martin@ximian.com>
15071 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
15072 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
15074 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
15076 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
15078 2003-07-10 Martin Baulig <martin@ximian.com>
15080 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
15081 of decimal. Fixes #42850.
15083 NOTE: I also fixed the created byte blob, but this doesn't work on
15084 the MS runtime and csc never produces any byte blobs for decimal
15087 2003-07-10 Martin Baulig <martin@ximian.com>
15089 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
15090 structs; fixes #32068.
15091 (Block.AddChildVariableNames): Fixed #44302.
15093 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15095 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
15097 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15099 * attribute.cs: And this test is onger needed.
15101 2003-07-08 Martin Baulig <martin@ximian.com>
15103 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
15104 inaccessible types. Fixes #36313.
15106 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
15108 * namespace.cs (NamespaceEntry): Create implicit entries for all
15109 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
15110 implicit entries for N1.N2 and N1.
15112 2003-07-08 Martin Baulig <martin@ximian.com>
15114 Rewrote the handling of namespaces to fix a lot of the issues
15115 wrt. `using' aliases etc.
15117 * namespace.cs (Namespace): Splitted this class into a
15118 per-assembly `Namespace' and a per-file `NamespaceEntry'.
15120 * typemanager.cs (TypeManager.IsNamespace): Removed.
15121 (TypeManager.ComputeNamespaces): Only compute namespaces from
15122 loaded assemblies here, not the namespaces from the assembly we're
15123 currently compiling.
15125 2003-07-08 Martin Baulig <martin@ximian.com>
15127 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
15129 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15131 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
15134 I thought about the memory savings here, but LookupTypeReflection
15135 is used under already very constrained scenarios. Compiling
15136 corlib or mcs only exposes one hit, so it would not really reduce
15137 any memory consumption.
15139 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15141 * typemanager.cs: fixes bug #45889 by only adding public types from
15142 other assemblies to the list of known types.
15144 2003-07-07 Miguel de Icaza <miguel@ximian.com>
15146 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
15147 on the type we resolved.
15149 2003-07-05 Martin Baulig <martin@ximian.com>
15151 * pending.cs (PendingImplementation.ParentImplements): Don't
15152 create the proxy if the parent is abstract.
15154 * class.cs (TypeContainer.DefineIndexers): Process explicit
15155 interface implementations first. Fixes #37714.
15157 2003-07-04 Miguel de Icaza <miguel@ximian.com>
15159 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
15160 defined recursively; but since we modify the input parameters
15161 (left is set to `this' temporarily), we reset this value if the
15162 left_is_explicit is false, which gives the original semantics to
15165 * literal.cs (NullPointer): new class used to represent a null
15166 literal in a pointer context.
15168 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
15169 type is a pointer, use a NullPointer object instead of a
15170 NullLiteral. Closes 43687
15172 (ExplicitConversion): Convert pointer values using
15173 the conv opcode to the proper type.
15175 * ecore.cs (New): change ValueTypeVariable property into a method,
15176 that returns whether the valuetype is suitable for being used.
15178 * expression.cs (Binary.DoNumericPromotions): Only return if we
15179 the int constant was a valid uint, and we can return both left and
15180 right as uints. If not, we continue processing, to trigger the
15181 type conversion. This fixes 39018.
15183 * statement.cs (Block.EmitMeta): During constant resolution, set
15184 the CurrentBlock property on the emitcontext, so that we resolve
15185 constants propertly.
15187 2003-07-02 Martin Baulig <martin@ximian.com>
15189 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
15190 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
15192 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
15193 than emitting it here.
15195 * statement.cs: Fixed some more flow analysis bugs.
15197 2003-07-02 Martin Baulig <martin@ximian.com>
15199 * class.cs (MethodData.Define): When implementing interface
15200 methods, set Final unless we're Virtual.
15202 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
15203 check work for interface methods.
15205 2003-07-01 Martin Baulig <martin@ximian.com>
15207 * ecore.cs (EmitContext.This): Replaced this property with a
15208 GetThis() method which takes a Location argument. This ensures
15209 that we get the correct error location for a CS0188.
15211 2003-07-01 Miguel de Icaza <miguel@ximian.com>
15213 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
15214 ImplicitStandardConversion.
15216 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
15218 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
15220 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
15223 2003-06-30 Miguel de Icaza <miguel@ximian.com>
15225 * class.cs (Constructor.Define): Turn off initlocals for unsafe
15228 (MethodData.Define): Turn off initlocals for unsafe methods.
15230 2003-06-29 Miguel de Icaza <miguel@ximian.com>
15232 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
15233 complete; Fixes #37521.
15235 * delegate.cs: Use Modifiers.TypeAttr to compute the
15236 TypeAttributes, instead of rolling our own. This makes the flags
15237 correct for the delegates.
15239 2003-06-28 Miguel de Icaza <miguel@ximian.com>
15241 * class.cs (Constructor.Define): Set the private flag for static
15242 constructors as well.
15244 * cs-parser.jay (statement_expression): Set the return value to
15245 null, to avoid a crash when we catch an error.
15247 2003-06-24 Miguel de Icaza <miguel@ximian.com>
15249 * cs-parser.jay: Applied patch from Jackson that adds support for
15250 extern and unsafe modifiers to destructor declarations.
15252 * expression.cs: Report error 21 if the user is trying to index a
15255 * driver.cs: Add an error message, suggested by the bug report.
15257 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
15258 if we do not have a ": this ()" constructor initializer. Fixes 45149
15260 2003-06-14 Miguel de Icaza <miguel@ximian.com>
15262 * namespace.cs: Add some information to reduce FAQs.
15264 2003-06-13 Miguel de Icaza <miguel@ximian.com>
15266 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
15267 underlying enumeration types. Fixes #43915.
15269 * expression.cs: Treat ushort/short as legal values to be used in
15270 bitwise operations.
15272 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
15274 * delegate.cs: transfer custom attributes for paramenters from
15275 the delegate declaration to Invoke and BeginInvoke.
15277 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
15279 * attribute.cs: handle custom marshalers and emit marshal info
15282 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
15284 * makefile.gnu: Added anonymous.cs to the compiler sources.
15286 2003-05-28 Miguel de Icaza <miguel@ximian.com>
15288 * iterators.cs: Change the name of the proxy class to include two
15291 * cs-parser.jay: Update grammar to include anonymous methods.
15293 * anonymous.cs: new file.
15295 2003-05-27 Miguel de Icaza <miguel@ximian.com>
15297 * class.cs (Field.Define): Add missing test for pointers and
15300 2003-05-27 Ravi Pratap <ravi@ximian.com>
15302 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
15303 we use the stobj opcode.
15305 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
15306 since it wasn't the correct fix.
15308 It still is puzzling that we are required to use stobj for IntPtr
15309 which seems to be a ValueType.
15311 2003-05-26 Miguel de Icaza <miguel@ximian.com>
15313 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
15314 during regular simple name resolution. Now, the trick is that
15315 instead of returning for processing the simplename, we do a
15316 TypeManager.LookupType (ie, a rooted lookup as opposed to a
15317 contextual lookup type). If a match is found, return that, if
15318 not, return for further composition.
15320 This fixes long-standing 30485.
15322 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15323 using the address to initialize an object, do an Stobj instead of
15324 using the regular Stelem.
15326 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
15327 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
15328 Because if we are a BaseIndexerAccess that value will be true.
15331 * statement.cs (GotoCase.Resolve): Return after reporting an
15332 error, do not attempt to continue.
15334 * expression.cs (PointerArithmetic.Emit): If our operand is a
15335 long, convert our constants to match the operand before
15336 multiplying. Convert to I type before adding. Fixes 43670.
15338 2003-05-14 Ravi Pratap <ravi@ximian.com>
15340 * enum.cs (ImplicitConversionExists) : Rename to
15341 ImplicitEnumConversionExists to remove ambiguity.
15343 * ecore.cs (NullCast): New type of cast expression class which
15344 basically is very similar to EmptyCast with the difference being
15345 it still is a constant since it is used only to cast a null to
15347 (eg. (string) null)
15349 * convert.cs (ImplicitReferenceConversion): When casting a null
15350 literal, we return a NullCast.
15352 * literal.cs (NullLiteralTyped): Remove - I don't see why this
15353 should be around anymore.
15355 The renaming (reported was slightly wrong). Corrections:
15357 ConvertImplicitStandard -> ImplicitConversionStandard
15358 ConvertExplicitStandard -> ExplicitConversionStandard
15360 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
15361 before passing them in !
15363 * convert.cs (ImplicitConversionStandard): When comparing for
15364 equal expr and target types, ensure that expr is not a
15367 In general, we must not be checking (expr_type ==
15368 target_type) in the top level conversion methods
15369 (ImplicitConversion, ExplicitConversion etc). This checking is
15370 done in the methods that they delegate to.
15372 2003-05-20 Miguel de Icaza <miguel@ximian.com>
15374 * convert.cs: Move Error_CannotConvertType,
15375 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
15376 ImplicitNumericConversion, ImplicitConversionExists,
15377 ImplicitUserConversionExists, StandardConversionExists,
15378 FindMostEncompassedType, FindMostSpecificSource,
15379 FindMostSpecificTarget, ImplicitUserConversion,
15380 ExplicitUserConversion, GetConversionOperators,
15381 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
15382 TryImplicitIntConversion, Error_CannotConvertImplicit,
15383 ConvertImplicitRequired, ConvertNumericExplicit,
15384 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
15385 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
15388 Perform the following renames:
15390 StandardConversionExists -> ImplicitStandardConversionExists
15391 ConvertImplicit -> ImplicitConversion
15392 ConvertImplicitStandard -> ImplicitStandardConversion
15393 TryImplicitIntConversion -> ImplicitIntConversion
15394 ConvertImplicitRequired -> ImplicitConversionRequired
15395 ConvertNumericExplicit -> ExplicitNumericConversion
15396 ConvertReferenceExplicit -> ExplicitReferenceConversion
15397 ConvertExplicit -> ExplicitConversion
15398 ConvertExplicitStandard -> ExplicitStandardConversion
15400 2003-05-19 Martin Baulig <martin@ximian.com>
15402 * statement.cs (TypeInfo.StructInfo): Made this type protected.
15403 (TypeInfo): Added support for structs having structs as fields.
15405 * ecore.cs (FieldExpr): Implement IVariable.
15406 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
15407 VariableInfo for the field.
15409 2003-05-18 Martin Baulig <martin@ximian.com>
15411 * expression.cs (This.DoResolve): Report a CS0027 if we're
15412 emitting a field initializer.
15414 2003-05-18 Martin Baulig <martin@ximian.com>
15416 * expression.cs (This.ResolveBase): New public function.
15417 (This.DoResolve): Check for CS0188.
15419 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
15422 * ecore.cs (MethodGroupExpr.DoResolve): Set the
15423 `instance_expression' to null if we don't have any non-static
15426 2003-05-18 Martin Baulig <martin@ximian.com>
15428 Reworked the way how local variables and parameters are handled by
15429 the flow analysis code.
15431 * statement.cs (TypeInfo, VariableMap): New public classes.
15432 (VariableInfo): New public class. This is now responsible for
15433 checking whether a variable has been assigned. It is used for
15434 parameters and local variables.
15435 (Block.EmitMeta): Take the InternalParameters as argument; compute
15436 the layout of the flow vectors here.
15437 (Block.LocalMap, Block.ParameterMap): New public properties.
15438 (FlowBranching): The .ctor doesn't get the InternalParameters
15439 anymore since Block.EmitMeta() now computes the layout of the flow
15441 (MyStructInfo): This class is now known as `StructInfo' and nested
15442 in `TypeInfo'; we don't access this directly anymore.
15444 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
15445 property and removed IsAssigned(), IsFieldAssigned(),
15446 SetAssigned() and SetFieldAssigned(); we now call them on the
15447 VariableInfo so we don't need to duplicate this code everywhere.
15449 * expression.cs (ParameterReference): Added `Block block' argument
15451 (LocalVariableReference, ParameterReference, This): The new
15452 VariableInfo class is now responsible for all the definite
15455 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
15456 IsParameterAssigned, SetParameterAssigned): Removed.
15458 2003-05-18 Martin Baulig <martin@ximian.com>
15460 * typemanager.cs (InitCoreTypes): Try calling
15461 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
15462 the 3-args-version. Corlib now also needs our `void_type'.
15463 (GetMethod): Added overloaded version which takes an optional
15464 `bool report_errors' to allow lookups of optional methods.
15466 2003-05-12 Martin Baulig <martin@ximian.com>
15468 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
15469 only used for locals and not for parameters.
15471 2003-05-12 Miguel de Icaza <miguel@ximian.com>
15473 * support.cs (InternalParameters.ParameterType): Return the
15474 ExternalType of the parameter.
15476 * parameter.cs (Parameter.ExternalType): drop the two arguments,
15479 2003-05-11 Miguel de Icaza <miguel@ximian.com>
15481 * class.cs (MethodData.Define): Do not set the `newslot' on
15482 interface members, if they are also flagged as "override".
15484 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
15485 better code for ++i and i++. This only works for static fields
15486 and local variables.
15488 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
15489 want to pull the DeclSpace out of the builder_to_declspace instead
15490 of the TypeBuilder (like in TypeContainer.FindMembers).
15492 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
15493 instead of LookupTypeContainer. Fixes the crash on .NET for
15494 looking up interface members.
15496 * const.cs: Create our own emit context during the Definition
15497 stage, so that constants are evaluated in the proper context, when
15498 a recursive definition happens.
15500 2003-05-11 Martin Baulig <martin@ximian.com>
15502 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
15503 new block for a switch section.
15504 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15505 the adding/lookup in the switch block. Fixes #39828.
15507 2003-05-09 Miguel de Icaza <miguel@ximian.com>
15509 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15510 functionality: I needed to convert the data after I had performed
15511 the add/sub operation into the operands type size.
15513 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15514 pass the type for the box operation, otherwise the resulting
15515 object would have been of type object.
15517 (BoxedCast): Add constructor to specify the type to box as.
15519 2003-05-07 Miguel de Icaza <miguel@ximian.com>
15521 * iterators.cs: I was reusing the `count' variable inadvertently,
15522 take steps to not allow this to happen.
15524 2003-05-06 Miguel de Icaza <miguel@ximian.com>
15526 * attribute.cs (Attribute.Resolve): Params attributes are encoded
15527 by creating an array at the point where the params starts and
15528 putting all those arguments there, then adjusting the size of the
15531 2003-05-05 Miguel de Icaza <miguel@ximian.com>
15533 * expression.cs (New.AddressOf): Implement interface
15534 IMemoryLocation. This is used when the `new' operator is used in
15535 the context of an invocation to a method on a value type.
15537 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15540 * namespace.cs: Also check the using aliases here.
15542 * driver.cs: Move the test for using validity after the types have
15543 been entered, so we do a single pass that also includes the using
15546 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15547 in the regular case. CreateSiblingForFinally is doing extra
15550 * attribute.cs (GetAttributeArgumentExpression): Store the result
15551 on an out value, and use the return value to indicate failure
15552 instead of using null (which is a valid return for Constant.GetValue).
15554 * statement.cs: Perform the analysis flow for the increment
15555 portion after the statement, because this will be the real flow of
15556 execution. Fixes #42385
15558 * codegen.cs (EmitContext.EmitArgument,
15559 EmitContext.EmitStoreArgument): New helper functions when the
15560 RemapToProxy flag is set.
15562 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15565 Add support for remapping parameters.
15567 * iterators.cs: Propagate parameter values; Store parameter
15568 values in the proxy classes.
15570 2003-05-04 Miguel de Icaza <miguel@ximian.com>
15572 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
15573 need a proxy reference; I do not know what I was thinking
15575 * cs-parser.jay (constructor_initializer): catch another error,
15576 and display nice message.
15578 (field_declaration): catch void field declaration
15579 to flag a better error.
15581 * class.cs (MemberBase.CheckBase): Report an error instead of a
15582 warning if a new protected member is declared in a struct.
15583 (Field.Define): catch the error of readonly/volatile.
15585 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15587 (FieldExpr.AddressOf): ditto. Catch error where the address of a
15588 volatile variable is taken
15590 2003-05-02 Miguel de Icaza <miguel@ximian.com>
15592 * statement.cs (Fixed.Resolve): Report an error if we are not in
15595 2003-05-01 Miguel de Icaza <miguel@ximian.com>
15597 * typemanager.cs: reuse the code that handles type clashes for
15598 delegates and enumerations.
15600 * class.cs (Report28): Always report.
15602 * expression.cs (EncodeAsAttribute): Allow nulls here.
15604 2003-04-28 Miguel de Icaza <miguel@ximian.com>
15606 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15607 the functionality for testing whether an expression is valid for
15608 an attribute here. Also handle the case of arrays of elements
15611 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15612 encoding a linear array into an array of objects that are suitable
15613 to be passed to an CustomAttributeBuilder.
15615 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15617 * ecore.cs: (FieldExpr): Handle field remapping here.
15619 * iteratators.cs: Pass the instance variable (if the method is an
15620 instance method) to the constructors, so we can access the field
15621 variables on the class.
15623 TODO: Test this with structs. I think the THIS variable on
15624 structs might have to be a pointer, and not a refenrece
15626 2003-04-27 Miguel de Icaza <miguel@ximian.com>
15628 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15629 local variables to fields in a proxy class.
15631 * iterators.cs (PopulateProxy): Rename our internal fields to
15633 Create a <THIS> field if we are an instance method, so we can
15634 reference our parent container variables.
15635 (MapVariable): Called back from the EmitContext code to enter a
15636 new variable to field mapping into the proxy class (we just create
15640 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15641 for using the remapped locals to fields.
15643 I placed the code here, because that gives the same semantics to
15644 local variables, and only changes the Emit code.
15646 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15647 statements inside iterators.
15648 (VariableInfo): Add a FieldBuilder for the cases when we are
15649 remapping local variables to fields in a proxy class
15651 * ecore.cs (SimpleNameResolve): Avoid testing two times for
15652 current_block != null.
15654 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15655 not cope with strings, as it has been moved to the
15656 TableSwitchEmit. Fixed bug in switch generation.
15658 * expression.cs (New.DoResolve): Provide more context for the user
15659 when reporting an error.
15661 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15664 * expression.cs (MemberAccess.DoResolve): When we get a type back,
15665 check the permissions for it. Note than in a type-resolution
15666 context the check was already present in DeclSpace.ResolveType,
15667 but was missing from the MemberAccess.
15669 (ArrayCreation.CheckIndices): warn if the user has
15670 more nested levels of expressions, but there are no more
15671 dimensions specified. Avoids crash on bug 41906.
15673 2003-04-26 Miguel de Icaza <miguel@ximian.com>
15675 * statement.cs (Block): replace Implicit bool, for a generic
15677 New flag: `Unchecked'. This is used during the EmitMeta phase
15678 (which is out-of-line with the regular Resolve/Emit process for a
15679 statement, as this is done ahead of time, but still gets a chance
15680 to call constant resolve).
15682 (Block.Flags): new enum for adding a new flag.
15684 (Block.EmitMeta): track the state of unchecked.
15686 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15687 to enable constant resolution to work there as well.
15689 2003-04-22 Miguel de Icaza <miguel@ximian.com>
15691 * typemanager.cs (ienumerable_type): Also look up
15692 System.Collections.IEnumerable.
15694 2003-04-21 Miguel de Icaza <miguel@ximian.com>
15696 TODO: Test more than one conditional per method.
15698 * class.cs (Indexer.Define): Report the location where the user is
15699 referencing the unsupported feature.
15701 (MethodData): Overload the use of `conditionals' to
15702 minimize the creation of needless ArrayLists. This saves roughly
15703 212kb on my machine.
15705 (Method): Implement the new IIteratorContainer interface.
15706 (Method.SetYields): Implement the method by setting the ModFlags
15707 to contain METHOD_YIELDS.
15709 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15710 which just got set to null.
15712 * iterators.cs: New file.
15714 (Yield, YieldBreak): New statements.
15716 * statement.cs (Return.Resolve): Flag an error if we are used in
15717 an iterator method.
15719 * codegen.cs (InIterator): New flag set if the code is being
15720 compiled in an iterator method.
15722 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
15723 internal modifier, and we just use it to avoid adding extra
15724 fields, as this is seldom used.
15726 * cs-parser.jay: Add yield_statement (yield and yield break).
15728 * driver.cs: New flag -v2 to turn on version 2 features.
15730 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15731 hashtable when v2 is enabled.
15733 2003-04-20 Miguel de Icaza <miguel@ximian.com>
15735 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15736 there is already a namespace defined with this name.
15738 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15739 people upgraded their corlibs.
15741 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15742 always use fully qualified types, no need to use the compiler
15745 (TypeManager.IsNamespace): Use binarysearch.
15747 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15748 AddDelegate): I did not quite use the new IsValid API properly: I
15749 have to pass the short-name and the fullname. I was passing only
15750 the basename instead of the fullname sometimes.
15752 (TypeContainer.DefineType): call NamespaceClash.
15754 * interface.cs (Interface.DefineType): use NamespaceClash before
15757 * delegate.cs (Delegate.DefineType): use NamespaceClash before
15760 * enum.cs: (Enum.DefineType): use NamespaceClash before
15763 * typemanager.cs (: 3-line patch that gives us some tasty 11%
15764 speed increase. First, use the negative_hits cache when we get a
15765 negative. Second, add the type with its full original name
15766 instead of the new . and + encoded name (reflection uses + to
15767 separate type from a nested type). Use LookupTypeReflection
15768 directly which bypasses the type->name hashtable (that we already
15769 know does not contain the type.
15771 * decl.cs (DeclSpace.ResolveTypeExpr): track the
15772 location/container type.
15774 * driver.cs: When passing utf8, use directly the UTF8Encoding.
15776 2003-04-19 Miguel de Icaza <miguel@ximian.com>
15778 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15780 * delegate.cs (NewDelegate.Resolve): Test whether an instance
15781 method is being referenced in the method group from a static
15782 context, and report error 120 if so.
15784 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15787 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15788 is created, we create the A namespace).
15790 * cs-parser.jay: A namespace also introduces a DeclarationFound.
15793 2003-04-18 Miguel de Icaza <miguel@ximian.com>
15795 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15796 invocation to ModuleBuilder.GetType with the same values will
15797 return a new type instance, so we need to cache its return
15800 * expression.cs (Binary.ResolveOperator): Only allow the compare
15801 operators on enums if they are of the same type.
15803 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15804 types of ValueType on their own case. Before we were giving them
15805 the same treatment as objects.
15807 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15808 fullname. Short name is used to compare against container name.
15809 Fullname is used to check against defined namespace names.
15811 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15812 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15814 (Method.CheckBase): Call parent.
15815 (MemberBase.CheckBase): Check for protected members on sealed
15817 (PropertyBase.CheckBase): Call parent.
15818 (Field.Define): Call parent.
15820 * report.cs: Negative error codes are now mapped to 8000 - code,
15821 so that the display is render more nicely.
15823 * typemanager.cs: Do not use try/catch, instead report a regular
15826 (GetPointerType, GetReferenceType): These methods provide
15827 mechanisms to obtain the T* and T& from a T. We had the code
15828 previously scattered around the code base, and it also used
15829 TypeManager.LookupType that would go through plenty of caches.
15830 This one goes directly to the type source.
15832 In some places we did the Type.GetType followed by
15833 ModuleBuilder.GetType, but not in others, so this unifies the
15834 processing as well.
15836 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15837 statements now that we have namespace information.
15839 * typemanager.cs (IsNamespace): New method, returns whether the
15840 string presented is a namespace or not.
15842 (ComputeNamespaces): New public entry point, computes the list of
15843 available namespaces, using the GetNamespaces API call in Mono, or
15844 the slower version in MS.NET.
15846 Now before we start the semantic analysis phase, we have a
15847 complete list of namespaces including everything that the user has
15850 Deleted old code to cache namespaces in .nsc files.
15852 2003-04-17 Miguel de Icaza <miguel@ximian.com>
15854 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15855 class/struct location definition Location for the implicit
15856 constructor location.
15858 (Operator.Define): Use the location of the operator for the
15859 implicit Method definition.
15861 (Constructor.Emit): use the constructor location for the implicit
15862 base initializer constructor.
15864 * ecore.cs: Remove ITypeExpression. This interface is now gone,
15865 and the Expression class now contains two new methods:
15867 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
15868 isolate type lookup from the rest of the resolution process.
15870 Since we use Expressions to hold type definitions due to the way
15871 we parse the input we have historically overloaded Resolve to
15872 perform the Type lookups if a special flag is passed. Now this is
15873 eliminated and two methods take their place.
15875 The differences in the two methods between xStep and xTerminal is
15876 that xStep is involved in our current lookup system that uses
15877 SimpleNames to compose a name, while xTerminal is used just to
15878 catch the case where the simplename lookup failed.
15880 2003-04-16 Miguel de Icaza <miguel@ximian.com>
15882 * expression.cs (ResolveMemberAccess): Remove redundant code.
15883 TypeExpr expressions are always born fully resolved.
15885 * interface.cs (PopulateMethod): Do not lookup the types twice.
15886 We were doing it once during SemanticAnalysis and once during
15889 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15890 in local variable type definitions, were being returned as a
15891 SimpleName (we decomposed everything into a string), that is
15892 because primary_expression was being used instead of a type in the
15893 grammar (reduce/reduce conflicts).
15895 The part that was wrong is that we converted the expression into a
15896 string (an oversimplification in one hand, compounded with primary
15897 expressions doing string concatenation).
15903 Would return "A.B.C[]" as a SimpleName. This stopped things like
15904 using clauses from working on this particular context. And a type
15905 was being matched directly against "A.B.C[]".
15907 We now use the correct approach, and allow for ComposedCast to be
15908 part of the unary expression. So the "A.B.C []" become a composed
15909 cast of "A.B.C" (as a nested group of MemberAccess with a
15910 SimpleName at the end) plus the rank composition "[]".
15914 2003-04-10 Miguel de Icaza <miguel@ximian.com>
15916 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15917 for the access level checking.
15919 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
15920 `TypeContainer container', because I kept getting confused when I
15921 was debugging this code.
15923 * expression.cs (Indexers): Instead of tracking getters/setters,
15924 we now track them in parallel. We create one arraylist less, but
15925 most importantly it is possible now for the LValue code to find a
15926 matching get for a set.
15928 (IndexerAccess.DoResolveLValue): Update the code.
15929 GetIndexersForType has been modified already to extract all the
15930 indexers from a type. The code assumed it did not.
15932 Also make the code set the correct return type for the indexer.
15933 This was fixed a long time ago for properties, but was missing for
15934 indexers. It used to be void_type.
15936 (Binary.Emit): Test first for doubles instead of
15937 floats, as they are more common.
15939 (Binary.EmitBranchable): Use the .un version of the branch opcodes
15940 when dealing with floats and the <=, >= operators. This fixes bug
15943 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15944 to load the array value by emitting a load on the foreach variable
15945 type. This was incorrect.
15947 We now emit the code to load an element using the the array
15948 variable type, and then we emit the conversion operator.
15952 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15954 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15956 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15958 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15959 test for protection before we test for signatures.
15961 (MethodSignature.ToString): implement.
15963 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15964 to the case where we reduced into a LongConstant.
15966 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15967 depend on whether the information is acurrate, because the
15968 Microsoft runtime will always claim that the array type is public,
15969 regardless of the real state.
15971 If the type is a pointer, another problem happens: the type is
15972 reported as non-public in Microsoft.
15974 In both cases we have to call CheckAccessLevel recursively with
15975 the underlying type as the argument to be tested.
15977 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15979 * assign.cs (Assign.Emit): If we are dealing with a compound
15980 assignment expression, we should use the code path that stores the
15981 intermediate result in a temporary value. This fixes #40903.
15983 *expression.cs (Indirection.ToString): Provide ToString method for
15986 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15988 * class.cs: Null out fields holding references to Block objects so
15989 they can be garbage collected.
15991 * expression.cs (OverloadResolve): Remove unused local.
15993 2003-04-07 Martin Baulig <martin@ximian.com>
15995 * codegen.cs (EmitContext.CurrentFile): New public field.
15996 (EmitContext.Mark): Use the CurrentFile to check whether the
15997 location is in the correct file.
15998 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
16000 2003-04-07 Martin Baulig <martin@ximian.com>
16002 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
16004 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
16005 location. [FIXME: The location argument which gets passed to this
16006 method is sometimes wrong!]
16008 2003-04-07 Nick Drochak <ndrochak@gol.com>
16010 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
16012 2003-04-07 Miguel de Icaza <miguel@ximian.com>
16014 * expression.cs (Indirection.EmitAssign): We were using the
16015 temporary, but returning immediately instead of continuing the
16018 2003-04-06 Martin Baulig <martin@ximian.com>
16020 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
16021 if it's a nested child, but also deriving from the outer class.
16024 * typemanager.cs (IsNestedChildOf): Make this work if it's a
16025 nested child, but also deriving from the outer class. See
16027 (FilterWithClosure): We may access private members of the outer
16028 class if we're a nested child and deriving from the outer class.
16029 (RealMemberLookup): Only set `closure_private_ok' if the
16030 `original_bf' contained BindingFlags.NonPublic.
16032 2003-04-05 Martin Baulig <martin@ximian.com>
16034 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
16035 probe if its a type parameter, and if so, flag an error.
16037 * decl.cs: Move here the SetParameterInfo code from class.cs.
16038 Handle IsGeneric here.
16040 Handle a variety of errors in the parameter info definition.
16042 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
16043 type parameters here.
16045 * cs-parser.jay (class_declaration): report errors for parameters
16048 2003-01-21 Miguel de Icaza <miguel@ximian.com>
16050 * generic.cs: New file, contains support code for generics.
16052 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
16053 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
16055 Update parser for the above removals.
16057 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
16058 now taken care of in the parser.
16060 2003-04-02 Miguel de Icaza <miguel@ximian.com>
16062 * class.cs (Event.Define): Do not allow abstract events to have
16065 2003-04-01 Miguel de Icaza <miguel@ximian.com>
16067 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
16068 block in event declarations.
16070 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
16071 value type, get its address.
16073 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
16074 leaving a class on the stack instead of a boolean value (int
16075 0/1). Change the code so we compare against null, and then the
16076 result against zero.
16078 * class.cs (TypeContainer.GetClassBases): We were checking for the
16079 parent class being sealed too late.
16081 * expression.cs (Binary.Emit): For <= and >= when dealing with
16082 floating point values, use cgt.un and clt.un instead of cgt and
16085 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
16087 * statement.cs: Apply the same optimization as MS: skip the
16088 GetEnumerator returning an IEnumerator, and use the one returning a
16089 CharEnumerator instead. This allows us to avoid the try-finally block
16092 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
16094 * cs-parser.jay: Attributes cannot be applied to
16095 namespaces. Fixes #40473
16097 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16100 (Add*): check if the name is valid using the full name for constants,
16101 fields, properties and events.
16103 2003-03-28 Miguel de Icaza <miguel@ximian.com>
16105 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
16106 char constants to be part of the enumeration.
16108 * expression.cs (Conditional.DoResolve): Add support for operator
16109 true. Implements the missing functionality from 14.12
16111 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
16112 operator true/false as required by the spec.
16114 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
16115 implicit conversion to boolean.
16117 * statement.cs (Statement.ResolveBoolean): A boolean expression is
16118 also one where the type implements `operator true'.
16120 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
16121 get an expression that will invoke operator true based on an
16124 (GetConversionOperators): Removed the hack that called op_True
16127 (Expression.ResolveBoolean): Move this from Statement.
16129 2003-03-17 Miguel de Icaza <miguel@ximian.com>
16131 * ecore.cs (FieldExpr): do not allow initialization of initonly
16132 fields on derived classes
16134 2003-03-13 Martin Baulig <martin@ximian.com>
16136 * statement.cs (Block.Emit): Call ig.BeginScope() and
16137 ig.EndScope() when compiling with debugging info; call
16138 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
16140 2003-03-08 Miguel de Icaza <miguel@ximian.com>
16142 * expression.cs (Indexers): Do not construct immediately, allow
16143 for new members to be appended as we go. Fixes 38143
16145 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16147 * expression.cs: save/restore context when resolving an unchecked
16150 2003-03-05 Miguel de Icaza <miguel@ximian.com>
16152 * cfold.cs: Catch division by zero in modulus operator during
16155 2003-03-03 Miguel de Icaza <miguel@ximian.com>
16157 * interface.cs (Interface.DefineMembers): Avoid defining members
16160 2003-02-27 Miguel de Icaza <miguel@ximian.com>
16162 * driver.cs: handle the +/- options for -noconfig
16164 * statement.cs (Unckeched.Resolve): Also track the state of
16165 unchecked in the Resolve phase.
16167 2003-02-27 Martin Baulig <martin@ximian.com>
16169 * ecore.cs (Expression.MemberLookup): Don't create a
16170 MethodGroupExpr for something which is not a method. Fixes #38291.
16172 2003-02-25 Miguel de Icaza <miguel@ximian.com>
16174 * class.cs (MemberBase.CheckParameters): Also check that the type
16175 is unmanaged if it is a pointer.
16177 * expression.cs (SizeOf.Resolve): Add location information.
16179 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
16180 a managed type is declared.
16182 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
16183 parameter modifiers as well. Fixes bug 38606
16185 * class.cs: Very sad. Am backing out the speed up changes
16186 introduced by the ArrayList -> Array in the TypeContainer, as they
16187 were not actually that much faster, and introduced a bug (no error
16188 reports on duplicated methods).
16190 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
16191 source first, this will guarantee that we have a valid expression
16192 before calling in lower levels functions that will require a
16193 resolved object. Then use this original_source in the
16194 target.ResolveLValue instead of the original source that was
16197 Another change. Use target.Resolve instead of LValueResolve.
16198 Although we are resolving for LValues, we will let the Assign code
16199 take care of that (it will be called again from Resolve). This
16200 basically allows code like this:
16202 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
16203 class Y { void A (X x) { x [0] += o; }
16205 The problem was that the indexer was trying to resolve for
16206 set_Item (idx, object o) and never finding one. The real set_Item
16207 was set_Item (idx, X). By delaying the process we get the right
16212 2003-02-23 Martin Baulig <martin@ximian.com>
16214 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
16215 while calling DoEmit ().
16217 * codegen.cs (EmitContext.Mark): Don't mark locations in other
16218 source files; if you use the #line directive inside a method, the
16219 compiler stops emitting line numbers for the debugger until it
16220 reaches the end of the method or another #line directive which
16221 restores the original file.
16223 2003-02-23 Martin Baulig <martin@ximian.com>
16225 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
16227 2003-02-23 Martin Baulig <martin@ximian.com>
16229 * statement.cs (Block.AddChildVariableNames): We need to call this
16230 recursively, not just for our immediate children.
16232 2003-02-23 Martin Baulig <martin@ximian.com>
16234 * class.cs (Event.Define): Always make the field private, like csc does.
16236 * typemanager.cs (TypeManager.RealMemberLookup): Make events
16237 actually work, fixes bug #37521.
16239 2003-02-23 Miguel de Icaza <miguel@ximian.com>
16241 * delegate.cs: When creating the various temporary "Parameters"
16242 classes, make sure that we call the ComputeAndDefineParameterTypes
16243 on those new parameters (just like we do with the formal ones), to
16244 allow them to be resolved in the context of the DeclSpace.
16246 This fixes the bug that Dick observed in Bugzilla #38530.
16248 2003-02-22 Miguel de Icaza <miguel@ximian.com>
16250 * expression.cs (ResolveMemberAccess): When resolving a constant,
16251 do not attempt to pull a constant if the value was not able to
16252 generate a valid constant.
16254 * const.cs (LookupConstantValue): Do not report more errors than required.
16256 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16258 * expression.cs: fixes bug #38328.
16260 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16262 * class.cs: Changed all the various members that can be part of a
16263 class from being an ArrayList to be an Array of the right type.
16264 During the DefineType type_list, interface_list, delegate_list and
16265 enum_list are turned into types, interfaces, delegates and enums
16268 And during the member population, indexer_list, event_list,
16269 constant_list, field_list, instance_constructor_list, method_list,
16270 operator_list and property_list are turned into their real arrays.
16272 Although we could probably perform this operation earlier, for
16273 good error reporting we need to keep the lists and remove the
16274 lists for longer than required.
16276 This optimization was triggered by Paolo profiling the compiler
16277 speed on the output of `gen-sample-program.pl' perl script.
16279 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
16280 not crash in methods like MemberLookupFailed that use this field.
16282 This problem arises when the compiler fails to resolve a type
16283 during interface type definition for example.
16285 2003-02-18 Miguel de Icaza <miguel@ximian.com>
16287 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
16288 inherit from System.Object, so we have to stop at null, not only
16289 when reaching System.Object.
16291 2003-02-17 Miguel de Icaza <miguel@ximian.com>
16293 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
16294 DeclaredOnly because the parent indexer might have had a different
16295 name, but did not loop until the top of the hierarchy was reached.
16297 The problem this one fixes is 35492: when a class implemented an
16298 indexer from an interface, we were getting the interface method
16299 (which was abstract) and we were flagging an error (can not invoke
16302 This also keeps bug 33089 functioning, and test-148 functioning.
16304 * typemanager.cs (IsSpecialMethod): The correct way of figuring
16305 out if a method is special is to see if it is declared in a
16306 property or event, or whether it is one of the predefined operator
16307 names. This should fix correctly #36804.
16309 2003-02-15 Miguel de Icaza <miguel@ximian.com>
16311 The goal here is to remove the dependency on EmptyCast.Peel ().
16312 Killing it completely.
16314 The problem is that currently in a number of places where
16315 constants are expected, we have to "probe" for an EmptyCast, and
16316 Peel, which is not the correct thing to do, as this will be
16317 repetitive and will likely lead to errors.
16319 The idea is to remove any EmptyCasts that are used in casts that
16320 can be reduced to constants, so we only have to cope with
16323 This bug hunt was triggered by Bug 37363 and the desire to remove
16324 the duplicate pattern where we were "peeling" emptycasts to check
16325 whether they were constants. Now constants will always be
16328 * ecore.cs: Use an enumconstant here instead of wrapping with
16331 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
16332 throwing me off. By handling this we can get rid of a few hacks.
16334 * statement.cs (Switch): Removed Peel() code.
16336 2003-02-14 Miguel de Icaza <miguel@ximian.com>
16338 * class.cs: Location information for error 508
16340 * expression.cs (New.DoResolve): Add a guard against double
16341 resolution of an expression.
16343 The New DoResolve might be called twice when initializing field
16344 expressions (see EmitFieldInitializers, the call to
16345 GetInitializerExpression will perform a resolve on the expression,
16346 and later the assign will trigger another resolution
16348 This leads to bugs (#37014)
16350 * delegate.cs: The signature for EndInvoke should contain any ref
16351 or out parameters as well. We were not doing this in the past.
16353 * class.cs (Field.Define): Do not overwrite the type definition
16354 inside the `volatile' group. Turns out that volatile enumerations
16355 were changing the type here to perform a validity test, which
16358 2003-02-12 Miguel de Icaza <miguel@ximian.com>
16360 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
16361 and structs, we do not want to load the instance variable
16363 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
16364 enum_type has to be handled like an object reference (implicit
16365 conversions exists from this to object), but the regular IsClass
16366 and IsValueType tests will never return true for this one.
16368 Also we use TypeManager.IsValueType instead of type.IsValueType,
16369 just for consistency with the rest of the code (this is only
16370 needed if we ever use the construct exposed by test-180.cs inside
16371 corlib, which we dont today).
16373 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
16375 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
16378 2003-02-09 Martin Baulig <martin@ximian.com>
16380 * namespace.cs (Namespace..ctor): Added SourceFile argument.
16381 (Namespace.DefineNamespaces): New static public method; this is
16382 called when we're compiling with debugging to add all namespaces
16383 to the symbol file.
16385 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
16386 pass it to the Namespace's .ctor.
16388 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
16389 and MethodBase arguments; pass the namespace ID to the symwriter;
16390 pass the MethodBase instead of the token to the symwriter.
16391 (SymbolWriter.DefineNamespace): New method to add a namespace to
16394 2003-02-09 Martin Baulig <martin@ximian.com>
16396 * symbolwriter.cs: New file. This is a wrapper around
16397 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
16398 methods here in near future.
16400 2003-02-09 Martin Baulig <martin@ximian.com>
16402 * codegen.cs (EmitContext.Mark): Just pass the arguments to
16403 ILGenerator.MarkSequencePoint() which are actually used by the
16406 2003-02-09 Martin Baulig <martin@ximian.com>
16408 * location.cs (SourceFile): New public sealed class. This
16409 contains the name and an index which is used in the location's token.
16410 (Location): Reserve an appropriate number of bits in the token for
16411 the source file instead of walking over that list, this gives us a
16412 really huge performance improvement when compiling with debugging.
16414 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
16415 `SourceFile' argument instead of a string.
16416 (Driver.ProcessFile): Add all the files via Location.AddFile(),
16417 but don't parse/tokenize here, we need to generate the list of all
16418 source files before we do that.
16419 (Driver.ProcessFiles): New static function. Parses/tokenizes all
16422 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
16423 instead of a string.
16425 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
16428 2003-02-09 Martin Baulig <martin@ximian.com>
16430 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
16431 filename on `#line default'.
16433 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
16435 * statement.cs: don't clear the pinned var when the fixed statement
16436 returns from the method (fixes bug#37752).
16438 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
16440 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
16443 2003-02-07 Martin Baulig <martin@ximian.com>
16445 * driver.cs: Removed the `--debug-args' command line argument.
16447 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
16448 automatically by the AsssemblyBuilder.
16449 (CodeGen.InitializeSymbolWriter): We don't need to call any
16450 initialization function on the symbol writer anymore. This method
16451 doesn't take any arguments.
16453 2003-02-03 Miguel de Icaza <miguel@ximian.com>
16455 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
16456 from referenced assemblies as well.
16458 2003-02-02 Martin Baulig <martin@ximian.com>
16460 * class.cs (MethodData.Emit): Generate debugging info for external methods.
16462 2003-02-02 Martin Baulig <martin@ximian.com>
16464 * class.cs (Constructor.Emit): Open the symbol writer before
16465 emitting the constructor initializer.
16466 (ConstructorInitializer.Emit): Call ec.Mark() to allow
16467 single-stepping through constructor initializers.
16469 2003-01-30 Miguel de Icaza <miguel@ximian.com>
16471 * class.cs: Handle error 549: do not allow virtual methods in
16474 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
16476 * decl.cs: Check access levels when resolving types
16478 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
16480 * statement.cs: Add parameters and locals set in catch blocks that might
16481 return to set vector
16483 2003-01-29 Miguel de Icaza <miguel@ximian.com>
16485 * class.cs (Operator): Set the SpecialName flags for operators.
16487 * expression.cs (Invocation.DoResolve): Only block calls to
16488 accessors and operators on SpecialName methods.
16490 (Cast.TryReduce): Handle conversions from char constants.
16493 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
16495 * statement.cs: small memory and time optimization in FlowBranching.
16497 2003-01-28 Pedro Mart <yoros@wanadoo.es>
16499 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
16500 problem that the last fix but in the other sid (Set).
16502 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
16503 access when there is no indexer in the hierarchy.
16505 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
16507 * class.cs: Combine some if statements.
16509 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16511 * driver.cs: fixed bug #37187.
16513 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
16515 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
16516 any indexer, it's needed to build a list with all the indexers in the
16517 hierarchy (AllGetters), else we have problems. Fixes #35653.
16519 2003-01-23 Miguel de Icaza <miguel@ximian.com>
16521 * class.cs (MethodData.Define): It is wrong for an interface
16522 implementation to be static in both cases: explicit and implicit.
16523 We were only handling this in one case.
16525 Improve the if situation there to not have negations.
16527 * class.cs (Field.Define): Turns out that we do not need to check
16528 the unsafe bit on field definition, only on usage. Remove the test.
16530 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16532 * driver.cs: use assembly.Location instead of Codebase (the latest
16533 patch made mcs fail when using MS assemblies).
16535 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
16537 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16538 get the path to *corlib.dll.
16540 2003-01-21 Nick Drochak <ndrochak@gol.com>
16544 * typemanager.cs: Remove compiler warnings
16546 2003-01-20 Duncan Mak <duncan@ximian.com>
16548 * AssemblyInfo.cs: Bump the version number to 0.19.
16550 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16552 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16554 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
16556 * class.cs (Constructor::Emit): Emit debugging info for constructors.
16558 2003-01-17 Miguel de Icaza <miguel@ximian.com>
16560 * cs-parser.jay: Small fix: we were not comparing the constructor
16561 name correctly. Thanks to Zoltan for the initial pointer.
16563 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16565 * cs-tokenizer.cs: Set file name when specified with #line
16567 2003-01-15 Miguel de Icaza <miguel@ximian.com>
16569 * cs-parser.jay: Only perform the constructor checks here if we
16570 are named like the class; This will help provider a better
16571 error. The constructor path is taken when a type definition is
16572 not found, but most likely the user forgot to add the type, so
16573 report that rather than the constructor error.
16575 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16577 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16580 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16582 * cs-parser.jay: Add cleanup call.
16584 2003-01-13 Duncan Mak <duncan@ximian.com>
16586 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16587 consistent with other methods.
16589 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16591 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16593 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16595 * attribute.cs: only set GuidAttr to true when we have a
16598 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16602 * typemanager.cs: fixes to allow mcs compile corlib with the new
16603 Type.IsSubclassOf fix.
16605 2003-01-08 Miguel de Icaza <miguel@ximian.com>
16607 * expression.cs (LocalVariableReference.DoResolve): Classify a
16608 constant as a value, not as a variable. Also, set the type for
16611 * cs-parser.jay (fixed_statement): take a type instead of a
16612 pointer_type, so we can produce a better error message later.
16614 * statement.cs (Fixed.Resolve): Flag types that are not pointers
16617 (For.DoEmit): Make inifinite loops have a
16618 non-conditional branch back.
16620 (Fixed.DoEmit): First populate the pinned variables, then emit the
16621 statement, then clear the variables. Before I was emitting the
16622 code once for each fixed piece.
16625 2003-01-08 Martin Baulig <martin@ximian.com>
16627 * statement.cs (FlowBranching.MergeChild): A break in a
16628 SWITCH_SECTION does not leave a loop. Fixes #36155.
16630 2003-01-08 Martin Baulig <martin@ximian.com>
16632 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16633 lives in the same number space than `param_map'. Fixes #36154.
16635 2003-01-07 Miguel de Icaza <miguel@ximian.com>
16637 * cs-parser.jay (constructor_declaration): Set the
16638 Constructor.ModFlags before probing for it. This makes the
16639 compiler report 514, 515 and 132 (the code was there, but got
16642 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16643 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16644 (GotoCase.Resolve): Set `Returns' to ALWAYS.
16646 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16648 * enum.cs: create the enum static fields using the enum type.
16650 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16652 * class.cs: don't try to create the ParamBuilder for the return
16653 type if it's not needed (and handle it breaking for the ms runtime
16656 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16658 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16660 2002-12-29 Miguel de Icaza <miguel@ximian.com>
16662 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16663 the command. This showed up while compiling the JANET source
16664 code, which used \r as its only newline separator.
16666 2002-12-28 Miguel de Icaza <miguel@ximian.com>
16668 * class.cs (Method.Define): If we are an operator (because it
16669 reuses our code), then set the SpecialName and HideBySig. #36128
16671 2002-12-22 Miguel de Icaza <miguel@ximian.com>
16673 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16674 exception, report error 120 `object reference required'.
16676 * driver.cs: Add --pause option, used during to measure the size
16677 of the process as it goes with --timestamp.
16679 * expression.cs (Invocation.DoResolve): Do not allow methods with
16680 SpecialName to be invoked.
16682 2002-12-21 Miguel de Icaza <miguel@ximian.com>
16684 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16685 number before adding it.
16687 2002-12-21 Ravi Pratap <ravi@ximian.com>
16689 * ecore.cs (StandardImplicitConversion): When in an unsafe
16690 context, we allow conversion between void * to any other pointer
16691 type. This fixes bug #35973.
16693 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16695 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16696 is not thrown when extensionless outputs are used
16698 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16700 * rootcontext.cs: fixed compilation of corlib.
16702 2002-12-19 Miguel de Icaza <miguel@ximian.com>
16704 * attribute.cs (Attributes.Contains): Add new method.
16706 * class.cs (MethodCore.LabelParameters): if the parameter is an
16707 `out' parameter, check that no attribute `[In]' has been passed.
16709 * enum.cs: Handle the `value__' name in an enumeration.
16711 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
16713 * decl.cs: Added special case to allow overrides on "protected
16716 2002-12-18 Ravi Pratap <ravi@ximian.com>
16718 * attribute.cs (Attributes.AddAttributeSection): Rename to this
16719 since it makes much more sense.
16721 (Attributes.ctor): Don't require a Location parameter.
16723 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16725 * attribute.cs (ApplyAttributes): Remove extra Location parameters
16726 since we already have that information per attribute.
16728 * everywhere : make appropriate changes.
16730 * class.cs (LabelParameters): Write the code which actually
16731 applies attributes to the return type. We can't do this on the MS
16732 .NET runtime so we flag a warning in the case an exception is
16735 2002-12-18 Miguel de Icaza <miguel@ximian.com>
16737 * const.cs: Handle implicit null conversions here too.
16739 2002-12-17 Ravi Pratap <ravi@ximian.com>
16741 * class.cs (MethodCore.LabelParameters): Remove the extra
16742 Type [] parameter since it is completely unnecessary. Instead
16743 pass in the method's attributes so that we can extract
16744 the "return" attribute.
16746 2002-12-17 Miguel de Icaza <miguel@ximian.com>
16748 * cs-parser.jay (parse): Use Report.Error to flag errors instead
16749 of ignoring it and letting the compile continue.
16751 * typemanager.cs (ChangeType): use an extra argument to return an
16752 error condition instead of throwing an exception.
16754 2002-12-15 Miguel de Icaza <miguel@ximian.com>
16756 * expression.cs (Unary.TryReduce): mimic the code for the regular
16757 code path. Perform an implicit cast in the cases where we can
16758 implicitly convert to one of the integral types, and then reduce
16759 based on that constant. This fixes bug #35483.
16761 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16763 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16765 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16767 * namespace.cs: fixed bug #35489.
16769 2002-12-12 Miguel de Icaza <miguel@ximian.com>
16771 * class.cs: Remove some dead code.
16773 * cs-parser.jay: Estimate the number of methods needed
16774 (RootContext.MethodCount);
16776 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16777 numbers instead of StringBuilders.
16779 * support.cs (PtrHashtable): Add constructor with initial size;
16780 We can now reduce reallocations of the method table.
16782 2002-12-10 Ravi Pratap <ravi@ximian.com>
16784 * attribute.cs (ApplyAttributes): Keep track of the emitted
16785 attributes on a per-target basis. This fixes bug #35413.
16787 2002-12-10 Miguel de Icaza <miguel@ximian.com>
16789 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16790 default to the Windows 1252 encoding.
16792 (UnixParseOption): Support version, thanks to Alp for the missing
16795 * AssemblyInfo.cs: Add nice assembly information.
16797 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16800 * cs-parser.jay: Allow a trailing comma before the close bracked
16801 in the attribute_section production.
16803 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16804 address of the instance was being taken, I will take this out,
16805 because we take the address of the object immediately here.
16807 2002-12-09 Ravi Pratap <ravi@ximian.com>
16809 * typemanager.cs (AreMultipleAllowed): Take care of the most
16810 obvious case where attribute type is not in the current assembly -
16813 2002-12-08 Miguel de Icaza <miguel@ximian.com>
16815 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16816 definitions, instead of doing that afterwards.
16818 Also we use a nice little hack, depending on the constructor, we
16819 know if we are a "composed" name or a simple name. Hence, we
16820 avoid the IndexOf test, and we avoid
16822 * codegen.cs: Add code to assist in a bug reporter to track down
16823 the source of a compiler crash.
16825 2002-12-07 Ravi Pratap <ravi@ximian.com>
16827 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16828 types have been emitted for a given element and flag an error
16829 if something which does not have AllowMultiple set is used more
16832 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16833 attribute types and their corresponding AllowMultiple properties
16835 (AreMultipleAllowed): Check the property for a given type.
16837 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16838 property in the case we have a TypeContainer.
16840 (Attributes.AddAttribute): Detect duplicates and just skip on
16841 adding them. This trivial fix catches a pretty gross error in our
16842 attribute emission - global attributes were being emitted twice!
16844 Bugzilla bug #33187 is now fixed.
16846 2002-12-06 Miguel de Icaza <miguel@ximian.com>
16848 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16849 instead of pp_and).
16851 * expression.cs (Binary.ResolveOperator): I can only use the
16852 Concat (string, string, string) and Concat (string, string,
16853 string, string) if the child is actually a concatenation of
16856 2002-12-04 Miguel de Icaza <miguel@ximian.com>
16858 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16859 context where we need a 2-character lookahead.
16861 * pending.cs (PendingImplementation): Rework so we can keep track
16862 of interface types all the time, and flag those which were
16863 implemented by parents as optional.
16865 2002-12-03 Miguel de Icaza <miguel@ximian.com>
16867 * expression.cs (Binary.ResolveOperator): Use
16868 String.Concat(string,string,string) or
16869 String.Concat(string,string,string,string) when possible.
16871 * typemanager: More helper methods.
16874 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16876 * pending.cs: remove the bogus return from GetMissingInterfaces()
16877 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16879 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16881 * namespace.cs: avoid duplicated 'using xxx' being added to
16882 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16883 when we get more than one 'using' statement for the same namespace.
16884 Report a CS0105 warning for it.
16886 2002-11-30 Miguel de Icaza <miguel@ximian.com>
16888 * cs-tokenizer.cs (consume_identifier): use read directly, instead
16889 of calling getChar/putback, uses internal knowledge of it.
16891 (xtoken): Reorder tokenizer so most common patterns are checked
16892 first. This reduces the compilation time in another 5% (from 8.11s
16893 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16895 The parsing time is 22% of the compilation in mcs, and from that
16896 64% is spent on the tokenization process.
16898 I tried using a binary search for keywords, but this is slower
16899 than the hashtable. Another option would be to do a couple of
16902 * Not use a StringBuilder, instead use an array of chars,
16903 with a set value. Notice that this way we could catch
16904 the 645 error without having to do it *afterwards*.
16906 * We could write a hand-parser to avoid the hashtable
16907 compares altogether.
16909 The identifier consumption process takes 37% of the tokenization
16910 time. Another 15% is spent on is_number. 56% of the time spent
16911 on is_number is spent on Int64.Parse:
16913 * We could probably choose based on the string length to
16914 use Int32.Parse or Int64.Parse and avoid all the 64-bit
16917 Another 3% is spend on wrapping `xtoken' in the `token' function.
16919 Handle 0xa0 as whitespace (#34752)
16921 2002-11-26 Miguel de Icaza <miguel@ximian.com>
16923 * typemanager.cs (IsCLRType): New routine to tell whether a type
16924 is one of the builtin types.
16926 Maybe it needs to use TypeCodes to be faster. Maybe we could use
16927 typecode in more places instead of doing pointer comparissions.
16928 We could leverage some knowledge about the way the typecodes are
16931 New code to cache namespaces in assemblies, it is currently not
16932 invoked, to be used soon.
16934 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16936 * expression.cs (Binary.ResolveOperator): specially handle
16937 strings, and do not perform user-defined operator overloading for
16940 2002-11-24 Miguel de Icaza <miguel@ximian.com>
16942 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16943 internalcall as it is a pretty simple operation; Avoid whenever
16944 possible to call Char.IsLetter.
16946 (consume_identifier): Cut by half the number of
16947 hashtable calls by merging the is_keyword and GetKeyword behavior.
16949 Do not short-circuit, because if we do, we
16950 report errors (ie, #if false && true would produce an invalid
16954 2002-11-24 Martin Baulig <martin@ximian.com>
16956 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16957 check constant ranges and report a CS0221. Fixes #33186.
16959 2002-11-24 Martin Baulig <martin@ximian.com>
16961 * cs-parser.jay: Make this work for uninitialized variable
16962 declarations in the `for' initializer. Fixes #32416.
16964 2002-11-24 Martin Baulig <martin@ximian.com>
16966 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16967 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16969 2002-11-24 Martin Baulig <martin@ximian.com>
16971 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16972 argument; if true, we also check for user-defined conversions.
16973 This is only needed if both arguments are of a user-defined type.
16974 Fixes #30443, added test-175.cs.
16975 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16977 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16979 2002-11-24 Martin Baulig <martin@ximian.com>
16981 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16982 function to get the store opcode.
16983 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16984 only emit the Ldelema if the store opcode is Stobj. You must run
16985 both test-34 and test-167 to test this. Fixes #34529.
16987 2002-11-23 Martin Baulig <martin@ximian.com>
16989 * ecore.cs (Expression.MemberLookup): Added additional
16990 `qualifier_type' argument which is used when we're being called
16991 from MemberAccess.DoResolve() and null if we're called from a
16993 (Expression.MemberLookupFailed): New method to report errors; this
16994 does the CS1540 check and reports the correct error message.
16996 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16997 argument for the CS1540 check and redone the way how we're dealing
16998 with private members. See the comment in the source code for details.
16999 (FilterWithClosure): Reverted this back to revision 1.197; renamed
17000 `closure_start_type' to `closure_qualifier_type' and check whether
17001 it's not null. It was not this filter being broken, it was just
17002 being called with the wrong arguments.
17004 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
17005 and pass it the correct `qualifier_type'; this also does the error
17008 2002-11-22 Miguel de Icaza <miguel@ximian.com>
17010 * expression.cs (Invocation.EmitParams): If the we are dealing
17011 with a non-built-in value type, load its address as well.
17013 (ArrayCreation): Use a a pretty constant instead
17014 of the hardcoded value 2. Use 6 instead of 2 for the number of
17015 static initializers.
17017 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
17018 because they are not really value types, just glorified integers.
17020 * driver.cs: Do not append .exe, the CSC compiler does not do it.
17022 * ecore.cs: Remove redundant code for enumerations, make them use
17023 the same code path as everything else, fixes the casting issue
17024 with enumerations in Windows.Forms.
17026 * attribute.cs: Do only cast to string if it is a string, the
17027 validation happens later.
17029 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
17030 people upgrade their corlibs.
17032 * ecore.cs: Oops, enumerations were not following the entire code path
17034 2002-11-21 Miguel de Icaza <miguel@ximian.com>
17036 * typemanager.cs (FilterWithClosure): Commented out the test for
17037 1540 in typemanager.cs, as it has problems when accessing
17038 protected methods from a parent class (see test-174.cs).
17040 * attribute.cs (Attribute.ValidateGuid): new method.
17041 (Attribute.Resolve): Use above.
17043 2002-11-19 Miguel de Icaza <miguel@ximian.com>
17045 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
17047 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
17048 handling for enumerations, as we only needed the TypeContainer
17049 functionality to begin with (this is required for the fix below to
17050 work for enums that reference constants in a container class for
17053 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
17055 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
17056 a valid TypeBuilder to perform lookups on.o
17058 * class.cs (InheritableMemberSignatureCompare): Use true in the
17059 call to GetGetMethod and GetSetMethod, because we are comparing
17060 the signature, and we need to get the methods *even* if they are
17063 (PropertyBase.CheckBase): ditto.
17065 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
17066 GotoCase.Resolve): Use Peel on EmpytCasts.
17068 * ecore.cs (EmptyCast): drop child, add Peel method.
17070 2002-11-17 Martin Baulig <martin@ximian.com>
17072 * ecore.cs (EmptyCast.Child): New public property.
17074 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
17075 label resolved to an EmptyCast. Fixes #34162.
17076 (GotoCase.Resolve): Likewise.
17077 (Block.EmitMeta): Likewise.
17079 2002-11-17 Martin Baulig <martin@ximian.com>
17081 * expression.cs (Invocation.BetterConversion): Prefer int over
17082 uint; short over ushort; long over ulong for integer literals.
17083 Use ImplicitConversionExists instead of StandardConversionExists
17084 since we also need to check for user-defined implicit conversions.
17085 Fixes #34165. Added test-173.cs.
17087 2002-11-16 Martin Baulig <martin@ximian.com>
17089 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
17090 with the `true' and `false' literals. Fixes #33151.
17092 2002-11-16 Martin Baulig <martin@ximian.com>
17094 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
17095 October 22nd; don't do the cs1540 check for static members.
17097 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
17098 now using our own filter here and doing the cs1540 check again.
17100 2002-11-16 Martin Baulig <martin@ximian.com>
17102 * support.cs (InternalParameters): Don't crash if we don't have
17103 any fixed parameters. Fixes #33532.
17105 2002-11-16 Martin Baulig <martin@ximian.com>
17107 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
17108 when looking up static methods to make this work on Windows.
17111 2002-11-16 Martin Baulig <martin@ximian.com>
17113 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
17114 a setter rather than using PropertyInfo.CanWrite.
17116 2002-11-15 Nick Drochak <ndrochak@gol.com>
17118 * class.cs: Allow acces to block member by subclasses. Fixes build
17121 2002-11-14 Martin Baulig <martin@ximian.com>
17123 * class.cs (Constructor.Emit): Added the extern/block check.
17126 2002-11-14 Martin Baulig <martin@ximian.com>
17128 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
17129 iteration while looking for indexers, this is needed because the
17130 indexer may have a different name in our base classes. Fixed the
17131 error reporting (no indexers at all, not get accessor, no
17132 overloaded match). Fixes bug #33089.
17133 (IndexerAccess.DoResolveLValue): Likewise.
17135 2002-11-14 Martin Baulig <martin@ximian.com>
17137 * class.cs (PropertyBase.CheckBase): Make this work for multiple
17138 indexers. Fixes the first part of bug #33089.
17139 (MethodSignature.InheritableMemberSignatureCompare): Added support
17142 2002-11-13 Ravi Pratap <ravi@ximian.com>
17144 * attribute.cs (Attribute.Resolve): Catch the
17145 NullReferenceException and report it since it isn't supposed to
17148 2002-11-12 Miguel de Icaza <miguel@ximian.com>
17150 * expression.cs (Binary.EmitBranchable): Also handle the cases for
17151 LogicalOr and LogicalAnd that can benefit from recursively
17152 handling EmitBranchable. The code now should be nice for Paolo.
17154 2002-11-08 Miguel de Icaza <miguel@ximian.com>
17156 * typemanager.cs (LookupType): Added a negative-hit hashtable for
17157 the Type lookups, as we perform quite a number of lookups on
17158 non-Types. This can be removed once we can deterministically tell
17159 whether we have a type or a namespace in advance.
17161 But this might require special hacks from our corlib.
17165 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
17166 and double which avoids a conversion from an integer to a double.
17168 * expression.cs: tiny optimization, avoid calling IsConstant,
17169 because it effectively performs the lookup twice.
17171 2002-11-06 Miguel de Icaza <miguel@ximian.com>
17173 But a bogus return here to keep the semantics of the old code
17174 until the Mono runtime is fixed.
17176 * pending.cs (GetMissingInterfaces): New method used to remove all
17177 the interfaces that are already implemented by our parent
17178 classes from the list of pending methods.
17180 * interface.cs: Add checks for calls after ResolveTypeExpr.
17182 2002-11-05 Miguel de Icaza <miguel@ximian.com>
17184 * class.cs (Class.Emit): Report warning 67: event not used if the
17185 warning level is beyond 3.
17187 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
17188 being a NullLiteral.
17190 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
17193 * class.cs (TypeContainer.GetClassBases): Cover a missing code
17194 path that might fail if a type can not be resolved.
17196 * expression.cs (Binary.Emit): Emit unsigned versions of the
17199 * driver.cs: use error 5.
17201 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
17203 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
17205 2002-11-01 Miguel de Icaza <miguel@ximian.com>
17207 * cs-parser.jay (switch_section): A beautiful patch from Martin
17208 Baulig that fixed 33094.
17210 2002-10-31 Miguel de Icaza <miguel@ximian.com>
17212 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
17213 Check whether the base is abstract and report an error if so.
17215 * expression.cs (IndexerAccess.DoResolveLValue,
17216 IndexerAccess.DoResolve): ditto.
17218 (Invocation.DoResolve): ditto.
17220 (Invocation.FullMethodDesc): Improve the report string.
17222 * statement.cs (Block): Eliminate IsVariableDefined as it is
17223 basically just a wrapper for GetVariableInfo.
17225 * ecore.cs (SimpleName): Use new
17227 * support.cs (ReflectionParamter.ParameterType): We unwrap the
17228 type, as we return the actual parameter ref/unref state on a
17231 2002-10-30 Miguel de Icaza <miguel@ximian.com>
17233 * support.cs: Return proper flags REF/OUT fixing the previous
17236 * expression.cs: Reverted last patch, that was wrong. Is_ref is
17237 not used to mean `ref' but `ref or out' in ParameterReference
17239 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
17240 full type signature instead of calling TypeManger.CSharpName
17243 * support.cs (InternalParameters.ParameterDesc): Do not compare
17244 directly to the modflags, because REF/OUT will actually be bitsets
17247 * delegate.cs (VerifyMethod): Check also the modifiers.
17249 * cs-tokenizer.cs: Fix bug where floating point values with an
17250 exponent where a sign was missing was ignored.
17252 * driver.cs: Allow multiple assemblies to be specified in a single
17255 2002-10-28 Miguel de Icaza <miguel@ximian.com>
17257 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
17258 because identifiers after a parenthesis would end up in this kind
17259 of production, and we needed to desamiguate it for having casts
17262 (UserDefinedType *) xxx
17264 2002-10-24 Miguel de Icaza <miguel@ximian.com>
17266 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
17267 we should set on the Bindingflags.NonPublic, but not turn on
17268 private_ok. private_ok controls whether a Private member is
17269 returned (this is chekced on the filter routine), while the
17270 BindingFlags.NonPublic just controls whether private/protected
17271 will be allowed. This fixes the problem part of the problem of
17272 private properties being allowed to be used in derived classes.
17274 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
17275 so we can call the children DoResolveLValue method (this will
17276 properly signal errors on lvalue assignments to base properties)
17278 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
17279 getter are null, and we have a property info, we know that this
17280 happened because the lookup failed, so we report an error 122 for
17281 protection level violation.
17283 We also silently return if setter and getter are null in the
17284 resolve functions, this condition only happens if we have flagged
17285 the error before. This is the other half of the problem.
17287 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
17288 not have accessibility information, that is why we were returning
17289 true in the filter function in typemanager.cs.
17291 To properly report 122 (property is inaccessible because of its
17292 protection level) correctly, we report this error in ResolveAccess
17293 by failing if both the setter and the getter are lacking (ie, the
17296 DoResolve and DoLResolve have been modified to check for both
17297 setter/getter being null and returning silently, the reason being
17298 that I did not want to put the knowledge about this error in upper
17301 int old = Report.Errors;
17302 x = new PropertyExpr (...);
17303 if (old != Report.Errors)
17308 So the property expr is returned, but it is invalid, so the error
17309 will be flagged during the resolve process.
17311 * class.cs: Remove InheritablePropertySignatureCompare from the
17312 class, as we no longer depend on the property signature to compute
17313 whether it is possible to implement a method or not.
17315 The reason is that calling PropertyInfo.GetGetMethod will return
17316 null (in .NET, in Mono it works, and we should change this), in
17317 cases where the Get Method does not exist in that particular
17322 class X { public virtual int A { get { return 1; } } }
17324 class Z : Y { public override int A { get { return 2; } } }
17326 Would fail in Z because the parent (Y) would not have the property
17327 defined. So we avoid this completely now (because the alternative
17328 fix was ugly and slow), and we now depend exclusively on the
17331 (PropertyBase.CheckBase): Use a method-base mechanism to find our
17332 reference method, instead of using the property.
17334 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
17335 routines are gone now.
17337 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
17338 names, they were incorrectly named.
17340 * cs-tokenizer.cs: Return are more gentle token on failure.
17342 * pending.cs (PendingImplementation.InterfaceMethod): This routine
17343 had an out-of-sync index variable, which caused it to remove from
17344 the list of pending methods the wrong method sometimes.
17346 2002-10-22 Miguel de Icaza <miguel@ximian.com>
17348 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
17349 CanWrite, because those refer to this particular instance of the
17350 property, and do not take into account the fact that we can
17351 override single members of a property.
17353 Constructor requires an EmitContext. The resolution process does
17354 not happen here, but we need to compute the accessors before,
17355 because the resolution does not always happen for properties.
17357 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
17358 subclass, before we did not update this flag, but we did update
17361 (GetAccessors): Drop this routine, as it did not work in the
17362 presence of partially overwritten set/get methods.
17364 Notice that this broke the cs1540 detection, but that will require
17367 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17371 * driver.cs: issue a warning instead of an error if we don't support
17372 debugging for the platform. Also ignore a couple of errors that may
17373 arise when trying to write the symbols. Undo my previous patch.
17375 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17377 * driver.cs: ignore /debug switch except for Unix platforms.
17379 2002-10-23 Nick Drochak <ndrochak@gol.com>
17381 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
17383 2002-10-21 Miguel de Icaza <miguel@ximian.com>
17385 * driver.cs: Do not make mcs-debug conditional, so we do not break
17386 builds that use it.
17388 * statement.cs (UsageVector.MergeChildren): I would like Martin to
17389 review this patch. But basically after all the children variables
17390 have been merged, the value of "Breaks" was not being set to
17391 new_breaks for Switch blocks. I think that it should be set after
17392 it has executed. Currently I set this to the value of new_breaks,
17393 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
17394 conservative, but I do not understand this code very well.
17396 I did not break anything in the build, so that is good ;-)
17398 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
17400 2002-10-20 Mark Crichton <crichton@gimp.org>
17402 * cfold.cs: Fixed compile blocker. Really fixed it this time.
17404 2002-10-20 Nick Drochak <ndrochak@gol.com>
17406 * cfold.cs: Fixed compile blocker.
17408 2002-10-20 Miguel de Icaza <miguel@ximian.com>
17410 * driver.cs: I was chekcing the key, not the file.
17412 2002-10-19 Ravi Pratap <ravi@ximian.com>
17414 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
17415 message that we were generating - we just need to silently return
17418 2002-10-19 Miguel de Icaza <miguel@ximian.com>
17420 * class.cs (Event.Define): Change my previous commit, as this
17421 breaks the debugger. This is a temporary hack, as it seems like
17422 the compiler is generating events incorrectly to begin with.
17424 * expression.cs (Binary.ResolveOperator): Added support for
17425 "U operator - (E x, E y)"
17427 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
17430 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
17431 init-only variables, but this path did not take into account that
17432 there might be also instance readonly variables. Correct this
17435 This fixes bug 32253
17437 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
17440 * driver.cs: Change the extension for modules to `netmodule'
17442 * cs-parser.jay: Improved slightly the location tracking for
17443 the debugger symbols.
17445 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
17446 modifiers that were specified instead of the hardcoded value
17447 (FamAndAssem). This was basically ignoring the static modifier,
17448 and others. Fixes 32429.
17450 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
17451 fixed a bug in the process (32476)
17453 * expression.cs (ArrayAccess.EmitAssign): Patch from
17454 hwang_rob@yahoo.ca that fixes bug 31834.3
17456 2002-10-18 Miguel de Icaza <miguel@ximian.com>
17458 * driver.cs: Make the module extension .netmodule.
17460 2002-10-16 Miguel de Icaza <miguel@ximian.com>
17462 * driver.cs: Report an error if the resource file is not found
17463 instead of crashing.
17465 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
17466 false, like Emit does.
17468 2002-10-16 Nick Drochak <ndrochak@gol.com>
17470 * typemanager.cs: Remove unused private member. Also reported mcs
17471 bug to report this as a warning like csc.
17473 2002-10-15 Martin Baulig <martin@gnome.org>
17475 * statement.cs (Statement.Emit): Made this a virtual method; emits
17476 the line number info and calls DoEmit().
17477 (Statement.DoEmit): New protected abstract method, formerly knows
17478 as Statement.Emit().
17480 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
17482 2002-10-11 Miguel de Icaza <miguel@ximian.com>
17484 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
17485 have fixed a remaining problem: not every AddXXXX was adding a
17486 fully qualified name.
17488 Now everyone registers a fully qualified name in the DeclSpace as
17489 being defined instead of the partial name.
17491 Downsides: we are slower than we need to be due to the excess
17492 copies and the names being registered this way.
17494 The reason for this is that we currently depend (on the corlib
17495 bootstrap for instance) that types are fully qualified, because
17496 we dump all the types in the namespace, and we should really have
17497 types inserted into the proper namespace, so we can only store the
17498 basenames in the defined_names array.
17500 2002-10-10 Martin Baulig <martin@gnome.org>
17502 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
17503 from bug #31834, see the bug report for a testcase which is
17506 2002-10-10 Martin Baulig <martin@gnome.org>
17508 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
17509 flow analysis code for this.
17511 * statement.cs (Do, While, For): Tell the flow analysis code about
17513 (FlowBranching.UsageVector): Added support for infinite loops.
17514 (Block.Resolve): Moved the dead code elimination here and use flow
17517 2002-10-09 Miguel de Icaza <miguel@ximian.com>
17519 * class.cs (Field.Define): Catch cycles on struct type
17522 * typemanager.cs (IsUnmanagedtype): Do not recursively check
17523 fields if the fields are static. We only need to check instance
17526 * expression.cs (As.DoResolve): Test for reference type.
17528 * statement.cs (Using.ResolveExpression): Use
17529 ConvertImplicitRequired, not ConvertImplicit which reports an
17531 (Using.ResolveLocalVariableDecls): ditto.
17533 * expression.cs (Binary.ResolveOperator): Report errors in a few
17534 places where we had to.
17536 * typemanager.cs (IsUnmanagedtype): Finish implementation.
17538 2002-10-08 Miguel de Icaza <miguel@ximian.com>
17540 * expression.cs: Use StoreFromPtr instead of extracting the type
17541 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
17543 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17544 an enumeration value to a System.Enum, but System.Enum is not a
17545 value type, but an class type, so we need to box.
17547 (Expression.ConvertExplicit): One codepath could return
17548 errors but not flag them. Fix this. Fixes #31853
17550 * parameter.cs (Resolve): Do not allow void as a parameter type.
17552 2002-10-06 Martin Baulig <martin@gnome.org>
17554 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17555 if it's a class type and not a struct. Fixes #31815.
17557 2002-10-06 Martin Baulig <martin@gnome.org>
17559 * statement.cs: Reworked the flow analysis code a bit to make it
17560 usable for dead code elimination.
17562 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17564 * cs-parser.jay: allow empty source files. Fixes bug #31781.
17566 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17568 * expression.cs (ComposedCast.DoResolveType): A quick workaround
17569 to fix the test 165, will investigate deeper.
17571 2002-10-04 Martin Baulig <martin@gnome.org>
17573 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17574 finally blocks actually work.
17575 (Try.Resolve): We don't need to create a sibling for `finally' if
17576 there is no finally block.
17578 2002-10-04 Martin Baulig <martin@gnome.org>
17580 * class.cs (Constructor.Define): The default accessibility for a
17581 non-default constructor is private, not public.
17583 2002-10-04 Miguel de Icaza <miguel@ximian.com>
17585 * class.cs (Constructor): Make AllowedModifiers public, add
17588 * cs-parser.jay: Perform the modifiers test here, as the
17589 constructor for the Constructor class usually receives a zero
17590 because of the way we create it (first we create, later we
17591 customize, and we were never checking the modifiers).
17593 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17594 is a version of LookupTypeReflection that includes the type-name
17595 cache. This can be used as a fast path for functions that know
17596 the fully qualified name and are only calling into *.GetType() to
17597 obtain a composed type.
17599 This is also used by TypeManager.LookupType during its type
17602 (LookupType): We now also track the real type name, as sometimes
17603 we can get a quey for the real type name from things like
17604 ComposedCast. This fixes bug 31422.
17606 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17607 complete type fullname, it does not have to go through the type
17608 resolution system to obtain the composed version of the type (for
17609 obtaining arrays or pointers).
17611 (Conditional.Emit): Use the EmitBoolExpression to
17612 generate nicer code, as requested by Paolo.
17614 (ArrayCreation.CheckIndices): Use the patch from
17615 hwang_rob@yahoo.ca to validate the array initializers.
17617 2002-10-03 Miguel de Icaza <miguel@ximian.com>
17619 * class.cs (ConstructorInitializer.Emit): simplify code by using
17620 Invocation.EmitCall, and at the same time, fix the bugs in calling
17621 parent constructors that took variable arguments.
17623 * ecore.cs (Expression.ConvertNumericExplicit,
17624 Expression.ImplicitNumericConversion): Remove the code that
17625 manually wrapped decimal (InternalTypeConstructor call is now gone
17628 * expression.cs (Cast.TryReduce): Also handle decimal types when
17629 trying to perform a constant fold on the type.
17631 * typemanager.cs (IsUnmanagedtype): Partially implemented.
17633 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17634 that only turned off an error report, and did nothing else.
17636 2002-10-02 Miguel de Icaza <miguel@ximian.com>
17638 * driver.cs: Handle and ignore /fullpaths
17640 2002-10-01 Miguel de Icaza <miguel@ximian.com>
17642 * expression.cs (Binary.ResolveOperator): Catch the case where
17643 DoNumericPromotions returns true,
17645 (Binary.DoNumericPromotions): Simplify the code, and the tests.
17647 2002-09-27 Miguel de Icaza <miguel@ximian.com>
17649 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17652 2002-09-26 Miguel de Icaza <miguel@ximian.com>
17654 * ecore.cs (ConvertNumericExplicit): It is not enough that the
17655 conversion exists, but it is also required that the conversion be
17656 performed. This manifested in "(Type64Enum) 2".
17658 * class.cs (TypeManager.AddMethod): The fix is not to change
17659 AddEnum, because that one was using a fully qualified name (every
17660 DeclSpace derivative does), but to change the AddMethod routine
17661 that was using an un-namespaced name. This now correctly reports
17662 the duplicated name.
17664 Revert patch until I can properly fix it. The issue
17665 is that we have a shared Type space across all namespaces
17666 currently, which is wrong.
17668 Options include making the Namespace a DeclSpace, and merge
17669 current_namespace/current_container in the parser.
17671 2002-09-25 Miguel de Icaza <miguel@ximian.com>
17673 * cs-parser.jay: Improve error reporting when we get a different
17674 kind of expression in local_variable_type and
17675 local_variable_pointer_type.
17677 Propagate this to avoid missleading errors being reported.
17679 * ecore.cs (ImplicitReferenceConversion): treat
17680 TypeManager.value_type as a target just like object_type. As
17685 Is valid, and needs to result in the int 1 being boxed before it
17686 is assigned to the value type v.
17688 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17689 to validate the enumeration name.
17691 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17692 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
17693 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17695 * ecore.cs (TryImplicitIntConversion): When doing an
17696 implicit-enumeration-conversion, check if the type is 64-bits and
17697 perform a conversion before passing to EnumConstant.
17699 2002-09-23 Miguel de Icaza <miguel@ximian.com>
17701 * decl.cs (Error_AmbiguousTypeReference); New routine used to
17702 report ambiguous type references. Unlike the MS version, we
17703 report what the ambiguity is. Innovation at work ;-)
17705 (DeclSpace.FindType): Require a location argument to
17706 display when we display an ambiguous error.
17708 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17710 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17712 * expression.cs (EmitDynamicInitializers): Apply patch from
17713 hwang_rob@yahoo.ca that fixes the order in which we emit our
17716 2002-09-21 Martin Baulig <martin@gnome.org>
17718 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17719 delegate takes no arguments.
17721 2002-09-20 Miguel de Icaza <miguel@ximian.com>
17723 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17726 * expression.cs: Extract the underlying type.
17728 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17730 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17732 2002-09-19 Miguel de Icaza <miguel@ximian.com>
17734 * class.cs (TypeContainer.DefineType): We can not use the nice
17735 PackingSize with the size set to 1 DefineType method, because it
17736 will not allow us to define the interfaces that the struct
17739 This completes the fixing of bug 27287
17741 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17742 means also structs. This fixes part of the problem.
17743 (Expresion.ImplicitReferenceConversionExists): ditto.
17745 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17746 error if there were no errors reported during the type lookup
17747 process, to avoid duplicates or redundant errors. Without this
17748 you would get an ambiguous errors plus a type not found. We have
17749 beaten the user enough with the first error.
17751 (DeclSparce.FindType): Emit a warning if we have an ambiguous
17754 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17755 during the resolution process, stop the lookup, this avoids
17756 repeated error reports (same error twice).
17758 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17760 * typemanager.cs (LookupType): Redo the type lookup code to match
17761 the needs of System.Reflection.
17763 The issue is that System.Reflection requires references to nested
17764 types to begin with a "+" sign instead of a dot. So toplevel
17765 types look like: "NameSpace.TopLevelClass", and nested ones look
17766 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17769 2002-09-19 Martin Baulig <martin@gnome.org>
17771 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17772 says that a method always returns or always throws an exception,
17773 don't report the CS0161.
17775 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17776 set `Returns = new_returns'.
17778 2002-09-19 Martin Baulig <martin@gnome.org>
17780 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17781 to an enum constant, check for a CS0176.
17783 2002-09-18 Miguel de Icaza <miguel@ximian.com>
17785 * class.cs (TypeContainer.CheckPairedOperators): Now we check
17786 for operators that must be in pairs and report errors.
17788 * ecore.cs (SimpleName.DoResolveType): During the initial type
17789 resolution process, when we define types recursively, we must
17790 check first for types in our current scope before we perform
17791 lookups in the enclosing scopes.
17793 * expression.cs (MakeByteBlob): Handle Decimal blobs.
17795 (Invocation.VerifyArgumentsCompat): Call
17796 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17797 I thought we were supposed to always call this, but there are a
17798 few places in the code where we dont do it.
17800 2002-09-17 Miguel de Icaza <miguel@ximian.com>
17802 * driver.cs: Add support in -linkres and -resource to specify the
17803 name of the identifier.
17805 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17807 * ecore.cs (StandardConversionExists): Sync with the conversion
17808 code: allow anything-* to void* conversions.
17810 (FindMostSpecificSource): Use an Expression argument
17811 instead of a Type, because we might be handed over a Literal which
17812 gets a few more implicit conversions that plain types do not. So
17813 this information was being lost.
17815 Also, we drop the temporary type-holder expression when not
17818 2002-09-17 Martin Baulig <martin@gnome.org>
17820 * class.cs (PropertyBase.CheckBase): Don't check the base class if
17821 this is an explicit interface implementation.
17823 2002-09-17 Martin Baulig <martin@gnome.org>
17825 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17826 different `IndexerName' attributes.
17828 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17829 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17830 virtual CommonResolve().
17832 2002-09-16 Miguel de Icaza <miguel@ximian.com>
17834 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17835 and convert that to the UnderlyingType.
17837 * statement.cs (Foreach.Resolve): Indexers are just like variables
17838 or PropertyAccesses.
17840 * cs-tokenizer.cs (consume_string): Track line numbers and columns
17841 inside quoted strings, we were not doing this before.
17843 2002-09-16 Martin Baulig <martin@gnome.org>
17845 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17846 resolve it. This is needed for the definite assignment check of the
17847 instance expression, fixes bug #29846.
17848 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17850 2002-09-16 Nick Drochak <ndrochak@gol.com>
17852 * parameter.cs: Fix compile error. Cannot reference static member
17853 from an instance object. Is this an mcs bug?
17855 2002-09-14 Martin Baulig <martin@gnome.org>
17857 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17858 multiple times. Fixes bug #30295, added test-166.cs.
17860 2002-09-14 Martin Baulig <martin@gnome.org>
17862 * statement.cs (Block.Emit): Don't emit unreachable code.
17863 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17864 `break' statements.
17865 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17867 2002-09-14 Martin Baulig <martin@gnome.org>
17869 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17872 2002-09-14 Martin Baulig <martin@gnome.org>
17874 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17875 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17876 be false on the ms runtime.
17878 2002-09-13 Martin Baulig <martin@gnome.org>
17880 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17881 the CS0038 error message.
17883 2002-09-12 Miguel de Icaza <miguel@ximian.com>
17885 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17886 constant inside, return it.
17888 2002-09-12 Martin Baulig <martin@gnome.org>
17890 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17891 implicit conversion can be done between enum types.
17893 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17894 check whether an implicit conversion to the current enum's UnderlyingType
17895 exists and report an error if not.
17897 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17898 without debugging support.
17900 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17901 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
17903 2002-09-12 Martin Baulig <martin@gnome.org>
17905 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17907 * ecore.cs (IMemberExpr.DeclaringType): New property.
17908 (SimpleName.SimpleNameResolve): Check whether we're accessing a
17909 nonstatic member of an outer type (CS0038).
17911 2002-09-11 Miguel de Icaza <miguel@ximian.com>
17913 * driver.cs: Activate the using-error detector at warning level
17914 4 (at least for MS-compatible APIs).
17916 * namespace.cs (VerifyUsing): Small buglett fix.
17918 * pending.cs (PendingImplementation): pass the container pointer.
17920 * interface.cs (GetMethods): Allow for recursive definition. Long
17921 term, I would like to move every type to support recursive
17922 definitions, not the current ordering mechanism that we have right
17925 The situation is this: Attributes are handled before interfaces,
17926 so we can apply attributes to interfaces. But some attributes
17927 implement interfaces, we will now handle the simple cases
17928 (recursive definitions will just get an error).
17930 * parameter.cs: Only invalidate types at the end if we fail to
17933 2002-09-09 Martin Baulig <martin@gnome.org>
17935 * ecore.cs (PropertyExpr.Emit): Also check for
17936 TypeManager.system_int_array_get_length so this'll also work when
17937 compiling corlib. Fixes #30003.
17939 2002-09-09 Martin Baulig <martin@gnome.org>
17941 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17942 and throw an exception if we can't get the type's size. Fixed #30040,
17945 2002-09-09 Martin Baulig <martin@gnome.org>
17947 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17949 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17950 context. Fixes bug #30027.
17952 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17953 virtual functions. Fixes bug #30043, added test-164.cs.
17955 2002-09-08 Ravi Pratap <ravi@ximian.com>
17957 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17959 2002-09-08 Nick Drochak <ndrochak@gol.com>
17961 * driver.cs: Use an object to get the windows codepage since it's not a
17964 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17966 * statement.cs (For.Emit): for infinite loops (test == null)
17967 return whether there is a break inside, not always "true".
17969 * namespace.cs (UsingEntry): New struct to hold the name of the
17970 using definition, the location where it is defined, and whether it
17971 has been used in a successful type lookup.
17973 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17978 2002-09-06 Ravi Pratap <ravi@ximian.com>
17980 * attribute.cs : Fix incorrect code which relied on catching
17981 a NullReferenceException to detect a null being passed in
17982 where an object was expected.
17984 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17986 * statement.cs (Try): flag the catch variable as assigned
17988 * expression.cs (Cast): Simplified by using ResolveType instead of
17989 manually resolving.
17991 * statement.cs (Catch): Fix bug by using ResolveType.
17993 2002-09-06 Ravi Pratap <ravi@ximian.com>
17995 * expression.cs (BetterConversion): Special case for when we have
17996 a NullLiteral as the argument and we have to choose between string
17997 and object types - we choose string the way csc does.
17999 * attribute.cs (Attribute.Resolve): Catch the
18000 NullReferenceException and report error #182 since the Mono
18001 runtime no more has the bug and having this exception raised means
18002 we tried to select a constructor which takes an object and is
18005 2002-09-05 Ravi Pratap <ravi@ximian.com>
18007 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
18008 message (1502, 1503) when we can't locate a method after overload
18009 resolution. This is much more informative and closes the bug
18012 * interface.cs (PopulateMethod): Return if there are no argument
18013 types. Fixes a NullReferenceException bug.
18015 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
18016 expressions too. Previously we were checking only in one place for
18017 positional arguments leaving out named arguments.
18019 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
18020 type to the enum type is not allowed. Remove code corresponding to
18023 (ConvertNumericExplicit): Allow explicit conversions from
18024 the underlying type to enum type. This precisely follows the spec
18025 and closes a bug filed by Gonzalo.
18027 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18030 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
18032 2002-09-03 Miguel de Icaza <miguel@ximian.com>
18034 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
18035 it was important that we stored the right value after the
18036 reduction in `converted'.
18038 2002-09-04 Martin Baulig <martin@gnome.org>
18040 * location.cs (Location.SymbolDocument): Use full pathnames for the
18043 2002-08-30 Miguel de Icaza <miguel@ximian.com>
18045 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
18046 of the expression resolve mechanism, because that will catch the
18047 SimpleName error failures.
18049 (Conditional): If we can not resolve the
18050 expression, return, do not crash.
18052 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18055 (location): display token name instead of its number.
18057 2002-08-28 Martin Baulig <martin@gnome.org>
18059 * expression.cs (Binary.ResolveOperator): Don't silently return
18060 but return an error if an operator cannot be applied between two
18063 2002-08-28 Martin Baulig <martin@gnome.org>
18065 * class.cs (Constructor.Define): Set the permission attributes
18066 correctly instead of making all constructors public.
18068 2002-08-28 Martin Baulig <martin@gnome.org>
18070 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
18071 for private members before reporting a CS0103; if we find anything,
18074 2002-08-28 Martin Baulig <martin@gnome.org>
18076 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
18077 to check whether `closure_start_type == closure_invocation_type',
18078 we also need to check whether `m.DeclaringType == closure_invocation_type'
18079 before bypassing the permission checks. We might be accessing
18080 protected/private members from the base class.
18081 (TypeManager.RealMemberLookup): Only set private_ok if private
18082 members were requested via BindingFlags.NonPublic.
18084 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
18086 * expression.cs (MemberAccess.ResolveMemberAccess): Set
18087 MethodGroupExpr.IsExplicitImpl if appropriate.
18088 (Invocation.DoResolve): Don't report the CS0120 for explicit
18089 interface implementations.
18091 2002-08-27 Martin Baulig <martin@gnome.org>
18093 * expression.cs (Invocation.DoResolve): If this is a static
18094 method and we don't have an InstanceExpression, we must report
18097 2002-08-25 Martin Baulig <martin@gnome.org>
18099 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
18100 `==' between a valuetype and an object.
18102 2002-08-25 Miguel de Icaza <miguel@ximian.com>
18104 * ecore.cs (TypeExpr): Provide a ToString method.
18106 2002-08-24 Martin Baulig <martin@gnome.org>
18108 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
18109 now called proggie.dbg and it's a binary file.
18111 2002-08-23 Martin Baulig <martin@gnome.org>
18113 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
18115 2002-08-23 Martin Baulig <martin@gnome.org>
18117 * struct.cs (MyStructInfo.ctor): Make this work with empty
18118 structs; it's not allowed to use foreach() on null.
18120 2002-08-23 Martin Baulig <martin@gnome.org>
18122 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
18123 writer the full pathname of the generated assembly.
18125 2002-08-23 Martin Baulig <martin@gnome.org>
18127 * statements.cs (FlowBranching.UsageVector.MergeChildren):
18128 A `finally' block never returns or breaks; improved handling of
18131 2002-08-23 Martin Baulig <martin@gnome.org>
18133 * statement.cs (Throw.Resolve): Allow `throw null'.
18135 2002-08-23 Martin Baulig <martin@gnome.org>
18137 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
18138 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
18139 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
18140 MemberLookup would return a wrong event if this is an explicit
18141 interface implementation and the class has an event with the same
18144 2002-08-23 Martin Baulig <martin@gnome.org>
18146 * statement.cs (Block.AddChildVariableNames): New public method.
18147 (Block.AddChildVariableName): Likewise.
18148 (Block.IsVariableNameUsedInChildBlock): Likewise.
18149 (Block.AddVariable): Check whether a variable name has already
18150 been used in a child block.
18152 * cs-parser.jay (declare_local_variables): Mark all variable names
18153 from the current block as being used in a child block in the
18156 2002-08-23 Martin Baulig <martin@gnome.org>
18158 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
18159 find the symbol writer.
18161 * driver.cs: csc also allows the arguments to /define being
18162 separated by commas, not only by semicolons.
18164 2002-08-23 Martin Baulig <martin@gnome.org>
18166 * interface.cs (Interface.GetMembers): Added static check for events.
18168 2002-08-15 Martin Baulig <martin@gnome.org>
18170 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
18171 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
18173 * ecore.cs (Expression.MemberLookup): Added documentation and explained
18174 why the MethodData.EmitDestructor() change was necessary.
18176 2002-08-20 Martin Baulig <martin@gnome.org>
18178 * class.cs (TypeContainer.FindMembers): Added static check for events.
18180 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
18182 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
18183 use Type.GetEvents(), not Type.FindMembers().
18185 2002-08-20 Martin Baulig <martin@gnome.org>
18187 * decl.cs (MemberCache): Added a special method cache which will
18188 be used for method-only searched. This ensures that a method
18189 search will return a MethodInfo with the correct ReflectedType for
18192 2002-08-20 Martin Baulig <martin@gnome.org>
18194 * decl.cs (DeclSpace.FindMembers): Made this public.
18196 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18198 * delegate.cs: fixed build on windows.
18199 [FIXME: Filed as bug #29150: MCS must report these errors.]
18201 2002-08-19 Ravi Pratap <ravi@ximian.com>
18203 * ecore.cs (StandardConversionExists): Return a false
18204 if we are trying to convert the void type to anything else
18205 since that is not allowed.
18207 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
18208 we flag error 70 in the event an event is trying to be accessed
18209 directly from outside the declaring type.
18211 2002-08-20 Martin Baulig <martin@gnome.org>
18213 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
18214 MemberCache from typemanager.cs to decl.cs.
18216 2002-08-19 Martin Baulig <martin@gnome.org>
18218 * class.cs (TypeContainer): Implement IMemberContainer.
18219 (TypeContainer.DefineMembers): Create the MemberCache.
18220 (TypeContainer.FindMembers): Do better BindingFlags checking; only
18221 return public members if BindingFlags.Public was given, check
18222 whether members are static.
18224 2002-08-16 Martin Baulig <martin@gnome.org>
18226 * decl.cs (DeclSpace.Define): Splitted this in Define and
18227 DefineMembers. DefineMembers is called first and initializes the
18230 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
18231 DefineMembers() on all our DeclSpaces.
18233 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
18234 but call DefineMembers() on all nested interfaces. We call their
18235 Define() in our new Define() function.
18237 * interface.cs (Interface): Implement IMemberContainer.
18238 (Interface.Define): Moved all code except the attribute stuf to
18240 (Interface.DefineMembers): Initialize the member cache.
18242 * typemanager.cs (IMemberFinder): Removed this interface, we don't
18243 need this anymore since we can use MemberCache.FindMembers directly.
18245 2002-08-19 Martin Baulig <martin@gnome.org>
18247 * typemanager.cs (MemberCache): When creating the cache for an
18248 interface type, add all inherited members.
18249 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
18250 to `out bool used_cache' and documented it.
18251 (TypeManager.MemberLookup): If we already used the cache in the first
18252 iteration, we don't need to do the interfaces check.
18254 2002-08-19 Martin Baulig <martin@gnome.org>
18256 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
18257 here from IMemberFinder and don't implement this interface anymore.
18258 (DeclSpace.MemberCache): Moved here from IMemberFinder.
18260 * typemanager.cs (IMemberFinder): This interface is now only used by
18261 classes which actually support the member cache.
18262 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
18263 since we only put DeclSpaces into this Hashtable.
18264 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
18265 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
18267 2002-08-16 Martin Baulig <martin@gnome.org>
18269 * typemanager.cs (ICachingMemberFinder): Removed.
18270 (IMemberFinder.MemberCache): New property.
18271 (TypeManager.FindMembers): Merged this with RealFindMembers().
18272 This function will never be called from TypeManager.MemberLookup()
18273 so we can't use the cache here, just the IMemberFinder.
18274 (TypeManager.MemberLookup_FindMembers): Check whether the
18275 IMemberFinder has a MemberCache and call the cache's FindMembers
18277 (MemberCache): Rewrote larger parts of this yet another time and
18278 cleaned it up a bit.
18280 2002-08-15 Miguel de Icaza <miguel@ximian.com>
18282 * driver.cs (LoadArgs): Support quoting.
18284 (Usage): Show the CSC-like command line arguments.
18286 Improved a few error messages.
18288 2002-08-15 Martin Baulig <martin@gnome.org>
18290 * typemanager.cs (IMemberContainer.Type): New property.
18291 (IMemberContainer.IsInterface): New property.
18293 The following changes are conditional to BROKEN_RUNTIME, which is
18294 defined at the top of the file.
18296 * typemanager.cs (MemberCache.MemberCache): Don't add the base
18297 class'es members, but add all members from TypeHandle.ObjectType
18298 if we're an interface.
18299 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
18300 is the current type.
18301 (MemberCache.CacheEntry.Container): Removed this field.
18302 (TypeHandle.GetMembers): Include inherited members.
18304 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18306 * typemanager.cs: fixed compilation and added a comment on a field that
18309 2002-08-15 Martin Baulig <martin@gnome.org>
18311 * class.cs (ConstructorInitializer.Resolve): In the
18312 Expression.MemberLookup call, use the queried_type as
18315 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
18316 declared' attribute, it's always true.
18317 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
18318 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
18319 temporary wrapper for FindMembers which tells MemberLookup whether
18320 members from the base classes are included in the return value.
18321 This will go away soon.
18322 (TypeManager.MemberLookup): Use this temporary hack here; once the
18323 new MemberCache is completed, we don't need to do the DeclaredOnly
18324 looping here anymore since the MemberCache will take care of this.
18325 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
18326 (MemberCache): When creating the MemberCache for a class, get
18327 members from the current class and all its base classes.
18328 (MemberCache.CacheEntry.Container): New field. This is a
18329 temporary hack until the Mono runtime is fixed to distinguish
18330 between ReflectedType and DeclaringType. It allows us to use MCS
18331 with both the MS runtime and the unfixed Mono runtime without
18332 problems and without accecting performance.
18333 (MemberCache.SearchMembers): The DeclaredOnly looping from
18334 TypeManager.MemberLookup is now done here.
18336 2002-08-14 Martin Baulig <martin@gnome.org>
18338 * statement.cs (MyStructInfo.MyStructInfo): Don't call
18339 Type.GetFields on dynamic types but get the fields from the
18340 corresponding TypeContainer.
18341 (MyStructInfo.GetStructInfo): Added check for enum types.
18343 * typemanager.cs (MemberList.IsSynchronized): Implemented.
18344 (MemberList.SyncRoot): Implemented.
18345 (TypeManager.FilterWithClosure): No need to check permissions if
18346 closure_start_type == closure_invocation_type, don't crash if
18347 closure_invocation_type is null.
18349 2002-08-13 Martin Baulig <martin@gnome.org>
18351 Rewrote TypeContainer.FindMembers to use a member cache. This
18352 gives us a speed increase of about 35% for the self-hosting MCS
18353 build and of about 15-20% for the class libs (both on GNU/Linux).
18355 * report.cs (Timer): New class to get enhanced profiling. This
18356 whole class is "TIMER" conditional since it remarkably slows down
18359 * class.cs (MemberList): New class. This is an IList wrapper
18360 which we're now using instead of passing MemberInfo[]'s around to
18361 avoid copying this array unnecessarily.
18362 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
18363 (ICachingMemberFinder, IMemberContainer): New interface.
18364 (TypeManager.FilterWithClosure): If `criteria' is null, the name
18365 has already been checked, otherwise use it for the name comparision.
18366 (TypeManager.FindMembers): Renamed to RealMemberFinder and
18367 provided wrapper which tries to use ICachingMemberFinder.FindMembers
18368 if possible. Returns a MemberList, not a MemberInfo [].
18369 (TypeHandle): New class, implements IMemberContainer. We create
18370 one instance of this class per type, it contains a MemberCache
18371 which is used to do the member lookups.
18372 (MemberCache): New class. Each instance of this class contains
18373 all members of a type and a name-based hash table.
18374 (MemberCache.FindMembers): This is our new member lookup
18375 function. First, it looks up all members of the requested name in
18376 the hash table. Then, it walks this list and sorts out all
18377 applicable members and returns them.
18379 2002-08-13 Martin Baulig <martin@gnome.org>
18381 In addition to a nice code cleanup, this gives us a performance
18382 increase of about 1.4% on GNU/Linux - not much, but it's already
18383 half a second for the self-hosting MCS compilation.
18385 * typemanager.cs (IMemberFinder): New interface. It is used by
18386 TypeManager.FindMembers to call FindMembers on a TypeContainer,
18387 Enum, Delegate or Interface.
18388 (TypeManager.finder_to_member_finder): New PtrHashtable.
18389 (TypeManager.finder_to_container): Removed.
18390 (TypeManager.finder_to_delegate): Removed.
18391 (TypeManager.finder_to_interface): Removed.
18392 (TypeManager.finder_to_enum): Removed.
18394 * interface.cs (Interface): Implement IMemberFinder.
18396 * delegate.cs (Delegate): Implement IMemberFinder.
18398 * enum.cs (Enum): Implement IMemberFinder.
18400 * class.cs (TypeContainer): Implement IMemberFinder.
18402 2002-08-12 Martin Baulig <martin@gnome.org>
18404 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
18406 2002-08-12 Martin Baulig <martin@gnome.org>
18408 * ecore.cs (ITypeExpression): New interface for expressions which
18410 (TypeExpression): Renamed to TypeLookupExpression.
18411 (Expression.DoResolve): If we're doing a types-only lookup, the
18412 expression must implement the ITypeExpression interface and we
18413 call DoResolveType() on it.
18414 (SimpleName): Implement the new ITypeExpression interface.
18415 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
18416 hack, the situation that we're only looking up types can't happen
18417 anymore when this method is called. Moved the type lookup code to
18418 DoResolveType() and call it.
18419 (SimpleName.DoResolveType): This ITypeExpression interface method
18420 is now doing the types-only lookup.
18421 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
18422 (ResolveFlags): Added MaskExprClass.
18424 * expression.cs (MemberAccess): Implement the ITypeExpression
18426 (MemberAccess.DoResolve): Added support for a types-only lookup
18427 when we're called via ITypeExpression.DoResolveType().
18428 (ComposedCast): Implement the ITypeExpression interface.
18430 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
18431 Expression.Resolve() with ResolveFlags.Type instead.
18433 2002-08-12 Martin Baulig <martin@gnome.org>
18435 * interface.cs (Interface.Define): Apply attributes.
18437 * attribute.cs (Attribute.ApplyAttributes): Added support for
18438 interface attributes.
18440 2002-08-11 Martin Baulig <martin@gnome.org>
18442 * statement.cs (Block.Emit): Only check the "this" variable if we
18443 do not always throw an exception.
18445 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
18446 whether the property has a set accessor.
18448 2002-08-11 Martin Baulig <martin@gnome.org>
18450 Added control flow analysis support for structs.
18452 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
18453 with control flow analysis turned off.
18454 (IVariable): New interface.
18455 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
18456 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
18457 (FieldExpr.DoResolve): Resolve the instance expression with flow
18458 analysis turned off and do the definite assignment check after the
18459 resolving when we know what the expression will resolve to.
18461 * expression.cs (LocalVariableReference, ParameterReference):
18462 Implement the new IVariable interface, only call the flow analysis
18463 code if ec.DoFlowAnalysis is true.
18464 (This): Added constructor which takes a Block argument. Implement
18465 the new IVariable interface.
18466 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
18467 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
18468 This does the definite assignment checks for struct members.
18470 * class.cs (Constructor.Emit): If this is a non-static `struct'
18471 constructor which doesn't have any initializer, call
18472 Block.AddThisVariable() to tell the flow analysis code that all
18473 struct elements must be initialized before control returns from
18476 * statement.cs (MyStructInfo): New public class.
18477 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
18478 argument to this indexer. If non-zero, check an individual struct
18479 member, not the whole struct.
18480 (FlowBranching.CheckOutParameters): Check struct members.
18481 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
18482 overloaded versions of these methods which take an additional
18483 `int field_idx' argument to check struct members.
18484 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
18485 overloaded versions of these methods which take an additional
18486 `string field_name' argument to check struct member.s
18487 (VariableInfo): Implement the IVariable interface.
18488 (VariableInfo.StructInfo): New public property. Returns the
18489 MyStructInfo instance of the variable if it's a struct or null.
18490 (Block.AddThisVariable): New public method. This is called from
18491 Constructor.Emit() for non-static `struct' constructor which do
18492 not have any initializer. It creates a special variable for the
18493 "this" instance variable which will be checked by the flow
18494 analysis code to ensure that all of the struct's fields are
18495 initialized before control returns from the constructor.
18496 (UsageVector): Added support for struct members. If a
18497 variable/parameter is a struct with N members, we reserve a slot
18498 in the usage vector for each member. A struct is considered fully
18499 initialized if either the struct itself (slot 0) or all its
18500 members are initialized.
18502 2002-08-08 Martin Baulig <martin@gnome.org>
18504 * driver.cs (Driver.MainDriver): Only report an error CS5001
18505 if there were no compilation errors.
18507 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
18508 `UnsafeContext' property to determine whether the parent is in
18509 unsafe context rather than checking the parent's ModFlags:
18510 classes nested in an unsafe class are unsafe as well.
18512 2002-08-08 Martin Baulig <martin@gnome.org>
18514 * statement.cs (UsageVector.MergeChildren): Distinguish between
18515 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
18516 we return. Added test17() and test18() to test-154.cs.
18518 2002-08-08 Martin Baulig <martin@gnome.org>
18520 * typemanager.cs (TypeManager.FilterWithClosure): If we have
18521 Family access, make sure the invoking type isn't a subclass of the
18522 queried type (that'd be a CS1540).
18524 * ecore.cs (Expression.MemberLookup): Added overloaded version of
18525 this method which takes an additional `Type invocation_type'.
18527 * expression.cs (BaseAccess.DoResolve): Use the base type as
18528 invocation and query type.
18529 (MemberAccess.DoResolve): If the lookup failed and we're about to
18530 report a CS0122, try a lookup with the ec.ContainerType - if this
18531 succeeds, we must report a CS1540.
18533 2002-08-08 Martin Baulig <martin@gnome.org>
18535 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18536 (MethodGroupExpr): Implement the IMemberExpr interface.
18538 * expression (MemberAccess.ResolveMemberAccess): No need to have
18539 any special code for MethodGroupExprs anymore, they're now
18542 2002-08-08 Martin Baulig <martin@gnome.org>
18544 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18545 Family, FamANDAssem and FamORAssem permissions.
18546 (TypeManager.IsSubclassOrNestedChildOf): New public method.
18548 2002-08-08 Martin Baulig <martin@gnome.org>
18550 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18551 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18554 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18556 * driver.cs: implemented /resource option to embed managed resources.
18558 2002-08-07 Martin Baulig <martin@gnome.org>
18560 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18561 (FieldBase.HasFieldInitializer): New public property.
18562 (FieldBase.GetInitializerExpression): New public method. Resolves and
18563 returns the field initializer and makes sure it is only resolved once.
18564 (TypeContainer.EmitFieldInitializers): Call
18565 FieldBase.GetInitializerExpression to get the initializer, this ensures
18566 that it isn't resolved multiple times.
18568 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
18569 the resolving process (SimpleName/MemberLookup) that we're currently
18570 emitting a field initializer (which must not access any instance members,
18571 this is an error CS0236).
18573 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18574 argument, if the `IsFieldInitializer' flag is set, we must report and
18575 error CS0236 and not an error CS0120.
18577 2002-08-07 Martin Baulig <martin@gnome.org>
18579 * ecore.cs (IMemberExpr): New public interface.
18580 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18581 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18582 if the expression is an IMemberExpr.
18584 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18585 to be null, implicitly default to `this' if we're non-static in
18586 this case. Simplified the code a lot by using the new IMemberExpr
18587 interface. Also fixed bug #28176 here.
18589 2002-08-06 Martin Baulig <martin@gnome.org>
18591 * cs-parser.jay (SimpleLookup): Removed. We need to create
18592 ParameterReferences during semantic analysis so that we can do a
18593 type-only search when resolving Cast, TypeOf and SizeOf.
18594 (block): Pass the `current_local_parameters' to the Block's
18597 * class.cs (ConstructorInitializer): Added `Parameters parameters'
18598 argument to the constructor.
18599 (ConstructorInitializer.Resolve): Create a temporary implicit
18600 block with the parameters.
18602 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18603 references here if we aren't doing a type-only search.
18605 * statement.cs (Block): Added constructor which takes a
18606 `Parameters parameters' argument.
18607 (Block.Parameters): New public property.
18609 * support.cs (InternalParameters.Parameters): Renamed `parameters'
18610 to `Parameters' and made it public readonly.
18612 2002-08-06 Martin Baulig <martin@gnome.org>
18614 * ecore.cs (Expression.Warning): Made this public as well.
18616 * report.cs (Report.Debug): Print the contents of collections.
18618 2002-08-06 Martin Baulig <martin@gnome.org>
18620 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
18621 used to tell Resolve() which kinds of expressions it may return.
18622 (Expression.Resolve): Added overloaded version of this method which
18623 takes a `ResolveFlags flags' argument. This can be used to tell
18624 Resolve() which kinds of expressions it may return. Reports a
18626 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18627 ResolveFlags.SimpleName.
18628 (Expression.Error118): Added overloaded version of this method which
18629 takes a `ResolveFlags flags' argument. It uses the flags to determine
18630 which kinds of expressions are allowed.
18632 * expression.cs (Argument.ResolveMethodGroup): New public method.
18633 Resolves an argument, but allows a MethodGroup to be returned.
18634 This is used when invoking a delegate.
18636 * TODO: Updated a bit.
18638 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18640 Fixed compilation with csc.
18642 * ecore.cs: Expression.Error made public. Is this correct? Should
18643 Warning be made public too?
18645 * expression.cs: use ea.Location instead of ea.loc.
18646 [FIXME: Filed as bug #28607: MCS must report these errors.]
18648 2002-08-06 Martin Baulig <martin@gnome.org>
18650 * ecore.cs (Expression.loc): Moved the location here instead of
18651 duplicating it in all derived classes.
18652 (Expression.Location): New public property.
18653 (Expression.Error, Expression.Warning): Made them non-static and
18654 removed the location argument.
18655 (Expression.Warning): Added overloaded version which takes an
18656 `int level' argument.
18657 (Expression.Error118): Make this non-static and removed the
18658 expression and location arguments.
18659 (TypeExpr): Added location argument to the constructor.
18661 * expression.cs (StaticCallExpr): Added location argument to
18663 (Indirection, PointerArithmetic): Likewise.
18664 (CheckedExpr, UnCheckedExpr): Likewise.
18665 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18666 (StringPtr): Likewise.
18669 2002-08-05 Martin Baulig <martin@gnome.org>
18671 * expression.cs (BaseAccess.DoResolve): Actually report errors.
18673 * assign.cs (Assign.DoResolve): Check whether the source
18674 expression is a value or variable.
18676 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18677 while resolving the corresponding blocks.
18679 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18680 an error, don't silently return null.
18682 * statement.cs (Block.AddVariable): Do the error reporting here
18683 and distinguish between CS0128 and CS0136.
18684 (Block.DoResolve): Report all unused labels (warning CS0164).
18685 (LabeledStatement): Pass the location to the constructor.
18686 (LabeledStatement.HasBeenReferenced): New property.
18687 (LabeledStatement.Resolve): Set it to true here.
18689 * statement.cs (Return.Emit): Return success even after reporting
18690 a type mismatch error (CS0126 or CS0127), this is what csc does and
18691 it avoids confusing the users with any consecutive errors.
18693 2002-08-05 Martin Baulig <martin@gnome.org>
18695 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18697 * const.cs (Const.LookupConstantValue): Catch circular definitions.
18699 * expression.cs (MemberAccess.DoResolve): Silently return if an
18700 error has already been reported.
18702 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18703 error has already been reported.
18705 2002-08-05 Martin Baulig <martin@gnome.org>
18707 * statement.cs (UsageVector): Only initialize the `parameters'
18708 vector if we actually have any "out" parameters.
18710 2002-08-05 Martin Baulig <martin@gnome.org>
18712 * expression.cs (Binary.ResolveOperator): When combining delegates,
18713 they must have the same type.
18715 2002-08-05 Martin Baulig <martin@gnome.org>
18717 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18718 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18719 work with the ms runtime and we also don't need it: if we're a
18720 PropertyBuilder and not in the `indexer_arguments' hash, then we
18721 are a property and not an indexer.
18723 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18724 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18725 since the latter one doesn't work with the ms runtime.
18727 2002-08-03 Martin Baulig <martin@gnome.org>
18729 Fixed bugs #27998 and #22735.
18731 * class.cs (Method.IsOperator): New public field.
18732 (Method.CheckBase): Report CS0111 if there's already a method
18733 with the same parameters in the current class. Report CS0508 when
18734 attempting to change the return type of an inherited method.
18735 (MethodData.Emit): Report CS0179 if a method doesn't have a body
18736 and it's not marked abstract or extern.
18737 (PropertyBase): New abstract base class for Property and Indexer.
18738 (PropertyBase.CheckBase): Moved here from Property and made it work
18740 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18741 the same so we can reuse it there.
18742 (Property, Indexer): Derive from PropertyBase.
18743 (MethodSignature.inheritable_property_signature_filter): New delegate
18744 to find properties and indexers.
18746 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18747 argument and improved error reporting.
18749 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18750 EmptyReadOnlyParameters and made it a property.
18752 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18753 version of this method which takes a `PropertyInfo indexer'.
18754 (TypeManager.RegisterIndexer): New method.
18756 * class.cs: Added myself as author of this file :-)
18758 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18760 * class.cs: fixed compilation on windoze.
18762 2002-08-03 Martin Baulig <martin@gnome.org>
18764 * interface.cs (Interface.GetInterfaceBases): Check whether all
18765 base interfaces are at least as accessible than the current one.
18767 * class.cs (TypeContainer.GetClassBases): Check whether base types
18768 are at least as accessible than the current type.
18769 (TypeContainer.AsAccessible): Implemented and made non-static.
18770 (MemberBase.CheckParameters): Report errors if the accessibility
18773 * delegate.cs (Delegate.Delegate): The default visibility is
18774 internal for top-level types and private for nested types.
18775 (Delegate.Define): Report errors if the accessibility checks fail.
18777 * enum.cs (Enum.Enum): The default visibility is internal for
18778 top-level types and private for nested types.
18779 (Enum.DefineType): Compute the correct visibility.
18781 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18782 function which takes a `bool is_toplevel' instead of a TypeContainer.
18784 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18787 2002-08-02 Martin Baulig <martin@gnome.org>
18789 * expression.cs (LocalVariableReferenc): Added constructor which
18790 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18791 (LocalVariableReference.IsReadOnly): New property.
18792 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18793 variable is readonly, use our own readonly flag to do this; you can
18794 use the new constructor to get a writable reference to a read-only
18797 * cs-parser.jay (foreach_statement, using_statement): Get a writable
18798 reference to the local variable.
18800 2002-08-01 Miguel de Icaza <miguel@ximian.com>
18802 * rootcontext.cs (ResolveCore): Also include System.Exception
18804 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18805 we reach an EmptyStatement.
18807 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18810 * expression.cs (Binary.ResolveOperator): Check error result in
18813 use brtrue/brfalse directly and avoid compares to null.
18815 2002-08-02 Martin Baulig <martin@gnome.org>
18817 * class.cs (TypeContainer.Define): Define all nested interfaces here.
18818 Fixes bug #28407, added test-155.cs.
18820 2002-08-01 Martin Baulig <martin@gnome.org>
18822 * class.cs (Event.EmitDefaultMethod): Make this work with static
18823 events. Fixes #28311, added verify-3.cs.
18825 2002-08-01 Martin Baulig <martin@gnome.org>
18827 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18828 `is_disposable' fields.
18829 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18830 `hm.is_disposable' if we're using the collection pattern.
18831 (Foreach.EmitCollectionForeach): Use the correct type for the
18832 enumerator's local variable, only emit the try/finally block if
18833 necessary (fixes #27713).
18835 2002-08-01 Martin Baulig <martin@gnome.org>
18837 * ecore.cs (Expression.report118): Renamed to Error118 and made
18840 * statement.cs (Throw.Resolve): Check whether the expression is of
18841 the correct type (CS0118) and whether the type derives from
18842 System.Exception (CS0155).
18843 (Catch.Resolve): New method. Do the type lookup here and check
18844 whether it derives from System.Exception (CS0155).
18845 (Catch.CatchType, Catch.IsGeneral): New public properties.
18847 * typemanager.cs (TypeManager.exception_type): Added.
18849 2002-07-31 Miguel de Icaza <miguel@ximian.com>
18851 * driver.cs: Updated About function.
18853 2002-07-31 Martin Baulig <martin@gnome.org>
18855 Implemented Control Flow Analysis.
18857 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18858 (EmitContext.CurrentBranching): Added.
18859 (EmitContext.StartFlowBranching): Added.
18860 (EmitContext.EndFlowBranching): Added.
18861 (EmitContext.KillFlowBranching): Added.
18862 (EmitContext.IsVariableAssigned): Added.
18863 (EmitContext.SetVariableAssigned): Added.
18864 (EmitContext.IsParameterAssigned): Added.
18865 (EmitContext.SetParameterAssigned): Added.
18866 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18867 Added control flow analysis stuff here.
18869 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18870 resolve the expression as lvalue.
18871 (LocalVariableReference.DoResolve): Check whether the variable has
18872 already been assigned.
18873 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18874 the parameter as assigned here.
18875 (ParameterReference.DoResolve): Check whether the parameter has already
18877 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18878 expression as lvalue.
18880 * statement.cs (FlowBranching): New class for the flow analysis code.
18881 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18882 (LabeledStatement.IsDefined): New public property.
18883 (LabeledStatement.AddUsageVector): New public method to tell flow
18884 analyis that the label may be reached via a forward jump.
18885 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18887 (VariableInfo.Number): New public field. This is used by flow analysis
18888 to number all locals of a block.
18889 (Block.CountVariables): New public property. This is the number of
18890 local variables in this block (including the locals from all parent
18892 (Block.EmitMeta): Number all the variables.
18894 * statement.cs: Added flow analysis support to all classes.
18896 2002-07-31 Martin Baulig <martin@gnome.org>
18898 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18899 To get debugging messages, compile mcs with /define:MCS_DEBUG and
18900 then use this argument.
18902 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18904 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18905 use this to specify /define options.
18907 2002-07-29 Martin Baulig <martin@gnome.org>
18909 * statement.cs (Fixed): Moved all code that does variable lookups
18910 and resolvings from Emit to Resolve.
18912 * statement.cs (For): Moved all code that does variable lookups
18913 and resolvings from Emit to Resolve.
18915 * statement.cs (Using): Moved all code that does variable lookups
18916 and resolvings from Emit to Resolve.
18918 2002-07-29 Martin Baulig <martin@gnome.org>
18920 * attribute.cs (Attribute.Resolve): Explicitly catch a
18921 System.NullReferenceException when creating the
18922 CustromAttributeBuilder and report a different warning message.
18924 2002-07-29 Martin Baulig <martin@gnome.org>
18926 * support.cs (ParameterData.ParameterName): Added method to
18927 get the name of a parameter.
18929 * typemanager.cs (TypeManager.IsValueType): New public method.
18931 2002-07-29 Martin Baulig <martin@gnome.org>
18933 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
18934 is a flag which specifies that it's either ref or out.
18935 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18936 the out parameter to `out Parameter.Modifier mod', also set the
18937 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18939 * support.cs (InternalParameters.ParameterModifier): Distinguish
18940 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18941 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18943 * expression.cs (Argument.GetParameterModifier): Distinguish
18944 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18945 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18947 2002-07-29 Martin Baulig <martin@gnome.org>
18949 * expression.cs (ParameterReference.ParameterReference): Added
18950 `Location loc' argument to the constructor.
18952 * cs-parser.jay: Pass location to ParameterReference.
18954 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18956 * statement.cs (Try): Initialize the location.
18958 * cs-parser.jay: pass location to Try.
18960 * expression.cs (Unary.Reduce): Change the prototype to return
18961 whether a constant fold could be performed or not. The result is
18962 returned in an out parameters. In the case of Indirection and
18963 AddressOf, we want to perform the full tests.
18965 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18967 * statement.cs (Statement.Emit): Flag dead code.
18969 2002-07-27 Andrew Birkett <andy@nobugs.org>
18971 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18973 2002-07-27 Martin Baulig <martin@gnome.org>
18975 * class.cs (MethodData.Define): Put back call to
18976 TypeManager.AddMethod(), accidentally commented this out.
18978 * report.cs (Debug): New public method to print debugging information,
18979 this is `[Conditional ("DEBUG")]'.
18981 2002-07-26 Martin Baulig <martin@gnome.org>
18983 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18984 (switch_statement): Push the current_block to the switch_stack and
18985 pop it again when we're done with the switch.
18986 (switch_section): The new block is a child of the current_block.
18987 Fixes bug #24007, added test-152.cs.
18989 2002-07-27 Martin Baulig <martin@gnome.org>
18991 * expression.cs (Invocation.EmitArguments): When calling a varargs
18992 function with only its fixed arguments, we need to pass an empty
18995 2002-07-27 Martin Baulig <martin@gnome.org>
18997 Mono 0.13 has been released.
18999 2002-07-25 Miguel de Icaza <miguel@ximian.com>
19001 * driver.cs: Rename --resource to --linkres, because that is what
19002 we do currently, we dont support --resource yet.
19004 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
19006 2002-07-25 Martin Baulig <martin@gnome.org>
19008 * class.cs (MethodData): New public class. This is a `method builder'
19009 class for a method or one accessor of a Property/Indexer/Event.
19010 (MethodData.GetMethodFlags): Moved here from MemberBase.
19011 (MethodData.ApplyAttributes): Likewise.
19012 (MethodData.ApplyObsoleteAttribute): Likewise.
19013 (MethodData.ApplyConditionalAttribute): Likewise.
19014 (MethodData.ApplyDllImportAttribute): Likewise.
19015 (MethodData.CheckAbstractAndExternal): Likewise.
19016 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
19017 (MethodData.Emit): Formerly known as Method.Emit().
19018 (MemberBase): Moved everything which was specific to a single
19019 accessor/method to MethodData.
19020 (Method): Create a new MethodData and call Define() and Emit() on it.
19021 (Property, Indexer, Event): Create a new MethodData objects for each
19022 accessor and call Define() and Emit() on them.
19024 2002-07-25 Martin Baulig <martin@gnome.org>
19026 Made MethodCore derive from MemberBase to reuse the code from there.
19027 MemberBase now also checks for attributes.
19029 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
19030 (MemberBase.GetMethodFlags): Moved here from class Method and marked
19032 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
19033 `CallingConventions cc' and `Attributes opt_attrs' arguments.
19034 (MemberBase.ApplyAttributes): New virtual method; applies the
19035 attributes to a method or accessor.
19036 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
19037 (MemberBase.ApplyConditionalAttribute): Likewise.
19038 (MemberBase.ApplyDllImportAttribute): Likewise.
19039 (MemberBase.CheckAbstractAndExternal): Likewise.
19040 (MethodCore.ParameterTypes): This is now a property instead of a
19041 method, it's initialized from DoDefineParameters().
19042 (MethodCore.ParameterInfo): Removed the set accessor.
19043 (MethodCore.DoDefineParameters): New protected virtual method to
19044 initialize ParameterTypes and ParameterInfo.
19045 (Method.GetReturnType): We can now simply return the MemberType.
19046 (Method.GetMethodFlags): Override the MemberBase version and add
19047 the conditional flags.
19048 (Method.CheckBase): Moved some code from Define() here, call
19049 DoDefineParameters() here.
19050 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
19051 here to avoid some larger code duplication.
19052 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
19053 ensure that abstract and external accessors don't declare a body.
19055 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
19056 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
19057 lookup in the attribute's parent classes, so we need to abort as soon
19058 as we found the first match.
19059 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
19060 the attribute has no arguments.
19062 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
19065 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19067 * cs-parser.jay: reverted previous patch.
19069 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19071 * cs-parser.jay: fixed bug #22119.
19073 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19075 * attribute.cs: fixed compilation. The error was:
19076 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
19077 be assigned to before control leaves the current method."
19078 [FIXME: Filed as bug #28186: MCS must report this error.]
19080 2002-07-25 Martin Baulig <martin@gnome.org>
19082 * attribute.cs (Attribute.Conditional_GetConditionName): New static
19083 method to pull the condition name ouf of a Conditional attribute.
19084 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
19085 the obsolete message and error flag out of an Obsolete attribute.
19087 * class.cs (Method.GetMethodFlags): New public method to get the
19088 TypeManager.MethodFlags for this method.
19089 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
19091 (Method.Define): Get and apply the Obsolete and Conditional attributes;
19092 if we're overriding a virtual function, set the new private variable
19093 `parent_method'; call the new TypeManager.AddMethod().
19095 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
19096 the MethodBuilder and the Method in a PtrHashtable.
19097 (TypeManager.builder_to_method): Added for this purpose.
19098 (TypeManager.MethodFlags): Added IsObsoleteError.
19099 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
19100 Obsolete and Conditional arguments in MethodBuilders. If we discover
19101 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
19102 the message from the attribute.
19104 2002-07-24 Martin Baulig <martin@gnome.org>
19106 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
19107 preprocessor directives, ensure that the argument to #define/#undef is
19108 exactly one identifier and that it's actually an identifier.
19110 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
19113 2002-07-24 Martin Baulig <martin@gnome.org>
19115 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
19116 initialize it to TypeManager.object_type in the constructor.
19117 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
19118 of the `hm.get_current' method if we're using the collection pattern.
19119 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
19120 for the explicit conversion to make it work when we're using the collection
19121 pattern and the `Current' property has a different return type than `object'.
19124 2002-07-24 Martin Baulig <martin@gnome.org>
19126 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
19127 does not match, but don't report any errors. This method is called in
19128 order for all methods in a MethodGroupExpr until a matching method is
19129 found, so we don't want to bail out if the first method doesn't match.
19130 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
19131 matches, report the 123. Fixes #28070.
19133 2002-07-24 Martin Baulig <martin@gnome.org>
19135 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
19136 TypeManager.TypeToCoreType() to the top of the method so the
19137 following equality checks will work. Fixes #28107.
19139 2002-07-24 Martin Baulig <martin@gnome.org>
19141 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
19142 operand is of type uint, and the other operand is of type sbyte,
19143 short or int, the operands are converted to type long." -
19144 Actually do what this comment already told us. Fixes bug #28106,
19147 2002-07-24 Martin Baulig <martin@gnome.org>
19149 * class.cs (MethodBase): New abstract class. This is now a base
19150 class for Property, Indexer and Event to avoid some code duplication
19151 in their Define() and DefineMethods() methods.
19152 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
19153 generic methods for Define() and DefineMethods().
19154 (FieldBase): Derive from MemberBase, not MemberCore.
19155 (Property): Derive from MemberBase, not MemberCore.
19156 (Property.DefineMethod): Moved all the code from this method to the
19157 new MethodBase.DefineAccessor(), just call it with appropriate
19159 (Property.Define): Call the new Property.DoDefine(), this does some
19160 sanity checks and we don't need to duplicate the code everywhere.
19161 (Event): Derive from MemberBase, not MemberCore.
19162 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
19163 accessors, this will also make them work with interface events.
19164 (Indexer): Derive from MemberBase, not MemberCore.
19165 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
19166 (Indexer.Define): Use the new MethodBase functions.
19168 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
19169 argument to the constructor.
19170 (Interface.FindMembers): Added support for interface events.
19171 (Interface.PopluateEvent): Implemented.
19173 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
19175 2002-07-22 Miguel de Icaza <miguel@ximian.com>
19177 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
19178 but this is required to check for a method name being the same as
19179 the containing class.
19183 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19185 * interface.cs: initialize variable.
19187 2002-07-23 Martin Baulig <martin@gnome.org>
19189 Implemented the IndexerName attribute in interfaces.
19191 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
19192 name if this is an explicit interface implementation.
19193 (Indexer.InterfaceIndexerName): New public variable. If we're
19194 implementing an interface indexer, this is the IndexerName in that
19195 interface. Otherwise, it's the IndexerName.
19196 (Indexer.DefineMethod): If we're implementing interface indexer,
19197 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
19198 and Pending.ImplementIndexer methods.
19199 (Indexer.Define): Also define the PropertyBuilder if we're
19200 implementing an interface indexer and this is neither an explicit
19201 interface implementation nor do the IndexerName match the one in
19204 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
19205 If a method is defined here, then we always need to create a proxy
19206 for it. This is used when implementing interface indexers.
19207 (Pending.IsInterfaceIndexer): New public method.
19208 (Pending.ImplementIndexer): New public method.
19209 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
19210 This is used when implementing interface indexers to define a proxy
19212 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
19213 define a proxy if necessary.
19215 * interface.cs (Interface.IndexerName): New public variable.
19216 (Interface.PopulateIndexer): Set the IndexerName.
19217 (Interface.DefineIndexers): New private method. Populate all the
19218 indexers and make sure their IndexerNames match.
19220 * typemanager.cs (IndexerPropertyName): Added support for interface
19223 2002-07-22 Martin Baulig <martin@gnome.org>
19225 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
19226 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
19227 ret if HasReturnLabel.
19228 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
19231 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
19232 and set the ec.LoopBeginTryCatchLevel.
19233 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
19234 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
19235 the current ec.TryCatchLevel, the branch goes out of an exception
19236 block. In this case, we need to use Leave and not Br.
19238 2002-07-22 Martin Baulig <martin@gnome.org>
19240 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
19241 block unless the block does not always return or it is contained in
19242 another try { ... } catch { ... } block. Fixes bug #26506.
19243 Added verify-1.cs to the test suite.
19245 2002-07-22 Martin Baulig <martin@gnome.org>
19247 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
19248 then we do not always return. Fixes bug #24985.
19250 2002-07-22 Martin Baulig <martin@gnome.org>
19252 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
19253 lookup on a per-class level; ie. walk up the class hierarchy until we
19254 found at least one applicable method, then choose the best among them.
19255 Fixes bug #24463 and test-29.cs.
19257 2002-07-22 Martin Baulig <martin@gnome.org>
19259 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
19260 return types of the methods. The return type is not part of the
19261 signature and we must not check it to make the `new' modifier work.
19262 Fixes bug #27999, also added test-147.cs.
19263 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
19265 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
19266 on the method's return type.
19268 2002-07-21 Martin Baulig <martin@gnome.org>
19270 * assign.cs: Make this work if the rightmost source is a constant and
19271 we need to do an implicit type conversion. Also adding a few more tests
19272 to test-38.cs which should have caught this.
19274 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
19275 target in the makefile for this. The makefile.gnu is primarily intended
19276 for end-users who don't want to debug the compiler.
19278 2002-07-21 Martin Baulig <martin@gnome.org>
19280 * assign.cs: Improved the Assign class so it can now handle embedded
19281 assignments (X = Y = Z = something). As a side-effect this'll now also
19282 consume less local variables. test-38.cs now passes with MCS, added
19283 a few new test cases to that test.
19285 2002-07-20 Martin Baulig <martin@gnome.org>
19287 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
19288 instructions. Fixes bug #27977, also added test-146.cs.
19290 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19292 * cs-tokenizer.cs: fixed getHex ().
19294 2002-07-19 Martin Baulig <martin@gnome.org>
19296 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
19297 not Type.GetType() to lookup the array type. This is needed when
19298 we're constructing an array of a user-defined type.
19299 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
19300 single-dimensional arrays, but also for single-dimensial arrays of
19303 2002-07-19 Martin Baulig <martin@gnome.org>
19305 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
19306 this function is called, it's not allowed to share LocalBuilders
19307 among ILGenerators.
19309 2002-07-19 Martin Baulig <martin@gnome.org>
19311 * expression.cs (Argument.Resolve): Report an error 118 when trying
19312 to pass a type as argument.
19314 2002-07-18 Martin Baulig <martin@gnome.org>
19316 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
19317 Conv_R_Un for the signed `long' type.
19319 2002-07-15 Miguel de Icaza <miguel@ximian.com>
19321 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
19322 `expr' for the temporary result, as that will fail if we do
19323 multiple resolves on the same expression.
19325 2002-07-05 Miguel de Icaza <miguel@ximian.com>
19327 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
19328 ec.TypeContainer for looking up aliases.
19330 * class.cs (TypeContainer): Remove LookupAlias from here.
19332 * decl.cs (DeclSpace); Move here.
19334 2002-07-01 Miguel de Icaza <miguel@ximian.com>
19336 * class.cs (FindMembers): Only call filter if the constructor
19337 bulider is not null.
19339 Also handle delegates in `NestedTypes' now. Now we will perform
19340 type lookups using the standard resolution process. This also
19343 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
19344 This uses Expressions (the limited kind that can be parsed by the
19345 tree) instead of strings.
19347 * expression.cs (ComposedCast.ToString): Implement, used to flag
19348 errors since now we have to render expressions.
19350 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
19353 * ecore.cs (SimpleName.ToString): ditto.
19355 * cs-parser.jay: Instead of using strings to assemble types, use
19356 Expressions to assemble the type (using SimpleName, ComposedCast,
19357 MemberAccess). This should fix the type lookups in declarations,
19358 because we were using a different code path for this.
19360 * statement.cs (Block.Resolve): Continue processing statements
19361 even when there is an error.
19363 2002-07-17 Miguel de Icaza <miguel@ximian.com>
19365 * class.cs (Event.Define): Also remove the `remove' method from
19366 the list of pending items.
19368 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
19369 generate more compact code.
19371 2002-07-17 Martin Baulig <martin@gnome.org>
19373 * const.cs (Const.LookupConstantValue): Add support for constant
19374 `unchecked' and `checked' expressions.
19375 Also adding test case test-140.cs for this.
19377 2002-07-17 Martin Baulig <martin@gnome.org>
19379 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
19380 check whether mi.ReturnType implements the IEnumerator interface; the
19381 `==' and the IsAssignableFrom() will fail in this situation.
19383 2002-07-16 Ravi Pratap <ravi@ximian.com>
19385 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
19388 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19390 * expression.cs: fixed bug #27811.
19392 2002-07-14 Miguel de Icaza <miguel@ximian.com>
19394 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
19395 Molaro: when we are a ref, the value already contains a pointer
19396 value, do not take the address of it.
19398 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19399 * removed mb-parser.jay and mb-tokenizer.cs
19401 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19403 * expression.cs: check against the building corlib void type.
19405 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
19407 * ecore.cs: fix for valuetype static readonly fields: when
19408 initializing them, we need their address, not the address of a copy.
19410 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
19412 * typemanager.cs: register also enum_type in corlib.
19414 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19416 * class.cs: allow calling this (but not base) initializers in structs.
19418 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
19420 * ecore.cs: make sure we compare against the building base types
19423 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
19425 * typemanager.cs: fix TypeToCoreType() to handle void and object
19426 (corlib gets no more typerefs after this change).
19428 2002-07-12 Miguel de Icaza <miguel@ximian.com>
19430 * expression.cs (ArrayCreation.EmitArrayArguments): use
19431 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
19433 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
19434 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
19435 array indexes, the runtime actually forbids them.
19437 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
19438 for array arguments here.
19440 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
19441 instead of the default for ValueTypes.
19443 (New.DoEmit): Use IsValueType instead of
19444 IsSubclassOf (value_type)
19445 (New.DoResolve): ditto.
19446 (Invocation.EmitCall): ditto.
19448 * assign.cs (Assign): ditto.
19450 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
19451 Statements *are* currently doing part of their resolution during
19454 Expressions do always resolve during resolve, but statements are
19455 only required to propagate resolution to their children.
19457 2002-07-11 Miguel de Icaza <miguel@ximian.com>
19459 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
19461 (LoadAssembly): Do not add the dll if it is already specified
19463 (MainDriver): Add the System directory to the link path at the end,
19464 after all the other -L arguments.
19466 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
19467 wrong opcode for loading bytes and bools (ldelem.i1 instead of
19468 ldelem.u1) and using the opposite for sbytes.
19470 This fixes Digger, and we can finally run it.
19472 * driver.cs (UnixParseOption): Move the option parsing here.
19473 (CSCParseOption): Implement CSC-like parsing of options.
19475 We now support both modes of operation, the old Unix way, and the
19476 new CSC-like way. This should help those who wanted to make cross
19477 platform makefiles.
19479 The only thing broken is that /r:, /reference: and /lib: are not
19480 implemented, because I want to make those have the same semantics
19481 as the CSC compiler has, and kill once and for all the confussion
19482 around this. Will be doing this tomorrow.
19484 * statement.cs (Unsafe.Resolve): The state is checked during
19485 resolve, not emit, so we have to set the flags for IsUnsfe here.
19487 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19489 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
19490 not catch the Error_ObjectRefRequired in SimpleName (as it is
19491 possible to have a class/instance variable name that later gets
19492 deambiguated), we have to check this here.
19494 2002-07-10 Ravi Pratap <ravi@ximian.com>
19496 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
19497 make static and put into Expression.
19499 (Event.Define): Register the private field of the event with the
19500 TypeManager so that GetFieldFromEvent can get at it.
19502 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
19503 keep track of the private field associated with an event which
19506 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
19509 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
19511 2002-07-10 Miguel de Icaza <miguel@ximian.com>
19513 * expression.cs (Binary.EmitBranchable): this routine emits the
19514 Binary expression in a branchable context. This basically means:
19515 we need to branch somewhere, not just get the value on the stack.
19517 This works together with Statement.EmitBoolExpression.
19519 * statement.cs (Statement.EmitBoolExpression): Use
19522 2002-07-09 Miguel de Icaza <miguel@ximian.com>
19524 * statement.cs (For): Reduce the number of jumps in loops.
19526 (For): Implement loop inversion for the For statement.
19528 (Break): We can be breaking out of a Try/Catch controlled section
19529 (foreach might have an implicit try/catch clause), so we need to
19530 use Leave instead of Br.
19532 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19533 now). If the instace expression supports IMemoryLocation, we use
19534 the AddressOf method from the IMemoryLocation to extract the
19535 address instead of emitting the instance.
19537 This showed up with `This', as we were emitting the instance
19538 always (Emit) instead of the Address of This. Particularly
19539 interesting when This is a value type, as we dont want the Emit
19540 effect (which was to load the object).
19542 2002-07-08 Miguel de Icaza <miguel@ximian.com>
19544 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19546 * statement.cs (Checked): Set the CheckedState during the resolve
19547 process too, as the ConvCast operations track the checked state on
19548 the resolve process, and not emit.
19550 * cs-parser.jay (namespace_member_declaration): Flag that we have
19551 found a declaration when we do. This is used to flag error 1529
19553 * driver.cs: Report ok when we display the help only.
19555 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
19557 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19559 2002-07-04 Miguel de Icaza <miguel@ximian.com>
19561 * cs-tokenizer.cs (define): We also have to track locally the
19562 defines. AllDefines is just used for the Conditional Attribute,
19563 but we also need the local defines for the current source code.
19565 2002-07-03 Miguel de Icaza <miguel@ximian.com>
19567 * statement.cs (While, For, Do): These loops can exit through a
19568 Break statement, use this information to tell whether the
19569 statement is the last piece of code.
19571 (Break): Flag that we break.
19573 * codegen.cs (EmitContexts): New `Breaks' state variable.
19575 2002-07-03 Martin Baulig <martin@gnome.org>
19577 * class.cs (TypeContainer.MethodModifiersValid): Allow override
19578 modifiers in method declarations in structs. Otherwise, you won't
19579 be able to override things like Object.Equals().
19581 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19583 * class.cs (Method, Property, Indexer): Do not allow the public
19584 modifier to be used in explicit interface implementations.
19586 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19587 override modifiers in method declarations in structs
19589 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
19591 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19592 integer or real overflow, report an error
19594 2002-07-02 Martin Baulig <martin@gnome.org>
19596 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19597 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19598 to tell the runtime about our newly created System.Object and
19599 System.ValueType types.
19601 2002-07-02 Miguel de Icaza <miguel@ximian.com>
19603 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19604 struct instead of Ldarg/Starg.
19606 2002-07-02 Martin Baulig <martin@gnome.org>
19608 * expression.cs (Indirection.Indirection): Call
19609 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19611 2002-07-02 Martin Baulig <martin@gnome.org>
19613 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19614 ValueType, call TypeManager.TypeToCoreType() on it.
19615 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19616 the OpCodes.Newarr argument.
19618 2002-07-02 Martin Baulig <martin@gnome.org>
19620 * expression.cs (Invocation.EmitCall): When compiling corlib,
19621 replace all calls to the system's System.Array type to calls to
19622 the newly created one.
19624 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19625 System.Array methods.
19626 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19627 from the system's System.Array type which must be replaced.
19629 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19631 * typemanager.cs: load unverifiable_code_ctor so we can build
19632 corlib using the correct type. Avoid using GetTypeCode() with
19634 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19635 TypeManager.object_type to allow building corlib.
19637 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19639 * ecore.cs: handle System.Enum separately in LoadFromPtr().
19641 2002-07-01 Martin Baulig <martin@gnome.org>
19643 * class.cs: Make the last change actually work, we need to check
19644 whether `ifaces != null' to avoid a crash.
19646 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19648 * class.cs: when we build structs without fields that implement
19649 interfaces, we need to add the interfaces separately, since there is
19650 no API to both set the size and add the interfaces at type creation
19653 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19655 * expression.cs: the dimension arguments to the array constructors
19656 need to be converted if they are a long.
19658 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19660 * class.cs: don't emit ldarg.0 if there is no parent constructor
19661 (fixes showstopper for corlib).
19663 2002-06-29 Martin Baulig <martin@gnome.org>
19665 MCS now compiles corlib on GNU/Linux :-)
19667 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19668 ie. check for MethodImplOptions.InternalCall.
19670 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19671 and TypeManager.attribute_type are null, so we must explicitly check
19672 whether parent is not null to find out whether it's an attribute type.
19673 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19674 and SetBuilder, not only if the property is neither abstract nor external.
19675 This is necessary to set the MethodImplOptions on the accessor methods.
19676 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19677 SetBuilder, see Property.Emit().
19679 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19680 populate "System.Object", "System.ValueType" and "System.Attribute" since
19681 they've already been populated from BootCorlib_PopulateCoreTypes().
19683 2002-06-29 Martin Baulig <martin@gnome.org>
19685 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19686 is the NullLiteral, we also need to make sure that target_type is not
19689 2002-06-29 Martin Baulig <martin@gnome.org>
19691 * rootcontext.cs (RootContext.ResolveCore): We must initialize
19692 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19693 before calling BootstrapCorlib_ResolveDelegate ().
19695 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19697 * statement.cs: fixed build-breaker. All tests passed ok.
19699 2002-06-27 Martin Baulig <martin@gnome.org>
19701 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19702 for System.Decimal when compiling corlib.
19704 2002-06-27 Martin Baulig <martin@gnome.org>
19706 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19707 switch blocks which contain nothing but a default clause.
19709 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
19711 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19713 2002-06-27 Martin Baulig <martin@gnome.org>
19715 * ecore.cs (PropertyExpr.PropertyExpr): Call
19716 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19718 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19719 is already a TypeBuilder.
19721 2002-06-27 Martin Baulig <martin@gnome.org>
19723 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19724 `target_type == TypeManager.array_type', not IsAssignableFrom() in
19725 the "from an array-type to System.Array" case. This makes it work
19726 when compiling corlib.
19728 2002-06-27 Martin Baulig <martin@gnome.org>
19730 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19731 non-static PropertyExpr, set its InstanceExpression. This makes
19732 the `ICollection.Count' property work in System/Array.cs.
19734 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
19736 * driver.cs: Made error handling more consistent. Errors now
19737 tracked by Report class, so many methods which used to return int
19738 now return void. Main() now prints success/failure and
19739 errors/warnings message.
19741 Renamed '--probe' compiler argument to '--expect-error'. Removed
19742 the magic number return values (123 and 124). Now, if the
19743 expected error occurs, the compiler exits with success (exit value
19744 0). If the compilation completes without seeing that particular
19745 error, the compiler exits with failure (exit value 1). The
19746 makefile in mcs/errors has been changed to handle the new behaviour.
19748 * report.cs: Made 'expected error' number a property and renamed
19749 it from 'Probe' to 'ExpectedError'.
19751 * genericparser.cs: Removed error handling support, since it is
19752 now all done by Report class.
19754 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19755 class, so parse() no longer returns an int.
19757 * namespace.cs: Use Report.Error instead of GenericParser.error
19759 2002-06-22 Miguel de Icaza <miguel@ximian.com>
19761 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19762 TypeContainer.AddOperator): At the front of the list put the
19763 explicit implementations, so they get resolved/defined first.
19765 2002-06-21 Miguel de Icaza <miguel@ximian.com>
19767 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19768 interface type is implemented by this TypeContainer. Used during
19769 explicit interface implementation.
19771 (Property.Define, Indexer.Define, Method.Define): Validate that
19772 the given interface in the explicit implementation is one of the
19773 base classes for the containing type.
19775 Also if we are explicitly implementing an interface, but there is
19776 no match in the pending implementation table, report an error.
19778 (Property.Define): Only define the property if we are
19779 not explicitly implementing a property from an interface. Use the
19780 correct name also for those properties (the same CSC uses,
19781 although that is really not needed).
19783 (Property.Emit): Do not emit attributes for explicitly implemented
19784 properties, as there is no TypeBuilder.
19786 (Indexer.Emit): ditto.
19788 Hiding then means that we do not really *implement* a pending
19789 implementation, which makes code fail.
19791 2002-06-22 Martin Baulig <martin@gnome.org>
19793 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19794 the return value of Object.GetType(). [FIXME: we need to do this whenever
19795 we get a type back from the reflection library].
19797 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19799 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19801 2002-06-20 Miguel de Icaza <miguel@ximian.com>
19803 * attribute.cs: Return null if we can not look up the type.
19805 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19806 the interface types found.
19808 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19809 interface types found.
19811 * typemanager.cs (GetInterfaces): Make this routine returns alll
19812 the interfaces and work around the lame differences between
19813 System.Type and System.Reflection.Emit.TypeBuilder in the results
19814 result for GetInterfaces.
19816 (ExpandInterfaces): Given an array of interface types, expand and
19817 eliminate repeated ocurrences of an interface. This expands in
19818 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19821 2002-06-21 Martin Baulig <martin@gnome.org>
19823 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19826 2002-06-21 Martin Baulig <martin@gnome.org>
19828 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
19829 and called with one of the core types, return the corresponding typebuilder for
19832 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19835 2002-06-21 Martin Baulig <martin@gnome.org>
19837 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19838 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19839 (Expression.ConvertReferenceExplicit): Likewise.
19841 * expression.cs (ElementAccess.DoResolve): Likewise.
19842 (ElementAccess.DoResolveLValue): Likewise.
19844 2002-06-10 Martin Baulig <martin@gnome.org>
19846 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19847 add the "value" parameter to the parameter list.
19849 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19852 2002-06-19 Miguel de Icaza <miguel@ximian.com>
19854 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19855 the argument to an int, uint, long or ulong, per the spec. Also
19856 catch negative constants in array creation.
19858 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19860 * class.cs: do not allow the same interface to appear twice in
19861 the definition list.
19863 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19865 * ecore.cs: don't use ldlen with System.Array.
19867 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19869 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19871 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19873 * modifiers.cs: produce correct field attributes for protected
19874 internal. Easy fix so miguel can work on ther harder stuff:-)
19876 2002-06-18 Miguel de Icaza <miguel@ximian.com>
19878 * pending.cs: New file. Move the code from class.cs here.
19879 Support clearning the pending flag for all methods (when not doing
19880 explicit interface implementation).
19882 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19884 * rootcontext.cs: added a couple more types needed to bootstrap.
19886 2002-06-17 Miguel de Icaza <miguel@ximian.com>
19888 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19889 constructor in the type, instead of any constructor in the type
19890 hierarchy. Thanks to Paolo for finding this bug (it showed up as
19891 a bug in the Mono runtime when applying the params attribute).
19893 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
19894 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19896 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
19898 * expression.cs (Unary.ResolveOperator): Use TypeManager
19899 to resolve the type.
19901 2002-06-13 Ravi Pratap <ravi@ximian.com>
19903 * cs-parser.jay (enum_member_declaration): Pass in the attributes
19906 * enum.cs (AddEnumMember): Add support to store the attributes associated
19907 with each member too.
19909 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19910 field builders too - this takes care of the enum member case.
19912 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
19914 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19915 address-of operator on both value types and pointers.
19917 2002-06-10 Martin Baulig <martin@gnome.org>
19919 * interface.cs (Interface.PopulateIndexer): Add the indexer's
19920 PropertyBuilder to the `property_builders' list.
19922 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19923 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19924 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
19925 find any indexers which are inherited from an interface.
19927 2002-06-09 Martin Baulig <martin@gnome.org>
19929 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19930 the same type as the constant if necessary. There's also a test-130.cs
19933 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19935 * typemanager.cs (TypeManager.ChangeType): Previously known as
19936 Enum.ChangeEnumType().
19938 2002-06-09 Martin Baulig <martin@gnome.org>
19940 * expression.cs (Cast.TryReduce): Added support for consts.
19942 2002-06-08 Ravi Pratap <ravi@ximian.com>
19944 * class.cs (Accessor): Hold attributes information so we can pass
19947 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19948 Modify to pass in attributes attached to the methods.
19950 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19952 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19953 to handle the Accessor kind :-)
19955 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19957 2002-06-08 Martin Baulig <martin@gnome.org>
19959 * expression.cs (Unary.TryReduceNegative): Added support for
19962 2002-06-08 Martin Baulig <martin@gnome.org>
19964 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19965 name can't be found in the `defined_names' - the caller will do a
19966 MemberLookup in this case and thus find methods in System.Enum
19967 such as Enum.IsDefined().
19969 2002-06-08 Martin Baulig <martin@gnome.org>
19971 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19972 Convert.ChangeType() which works with TypeBuilder created types.
19973 (Enum.LookupEnumValue, Enum.Define): Use it here.
19975 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19976 `TypeBuilder.BaseType != null' check.
19977 (TypeContainer.FindMembers): Only lookup parent members if we
19978 actually have a parent.
19979 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19980 (ConstructorInitializer.Resolve): Likewise.
19982 * interface.cs (Interface.FindMembers): Added
19983 `TypeBuilder.BaseType != null' check.
19985 * rootcontext.cs (RootContext.ResolveCore): Added
19986 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19987 classes_second_stage.
19989 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19990 debug_type and trace_type when compiling with --nostdlib.
19992 2002-06-07 Martin Baulig <martin@gnome.org>
19994 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19995 (AddField): Set it to true when adding a non-static field.
19996 (DefineType): Use `have_nonstatic_fields' to find out whether we
19997 have non-static fields, not `Fields != null'.
19999 2002-06-02 Miguel de Icaza <miguel@ximian.com>
20001 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
20002 dereferencing a null on the static-field code path)
20004 2002-05-30 Martin Baulig <martin@gnome.org>
20006 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
20007 to take command line arguments. Use reflection to call the new
20008 custom `Initialize' function on the symbol writer and pass it the
20009 command line arguments.
20011 * driver.cs (--debug-args): New command line argument to pass command
20012 line arguments to the symbol writer.
20014 2002-05-28 Miguel de Icaza <miguel@ximian.com>
20016 * assign.cs (DoResolve): Forgot to do the implicit conversion to
20017 the target type for indexers and properties. Thanks to Joe for
20020 2002-05-27 Miguel de Icaza <miguel@ximian.com>
20022 * typemanager.cs (MethodFlags): returns the method flags
20023 (Obsolete/ShouldIgnore) that control warning emission and whether
20024 the invocation should be made, or ignored.
20026 * expression.cs (Invocation.Emit): Remove previous hack, we should
20027 not do this on matching a base type, we should do this based on an attribute
20029 Only emit calls to System.Diagnostics.Debug and
20030 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
20031 on the command line.
20033 * rootcontext.cs: Global settings for tracing and debugging.
20035 * cs-tokenizer.cs (define): New utility function to track
20036 defines. Set the global settings for TRACE and DEBUG if found.
20038 2002-05-25 Ravi Pratap <ravi@ximian.com>
20040 * interface.cs (Populate*): Pass in the TypeContainer as well as
20041 the DeclSpace as parameters so that we can create EmitContexts and
20042 then use that to apply attributes etc.
20044 (PopulateMethod, PopulateEvent, PopulateProperty)
20045 (PopulateIndexer): Apply attributes everywhere.
20047 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
20050 (ApplyAttributes): Update accordingly.
20052 We now apply interface attributes for all members too.
20054 2002-05-26 Miguel de Icaza <miguel@ximian.com>
20056 * class.cs (Indexer.Define); Correctly check if we are explicit
20057 implementation (instead of checking the Name for a ".", we
20058 directly look up if the InterfaceType was specified).
20060 Delay the creation of the PropertyBuilder.
20062 Only create the PropertyBuilder if we are not an explicit
20063 interface implementation. This means that explicit interface
20064 implementation members do not participate in regular function
20065 lookups, and hence fixes another major ambiguity problem in
20066 overload resolution (that was the visible effect).
20068 (DefineMethod): Return whether we are doing an interface
20071 * typemanager.cs: Temporary hack until we get attributes in
20072 interfaces (Ravi is working on that) and we get IndexerName
20073 support in interfaces.
20075 * interface.cs: Register the indexers as properties.
20077 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
20078 warning, I have verified that this is a bug in the .NET runtime
20079 (JavaScript suffers of the same problem).
20081 * typemanager.cs (MemberLookup): When looking up members for
20082 interfaces, the parent of an interface is the implicit
20083 System.Object (so we succeed in searches of Object methods in an
20084 interface method invocation. Example: IEnumerable x; x.ToString
20087 2002-05-25 Miguel de Icaza <miguel@ximian.com>
20089 * class.cs (Event): Events should also register if they do
20090 implement the methods that an interface requires.
20092 * typemanager.cs (MemberLookup); use the new GetInterfaces
20095 (GetInterfaces): The code used to lookup interfaces for a type is
20096 used in more than one place, factor it here.
20098 * driver.cs: Track the errors at the bottom of the file, we kept
20101 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
20102 instance if the method we are calling is static!
20104 2002-05-24 Miguel de Icaza <miguel@ximian.com>
20106 * attribute.cs (ApplyAttributes): Make this function filter out
20107 the IndexerName attribute (as that attribute in reality is never
20108 applied) and return the string constant for the IndexerName
20111 * class.cs (TypeContainer.Emit): Validate that all the indexers
20112 have the same IndexerName attribute, and if so, set the
20113 DefaultName attribute on the class.
20115 * typemanager.cs: The return value might contain other stuff (not
20116 only methods). For instance, consider a method with an "Item"
20117 property and an Item method.
20119 * class.cs: If there is a problem with the parameter types,
20122 2002-05-24 Ravi Pratap <ravi@ximian.com>
20124 * ecore.cs (ImplicitConversionExists): Wrapper function which also
20125 looks at user defined conversion after making a call to
20126 StandardConversionExists - we need this for overload resolution.
20128 * expression.cs : Update accordingly the various method calls.
20130 This fixes 2 bugs filed against implicit user defined conversions
20132 2002-05-22 Miguel de Icaza <miguel@ximian.com>
20134 * statement.cs: Track the result of the assignment.
20136 2002-05-21 Miguel de Icaza <miguel@ximian.com>
20138 * expression.cs (MemberAccess): Improved error reporting for
20139 inaccessible members.
20141 2002-05-22 Martin Baulig <martin@gnome.org>
20143 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
20144 itself with debugging support.
20146 2002-05-22 Martin Baulig <martin@gnome.org>
20148 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
20149 Removed, this isn't needed anymore.
20151 2002-05-20 Martin Baulig <martin@gnome.org>
20153 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
20154 be underlying type for an enum.
20156 2002-05-20 Miguel de Icaza <miguel@ximian.com>
20158 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
20159 that splits out the loading of just the core types.
20161 * rootcontext.cs (ResolveCore): Split the struct resolution in
20162 two, so we can load the enumeration underlying types before any
20165 * expression.cs (Is): Bandaid until we fix properly Switch (see
20166 bug #24985 for details).
20168 * typemanager.cs (ImplementsInterface): The hashtable will contain
20169 a null if there are no interfaces implemented.
20171 2002-05-18 Miguel de Icaza <miguel@ximian.com>
20173 * cs-parser.jay (indexer_declarator): It is fine to have array
20176 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20178 * typemanager.cs: (RegisterBuilder): New function used to register
20179 TypeBuilders that implement interfaces. Since
20180 TypeBuilder.GetInterfaces (as usual) does not work with lame
20182 (AddUserType): register interfaces.
20184 (ImplementsInterface): Use the builder_to_ifaces hash if we are
20185 dealing with TypeBuilder. Also, arrays are showing up as
20186 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
20187 methods can not be invoked on them!
20189 * ecore.cs (ExplicitReferenceConversionExists): Made public.
20190 (ImplicitReferenceConversionExists): Split out from
20191 StandardConversionExists.
20193 * expression.cs (As): We were only implementing one of the three
20194 cases for the as operator. We now implement them all.
20195 (Is): Implement the various other cases for Is as well.
20197 * typemanager.cs (CACHE): New define used to control if we want or
20198 not the FindMembers cache. Seems to have a negative impact on
20199 performance currently
20201 (MemberLookup): Nested types have full acess to
20202 enclosing type members
20204 Remove code that coped with instance/static returns for events, we
20205 now catch this in RealFindMembers.
20207 (RealFindMembers): only perform static lookup if the instance
20208 lookup did not return a type or an event.
20210 2002-05-17 Miguel de Icaza <miguel@ximian.com>
20212 * assign.cs (CompoundAssign): We pass more semantic information
20213 now to Compound Assignments than we did before: now we have all
20214 the information at hand, and now we resolve the target *before* we
20215 do the expression expansion, which allows the "CacheValue" method
20216 to have the effect we intended (before, a [x] += 1 would generate
20217 two differen ArrayAccess expressions from the ElementAccess,
20218 during the resolution process).
20220 (CompoundAssign.DoResolve): Resolve target and original_source here.
20222 2002-05-16 Miguel de Icaza <miguel@ximian.com>
20224 * expression.cs (ArrayAccess): dropped debugging information.
20226 * typemanager.cs: Small bug fix: I was always returning i_members,
20227 instead of one of i_members or s_members (depending on which had
20230 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
20231 method is invoked before any code generation takes place, and it
20232 is a mechanism to inform that the expression will be invoked more
20233 than once, and that the method should use temporary values to
20234 avoid having side effects
20236 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
20238 * ecore.cs (Expression.CacheTemporaries): Provide empty default
20241 * expression.cs (Indirection, ArrayAccess): Add support for
20242 CacheTemporaries in these two bad boys.
20244 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
20245 ldobj or ldind_ref.
20246 (StoreFromPtr): Handle stobj as well.
20248 * expression.cs (UnaryMutator): Share more code.
20250 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
20251 down: I was not tracking the Filter function as well, which
20252 was affecting the results of the cache.
20254 2002-05-15 Miguel de Icaza <miguel@ximian.com>
20256 * attribute.cs: Remove the hack to handle the CharSet property on
20259 2002-05-14 Miguel de Icaza <miguel@ximian.com>
20261 * attribute.cs (DoResolve): More uglyness, we now only try to
20262 resolve the attribute partially, to extract the CharSet
20263 information (only if we are a StructLayout attribute). Otherwise
20265 (GetExtraTypeInfo): Add some code to conditionally kill in the
20266 future this. I am more and more convinced that the .NET
20267 framework has special code to handle the attribute setting on
20270 * expression.cs (IsParamsMethodApplicable): Revert my previous
20271 foreach change here, it was wrong.
20273 2002-05-13 Miguel de Icaza <miguel@ximian.com>
20275 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
20276 (pp_expr): do not abort on unknown input, just return.
20277 (eval): abort if there are pending chars.
20279 * attribute.cs (Attribute.Resolve): Positional parameters are
20280 optional. Deal with that case.
20282 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
20283 the Ansi/Unicode/Auto information for the type.
20285 (TypeContainer.DefineType): instantiate the EmitContext here, as
20286 we will be using it during the type definition (to resolve
20287 attributes) and during the emit phase.
20289 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
20290 to pull type information out of the attributes
20292 (Attribute.Resolve): track the constructor builder, and allow for
20293 multiple invocations (structs and classes will use this).
20295 * ecore.cs (MemberLookupFinal): new version with all the
20296 parameters customizable.
20298 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
20299 constructors. Return if the result value is null (as the error
20300 would have been flagged already by MemberLookupFinal)
20302 Do not allow instances of abstract classes or interfaces to be
20305 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
20306 We have to compare the assembly property here when dealing with
20307 FamANDAssem and Assembly access modifiers, because we might be
20308 creating an assembly from *modules* (that means that we are not
20309 getting TypeBuilders for types defined in other modules that are
20310 part of this assembly).
20312 (Method.Emit): If the method is marked abstract and has a body,
20315 (TypeContainer.DefineMembers): If both the defined member and the
20316 parent name match are methods, then do not emit any warnings: let
20317 the Method.Define routine take care of flagging warnings. But if
20318 there is a mismatch (method overrides something else, or method is
20319 overriwritten by something, then emit warning).
20321 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
20322 set to null, this means `do not check for the return type on the
20325 (Method.Define): set the return type for the method signature to
20326 null, so that we get methods with the same name and parameters and
20327 different return types. This is used to flag warning 114 (you are
20328 hiding a method, and you probably want to use the new/override
20331 * typemanager.cs (MemberLookup): Implemented proper access
20332 control, closing a long standing set of bug reports. The problem
20333 was that the Framework only has two bits: Public and NonPublic,
20334 and NonPublic includes private and protected methods, but we need
20335 to enforce the FamANDAssem, FamOrAssem and Family.
20337 2002-05-11 Miguel de Icaza <miguel@ximian.com>
20339 * statement.cs (GotoCase): Return true: Ammounts to giving up
20340 knowledge on whether we return or not, and letting the other case
20341 be responsible for it.
20343 2002-05-10 Miguel de Icaza <miguel@ximian.com>
20345 * driver.cs: Do not load directories for each file processed, only
20346 do it if there is a pattern.
20348 * ecore.cs: Report readonly assigns here as well, as we might have
20349 been resolved only by MemberAccess.
20351 (SimpleName.SimpleNameResolve): Also be useful for LValue
20352 resolution. We need this to propagate assign to local readonly variables
20354 * typemanager.cs: Use a ptrhashtable for the criteria, because we
20355 do not want to reuse potential criteria memory.
20357 * class.cs (MyEventBuilder): Set reflected_type;
20359 * ecore.cs (Constantify): Added support for constifying bools.
20361 (RootContext.LookupType): Added a cache for values looked up in
20362 the declaration space.
20364 * typemanager.cs (FindMembers): Now is a front-end to
20365 RealFindMembers, and provides a two-level hashtable-based cache to
20368 15% performance improvement: from 22.5 to 19.2 seconds.
20370 * expression.cs (IsParamsMethodApplicable): use foreach.
20371 (Invocation.DoResolve): ditto.
20372 (New.DoResolve): ditto.
20373 (ArrayCreation.DoResolve): ditto.
20375 * ecore.cs (FindMostEncompassingType): use foreach.
20377 * delegate.cs (NewDelegate.DoResolve): Use foreach
20379 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
20380 (RemoveMethods): use foreach.
20382 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
20383 nested foreach statements instead of for, and also break out of
20384 the inner loop once a match is found.
20386 (Invocation.OverloadResolve): Use foreach, simplify the code.
20388 2002-05-08 Miguel de Icaza <miguel@ximian.com>
20390 * cfold.cs (BinaryFold): During an enumeration evaluation context,
20391 we actually unwrap the expression to allow for extra information
20394 * expression.cs: Use Shr_Un on unsigned operations.
20396 2002-05-08 Ravi Pratap <ravi@ximian.com>
20398 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
20399 applicable operators was not being considered correctly. This closes
20400 the bug Miguel reported.
20402 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
20404 * attribute.cs: check that the type derives from System.Attribute
20405 and report the correct error in that case (moved the duplicate code to
20406 its own method, too).
20408 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
20410 * attribute.cs: lookup attribute type name as the spec says: first the
20411 bare attribute name and then name + "Attribute" (nant compiles with
20412 mcs after this fix).
20414 2002-05-07 Miguel de Icaza <miguel@ximian.com>
20416 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
20417 Because of the way we parse things, we should try to see if a
20418 UIntConstant can fit in an integer.
20420 2002-05-07 Ravi Pratap <ravi@ximian.com>
20422 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
20423 when we are in an explicit context.
20425 (ConvertReferenceExplicit): When converting from Iface type S to Class
20426 T make sure the rules are implemented as an OR.
20428 * parameter.cs (ParameterType): Make it a property for now although the
20429 purpose really isn't anything immediate.
20431 * expression.cs (Is*Applicable): Do better checking on the parameter type
20432 of a ref/out parameter. The ones from the system assemblies are already
20433 marked with the correct type so we don't need to do any correction.
20435 * ecore.cs (StandardConversionExists): Conversion from Interface types to
20436 the object type is standard too so include that.
20438 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20440 * ecore.cs (StandardConversionExists): Augment with missing code:
20441 deal with IntConstant, LongConstants and Enumerations.
20443 * assign.cs: Report the error, instead of failing silently
20445 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
20446 typecontainer that they are declared, because the
20447 typecontainer/namespace will have the list of using clauses that
20448 need to be applied.
20450 Assembly Attributes were escaping the normal registration
20453 (EmitCode): Apply attributes within an EmitContext that represents
20454 the container they were declared on.
20456 * cs-parser.jay: Track bases for structs. How did I get this wrong?
20458 2002-05-06 Ravi Pratap <ravi@ximian.com>
20460 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
20461 Revamp completely - make much cleaner as we now operate only
20464 (FindMostSpecificSource, FindMostSpecificTarget): New methods
20465 to implement the logic detailed in the spec more correctly.
20467 (UserDefinedConversion): Update accordingly.
20469 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20471 * statement.cs: Return flow analysis information up.
20473 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
20476 (token): Do not consume an extra character before calling
20479 2002-05-06 Piers Haken <piersh@friskit.com>
20481 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
20483 2002-05-06 Miguel de Icaza <miguel@ximian.com>
20485 * class.cs (Constructor.Emit): Set the IsStatic flag in the
20486 EmitContext during the instance constructor initializer
20487 resolution, to stop access to instance variables.
20489 This is mandated by the spec, last paragraph of the `constructor
20490 initializers' section.
20492 2002-05-05 Miguel de Icaza <miguel@ximian.com>
20494 * cs-parser.jay, class.cs (Accessor): new class used to represent
20495 an accessor (get or set). In the past we used `null' to represent
20496 a missing accessor. But this is ambiguous because there was no
20497 way to tell in abstract indexers/properties if one of them was
20500 Now there is a way of addressing that.
20502 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
20503 instead of FindMembers.
20505 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
20506 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
20508 * attribute.cs: Treat indexers and properties as the same in terms
20509 of applying attributes
20511 * ecore.cs (FindMostEncompassedType): Use statically initialized
20512 EmptyExpressions()s like we do elsewhere to avoid creating useless
20513 objects (and we take this out of the tight loop).
20515 (GetConversionOperators): Move the code to extract the actual
20516 operators to a separate routine to clean things up.
20518 2002-05-04 Miguel de Icaza <miguel@ximian.com>
20520 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20521 events are always registered FieldBuilders.
20523 * class.cs (FieldBase): New class shared by Fields
20525 * delegate.cs: If we are a toplevel delegate, use our full name.
20526 If we are a nested delegate, then only use our tail name.
20528 2002-05-02 Ravi Pratap <ravi@ximian.com>
20530 * expression.cs (IsApplicable): Ensure that we add the "&" to
20531 ref/out types before comparing it with the type of the argument.
20533 (IsParamsMethodApplicable): Ditto.
20535 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
20538 * delegate.cs : Handle the case when we have more than one applicable
20539 method. Flag an error only when we finish checking all.
20541 2002-05-02 Miguel de Icaza <miguel@ximian.com>
20543 * expression.cs: Add support for boolean static initializers.
20545 2002-05-01 Miguel de Icaza <miguel@ximian.com>
20547 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20549 * parameter.cs (ComputeParameterTypes,
20550 ComputeAndDefineParameterTypes): Better error handling: now we
20551 clear the `types' cache if we fail during any of the type lookups.
20552 We also return the status code correctly to our caller
20554 * delegate.cs: If we fail to define a delegate, abort the extra
20557 * expression.cs (Binary.ResolveOperator): for
20558 operator==(object,object) and operator !=(object, object) we also
20559 have to verify that there is an implicit conversion from one to
20562 (ArrayAccess.DoResolve): Array Access can operate on
20565 2002-04-30 Miguel de Icaza <miguel@ximian.com>
20567 * assign.cs (CompoundAssign): A new class used as a "flag" that
20568 the assignment actually is happening as part of a compound
20569 assignment operator.
20571 During compound assignment, a few new rules exist to enable things
20578 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20579 to the type of x) if y is implicitly convertible to the type of x,
20580 and the operator is a builtin operator and the return type of the
20581 operator is explicitly convertible to the type of x.
20583 * rootcontext.cs: Reset warning level to 2. 4 catches various
20584 "interesting" features in mcs, we must clean this up at some
20585 point, but currently am trying to kill other bugs ;-)
20587 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20588 in container classes as well.
20590 * expression.cs (Binary.ResolveOperator): Handle string case
20591 before anything else (as operator overloading does emit an error
20592 before doing anything else).
20594 This code could go away when we move to a table driven model, but
20595 i could not come up with a good plan last night.
20597 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
20599 * typemanager.cs (CSharpName): reimplementation using regex.
20600 * class.cs: added null check for fields in Emit
20601 * rootcontext.cs: set warninglevel to 4
20603 2002-04-29 Miguel de Icaza <miguel@ximian.com>
20605 * typemanager.cs (CSharpName): reimplemented with Lupus
20608 2002-04-28 Miguel de Icaza <miguel@ximian.com>
20610 * statement.cs (If): correclty implement Resolve, because we were
20611 not catching sem errors in there. The same process is needed
20613 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20616 (Statement.Warning_DeadCodeFound): Factorize code.
20617 (While): Report dead code here too.
20619 (Statement): Added Resolve virtual method to allow
20620 for resolution split from the emit code.
20622 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20624 * statement.cs (EmitBoolExpression): No longer try to resolve the
20626 (MakeBoolean): New utility function that resolve, implicitly
20627 converts to boolean and tags the expression.
20630 (If, Do): Implement dead code elimination.
20631 (While): Implement loop inversion
20633 (Do, While, For, If): Resolve the expression prior to calling our
20636 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
20639 - added method Report28 (warning: program has more than one entry point)
20640 - added method IsEntryPoint, implements paragraph 10.1 of the spec
20641 - modified method Method.Define, the part at the end of the method
20643 * rootcontext.cs: added static public Location EntryPointLocation;
20645 * ../errors/cs0028.cs : Add test case for the above warning.
20648 - modified method CSharpName to allow arrays of primitive type to
20649 be printed nicely (e.g. instead of System.Int32[][] it now prints
20651 - added method CSharpSignature: returns the signature of a method
20652 in string format to be used in reporting errors, warnings, etc.
20654 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20657 2002-04-26 Ravi Pratap <ravi@ximian.com>
20659 * delegate.cs (Define): Fix extremely silly bug where I was
20660 setting the type of the 'object' parameter of the BeginInvoke
20661 method to System.IAsyncResult instead of System.Object ;-)
20663 2002-04-26 Miguel de Icaza <miguel@ximian.com>
20665 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20668 (Constructor.Emit): return if we fail to initialize the
20669 constructor. Another door closed!
20671 * expression.cs (New.DoResolve): Improve error message (from -6 to
20672 1501). Use DeclaredOnly lookup to find the exact constructor.
20674 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20675 loop. This is useful.
20677 * cs-parser.jay: Adjust the default parameters so that destructors
20678 have the proper signature.
20680 2002-04-26 Martin Baulig <martin@gnome.org>
20682 * driver.cs (LoadAssembly): If `assembly' contains any characters
20683 which are only valid in path names and not in assembly names
20684 (currently slash, backslash and point), use Assembly.LoadFrom ()
20685 instead of Assembly.Load () on the `assembly' (before iteration
20686 over the link_paths).
20688 2002-04-26 Martin Baulig <martin@gnome.org>
20690 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20692 2002-04-25 Miguel de Icaza <miguel@ximian.com>
20694 * class.cs (Property): use the new typemanager.MemberLookup
20696 (TypeContainer.MemberLookup): Implement using the
20697 TypeManager.MemberLookup now.
20699 * typemanager.cs: Make MemberLookup a function of the TypeManager,
20700 and return MemberInfos, so that these can be used without an
20701 EmitContext (what we had before).
20703 2002-04-24 Miguel de Icaza <miguel@ximian.com>
20705 * expression.cs: Fix the case where the argument to params if the
20706 type of the params. I omitted handling this before. Fixed
20708 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20710 * driver.cs: Call BootCorlib_PopulateCoreType
20712 * class.cs (Property.CheckBase): Check for properties only, not
20715 * interface.cs: Temporary hack: try/catch around the
20716 CustomAttributeBuilder, because I am getting an exception that I
20719 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20720 types whose definitions are required to be there (attributes are
20721 defined before standard types).
20723 Compute definitions as we boot the various types, as they are used
20724 immediately (value_type class will need object_type, but if we do
20725 not initialize object_type, we will pass a null, which will let
20726 the runtime pick the System.Object from the existing corlib, which
20727 is not what we want).
20729 2002-04-22 Patrik Torstensson <totte@labs2.com>
20731 * cs-tokenizer.cs: fixed a number of trim() issues.
20733 2002-04-22 Ravi Pratap <ravi@ximian.com>
20735 * expression.cs (Argument.Type): Ensure that we return the correct
20736 type when we have out or ref parameters [in which case we
20739 2002-04-22 Miguel de Icaza <miguel@ximian.com>
20741 * class.cs (Property, Indexer): Allow extern modifier in there.
20743 * typemanager.cs (InitBaseTypes): Initializes object_type and
20744 value_type, since those will be used early on during the bootstrap
20745 process to compile corlib.
20747 (InitCoreTypes): Move code from here to InitBaseTypes.
20749 2002-04-21 Miguel de Icaza <miguel@ximian.com>
20751 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20752 single-dimension arrays as using the ldlen opcode.
20754 Daniel Lewis discovered this optimization.
20756 * typemanager.cs: Add signature for System.Array::get_Length
20758 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20760 * statement.cs: report the error when the foreach does not apply to an
20761 array nor a collection.
20763 2002-04-19 Miguel de Icaza <miguel@ximian.com>
20765 * expression.cs: Add implicit conversions to the operator ~.
20767 * constant.cs (DecimalConstant.Emit): Emit decimal value.
20769 * typemanager.cs: Locate the decimal constructor.
20771 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20773 * attribute.cs: use the new property of TypeOf.
20774 * expression.cs: added 'get' property around typearg.
20776 These changes fix a build breaker reported by NickD. Is this the
20777 correct way to fix? If not, please, revert my changes and make it
20780 2002-04-17 Miguel de Icaza <miguel@ximian.com>
20782 * attribute.cs: Add support for typeof in attribute invocations.
20783 I am not sure that this is right though.
20785 2002-04-14 Duncan Mak <duncan@ximian.com>
20787 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20788 Binary.Operator.Division case.
20790 2002-04-13 Ravi Pratap <ravi@ximian.com>
20792 * class.cs (DefineType): Ensure that we do a proper check on
20793 attribute types and also register it with the TypeManager.
20795 (TypeContainer.Targets): The default for attribute types is
20796 AttributeTargets.All.
20798 * attribute.cs (ApplyAttributes): Registering the attribute type
20799 is done elsewhere, not when we discover we have a Usage attribute.
20801 2002-04-12 Ravi Pratap <ravi@ximian.com>
20803 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20804 and get rid of is_delegate parameter.
20806 * everywhere : update.
20808 2002-04-12 Ravi Pratap <ravi@ximian.com>
20810 * cs-parser.jay (compilation_unit): Revamp completely to use
20811 some new ideas that I got from Rhys' grammar to solve the problems
20812 with assembly level attributes.
20814 (outer_declaration): New grammar production.
20816 (attribute_sections): Add.
20818 (opt_attributes): Base on attribute_sections
20820 (namespace_declaration): Allow opt_attributes to tackle the case
20821 when we have assembly level attributes - we are clever in this
20824 * attribute.cs (ApplyAttributes): Do not worry about assembly
20825 attributes in the non-global context.
20827 * rootcontext.cs (AddGlobalAttributes): Go back to using this
20828 instead of SetGlobalAttributes.
20830 * class.cs, rootcontext.cs : Ensure we define and generate
20831 attribute types before anything else.
20833 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20834 and flag the new error -20 for the case when the attribute type
20835 does not have valid targets specified. csc does not catch this.
20837 * ../errors/errors.txt : update for error # -20
20839 2002-04-11 Ravi Pratap <ravi@ximian.com>
20841 * support.cs (InternalParameters.ParameterModifier): Do some null
20842 checking and return sane values.
20844 * class.cs (Method.Define): If we are a PInvoke method, ensure
20845 that we are static and extern. Report error # 601
20847 * ../errors/cs0601.cs : Add test case for the above error.
20849 2002-04-07 Ravi Pratap <ravi@ximian.com>
20851 * rootcontext.cs (attribute_types): We need to keep type of
20852 all attribute types separately and emit code for them first.
20854 (RegisterAttribute) : Implement.
20856 * class.cs (DefineType): Check if the current Type is a custom
20857 attribute type and register it accordingly.
20859 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20860 adding the first attribute twice and rename to
20862 (SetGlobalAttributes): this.
20864 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20867 * attribute.cs (ApplyAttributes): Take an additional argument telling us
20868 if we are processing global arguments. Hmm, I am unsure of this.
20870 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20872 * expression.cs: added static array of strings to avoid calling
20873 Enum.ToString () for Operator in Binary. Significant recover of
20876 2002-04-10 Miguel de Icaza <miguel@ximian.com>
20878 * class.cs (FindMembers): Allow the Builders of the various
20879 members to be null. If they are skip them. This only happens
20880 during the PInvoke declaration.
20882 2002-04-09 Miguel de Icaza <miguel@ximian.com>
20884 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20885 failure, so we do not keep going afterwards.
20887 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20888 wanted to pass `false' as the `is_delegate' argument. If this is
20889 the case, why not use delegate_type == null to mean `is_delegate =
20890 false' and anything else as is_delegate = true.
20892 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
20894 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20895 code for the section, not the beginning of the tests.
20897 2002-04-08 Miguel de Icaza <miguel@ximian.com>
20899 * cfold.cs: Handle operator + (Enum x, Underlying x)
20901 * expression.cs (Binary): same. Warn about errors where we have
20902 Enum/Enum in operator + as well.
20904 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
20907 - added support for switch(bool)
20908 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20909 - add TableSwitchEmit() to handle table-based switch statements
20911 2002-04-05 Ravi Pratap <ravi@ximian.com>
20913 * expression.cs (Invocation.OverloadResolve): Factor out code which
20914 does parameter compatibility checking with arguments so that we can
20915 re-use the code even from Delegate.VerifyApplicability
20917 (VerifyArgumentsCompat): Move above code here.
20919 * delegate.cs (VerifyApplicability): Get rid of duplicate code
20920 and instead make a call to the above method.
20922 2002-03-31 Ravi Pratap <ravi@ximian.com>
20924 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20925 We use it to keep track of classes which are attribute types.
20927 2002-04-02 Miguel de Icaza <miguel@ximian.com>
20929 * delegate.cs (Delegate.Define): Correctly define the types in the
20930 presence of fixed and array parameters.
20932 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20935 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20936 include NonPublic after the first iteration.
20938 * class.cs (Indexer.CheckBase): Only check if both parents are
20941 * cs-parser.jay (accessor_body): If empty, set to null.
20943 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20944 same code path here to resolve constants names that we did have in
20945 MemberAccess.DoResolve. There is too much code duplicated here.
20947 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20949 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20951 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20954 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20955 tokens, numbers and strings.
20957 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20960 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20961 asyncronous parameters and the regular parameters.
20963 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20964 specify the target directory.
20966 * expression.cs: (This.DoResolve): Simplify
20967 (As.Emit): Optimize, do not generate IsInst if the expression is
20968 always of the given type.
20970 (Is.DoResolve): Bug fix, we were reporting both always/never for
20973 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20974 creating too many unnecessary arrays.
20976 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20978 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20979 fields instead of rolling our own initializer. Takes care of all
20980 implicit conversions, and drops unnecessary static checks/argument.
20982 2002-03-31 Dick Porter <dick@ximian.com>
20984 * driver.cs: use the GetDirectories() return values properly, and
20985 use "/" as path separator.
20987 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20989 * expression.cs (Unary): Optimize - - expr into expr.
20990 (Binary): Optimize a + (-b) into a -b.
20992 * codegen.cs (CodeGen): Made all methods static.
20994 2002-03-29 Miguel de Icaza <miguel@ximian.com>
20998 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20999 TypeBuilder property.
21001 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
21004 * tree.cs: Removed the various RecordXXXX, and replaced with a
21005 single RecordDecl. Removed all the accessor methods, and just
21006 left a single access point Type
21008 * enum.cs: Rename DefineEnum to DefineType.
21010 * decl.cs: New abstract method `DefineType' used to unify the
21011 Defines for Enumerations, Interfaces, TypeContainers and
21014 (FindType): Moved LookupInterfaceOrClass here. Moved the
21015 LookupBaseClasses method that used to live in class.cs and
21016 interface.cs here, and renamed to FindType.
21018 * delegate.cs: Implement DefineType. Take advantage of the
21019 refactored pattern for locating the parent builder without taking
21020 the parent_builder argument (which we know does not work if we are
21021 nested, and triggering a toplevel definition).
21023 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21025 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
21026 accessibility of a member has changed during override and report
21029 * class.cs (Method.Define, Property.Define): Only complain on
21030 overrides if the method is private, any other accessibility is
21031 fine (and since we just checked the permission is the same, we are
21034 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
21035 and elif are processed always. The other pre-processing
21036 directives are only processed if we are "taking" the path
21038 2002-03-29 Martin Baulig <martin@gnome.org>
21040 * class.cs (Method.Emit): Only emit symbolic debugging info if the
21041 current location is not Null.
21043 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
21044 a separate method so we can profile it.
21046 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
21047 `span.Seconds' are just seconds, but no minutes or hours.
21048 (MainDriver): Profile the CodeGen.SaveSymbols calls.
21050 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21052 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
21053 Remove the gratuitous set of Final:
21055 // If an interface implementation, then we can set Final.
21056 if (((flags & MethodAttributes.Abstract) == 0) &&
21057 implementing.DeclaringType.IsInterface)
21058 flags |= MethodAttributes.Final;
21060 I do not know what I was smoking when I used that.
21063 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
21064 step into fixing the name resolution issues for delegates and
21065 unifying the toplevel name resolution.
21067 2002-03-28 Martin Baulig <martin@gnome.org>
21069 * class.cs (Method.Emit): If we have a symbol writer, call its
21070 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
21071 tell it about the current method.
21073 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
21074 writer that we're going to emit the first byte of IL code for a new
21075 statement (a new source line).
21076 (EmitContext.EmitTopBlock): If we have a symbol writer, call
21077 EmitContext.Mark() before emitting any code.
21079 * location.cs (SymbolDocument): Return null when we're Null.
21081 * statement.cs (Statement): Moved the `Location loc' variable here.
21082 (Statement.EmitBoolExpression): If we have a symbol writer, call
21083 ec.Mark() before emitting any code to tell it that we're at the
21084 beginning of a new statement.
21085 (StatementExpression): Added `Location' argument to the constructor.
21086 (Block): Added public readonly variable `StartLocation' and public
21087 variable `EndLocation'. The latter is to be set using SetEndLocation().
21088 (Block): Added constructor which takes a start and end location.
21089 (Block.SetEndLocation): New method. This sets the end location.
21090 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
21091 local variables we create.
21092 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
21093 each statement and do also mark the begin and end of the block.
21095 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
21096 tell it the current lexer.Location, use Location.Null for the end of the
21098 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
21099 current block, set its end location using SetEndLocation().
21100 (statement_expression): StatementExpression constructor now takes the
21101 lexer.Location as additional argument.
21102 (for_statement, declare_local_variables): Likewise.
21103 (declare_local_variables): When creating a new implicit block, use the
21104 new Block constructor and pass it the lexer.Location.
21106 2002-03-28 Miguel de Icaza <miguel@ximian.com>
21108 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
21109 members also on the parent interfaces recursively.
21111 2002-03-27 Miguel de Icaza <miguel@ximian.com>
21113 * report.cs: Use new formats, since Gonzalo finished the missing
21116 * expression.cs (Binary.ResolveOperator): added missing operator|
21117 operator& and operator^ for bool/bool.
21119 * cs-parser.jay: CheckDef now takes a Location argument that is
21120 used to report errors more precisly (instead of reporting the end
21121 of a definition, we try to track something which is a lot closer
21122 to the source of the problem).
21124 * cs-tokenizer.cs: Track global token use, so we can properly flag
21125 the use of #define/#undef after the first token has been seen.
21127 Also, rename the reportXXXX to Error_DescriptiveName
21129 * decl.cs (DeclSpace.IsTopLevel): Move property here from
21130 TypeContainer, so that Enum and Interface can use this too.
21132 * class.cs (TypeContainer.LookupInterfaceOrClass,
21133 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
21134 `builder' argument. Typically this was used to pass the parent
21135 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
21138 The problem is that a nested class could trigger the definition of
21139 a toplevel class, and the builder would be obviously wrong in that
21142 So we drop this argument, and we compute dynamically the
21143 TypeBuilder/ModuleBuilder (the correct information was available
21144 to us anyways from DeclSpace.Parent)
21146 * interface.cs (Interface.DefineInterface): Drop builder
21147 parameter cleanup like class.cs
21149 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
21152 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
21155 (Try.Emit): Propagate the returns value from the statement.
21157 (Return.Emit): Even if we are leavning
21159 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
21161 * modifiers.cs: Fix the computation of MethodAttributes flags.
21163 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
21165 * driver.cs: allow compilation of files that start with '/'.
21166 Add a default case when checking the argument of --target.
21168 2002-03-25 Miguel de Icaza <miguel@ximian.com>
21170 * interface.cs: Implement the same search algorithm for types in
21171 the interface code.
21173 * delegate.cs: Do not allow multiple definition.
21175 * Recovered ChangeLog that got accidentally amputated
21177 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
21179 * rootcontext.cs: Load manually enum to allow core classes to
21180 contain enumerations.
21182 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
21183 Update to new static methods in TypeManager.
21185 * typemanager.cs (GetMethod, GetConstructor): Use our
21186 implementation of FindMembers to find the members, since during
21187 corlib compilation, the types are TypeBuilders and GetMethod and
21188 GetConstructor do not work.
21190 Make all methods in TypeManager static.
21192 (InitCodeHelpers): Split the functionality from
21193 the InitCodeTypes function.
21195 * driver.cs: Call InitCodeHelpers after we have populated the
21198 * cs-parser.jay (delegate_declaration): we did not used to compute
21199 the delegate name correctly for void delegates.
21201 2002-03-24 Miguel de Icaza <miguel@ximian.com>
21203 * rootcontext.cs (RootContext): Init the interface_resolve_order
21204 and type_container_resolve_order always.
21206 (ResolveCore, BootstrapCorlib_ResolveClass,
21207 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
21208 compiler when compiling with --nostdlib
21210 * class.cs (TypeContainer.DefineType): Check that our parent is
21211 not null. This test is most important when we are bootstraping
21214 * codegen.cs: Split out the symbol writing code.
21216 2002-03-25 Martin Baulig <martin@gnome.org>
21218 * driver.cs (-g): Made -g an alias for --debug.
21220 2002-03-24 Martin Baulig <martin@gnome.org>
21222 * codegen.cs (SymbolWriter): New public variable. Returns the
21223 current symbol writer.
21224 (CodeGen): Added `bool want_debugging_support' argument to the
21225 constructor. If true, tell the ModuleBuild that we want debugging
21226 support and ask it for the ISymbolWriter.
21227 (Save): If we have a symbol writer, call it's Close() method after
21228 saving the assembly.
21230 * driver.c (--debug): New command line argument to create a
21231 debugger information file.
21233 * location.cs (SymbolDocument): New public property. Returns an
21234 ISymbolDocumentWriter object for the current source file or null
21235 if we don't have a symbol writer.
21237 2002-03-21 Miguel de Icaza <miguel@ximian.com>
21239 * driver.cs (LoadAssembly): Correctly return when all the paths
21240 have been tried and not before.
21242 * statement.cs (Switch.Emit): return the actual coverage for this
21243 statement (returns/not-returns)
21245 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
21246 switch of the statement if we are the last switch section. That
21247 kills two problems: try/catch problems (we used to emit an empty
21248 nop at the end) and switch statements where all branches would
21251 2002-03-19 Miguel de Icaza <miguel@ximian.com>
21253 * driver.cs: Add default assemblies (the equivalent to the
21254 Microsoft CSC.RSP file)
21256 * cs-tokenizer.cs: When updating `cols and setting it to zero,
21257 also update tokens_seen and set it to false.
21259 * driver.cs: Implement --recurse for Mike.
21261 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
21262 correctly splitting out the paths.
21264 2002-03-18 Miguel de Icaza <miguel@ximian.com>
21266 * interface.cs (Interface.PopulateProperty): Instead of using
21267 `parent' as the declaration space for the set parameters, use
21270 * support.cs (InternalParameters): InternalParameters constructor
21271 takes a DeclSpace instead of a TypeContainer.
21273 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
21274 types are being initialized, load the address of it before calling
21277 (New): Provide a mechanism to disable the generation of local
21278 value type temporaries when the caller will be providing us with
21279 an address to store it.
21281 (ArrayCreation.EmitDynamicInitializers): Use it.
21283 2002-03-17 Miguel de Icaza <miguel@ximian.com>
21285 * expression.cs (Invocation.EmitArguments): Only probe for array
21286 property if there is more than one argument. Sorry about that.
21288 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
21289 empty param arrays.
21291 * class.cs (Method.LabelParameters): Fix incorrect code path that
21292 prevented the `ParamArrayAttribute' from being applied to the
21295 2002-03-16 Miguel de Icaza <miguel@ximian.com>
21297 * support.cs (ReflectionParameters): Correctly compute whether the
21298 last argument is a params array. Fixes the problem with
21301 * typemanager.cs: Make the assemblies array always be non-null
21302 (empty, but non-null)
21304 * tree.cs (RecordDecl): New function that abstracts the recording
21305 of names. This reports error 101, and provides a pointer to the
21306 previous declaration. Fixes a crash in the compiler.
21308 * cs-parser.jay (constructor_declaration): Update to new grammar,
21309 and provide a constructor_body that can be empty.
21311 2002-03-15 Miguel de Icaza <miguel@ximian.com>
21313 * driver.cs: Add support for --resources.
21315 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
21316 Make all types for the various array helper methods be integer.
21318 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
21319 CheckState to ConvCast.
21321 (ConvCast): Now it takes a `checked' state argument, to avoid
21322 depending on the emit context for the conversion, and just using
21323 the resolve time setting.
21325 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
21326 instead of Invocation.EmitArguments. We do not emit the original
21327 arguments, instead we emit those which have been converted to
21328 unsigned int expressions.
21330 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
21332 * codegen.cs: ditto.
21334 * expression.cs (LocalVariableReference): Drop the use of the
21335 Store function that depended on the variable index.
21337 * statement.cs (VariableInfo): Drop the `Idx' property from this
21338 class, as this is not taking into account the indexes for
21339 temporaries tat we generate during the execution, getting the
21342 * class.cs: First emit class initializers, then call the parent
21345 * expression.cs (Binary): Fix opcode emision.
21346 (UnaryMutator.EmitCode): Support checked code generation
21348 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
21349 matches for events for both the Static and Instance scans,
21350 pointing to the same element. Fix that.
21352 2002-03-14 Miguel de Icaza <miguel@ximian.com>
21354 * rootcontext.cs (ResolveTree): Always set the
21355 interface_resolve_order, because nested interfaces will be calling
21358 * class.cs (GetInterfaceOrClass): Track the same resolution
21359 process used by TypeManager.LookupType. This fixes the nested
21360 type lookups in class declarations (separate path from
21363 (TypeContainer.DefineType): Also define nested interfaces.
21364 (TypeContainer.RegisterOrder): New public function used to
21365 register the order in which child interfaces need to be closed.
21367 Nested interfaces need to be closed after their parents have been
21370 * interface.cs (InterfaceAttr): Put all the logic for computing
21371 the interface attribute here.
21373 (DefineInterface): Register our interface order with the
21374 RootContext or with the TypeContainer depending on the case.
21376 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21378 * cs-parser.jay: rework foreach statement to work with the new
21379 changes to the policy on SimpleNames.
21381 * report.cs: support Stacktrace on warnings as well.
21383 * makefile: drop --unsafe and /unsafe from the compile.
21385 2002-03-13 Ravi Pratap <ravi@ximian.com>
21387 * ecore.cs (StandardConversionExists): Modify to take an Expression
21388 as the first parameter. Ensure we do null -> reference type conversion
21391 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
21392 temporary Expression objects.
21394 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
21396 * interface.cs: workaround bug in method overloading resolution
21397 (there is already a bugzilla bug for it).
21399 2002-03-12 Miguel de Icaza <miguel@ximian.com>
21401 We could also solve this problem by having a separate path for
21402 performing type lookups, instead of DoResolve, we could have a
21403 ResolveType entry point, and only participating pieces of the
21404 production (simplename, deref, array) would implement this.
21406 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
21407 signal SimpleName to only resolve type names and not attempt to
21408 resolve anything else.
21410 * expression.cs (Cast): Set the flag.
21412 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
21414 * class.cs: Only report 108 if there is no `new' modifier.
21416 * cs-parser.jay: rework foreach statement to work with the new
21417 changes to the policy on SimpleNames.
21419 * report.cs: support Stacktrace on warnings as well.
21421 * makefile: drop --unsafe and /unsafe from the compile.
21423 2002-03-11 Miguel de Icaza <miguel@ximian.com>
21425 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21426 lookups here, instead of doing that at parse time. This means
21427 that our grammar will not introduce `LocalVariableReferences' as
21428 expressions at this point. That solves the problem of code like
21432 static void Main ()
21436 This is only half the fix. The full fix requires parameters to
21437 also be handled in this way.
21439 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
21440 makes the use more obvious of the DeclSpace. The
21441 ec.TypeContainer.TypeBuilder is now only used to pull the
21442 TypeBuilder for it.
21444 My theory is that I can get rid of the TypeBuilder completely from
21445 the EmitContext, and have typecasts where it is used (from
21446 DeclSpace to where it matters).
21448 The only pending problem is that the code that implements Aliases
21449 is on TypeContainer, and probably should go in DeclSpace.
21451 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
21452 lookups here, instead of doing that at parse time. This means
21453 that our grammar will not introduce `LocalVariableReferences' as
21454 expressions at this point. That solves the problem of code like
21458 static void Main ()
21462 This is only half the fix. The full fix requires parameters to
21463 also be handled in this way.
21465 * class.cs (Property.DefineMethod): When implementing an interface
21466 method, set newslot, when implementing an abstract method, do not
21467 set the flag (before we tried never setting it, or always setting
21468 it, which is the difference).
21469 (Indexer.DefineMethod): same.
21470 (Method.DefineMethod): same.
21472 * ecore.cs: Only set the status used flag if we get back a Field.
21474 * attribute.cs: Temporary hack, so Paolo can keep working.
21476 2002-03-08 Ravi Pratap <ravi@ximian.com>
21478 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
21479 the unmanaged type in the case we have a MarshalAs attribute.
21481 (Resolve): Handle the case when we are parsing the special MarshalAs
21482 attribute [we need to store the unmanaged type to use later]
21484 * typemanager.cs (marshal_as_attr_type): Built in type for the
21485 MarshalAs Attribute.
21487 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
21488 on parameters and accordingly set the marshalling info.
21490 2002-03-09 Miguel de Icaza <miguel@ximian.com>
21492 * class.cs: Optimizing slightly by removing redundant code after
21493 we switched to the `NoTypes' return value.
21494 (Property.DefineMethod): use NoTypes here too.
21496 This fixes the bug I introduced in my last batch of changes.
21498 2002-03-05 Ravi Pratap <ravi@ximian.com>
21500 * tree.cs (RecordEnum): Add. We now keep track of enums too.
21502 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
21503 Enums since those are types too.
21505 * cs-parser.jay (enum_declaration): Record enums as we parse them.
21507 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
21508 thanks to a call during the lookup process.
21510 2002-03-07 Miguel de Icaza <miguel@ximian.com>
21512 * statement.cs (Foreach): Lots of work to accomodate a particular
21513 kind of foreach statement that I had not kept in mind. It is
21514 possible to have foreachs on classes that provide a GetEnumerator
21515 method that return objects that implement the "pattern" for using
21516 a foreach, there is no need to support GetEnumerator
21519 This is needed to compile nant.
21521 * decl.cs: Only report 114 if the member is not `Finalize' and if
21522 the warning level is at least 2.
21524 * class.cs: Moved the compare function from Method to
21527 (MethodSignature.InheritableMemberSignatureCompare): Add new
21528 filter function that is used to extract inheritable methods from a
21531 (Method.Define): Use the new `inheritable_method_signature_filter'
21534 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21537 2002-03-06 Miguel de Icaza <miguel@ximian.com>
21539 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21541 * cs-parser.jay: Add opt_semicolon to the interface declaration.
21543 * expression.cs: Pass location information to
21544 ConvertImplicitStandard.
21546 * class.cs: Added debugging code to track return values from
21549 2002-03-05 Miguel de Icaza <miguel@ximian.com>
21551 * expression.cs (Is.DoResolve): If either side of the `is' is an
21552 interface, do not flag the warning.
21554 * ecore.cs (ImplicitReferenceConversion): We need a separate test
21557 * report.cs: Allow for --fatal to be used with --probe.
21559 * typemanager.cs (NoTypes): Move the definition for the empty Type
21562 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21564 (TypeContainer.DefineProxy): New function used to proxy to parent
21565 implementations when implementing interfaces.
21566 (TypeContainer.ParentImplements): used to lookup if our parent
21567 implements a public function that is required by an interface.
21568 (TypeContainer.VerifyPendingMethods): Hook this up.
21570 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21571 `modules' and `assemblies' arraylists into arrays. We only grow
21572 these are the very early start up of the program, so this improves
21573 the speedof LookupType (nicely measured).
21575 * expression.cs (MakeByteBlob): Replaced unsafe code with
21576 BitConverter, as suggested by Paolo.
21578 * cfold.cs (ConstantFold.Binary): Special case: perform constant
21579 folding of string concatenation, but if either side is a string,
21580 and the other is not, then return null, and let the runtime use
21581 the concatenation on the string plus the object (using
21582 `Object.ToString').
21584 2002-03-04 Miguel de Icaza <miguel@ximian.com>
21586 Constant Folding has been implemented now.
21588 * expression.cs (Unary.Reduce): Do not throw an exception, catch
21589 the error instead on types that are not supported in one's
21592 * constant.cs (Constant and all children): New set of functions to
21593 perform implict and explicit conversions.
21595 * ecore.cs (EnumConstant): Implement the new functions to perform
21596 conversion by proxying to the child expression.
21598 * codegen.cs: (ConstantCheckState): Constant evaluation has its
21599 own separate setting that can not be turned off from the command
21600 line using --unchecked or --checked and is only controlled using
21601 the checked/unchecked statements and expressions. This setting is
21602 used by the constant folder to flag errors.
21604 * expression.cs (CheckedExpr, UncheckedExpr): Set the
21605 ConstantCheckState as well.
21607 During Resolve, they also have to flag the state, because the
21608 constant folder runs completely in the Resolve phase.
21610 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21613 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21615 * cfold.cs: New file, this file contains the constant folder.
21617 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21618 argument to track whether we are using the resulting address to
21619 load or store a value and provide better error messages.
21621 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21622 new AddressOf arguments.
21624 * statement.cs (Foreach.EmitCollectionForeach): Update
21626 * expression.cs (Argument.Emit): Call AddressOf with proper
21627 arguments to track usage.
21629 (New.DoEmit): Call AddressOf with new arguments.
21631 (Unary.Emit): Adjust AddressOf call.
21633 2002-03-01 Ravi Pratap <ravi@ximian.com>
21635 * cs-parser.jay (member_access): Change the case for pre-defined types
21636 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
21639 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21642 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21643 essentially like methods and apply attributes like MethodImplOptions to them too.
21645 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21648 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21649 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21652 * Update code everywhere accordingly.
21654 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21656 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21658 2002-02-28 Ravi Pratap <ravi@ximian.com>
21660 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21661 try performing lookups against those instead of jumping straight into using
21662 the 'using' clauses.
21664 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21666 (LookupType): Perform lookups in implicit parents too.
21668 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21669 sequence as RootContext.LookupType.
21671 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
21672 the various cases of namespace lookups into this method.
21674 2002-03-01 Miguel de Icaza <miguel@ximian.com>
21676 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21677 in positional arguments)
21679 * class.cs (Operator): Update the AllowedModifiers to contain
21682 * cs-parser.jay: Update operator declaration to allow for the
21683 operator body to be empty.
21685 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21688 2002-02-27 Miguel de Icaza <miguel@ximian.com>
21690 * class.cs (Method.Emit): Label parameters.
21692 * driver.cs: Return 1 or 0 as the program exit code.
21694 2002-02-26 Miguel de Icaza <miguel@ximian.com>
21696 * expression.cs: Special case the `null' object when trying to
21697 auto-compute the type, as anything can be explicitly converted to
21700 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21701 spotting this Paolo.
21703 (Expression.ImplicitNumericConversion): Perform comparissions of
21704 the type using the underlying type in the case of an enumeration
21705 rather than using the enumeration type for the compare.
21707 Cope with the underlying == type case, which is not possible to
21710 (Expression.ConvertNumericExplicit): Perform comparissions of
21711 the type using the underlying type in the case of an enumeration
21712 rather than using the enumeration type for the compare.
21714 * driver.cs: If the user does not supply an extension, assume .exe
21716 * cs-parser.jay (if_statement): Rewrote so that we can track the
21717 location for the if statement.
21719 * expression.cs (Binary.ConstantFold): Only concat strings when
21720 the operation is "+", not everything ;-)
21722 * statement.cs (Statement.EmitBoolExpression): Take a location
21724 (If, While, Do): Track location.
21726 * expression.cs (Binary.ResolveOperator): In the object + string
21727 case, I was missing a call to ConvertImplicit
21729 2002-02-25 Ravi Pratap <ravi@ximian.com>
21731 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21732 Location arguments. Ensure we use RootContext.LookupType to do our work
21733 and not try to do a direct Type.GetType and ModuleBuilder.GetType
21735 * interface.cs (PopulateMethod): Handle the type of the parameter being
21738 * expression.cs (Invocation.BetterFunction): Handle the case when we
21739 have a params method with no fixed arguments and a call is made with no
21742 2002-02-25 Miguel de Icaza <miguel@ximian.com>
21744 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21745 the verbatim-string-literal
21747 * support.cs (InternalParameters.ParameterModifier): handle null
21749 (InternalParameters.ParameterType): ditto.
21751 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21752 duplicating the name of the variable parameter.
21753 (GetParameterByName): Fix bug where we were not looking up array
21754 paramters if they were the only present (thanks Paolo!).
21755 (GetParameterInfo): We only have an empty set of types if both
21756 fixed and array are set to null.
21757 (GetParameterInfo-idx): Handle FixedParameter == null
21759 * cs-parser.jay: Handle the case where there is no catch
21760 statements (missing null test).
21762 2002-02-22 Miguel de Icaza <miguel@ximian.com>
21764 * driver.cs (MainDriver): Be conservative on our command line
21767 Catch DirectoryNotFoundException when calling GetFiles.
21769 (SplitPathAndPattern): Used to split the input specification into
21770 a path and a pattern that we can feed to Directory.GetFiles.
21772 2002-02-21 Miguel de Icaza <miguel@ximian.com>
21774 * statement.cs (Fixed): Implement the last case of the Fixed
21775 statement (string handling).
21777 * expression.cs (StringPtr): New class used to return a char * to
21778 a string; Used by the Fixed statement.
21780 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
21782 * expression.cs (Binary.ResolveOperator): Remove redundant
21783 MemberLookup pn parent type.
21784 Optimize union call, we do not need a union if the types are the same.
21785 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21788 Specialize the use of MemberLookup everywhere, instead of using
21789 the default settings.
21791 (StackAlloc): Implement stackalloc keyword.
21793 * cs-parser.jay: Add rule to parse stackalloc.
21795 * driver.cs: Handle /h, /help, /?
21797 * expression.cs (MakeByteBlob): Removed the hacks we had in place
21798 before we supported unsafe code.
21800 * makefile: add --unsafe to the self compilation of mcs.
21802 2002-02-20 Miguel de Icaza <miguel@ximian.com>
21804 * expression.cs (PointerArithmetic): New class that is used to
21805 perform pointer arithmetic.
21806 (Binary.Resolve): Handle pointer arithmetic
21807 Handle pointer comparission.
21808 (ArrayPtr): Utility expression class that is used to take the
21809 address of an array.
21811 (ElementAccess): Implement array access for pointers
21813 * statement.cs (Fixed): Implement fixed statement for arrays, we
21814 are missing one more case before we are done.
21816 * expression.cs (Indirection): Implement EmitAssign and set the
21817 ExprClass to Variable. This allows pointer dereferences to be
21818 treated as variables, and to have values assigned to them.
21820 * ecore.cs (Expression.StoreFromPtr): New utility function to
21821 store values dereferencing.
21823 2002-02-20 Ravi Pratap <ravi@ximian.com>
21825 * expression.cs (Binary.ResolveOperator): Ensure that we are
21826 not trying to operate on a void type - this fixes the reported
21829 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21830 the parent implementation is sealed.
21832 * ../errors/cs0239.cs : Add.
21834 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21836 * typemanager.cs (unverifiable_code_type): Corresponds to
21837 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21838 which have unsafe code in them.
21840 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
21843 2002-02-19 Miguel de Icaza <miguel@ximian.com>
21845 * cs-tokenizer.cs: Add support for @"litreal strings"
21847 Make tokenizer accept pre-processor directives
21848 on any column (remove the old C-like limitation).
21850 * rootcontext.cs (EmitCode): Emit any global attributes.
21851 (AddGlobalAttributes): Used to keep track of assembly attributes.
21853 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21855 * cs-parser.jay: Add support for global attributes.
21857 2002-02-17 Miguel de Icaza <miguel@ximian.com>
21859 * expression.cs (Indirection): New helper class. Unary will
21860 create Indirection classes to be able to implement the
21861 IMemoryLocation interface on it.
21863 2002-02-16 Miguel de Icaza <miguel@ximian.com>
21865 * cs-parser.jay (fixed_statement): reference the right statement.
21867 * statement.cs (Fixed.Emit): Finish implementing the fixed
21868 statement for the &x case.
21870 2002-02-14 Miguel de Icaza <miguel@ximian.com>
21872 * class.cs (Property.Define, Method.Define): Remove newslot when
21875 * modifiers.cs: My use of NewSlot when `Abstract' was set was
21876 wrong. NewSlot should only be used if the `new' keyword is present.
21878 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21879 locating our system dir. Sorry about this.
21881 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21883 * driver.cs (GetSystemDir): Compute correctly the location of our
21884 system assemblies. I was using the compiler directory instead of
21885 the library directory.
21887 2002-02-13 Ravi Pratap <ravi@ximian.com>
21889 * expression.cs (BetterFunction): Put back in what Miguel commented out
21890 since it is the correct fix. The problem is elsewhere ;-)
21892 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21893 parameters of the parms method are themselves compatible or not !
21895 (StandardConversionExists): Fix very dangerous bug where we were forgetting
21896 to check that a class implements an interface before saying that an implicit
21897 conversion was allowed. Use ImplementsInterface to do the checking.
21899 2002-02-13 Miguel de Icaza <miguel@ximian.com>
21901 * class.cs (Method.Define): Track whether we are an explicit
21902 implementation or not. And only call DefineMethodOverride if we
21903 are an explicit implementation.
21905 (Property.DefineMethod): Ditto.
21907 2002-02-11 Ravi Pratap <ravi@ximian.com>
21909 * expression.cs (BetterFunction): Catch hideous bug which was
21910 preventing us from detecting ambiguous calls due to implicit casts i.e
21913 2002-01-29 Miguel de Icaza <miguel@ximian.com>
21915 * support.cs (Pair): Remove un-needed method. I figured why I was
21916 getting the error in cs-parser.jay, the variable in a foreach loop
21917 is readonly, and the compiler does not really treat this as a variable.
21919 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
21920 instead of EQUALS in grammar.
21922 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21924 * expression.cs (Unary.DoResolve): Check whether the argument is
21927 2002-01-28 Miguel de Icaza <miguel@ximian.com>
21929 * support.cs: Api for Pair to set a value. Despite the fact that
21930 the variables are public the MS C# compiler refuses to compile
21931 code that accesses the field if the variable is part of a foreach
21934 * statement.cs (Fixed): Begin implementation of the fixed
21937 (Block.AddVariable): Return the VariableInfo on success and null
21938 on failure instead of true/false.
21940 * cs-parser.jay (foreach): Catch errors on variables already
21941 defined (we were ignoring this value before) and properly unwind
21942 the block hierarchy
21944 (fixed_statement): grammar for the fixed statement.
21946 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21948 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21949 pointer types to be incretemented.
21951 (SizeOf): Implement.
21953 * cs-parser.jay (pointer_member_access): Implement
21954 expr->IDENTIFIER production.
21956 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21957 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21960 (Unary): Implement indirection.
21962 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21963 use in non-unsafe context).
21965 (SimpleName.DoResolve): Check for pointers in field access on safe
21968 (Expression.LoadFromPtr): Factor the load-indirect code in this
21969 function. This was duplicated in UnboxCast and ParameterReference
21971 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21973 * expression.cs (ComposedCast): report an error if a pointer cast
21974 is used in a safe region.
21976 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21977 pointer type casts in unsafe context.
21979 * codegen.cs (EmitContext): Set up IsUnsafe.
21981 * cs-parser.jay (non_expression_type): Add productions for pointer
21984 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21985 code. We should not use force into static mode if the method is
21986 not virtual. Fixes bug in MIS
21988 * statement.cs (Do.Emit, While.Emit, For.Emit,
21989 Statement.EmitBoolExpression): Add support to Do and While to
21990 propagate infinite loop as `I do return' semantics.
21992 Improve the For case to also test for boolean constants.
21994 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21995 to the list of attributes we can add.
21997 Remove `EmitContext' argument.
21999 * class.cs (Method.Define): Apply parameter attributes.
22000 (Constructor.Define): Apply parameter attributes.
22001 (MethodCore.LabelParameters): Move here the core of labeling
22004 * support.cs (ReflectionParameters.ParameterModifier,
22005 InternalParameters.ParameterModifier): Use IsByRef on the type and
22006 only return the OUT bit for these parameters instead of in/out/ref
22009 This is because I miss-understood things. The ParameterInfo.IsIn
22010 and IsOut represent whether the parameter has the [In] and [Out]
22013 2002-01-22 Miguel de Icaza <miguel@ximian.com>
22015 * ecore.cs (FieldExpr.Emit): Release temporaries.
22017 * assign.cs (LocalTemporary.Release): new function.
22019 * codegen.cs (EmitContext.GetTemporaryStorage,
22020 EmitContext.FreeTemporaryStorage): Rework the way we deal with
22021 temporary storage. Now we can "put back" localbuilders when we
22024 2002-01-21 Miguel de Icaza <miguel@ximian.com>
22026 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
22027 need to make a copy of the variable to generate verifiable code.
22029 2002-01-19 Miguel de Icaza <miguel@ximian.com>
22031 * driver.cs: Compute dynamically the system directory.
22033 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
22034 Slower, but more generally useful. Used by the abstract
22035 registering implementation.
22037 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
22038 the rules for the special rule on Type/instances. First check if
22039 we have the same name, and if so, try that special static path
22040 rather than the instance path.
22042 2002-01-18 Miguel de Icaza <miguel@ximian.com>
22044 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
22047 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
22048 Enum, ValueType, Delegate or Array for non-corlib compiles.
22050 * cs-tokenizer.cs: Catch long identifiers (645)
22052 * typemanager.cs (IndexerPropetyName): Ravi never tested this
22055 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
22056 fix, we were returning too early, so we were not registering
22057 pending methods from abstract classes.
22059 Do not register pending methods if the class is abstract.
22061 * expression.cs (Conditional.DoResolve): Report circular implicit
22062 conversions when we neecd to compute it for conditional
22065 (Is.DoResolve): If the expression is always of the provided type,
22066 flag warning 183. If the expression can not ever be of the
22067 provided type flag warning 184.
22069 * class.cs: Catch 169 as well.
22071 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
22074 2002-01-18 Nick Drochak <ndrochak@gol.com>
22076 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
22078 2002-01-17 Miguel de Icaza <miguel@ximian.com>
22080 * interface.cs: (PopulateMethod): Check for pointers being defined
22081 only if the unsafe context is active.
22082 (PopulateProperty): ditto.
22083 (PopulateIndexer): ditto.
22085 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
22086 specified. If pointers are present, make sure that they are
22087 present in an unsafe context.
22088 (Constructor, Constructor.Define): ditto.
22089 (Field, Field.Define): ditto.
22090 (Property, Property.Define): ditto.
22091 (Event, Event.Define): ditto.
22093 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
22094 hashtable if there are classes or structs defined.
22096 * expression.cs (LocalVariableReference.DoResolve): Simplify this
22097 code, as the constant resolution moved.
22099 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
22100 the metadata, so we can flag error 133.
22102 * decl.cs (MemberCore.UnsafeOK): New function to test that a
22103 pointer is being declared in an unsafe context.
22105 2002-01-16 Miguel de Icaza <miguel@ximian.com>
22107 * modifiers.cs (Modifiers.Check): Require a Location argument.
22108 Report error 227 for Unsafe use.
22110 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
22112 * statement.cs (For.Emit): If the test is null, then report that
22113 we do `return', as we wont reach anything afterwards.
22115 (Switch.SwitchGoverningType): Track the expression that matched
22118 * driver.cs: Allow negative numbers as an error code to flag.
22120 * cs-parser.jay: Handle 1551.
22122 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
22124 2002-01-15 Miguel de Icaza <miguel@ximian.com>
22126 * cs-parser.jay: Report 1518 (type declaration can only contain
22127 class, struct, interface, enum or delegate)
22129 (switch_label): Report 1523 (keywords `case' or `default' must
22132 (opt_switch_sections): Report 1522 (empty switch)
22134 * driver.cs: Report 1515 (response file specified multiple times)
22135 Report 1516 (Source file specified multiple times).
22137 * expression.cs (Argument.Resolve): Signal 1510
22139 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
22140 access not allowed in static code)
22142 2002-01-11 Ravi Pratap <ravi@ximian.com>
22144 * typemanager.cs (IsPointerType): Utility method which we are going
22147 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
22148 the object type, so we take care of that.
22150 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
22152 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
22153 added to non-params parameters :-)
22155 * typemanager.cs (CSharpName): Include 'void' type too.
22157 (void_ptr_type): Include in the set of core types.
22159 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
22162 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
22165 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
22166 completely forgotten about it.
22168 2002-01-10 Ravi Pratap <ravi@ximian.com>
22170 * cs-parser.jay (pointer_type): Add. This begins our implementation
22171 of parsing rules for unsafe code.
22173 (unsafe_statement): Implement.
22175 (embedded_statement): Modify to include the above.
22177 * statement.cs (Unsafe): Implement new class for unsafe blocks.
22179 * codegen.cs (EmitContext.InUnsafe): Add. This determines
22180 if the current context is an unsafe one.
22182 * cs-parser.jay (local_variable_pointer_type): Since local variable types
22183 are handled differently, we need separate rules for them.
22185 (local_variable_declaration): Update to use local_variable_pointer_type
22186 to allow variable declarations of unmanaged pointer types.
22188 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
22189 in unsafe contexts.
22191 * ../errors/cs0214.cs : Add.
22193 2002-01-16 Nick Drochak <ndrochak@gol.com>
22195 * makefile: remove 'response' file when cleaning.
22197 2002-01-15 Miguel de Icaza <miguel@ximian.com>
22199 * cs-parser.jay: Report 1524.
22201 2002-01-14 Miguel de Icaza <miguel@ximian.com>
22203 * typemanager.cs (RegisterMethod): drop checking if we have
22204 registered this from here
22206 2002-01-12 Miguel de Icaza <miguel@ximian.com>
22208 * class.cs (Method.EmitDestructor): Implement calling our base
22211 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
22212 value of InFinally.
22214 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
22215 this routine and will wrap the call in a try/catch block. Deal
22218 2002-01-11 Miguel de Icaza <miguel@ximian.com>
22220 * ecore.cs (Expression.MemberLookup): instead of taking a
22221 parameter `same_type' that was used to tell whether we could
22222 access private members we compute our containing type from the
22225 (FieldExpr): Added partial support for volatile fields. This does
22226 not work for volatile fields exposed from assemblies, as I can not
22227 figure out how to extract the modreq from it.
22229 Updated all the source files to use this.
22231 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
22232 because it is referenced by MemberLookup very often.
22234 2002-01-09 Ravi Pratap <ravi@ximian.com>
22236 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
22237 TypeBuilder.GetCustomAttributes to retrieve what we need.
22239 Get rid of redundant default_member_attr_type as this is the same as
22240 default_member_type which already exists.
22242 * interface.cs, attribute.cs : Update accordingly.
22244 2002-01-08 Miguel de Icaza <miguel@ximian.com>
22246 * typemanager.cs: Enable IndexerPropertyName again. It does not
22247 work for TYpeBuilders though. Ravi, can you please fix this?
22249 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
22251 * expression.cs (Argument.Emit): Handle the case of ref objects
22252 being passed to ref functions;
22254 (ParameterReference.EmitLoad): Loads the content of the pointer
22255 without dereferencing.
22257 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22259 * cs-tokenizer.cs: Implemented the pre-processing expressions.
22261 2002-01-08 Ravi Pratap <ravi@ximian.com>
22263 * class.cs (Indexer.DefineMethod): Incorporate the interface
22264 type in the name of the method if we are doing explicit interface
22267 * expression.cs (ConversionExists): Remove as it is completely obsolete.
22269 (BetterConversion): Fix extremely trivial bug where we were referring to
22270 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
22273 * ../errors/bug16.cs : Add although we have fixed it.
22275 2002-01-07 Miguel de Icaza <miguel@ximian.com>
22277 * expression.cs (BaseIndexer): Begin implementation.
22279 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
22281 * cs-parser.jay (indexer_declarator): Use qualified_identifier
22282 production directly to remove a shift/reduce, and implement
22283 explicit interface implementation.
22285 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
22286 after a floating point suffix.
22288 * expression.cs (DoNumericPromotions): Improved the conversion for
22289 uint/uint. If we have a constant, we avoid doing a typecast to a
22292 * class.cs (Indexer): Implement explicit interface implementation
22295 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
22297 * class.cs: make the default instance constructor public and hidebysig.
22299 2001-01-03 Ravi Pratap <ravi@ximian.com>
22301 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
22302 so we can call it from elsewhere.
22304 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
22305 we emit it internally if the class has a defined indexer; otherwise the user
22306 emits it by decorating the class definition with the DefaultMemberAttribute.
22308 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
22309 attribute is not used on a type which defines an indexer.
22311 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
22312 character when we skip whitespace.
22314 * ../errors/cs0646.cs : Add.
22316 2002-01-03 Miguel de Icaza <miguel@ximian.com>
22318 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
22321 * makefile: Add practical target `mcs3.exe' which builds the third
22322 generation compiler.
22324 * expression.cs (New): Fix structures constructor calling.
22326 * class.cs (Property, Method, Indexer): Emit Final flag on the
22327 method if we are an interface implementation and we are not
22330 * ecore.cs (PropertyExpr): New public field `IsBase', tells
22331 whether this property is referencing a `base' method.
22333 * expression.cs (Invocation.EmitCall): take an extra argument:
22334 is_base, this is used to determine whether the `call' or
22335 `callvirt' opcode should be used.
22338 * delegate.cs: update EmitCall.
22340 * class.cs (Method.Define): Set NewSlot for the cases where we are
22341 not implementing an interface method.
22343 (Property.Define): ditto.
22345 2002-01-02 Miguel de Icaza <miguel@ximian.com>
22347 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
22348 'r'. Allows mcs to parse itself fully.
22350 2002-01-02 Ravi Pratap <ravi@ximian.com>
22352 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
22353 of the number of initializers that require the InitializeArray method.
22355 (CheckIndices): Store the Expression in all cases - not the plain value. Also
22356 update the above field where necessary.
22358 (MakeByteBlob): Update accordingly.
22360 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
22363 (EmitDynamicInitializers): Update in accordance with the new optimization.
22365 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
22366 same OpCode applies.
22368 * cs-parser.jay : Fix some glaring errors I introduced.
22370 2002-01-01 Ravi Pratap <ravi@ximian.com>
22372 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
22373 so that we can check for name clashes there too.
22375 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
22376 for interface indexers.
22378 * interfaces.cs (Define): Emit the default member attribute.
22380 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
22381 variable was being referred to while setting the value ;-)
22383 2002-01-01 Miguel de Icaza <miguel@ximian.com>
22385 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
22386 byte-by-byte information when we know the data is zero.
22388 Make the block always a multiple of 4, because
22389 DefineInitializedData has a bug.
22391 * assign.cs: Fix, we should assign from the temporary, not from
22394 * expression.cs (MakeByteBlob): Fix my incorrect code.
22396 2001-12-31 Miguel de Icaza <miguel@ximian.com>
22398 * typemanager.cs (EnumToUnderlying): This function is used to get
22399 the underlying type from an enumeration, because it does not
22402 * constant.cs: Use the I4_S form for values between -128 and 127.
22404 * statement.cs (Block.LookupLabel): Looks up a label.
22405 (Block): Drop support for labeled blocks.
22407 (LabeledStatement): New kind of statement that represents a label
22410 (Goto): Finally implement this bad boy.
22412 * cs-parser.jay: Update to reflect new mechanism to implement
22415 2001-12-30 Miguel de Icaza <miguel@ximian.com>
22417 * codegen.cs (EmitContext.This): a codegen property that keeps the
22418 a single instance of this instead of creating many different this
22421 * delegate.cs (Delegate.DoResolve): Update to use the property;
22423 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
22425 * expression.cs (BaseAccess.DoResolve): Ditto.
22427 2001-12-29 Ravi Pratap <ravi@ximian.com>
22429 * typemanager.cs (methodimpl_attr_type): Add to hold the type
22430 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
22432 (InitCoreTypes): Update accordingly.
22434 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
22435 so we can quickly store the state.
22437 (ApplyAttributes): Set the correct implementation flags
22438 for InternalCall methods.
22440 2001-12-29 Miguel de Icaza <miguel@ximian.com>
22442 * expression.cs (EmitCall): if a method is not virtual, then do
22443 not use callvirt on it.
22445 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
22446 user defined stuff) requires the use of stobj, which takes an
22447 address on the stack instead of an array and an index. So emit
22448 the Ldelema operation for it.
22450 (EmitStoreOpcode): Use stobj for valuetypes.
22452 (UnaryMutator.EmitCode): Use the right 1 value depending on
22453 whether we are dealing with int64/uint64, float or doubles.
22455 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
22456 constructors that I implemented last night.
22458 (Constructor.IsDefault): Fix to work properly for static
22461 * cs-parser.jay (CheckDef): report method signature errors.
22462 Update error number 103 to be 132.
22464 * decl.cs: New AdditionResult enumeration value: MethodExists.
22465 Although we do this check for methods later on in the semantic
22466 analysis, catching repeated default constructors is so easy that
22467 we catch these here.
22469 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
22472 (ParameterReference.EmitAssign, Emit): handle
22475 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
22476 (ArrayAccess.EmitStoreOpcode): ditto.
22478 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
22480 * expression.cs (MakeByteBlob): Complete all the missing types
22481 (uint, short, ushort, byte, sbyte)
22483 * class.cs: Only init instance field initializers on instance
22486 Rename `constructors' to instance_constructors.
22488 (TypeContainer.AddConstructor): Only add constructors to the list
22489 if it is not static.
22491 Make sure that we handle default_static_constructor independently
22492 everywhere where we handle instance_constructors
22494 2001-12-28 Miguel de Icaza <miguel@ximian.com>
22496 * class.cs: Do not lookup or create a base initializer for a
22497 static constructor.
22499 (ConstructorInitializer.Resolve): use the proper type to lookup
22502 * cs-parser.jay: Report error 1585 (modifiers between type and name).
22504 * enum.cs, interface.cs: Remove CloseType, this is taken care by
22507 * decl.cs: CloseType is now an virtual method, the default
22508 implementation just closes this type.
22510 2001-12-28 Ravi Pratap <ravi@ximian.com>
22512 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
22513 to PreserveSig by default. Also emit HideBySig on such methods.
22515 Basically, set the defaults to standard values.
22517 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
22518 argument, if candidate is better, it can't be worse than the best !
22520 (Invocation): Re-write bits to differentiate between methods being
22521 applicable in their expanded form and their normal form - for params
22524 Get rid of use_standard everywhere as only standard conversions are allowed
22525 in overload resolution.
22527 More spec conformance.
22529 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22531 * driver.cs: Add --timestamp, to see where the compiler spends
22534 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22535 `this' in static code.
22537 (SimpleName.DoResolve): Implement in terms of a helper function
22538 that allows static-references to be passed upstream to
22541 (Expression.ResolveWithSimpleName): Resolve specially simple
22542 names when called by MemberAccess to implement the special
22545 (Expression.ImplicitReferenceConversion): Handle conversions from
22546 Null to reference types before others, as Null's type is
22549 * expression.cs (Invocation.EmitCall): Handle the special case of
22550 calling methods declared on a reference type from a ValueType
22551 (Base classes System.Object and System.Enum)
22553 (MemberAccess.Resolve): Only perform lookups on Enumerations if
22554 the left hand side is a TypeExpr, not on every enumeration.
22556 (Binary.Resolve): If types are reference types, then do a cast to
22557 object on operators != and == of both arguments.
22559 * typemanager.cs (FindMembers): Extract instance and static
22560 members if requested.
22562 * interface.cs (PopulateProperty): Use void_type instead of null
22563 as the return type for the setter method.
22565 (PopulateIndexer): ditto.
22567 2001-12-27 Ravi Pratap <ravi@ximian.com>
22569 * support.cs (ReflectionParameters): Fix minor bug where we
22570 were examining the wrong parameter for the ParamArray attribute.
22572 Cope with requests for the type of the parameter at position
22573 greater than the params parameter's. We now return the element
22574 type of the params array as that makes more sense.
22576 * expression.cs (Invocation.IsParamsMethodApplicable): Update
22577 accordingly as we no longer have to extract the element type
22580 (Invocation.OverloadResolve): Update.
22582 2001-12-27 Miguel de Icaza <miguel@ximian.com>
22584 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22585 against IEnumerator, test whether the return value is a descendant
22586 of the IEnumerator interface.
22588 * class.cs (Indexer.Define): Use an auxiliary method to implement
22589 the other bits of the method definition. Begin support for
22590 explicit interface implementation.
22592 (Property.DefineMethod): Use TypeManager.void_type instead of null
22593 for an empty return value.
22595 2001-12-26 Miguel de Icaza <miguel@ximian.com>
22597 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22598 dealing with a FieldExpr which is composed of a FieldBuilder, in
22599 the code path we did extract the constant, but we should have
22600 obtained the underlying value to be able to cast it (otherwise we
22601 end up in an infinite loop, this is what Ravi was running into).
22603 (ArrayCreation.UpdateIndices): Arrays might be empty.
22605 (MemberAccess.ResolveMemberAccess): Add support for section
22606 14.5.4.1 that deals with the special case of E.I when E is a type
22607 and something else, that I can be a reference to a static member.
22609 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22610 handle a particular array type to create byte blobs, it is just
22611 something we dont generate byteblobs for.
22613 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22616 * location.cs (Push): remove the key from the hashtable that we
22617 are about to add. This happens for empty files.
22619 * driver.cs: Dispose files after we have parsed them.
22621 (tokenize): new function that only runs the tokenizer on its
22622 input, for speed testing.
22624 2001-12-26 Ravi Pratap <ravi@ximian.com>
22626 * class.cs (Event.Define): Define the private field only if there
22627 are no accessors defined.
22629 * expression.cs (ResolveMemberAccess): If there is no associated
22630 field with the event, that means we have an event defined with its
22631 own accessors and we should flag error cs0070 since transforming
22632 ourselves into a field is not valid in that case.
22634 * ecore.cs (SimpleName.DoResolve): Same as above.
22636 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22637 and charset to sane values.
22639 2001-12-25 Ravi Pratap <ravi@ximian.com>
22641 * assign.cs (DoResolve): Perform check on events only if they
22642 are being accessed outside the declaring type.
22644 * cs-parser.jay (event_declarations): Update rules to correctly
22645 set the type of the implicit parameter etc.
22647 (add_accessor, remove_accessor): Set current local parameters.
22649 * expression.cs (Binary): For delegate addition and subtraction,
22650 cast the return value from the method into the appropriate delegate
22653 2001-12-24 Ravi Pratap <ravi@ximian.com>
22655 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22656 of these as the workaround is unnecessary.
22658 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22659 delegate data - none of that is needed at all.
22661 Re-write bits to extract the instance expression and the delegate method
22664 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
22667 * attribute.cs (ApplyAttributes): New method to take care of common tasks
22668 of attaching attributes instead of duplicating code everywhere.
22670 * everywhere : Update code to do attribute emission using the above method.
22672 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22674 * expression.cs (IsParamsMethodApplicable): if there are not
22675 parameters, return immediately.
22677 * ecore.cs: The 0 literal can be implicity converted to an enum
22680 (SimpleName.DoResolve): First lookup the type, then lookup the
22683 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22684 want to get its address. If the InstanceExpression is not
22685 addressable, store the result in a temporary variable, then get
22688 * codegen.cs: Only display 219 errors on warning level or above.
22690 * expression.cs (ArrayAccess): Make it implement the
22691 IMemoryLocation interface.
22693 (Binary.DoResolve): handle the operator == (object a, object b)
22694 and operator != (object a, object b) without incurring into a
22695 BoxedCast (because 5 != o should never be performed).
22697 Handle binary enumerator operators.
22699 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22700 value type, otherwise use Ldelem_ref.
22702 Use precomputed names;
22704 (AddressOf): Implement address of
22706 * cs-parser.jay (labeled_statement): Fix recursive block
22707 addition by reworking the production.
22709 * expression.cs (New.DoEmit): New has a special case:
22711 If we are dealing with a ValueType, we have a few
22712 situations to deal with:
22714 * The target of New is a ValueType variable, that is
22715 easy, we just pass this as the variable reference
22717 * The target of New is being passed as an argument,
22718 to a boxing operation or a function that takes a
22721 In this case, we need to create a temporary variable
22722 that is the argument of New.
22725 2001-12-23 Ravi Pratap <ravi@ximian.com>
22727 * rootcontext.cs (LookupType): Check that current_type is not null before
22728 going about looking at nested types.
22730 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22731 not implement the IAssignMethod interface any more.
22733 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22734 where we tranform them into FieldExprs if they are being resolved from within
22735 the declaring type.
22737 * ecore.cs (SimpleName.DoResolve): Do the same here.
22739 * assign.cs (DoResolve, Emit): Clean up code considerably.
22741 * ../errors/bug10.cs : Add.
22743 * ../errors/cs0070.cs : Add.
22745 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22747 * assign.cs : Get rid of EventIsLocal everywhere.
22749 2001-12-23 Miguel de Icaza <miguel@ximian.com>
22751 * ecore.cs (ConvertIntLiteral): finished the implementation.
22753 * statement.cs (SwitchLabel): Convert the value we are using as a
22754 key before looking up the table.
22756 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22758 * codegen.cs (EmitTopBlock): Require a Location argument now.
22760 * cs-parser.jay (constructor_declarator): We need to setup
22761 current_local_parameters before we parse the
22762 opt_constructor_initializer, to allow the variables to be bound
22763 to the constructor arguments.
22765 * rootcontext.cs (LookupType): First lookup nested classes in our
22766 class and our parents before we go looking outside our class.
22768 * expression.cs (ConstantFold): Extract/debox the values at the
22771 * rootcontext.cs (EmitCode): Resolve the constants first before we
22772 resolve the types. This is not really needed, but it helps debugging.
22774 * statement.cs: report location.
22776 * cs-parser.jay: pass location to throw statement.
22778 * driver.cs: Small bug fix.
22780 * report.cs: Updated format to be 4-zero filled digits.
22782 2001-12-22 Ravi Pratap <ravi@ximian.com>
22784 * expression.cs (CheckIndices): Fix minor bug where the wrong
22785 variable was being referred to ;-)
22787 (DoEmit): Do not call EmitStaticInitializers when the
22788 underlying type is System.Object.
22790 2001-12-21 Ravi Pratap <ravi@ximian.com>
22792 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22793 and do the usual workaround for SRE.
22795 * class.cs (MyEventBuilder.EventType): New member to get at the type
22796 of the event, quickly.
22798 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22800 * assign.cs (Assign.DoResolve): Handle the case when the target
22801 is an EventExpr and perform the necessary checks.
22803 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22806 (SimpleName.MemberStaticCheck): Include check for EventExpr.
22808 (EventExpr): Set the type in the constructor itself since we
22809 are meant to be born fully resolved.
22811 (EventExpr.Define): Revert code I wrote earlier.
22813 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22814 instance expression is null. The instance expression is a This in that case
22815 or a null, depending on whether it is a static method or not.
22817 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22818 refers to more than one method.
22820 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22821 and accordingly flag errors.
22823 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22825 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22827 2001-12-22 Miguel de Icaza <miguel@ximian.com>
22829 * location.cs (ToString): Provide useful rutine.
22831 2001-12-21 Miguel de Icaza <miguel@ximian.com>
22833 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22834 objects, return the actual integral boxed.
22836 * statement.cs (SwitchLabel): define an ILLabel for each
22839 (Switch.CheckSwitch): If the value is a Literal, extract
22840 the underlying literal.
22842 Also in the unused hashtable we had, add the SwitchLabel so we can
22843 quickly look this value up.
22845 * constant.cs: Implement a bunch of new constants. Rewrite
22846 Literal based on this. Made changes everywhere to adapt to this.
22848 * expression.cs (Expression.MakeByteBlob): Optimize routine by
22849 dereferencing array only once, and also copes with enumrations.
22851 bytes are two bytes wide, not one.
22853 (Cast): Perform constant conversions.
22855 * ecore.cs (TryImplicitIntConversion): Return literals instead of
22856 wrappers to the literals here.
22858 * expression.cs (DoNumericPromotions): long literals can converted
22859 to ulong implicity (this is taken care of elsewhere, but I was
22860 missing this spot).
22862 * ecore.cs (Expression.Literalize): Make the return type Literal,
22863 to improve type checking.
22865 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22867 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22869 * literal.cs: Revert code from ravi that checked the bounds. The
22870 bounds are sane by the definition of the type itself.
22872 * typemanager.cs: Fix implementation of ImplementsInterface. We
22873 need to actually look up in our parent hierarchy for interfaces
22876 * const.cs: Use the underlying type for enumerations
22878 * delegate.cs: Compute the basename for the delegate creation,
22879 that should fix the delegate test case, and restore the correct
22880 Type Lookup semantics in rootcontext
22882 * rootcontext.cs: Revert Ravi's last patch. The correct way of
22883 referencing a nested type with the Reflection API is using the "+"
22886 * cs-parser.jay: Do not require EOF token at the end.
22888 2001-12-20 Ravi Pratap <ravi@ximian.com>
22890 * rootcontext.cs (LookupType): Concatenate type names with
22891 a '.' instead of a '+' The test suite passes again.
22893 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22894 field of the enumeration.
22896 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22897 the case when the member is an EventExpr.
22899 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22900 static has an associated instance expression.
22902 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22904 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22906 * class.cs (Event.Define): Register event and perform appropriate checks
22909 We define the Add and Remove methods even if the use provides none because
22910 in that case, we provide default implementations ourselves.
22912 Define a private field of the type of the event. This is done by the CSC compiler
22913 and we should be doing it too ;-)
22915 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22916 More methods we use in code we generate.
22918 (multicast_delegate_type, delegate_type): Two separate types since the distinction
22921 (InitCoreTypes): Update accordingly for the above.
22923 * class.cs (Event.Emit): Generate code for default accessors that we provide
22925 (EmitDefaultMethod): Do the job in the above.
22927 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
22930 2001-12-20 Miguel de Icaza <miguel@ximian.com>
22932 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22933 builders even if we were missing one.
22935 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22936 pass the Basename as our class name instead of the Name. The
22937 basename will be correctly composed for us.
22939 * parameter.cs (Paramters): Now takes a Location argument.
22941 * decl.cs (DeclSpace.LookupType): Removed convenience function and
22942 make all the code call directly LookupType in RootContext and take
22943 this chance to pass the Location information everywhere.
22945 * Everywhere: pass Location information.
22947 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22949 * class.cs (Constructor.Define): Updated way of detecting the
22950 length of the parameters.
22952 (TypeContainer.DefineType): Use basename as the type name for
22955 (TypeContainer.Define): Do not recursively define types here, as
22956 definition is taken care in order by the RootContext.
22958 * tree.cs: Keep track of namespaces in a per-file basis.
22960 * parameter.cs (Parameter.ComputeSignature): Update to use
22963 (Parameters.GetSignature): ditto.
22965 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22966 instead of a TypeContainer.
22968 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22969 resolve names. Because we need to be resolve in our context, not
22972 * driver.cs: Implement response files.
22974 * class.cs (TypeContainer.DefineType): If we are defined, do not
22975 redefine ourselves.
22977 (Event.Emit): Emit the code for add/remove handlers.
22978 (Event.Define): Save the MethodBuilders for add/remove.
22980 * typemanager.cs: Use pair here too.
22982 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22983 DictionaryEntry requires the first argument to be non-null.
22985 (enum_declaration): Compute full name for registering the
22988 (delegate_declaration): Instead of using
22989 formal_parameter_list, use opt_formal_parameter_list as the list
22992 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22993 (EventParsing): New property that controls whether `add' and
22994 `remove' are returned as tokens or identifiers (for events);
22996 2001-12-19 Ravi Pratap <ravi@ximian.com>
22998 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22999 use MyEventBuilder only and let it wrap the real builder for us.
23001 (MyEventBuilder): Revamp constructor etc.
23003 Implement all operations that we perform on EventBuilder in precisely the same
23006 (FindMembers): Update to use the EventBuilder member.
23008 (Event.Emit): Update accordingly.
23010 2001-12-18 Ravi Pratap <ravi@ximian.com>
23012 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
23013 by calling the appropriate methods.
23015 (GetCustomAttributes): Make stubs as they cannot possibly do anything
23018 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
23020 2001-12-17 Ravi Pratap <ravi@ximian.com>
23022 * delegate.cs (Delegate.Populate): Check that the return type
23023 and various parameters types are indeed accessible.
23025 * class.cs (Constructor.Define): Same here.
23027 (Field.Define): Ditto.
23029 (Event.Define): Ditto.
23031 (Operator.Define): Check that the underlying Method defined itself
23032 correctly - so it's MethodBuilder should not be null.
23034 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
23035 expression happens to be null.
23037 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
23038 members but as of now we don't seem to be able to do anything really useful with it.
23040 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
23041 not the EventBuilder.
23043 2001-12-18 Miguel de Icaza <miguel@ximian.com>
23045 * cs-tokenizer.cs: Add support for defines.
23046 Add support for #if, #elif, #else, #endif
23048 (eval_var): evaluates a variable.
23049 (eval): stubbed for evaluating functions.
23051 * cs-parser.jay: Pass the defines information
23053 * driver.cs: Add --define command line option.
23055 * decl.cs: Move MemberCore here.
23057 Make it the base class for DeclSpace. This allows us to catch and
23058 report 108 and 109 for everything now.
23060 * class.cs (TypeContainer.Define): Extract all the members
23061 before populating and emit the warning 108 (new keyword required
23062 to override) instead of having each member implement this.
23064 (MemberCore.Define): New abstract method, we will be using this in
23065 the warning reporting engine in Populate.
23067 (Operator.Define): Adjust to new MemberCore protocol.
23069 * const.cs (Const): This does not derive from Expression, it is a
23070 temporary object we use to create fields, it is a MemberCore.
23072 * class.cs (Method.Define): Allow the entry point to be in a
23075 * driver.cs: Rewrite the argument handler to clean it up a bit.
23077 * rootcontext.cs: Made it just an auxiliary namespace feature by
23078 making everything static.
23080 * driver.cs: Adapt code to use RootContext type name instead of
23083 * delegate.cs: Remove RootContext argument.
23085 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
23088 * class.cs (Event.Define): The lookup can fail.
23090 * cs-tokenizer.cs: Begin implementation of pre-procesor.
23092 * expression.cs: Resolve the this instance before invoking the code.
23094 2001-12-17 Miguel de Icaza <miguel@ximian.com>
23096 * cs-parser.jay: Add a production in element_access that allows
23097 the thing to become a "type" reference. This way we can parse
23098 things like "(string [])" as a type.
23100 Note that this still does not handle the more complex rules of
23104 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
23106 * ecore.cs: (CopyNewMethods): new utility function used to
23107 assemble the list of methods from running FindMembers.
23109 (MemberLookup): Rework FindMembers so that
23111 2001-12-16 Miguel de Icaza <miguel@ximian.com>
23113 * class.cs (TypeContainer): Remove Delegates who fail to be
23116 * delegate.cs (Populate): Verify that we dont get null return
23117 values. TODO: Check for AsAccessible.
23119 * cs-parser.jay: Use basename to emit error 574 (destructor should
23120 have the same name as container class), not the full name.
23122 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
23123 possible representation.
23125 Also implements integer type suffixes U and L.
23127 2001-12-15 Miguel de Icaza <miguel@ximian.com>
23129 * expression.cs (ArrayCreation.DoResolve): We need to do the
23130 argument resolution *always*.
23132 * decl.cs: Make this hold the namespace. Hold the root context as
23134 (LookupType): Move here.
23136 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
23138 * location.cs (Row, Name): Fixed the code, it was always returning
23139 references to the first file.
23141 * interface.cs: Register properties defined through interfaces.
23143 * driver.cs: Add support for globbing on the command line
23145 * class.cs (Field): Make it derive from MemberCore as well.
23148 2001-12-15 Ravi Pratap <ravi@ximian.com>
23150 * class.cs (Event::Define): Check that the type of the event is a delegate
23151 type else flag error #66.
23153 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
23156 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
23157 values of EntryPoint, CharSet etc etc.
23159 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
23161 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
23162 be null and we should ignore this. I am not sure if this is really clean. Apparently,
23163 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
23164 which needs this to do its work.
23166 * ../errors/cs0066.cs : Add.
23168 2001-12-14 Miguel de Icaza <miguel@ximian.com>
23170 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
23173 * class.cs: (MethodSignature.MethodSignature): Removed hack that
23174 clears out the parameters field.
23175 (MemberSignatureCompare): Cleanup
23177 (MemberCore): New base class used to share code between MethodCore
23180 (RegisterRequiredImplementations) BindingFlags.Public requires
23181 either BindingFlags.Instace or Static. Use instance here.
23183 (Property): Refactored code to cope better with the full spec.
23185 * parameter.cs (GetParameterInfo): Return an empty array instead
23188 * class.cs (Property): Abstract or extern properties have no bodies.
23190 * parameter.cs (GetParameterInfo): return a zero-sized array.
23192 * class.cs (TypeContainer.MethodModifiersValid): Move all the
23193 method modifier validation to the typecontainer so we can reuse
23194 this on properties.
23196 (MethodCore.ParameterTypes): return an empty sized array of types.
23198 (Property.Define): Test property modifier validity.
23200 Add tests for sealed/override too.
23202 (Method.Emit): abstract or extern methods have no bodies.
23204 2001-12-14 Ravi Pratap <ravi@ximian.com>
23206 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
23209 (Method::Define, ::Emit): Modify accordingly.
23211 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
23213 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
23215 * makefile: Pass in /unsafe.
23217 2001-12-13 Miguel de Icaza <miguel@ximian.com>
23219 * class.cs (MakeKey): Kill routine.
23221 * class.cs (TypeContainer.Define): Correctly define explicit
23222 method implementations (they require the full interface name plus
23225 * typemanager.cs: Deply the PtrHashtable here and stop using the
23226 lame keys. Things work so much better.
23228 This of course broke everyone who depended on `RegisterMethod' to
23229 do the `test for existance' test. This has to be done elsewhere.
23231 * support.cs (PtrHashtable): A hashtable that avoid comparing with
23232 the object stupid Equals method (because, that like fails all over
23233 the place). We still do not use it.
23235 * class.cs (TypeContainer.SetRequiredInterface,
23236 TypeContainer.RequireMethods): Killed these two routines and moved
23237 all the functionality to RegisterRequiredImplementations.
23239 (TypeContainer.RegisterRequiredImplementations): This routine now
23240 registers all the implementations required in an array for the
23241 interfaces and abstract methods. We use an array of structures
23242 which can be computed ahead of time to reduce memory usage and we
23243 also assume that lookups are cheap as most classes will not
23244 implement too many interfaces.
23246 We also avoid creating too many MethodSignatures.
23248 (TypeContainer.IsInterfaceMethod): Update and optionally does not
23249 clear the "pending" bit if we find that there are problems with
23252 (TypeContainer.VerifyPendingMethods): Update to report errors of
23253 methods that look like implementations but are not.
23255 (TypeContainer.Define): Add support for explicit interface method
23258 2001-12-12 Miguel de Icaza <miguel@ximian.com>
23260 * typemanager.cs: Keep track of the parameters here instead of
23261 being a feature of the TypeContainer.
23263 * class.cs: Drop the registration of parameters here, as
23264 InterfaceMethods are also interface declarations.
23266 * delegate.cs: Register methods with the TypeManager not only with
23267 the TypeContainer. This code was buggy.
23269 * interface.cs: Full registation here.
23271 2001-12-11 Miguel de Icaza <miguel@ximian.com>
23273 * expression.cs: Remove reducer for binary expressions, it can not
23276 * const.cs: Put here the code that used to go into constant.cs
23278 * constant.cs: Put here the code for constants, this is a new base
23279 class for Literals.
23281 * literal.cs: Make Literal derive from Constant.
23283 2001-12-09 Miguel de Icaza <miguel@ximian.com>
23285 * statement.cs (Return.Emit): Report error 157 if the user
23286 attempts to return from a finally block.
23288 (Return.Emit): Instead of emitting a return, jump to the end of
23291 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
23292 LocalBuilder to store the result of the function. ReturnLabel is
23293 the target where we jump.
23296 2001-12-09 Radek Doulik <rodo@ximian.com>
23298 * cs-parser.jay: remember alias in current namespace
23300 * ecore.cs (SimpleName::DoResolve): use aliases for types or
23303 * class.cs (LookupAlias): lookup alias in my_namespace
23305 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
23307 (LookupAlias): lookup alias in this and if needed in parent
23310 2001-12-08 Miguel de Icaza <miguel@ximian.com>
23314 * rootcontext.cs: (ModuleBuilder) Made static, first step into
23315 making things static. I need this to avoid passing the
23316 TypeContainer when calling ParameterType.
23318 * support.cs (InternalParameters.ParameterType): Remove ugly hack
23319 that did string manipulation to compute the type and then call
23320 GetType. Use Parameter.ParameterType instead.
23322 * cs-tokenizer.cs: Consume the suffix for floating values.
23324 * expression.cs (ParameterReference): figure out whether this is a
23325 reference parameter or not. Kill an extra variable by computing
23326 the arg_idx during emission.
23328 * parameter.cs (Parameters.GetParameterInfo): New overloaded
23329 function that returns whether a parameter is an out/ref value or not.
23331 (Parameter.ParameterType): The type of the parameter (base,
23332 without ref/out applied).
23334 (Parameter.Resolve): Perform resolution here.
23335 (Parameter.ExternalType): The full type (with ref/out applied).
23337 * statement.cs (Using.Emit, Using.EmitExpression): Implement
23338 support for expressions on the using statement.
23340 2001-12-07 Miguel de Icaza <miguel@ximian.com>
23342 * statement.cs (Using.EmitLocalVariableDecls): Split the
23343 localvariable handling of the using statement.
23345 (Block.EmitMeta): Keep track of variable count across blocks. We
23346 were reusing slots on separate branches of blocks.
23348 (Try.Emit): Emit the general code block, we were not emitting it.
23350 Check the type of the declaration to be an IDisposable or
23351 something that can be implicity converted to it.
23353 Emit conversions if required.
23355 * ecore.cs (EmptyExpression): New utility class.
23356 (Expression.ImplicitConversionExists): New utility function.
23358 2001-12-06 Miguel de Icaza <miguel@ximian.com>
23360 * statement.cs (Using): Implement.
23362 * expression.cs (LocalVariableReference): Support read only variables.
23364 * statement.cs: Remove the explicit emit for the Leave opcode.
23365 (VariableInfo): Add a readonly field.
23367 2001-12-05 Miguel de Icaza <miguel@ximian.com>
23369 * ecore.cs (ConvCast): new class used to encapsulate the various
23370 explicit integer conversions that works in both checked and
23371 unchecked contexts.
23373 (Expression.ConvertNumericExplicit): Use new ConvCast class to
23374 properly generate the overflow opcodes.
23376 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23378 * statement.cs: The correct type for the EmptyExpression is the
23379 element_type, not the variable type. Ravi pointed this out.
23381 2001-12-04 Ravi Pratap <ravi@ximian.com>
23383 * class.cs (Method::Define): Handle PInvoke methods specially
23384 by using DefinePInvokeMethod instead of the usual one.
23386 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
23387 above to do the task of extracting information and defining the method.
23389 2001-12-04 Ravi Pratap <ravi@ximian.com>
23391 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
23392 of the condition for string type.
23394 (Emit): Move that here.
23396 (ArrayCreation::CheckIndices): Keep string literals in their expression
23399 (EmitDynamicInitializers): Handle strings appropriately.
23401 2001-12-04 Miguel de Icaza <miguel@ximian.com>
23403 * codegen.cs (EmitContext): Replace multiple variables with a
23404 single pointer to the current Switch statement.
23406 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
23409 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23413 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
23416 (Foreach.Emit): Foreach on arrays was not setting
23417 up the loop variables (for break/continue).
23419 (GotoCase): Semi-implented.
23421 2001-12-03 Ravi Pratap <ravi@ximian.com>
23423 * attribute.cs (CheckAttribute): Handle system attributes by using
23424 Attribute.GetAttributes to examine information we need.
23426 (GetValidPlaces): Same here.
23428 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
23430 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
23432 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
23434 (Method::Define): Set appropriate flags if we have a DllImport attribute.
23436 (Method::Emit): Handle the case when we are a PInvoke method.
23438 2001-12-03 Miguel de Icaza <miguel@ximian.com>
23440 * expression.cs: Use ResolveWithSimpleName on compound names.
23442 2001-12-02 Ravi Pratap <ravi@ximian.com>
23444 * constant.cs (EmitConstant): Make sure we resolve the associated expression
23445 before trying to reduce it.
23447 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
23449 * constant.cs (LookupConstantValue): Implement.
23451 (EmitConstant): Use the above in emitting the constant.
23453 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
23454 that are user-defined by doing a LookupConstantValue on them.
23456 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
23459 2001-11-29 Miguel de Icaza <miguel@ximian.com>
23461 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
23463 (BaseAccess.DoResolve): Implement.
23465 (MemberAccess.DoResolve): Split this routine into a
23466 ResolveMemberAccess routine that can be used independently
23468 2001-11-28 Miguel de Icaza <miguel@ximian.com>
23470 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
23471 As that share bits of the implementation. Is returns a boolean,
23472 while As returns the Type that is being probed.
23474 2001-12-01 Ravi Pratap <ravi@ximian.com>
23476 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
23477 instead of a Literal - much easier.
23479 (EnumInTransit): Remove - utterly useless :-)
23481 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
23483 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
23485 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
23486 chain when we have no associated expression.
23488 2001-11-30 Ravi Pratap <ravi@ximian.com>
23490 * constant.cs (Define): Use Location while reporting the errror.
23492 Also emit a warning when 'new' is used and there is no inherited
23495 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
23498 (LookupEnumValue): Implement to lookup an enum member's value and define it
23501 (Populate): Re-write accordingly to use the above routine.
23503 2001-11-27 Miguel de Icaza <miguel@ximian.com>
23505 * expression.cs (This): Fix prototype for DoResolveLValue to
23506 override the base class DoResolveLValue.
23508 * cs-parser.cs: Report errors cs574 and cs575 (destructor
23511 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
23512 (we need to load the address of the field here). This fixes
23515 (FieldExpr.DoResolveLValue): Call the DoResolve
23516 function to initialize the Instance expression.
23518 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
23519 correctly the GetEnumerator operation on a value type.
23521 * cs-parser.jay: Add more simple parsing error catches.
23523 * statement.cs (Switch): Add support for string switches.
23524 Handle null specially.
23526 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
23528 2001-11-28 Ravi Pratap <ravi@ximian.com>
23530 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23532 (declare_local_constant): New helper function.
23534 * statement.cs (AddConstant): Keep a separate record of constants
23536 (IsConstant): Implement to determine if a variable is a constant.
23538 (GetConstantExpression): Implement.
23540 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23542 * statement.cs (IsVariableDefined): Re-write.
23544 2001-11-27 Ravi Pratap <ravi@ximian.com>
23546 * class.cs (TypeContainer::FindMembers): Look for constants
23547 in the case when we are looking for MemberTypes.Field
23549 * expression.cs (MemberAccess::DoResolve): Check that in the
23550 case we are a FieldExpr and a Literal, we are not being accessed
23551 by an instance reference.
23553 * cs-parser.jay (local_constant_declaration): Implement.
23555 (declaration_statement): Implement for constant declarations.
23557 2001-11-26 Miguel de Icaza <miguel@ximian.com>
23559 * statement.cs (Switch): Catch double defaults.
23561 (Switch): More work on the switch() statement
23562 implementation. It works for integral values now, need to finish
23566 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23568 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23569 integer literals into other integer literals. To be used by
23572 2001-11-24 Ravi Pratap <ravi@ximian.com>
23574 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23577 (EmitDynamicInitializers): Cope with the above since we extract data
23578 directly from ArrayData now.
23580 (ExpectInitializers): Keep track of whether initializers are mandatory
23583 (Bounds): Make it a hashtable to prevent the same dimension being
23584 recorded for every element in that dimension.
23586 (EmitDynamicInitializers): Fix bug which prevented the Set array method
23589 Also fix bug which was causing the indices to be emitted in the reverse
23592 2001-11-24 Miguel de Icaza <miguel@ximian.com>
23594 * expression.cs (ArrayCreation): Implement the bits that Ravi left
23595 unfinished. They do not work, because the underlying code is
23598 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23600 * cs-parser.jay: Remove bogus fixme.
23602 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23603 on Switch statement.
23605 2001-11-23 Ravi Pratap <ravi@ximian.com>
23607 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23610 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23611 parameter. Apparently, any expression is allowed.
23613 (ValidateInitializers): Update accordingly.
23615 (CheckIndices): Fix some tricky bugs thanks to recursion.
23617 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
23618 I was being completely brain-dead.
23620 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23621 and re-write acordingly.
23623 (DelegateInvocation): Re-write accordingly.
23625 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23627 (MakeByteBlob): Handle types more correctly.
23629 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23630 initialization from expressions but it is incomplete because I am a complete
23633 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23635 * statement.cs (If.Emit): Fix a bug that generated incorrect code
23636 on If. Basically, we have to return `true' (ie, we do return to
23637 our caller) only if both branches of the if return.
23639 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23640 short-circuit operators, handle them as short circuit operators.
23642 (Cast.DoResolve): Resolve type.
23643 (Cast.Cast): Take an expression as the target type.
23645 * cs-parser.jay (cast_expression): Remove old hack that only
23646 allowed a limited set of types to be handled. Now we take a
23647 unary_expression and we resolve to a type during semantic
23650 Use the grammar productions from Rhys to handle casts (this is
23651 not complete like Rhys syntax yet, we fail to handle that corner
23652 case that C# has regarding (-x), but we will get there.
23654 2001-11-22 Ravi Pratap <ravi@ximian.com>
23656 * class.cs (EmitFieldInitializer): Take care of the case when we have a
23657 field which is an array type.
23659 * cs-parser.jay (declare_local_variables): Support array initialization too.
23661 * typemanager.cs (MakeKey): Implement.
23663 (everywhere): Use the above appropriately.
23665 * cs-parser.jay (for_statement): Update for array initialization while
23666 declaring variables.
23668 * ecore.cs : The error message was correct, it's the variable's names that
23669 were misleading ;-) Make the code more readable.
23671 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23672 the correct type etc.
23674 (ConvertExplicit): Handle Enum types by examining the underlying type.
23676 2001-11-21 Ravi Pratap <ravi@ximian.com>
23678 * parameter.cs (GetCallingConvention): Always return
23679 CallingConventions.Standard for now.
23681 2001-11-22 Miguel de Icaza <miguel@ximian.com>
23683 * expression.cs (Binary.ResolveOperator): Update the values of `l'
23684 and `r' after calling DoNumericPromotions.
23686 * ecore.cs: Fix error message (the types were in the wrong order).
23688 * statement.cs (Foreach.ProbeCollectionType): Need to pass
23689 BindingFlags.Instance as well
23691 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23692 implicit int literal conversion in an empty cast so that we
23693 propagate the right type upstream.
23695 (UnboxCast): new class used to unbox value types.
23696 (Expression.ConvertExplicit): Add explicit type conversions done
23699 (Expression.ImplicitNumericConversion): Oops, forgot to test for
23700 the target type before applying the implicit LongLiterals to ULong
23703 2001-11-21 Miguel de Icaza <miguel@ximian.com>
23705 * cs-parser.jay (for_statement): Reworked the way For works: now
23706 we declare manually any variables that are introduced in
23707 for_initializer to solve the problem of having out-of-band code
23708 emition (that is what got for broken).
23710 (declaration_statement): Perform the actual variable declaration
23711 that used to be done in local_variable_declaration here.
23713 (local_variable_declaration): Do not declare anything, just pass
23714 the information on a DictionaryEntry
23716 2001-11-20 Ravi Pratap <ravi@ximian.com>
23718 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23719 re-write of the logic to now make it recursive.
23721 (UpdateIndices): Re-write accordingly.
23723 Store element data in a separate ArrayData list in the above methods.
23725 (MakeByteBlob): Implement to dump the array data into a byte array.
23727 2001-11-19 Ravi Pratap <ravi@ximian.com>
23729 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23732 * constant.cs (Define): Implement.
23734 (EmitConstant): Re-write fully.
23736 Pass in location info.
23738 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23741 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23742 DictionaryEntry since we need location info too.
23744 (constant_declaration): Update accordingly.
23746 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23747 code into another method : UpdateIndices.
23749 2001-11-18 Ravi Pratap <ravi@ximian.com>
23751 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23752 some type checking etc.
23754 2001-11-17 Ravi Pratap <ravi@ximian.com>
23756 * expression.cs (ArrayCreation::ValidateInitializers): Implement
23757 bits to provide dimension info if the user skips doing that.
23759 Update second constructor to store the rank correctly.
23761 2001-11-16 Ravi Pratap <ravi@ximian.com>
23763 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23764 and try to implement.
23766 * ../errors/cs0150.cs : Add.
23768 * ../errors/cs0178.cs : Add.
23770 2001-11-16 Miguel de Icaza <miguel@ximian.com>
23772 * statement.cs: Implement foreach on multi-dimensional arrays.
23774 * parameter.cs (Parameters.GetParameterByName): Also lookup the
23775 name of the params argument.
23777 * expression.cs: Use EmitStoreOpcode to get the right opcode while
23778 initializing the array.
23780 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23781 we can use this elsewhere.
23783 * statement.cs: Finish implementation of foreach for single
23786 * cs-parser.jay: Use an out-of-band stack to pass information
23787 around, I wonder why I need this.
23789 foreach_block: Make the new foreach_block the current_block.
23791 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23792 function used to return a static Parameters structure. Used for
23793 empty parameters, as those are created very frequently.
23795 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23797 2001-11-15 Ravi Pratap <ravi@ximian.com>
23799 * interface.cs : Default modifier is private, not public. The
23800 make verify test passes again.
23802 2001-11-15 Ravi Pratap <ravi@ximian.com>
23804 * support.cs (ReflectionParameters): Fix logic to determine
23805 whether the last parameter is a params one. Test 9 passes again.
23807 * delegate.cs (Populate): Register the builders we define with
23808 RegisterParameterForBuilder. Test 19 passes again.
23810 * cs-parser.jay (property_declaration): Reference $6 instead
23811 of $$ to get at the location.
23813 (indexer_declaration): Similar stuff.
23815 (attribute): Ditto.
23817 * class.cs (Property): Register parameters for the Get and Set methods
23818 if they exist. Test 23 passes again.
23820 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23821 call to EmitArguments as we are sure there aren't any params arguments.
23822 Test 32 passes again.
23824 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23825 IndexOutOfRangeException.
23827 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23828 Test 33 now passes again.
23830 2001-11-15 Miguel de Icaza <miguel@ximian.com>
23832 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23833 broke a bunch of things. Will have to come up with a better way
23834 of tracking locations.
23836 * statement.cs: Implemented foreach for single dimension arrays.
23838 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23840 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23841 an error. This removes the lookup from the critical path.
23843 * cs-parser.jay: Removed use of temporary_loc, which is completely
23846 2001-11-14 Miguel de Icaza <miguel@ximian.com>
23848 * support.cs (ReflectionParameters.ParameterModifier): Report
23849 whether the argument is a PARAMS argument or not.
23851 * class.cs: Set the attribute `ParamArrayAttribute' on the
23852 parameter argument.
23854 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23855 and cons_param_array_attribute (ConstructorInfo for
23856 ParamArrayAttribute).,
23858 * codegen.cs: Emit the return using the `Return' statement, that
23859 way we can report the error correctly for missing return values.
23861 * class.cs (Method.Emit): Clean up.
23863 * expression.cs (Argument.Resolve): Take another argument: the
23864 location where this argument is used. Notice that this is not
23865 part of the "Argument" class as to reduce the size of the
23866 structure (we know the approximate location anyways).
23868 Test if the argument is a variable-reference, if not, then
23869 complain with a 206.
23871 (Argument.Emit): Emit addresses of variables.
23873 (Argument.FullDesc): Simplify.
23875 (Invocation.DoResolve): Update for Argument.Resolve.
23877 (ElementAccess.DoResolve): ditto.
23879 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23880 method should be virtual, as this method is always virtual.
23882 (NewDelegate.DoResolve): Update for Argument.Resolve.
23884 * class.cs (ConstructorInitializer.DoResolve): ditto.
23886 * attribute.cs (Attribute.Resolve): ditto.
23888 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23890 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23892 * expression.cs (ParameterReference): Drop IStackStorage and implement
23893 IAssignMethod instead.
23895 (LocalVariableReference): ditto.
23897 * ecore.cs (FieldExpr): Drop IStackStorage and implement
23898 IAssignMethod instead.
23900 2001-11-13 Miguel de Icaza <miguel@ximian.com>
23902 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23903 enumerations that are used in heavily used structures derive from
23904 byte in a laughable and pathetic attempt to reduce memory usage.
23905 This is the kind of pre-optimzations that you should not do at
23906 home without adult supervision.
23908 * expression.cs (UnaryMutator): New class, used to handle ++ and
23909 -- separatedly from the other unary operators. Cleans up the
23910 code, and kills the ExpressionStatement dependency in Unary.
23912 (Unary): Removed `method' and `Arguments' from this class, making
23913 it smaller, and moving it all to SimpleCall, so I can reuse this
23914 code in other locations and avoid creating a lot of transient data
23915 strucutres when not required.
23917 * cs-parser.jay: Adjust for new changes.
23919 2001-11-11 Miguel de Icaza <miguel@ximian.com>
23921 * enum.cs (Enum.Populate): If there is a failure during
23924 * cs-parser.jay (opt_enum_base): we used to catch type errors
23925 here, but this is really incorrect. The type error should be
23926 catched during semantic analysis.
23928 2001-12-11 Ravi Pratap <ravi@ximian.com>
23930 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23931 current_local_parameters as expected since I, in my stupidity, had forgotten
23934 * attribute.cs (GetValidPlaces): Fix stupid bug.
23936 * class.cs (Method::Emit): Perform check on applicability of attributes.
23938 (Constructor::Emit): Ditto.
23940 (Field::Emit): Ditto.
23942 (Field.Location): Store location information.
23944 (Property, Event, Indexer, Operator): Ditto.
23946 * cs-parser.jay (field_declaration): Pass in location for each field.
23948 * ../errors/cs0592.cs : Add.
23950 2001-11-12 Ravi Pratap <ravi@ximian.com>
23952 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23954 (InitCoreTypes): Update accordingly.
23956 (RegisterAttrType, LookupAttr): Implement.
23958 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23959 info about the same.
23961 (Resolve): Update to populate the above as necessary.
23963 (Error592): Helper.
23965 (GetValidPlaces): Helper to the above.
23967 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23969 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23971 2001-11-12 Ravi Pratap <ravi@ximian.com>
23973 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23975 * ../errors/cs0617.cs : Add.
23977 2001-11-11 Ravi Pratap <ravi@ximian.com>
23979 * enum.cs (Emit): Rename to Populate to be more consistent with what
23980 we expect it to do and when exactly it is called.
23982 * class.cs, rootcontext.cs : Update accordingly.
23984 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23985 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23987 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23989 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23990 of a fieldinfo using the above, when dealing with a FieldBuilder.
23992 2001-11-10 Ravi Pratap <ravi@ximian.com>
23994 * ../errors/cs0031.cs : Add.
23996 * ../errors/cs1008.cs : Add.
23998 * ../errrors/cs0543.cs : Add.
24000 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
24003 (FindMembers): Implement.
24005 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
24006 enums and delegates too.
24008 (enum_types): Rename to builder_to_enum.
24010 (delegate_types): Rename to builder_to_delegate.
24012 * delegate.cs (FindMembers): Implement.
24014 2001-11-09 Ravi Pratap <ravi@ximian.com>
24016 * typemanager.cs (IsEnumType): Implement.
24018 * enum.cs (Emit): Re-write parts to account for the underlying type
24019 better and perform checking etc.
24021 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
24022 of the underlying type.
24024 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
24027 * enum.cs (error31): Helper to report error #31.
24029 * cs-parser.jay (enum_declaration): Store location of each member too.
24031 * enum.cs (member_to_location): New hashtable.
24033 (AddEnumMember): Update location hashtable.
24035 (Emit): Use the location of each member while reporting errors.
24037 2001-11-09 Miguel de Icaza <miguel@ximian.com>
24039 * cs-parser.jay: A for_initializer if is a
24040 local_variable_declaration really ammount to have an implicit
24041 block with the variable declaration and no initializer for for.
24043 * statement.cs (For.Emit): Cope with null initializers.
24045 This fixes the infinite loop on for initializers.
24047 2001-11-08 Miguel de Icaza <miguel@ximian.com>
24049 * enum.cs: More cleanup.
24051 * ecore.cs: Remove dead code.
24053 * class.cs (Property.Emit): More simplification.
24054 (Event.Emit): ditto.
24056 Reworked to have less levels of indentation.
24058 2001-11-08 Ravi Pratap <ravi@ximian.com>
24060 * class.cs (Property): Emit attributes.
24070 * enum.cs (Emit): Ditto.
24072 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
24075 * class.cs (Field, Event, etc.): Move attribute generation into the
24076 Emit method everywhere.
24078 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
24079 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
24080 as we had no way of defining nested enums !
24082 * rootcontext.cs : Adjust code accordingly.
24084 * typemanager.cs (AddEnumType): To keep track of enum types separately.
24086 2001-11-07 Ravi Pratap <ravi@ximian.com>
24088 * expression.cs (EvalConstantExpression): Move into ecore.cs
24090 * enum.cs (Enum): Rename some members and make them public and readonly
24091 according to our convention.
24093 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
24096 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
24098 (Enum::Emit): Write a simple version for now which doesn't try to compute
24099 expressions. I shall modify this to be more robust in just a while.
24101 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
24103 (TypeContainer::CloseType): Create the Enum types too.
24105 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
24107 * expression.cs (EvalConstantExpression): Get rid of completely.
24109 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
24110 user-defined values and other cases.
24112 (IsValidEnumLiteral): Helper function.
24114 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
24115 out there in the case we had a literal FieldExpr.
24117 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
24119 (Literalize): Revamp a bit to take two arguments.
24121 (EnumLiteral): New class which derives from Literal to wrap enum literals.
24123 2001-11-06 Ravi Pratap <ravi@ximian.com>
24125 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
24127 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
24129 (Resolve): Use the above to ensure we have proper initializers.
24131 2001-11-05 Ravi Pratap <ravi@ximian.com>
24133 * expression.cs (Expression::EvalConstantExpression): New method to
24134 evaluate constant expressions.
24136 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
24138 2001-11-07 Miguel de Icaza <miguel@ximian.com>
24140 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
24143 (Binary.ResolveOperator): Handle operator != (object a, object b)
24144 and operator == (object a, object b);
24146 (Binary.DoNumericPromotions): Indicate whether the numeric
24147 promotion was possible.
24149 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
24152 Made the ArrayAccess implement interface IAssignMethod instead of
24153 IStackStore as the order in which arguments are passed reflects
24156 * assign.cs: Instead of using expr.ExprClass to select the way of
24157 assinging, probe for the IStackStore/IAssignMethod interfaces.
24159 * typemanager.cs: Load InitializeArray definition.
24161 * rootcontext.cs (RootContext.MakeStaticData): Used to define
24162 static data that can be used to initialize arrays.
24164 2001-11-05 Miguel de Icaza <miguel@ximian.com>
24166 * expression.cs: Handle operator== and operator!= for booleans.
24168 (Conditioal.Reduce): Implement reducer for the ?: operator.
24170 (Conditional.Resolve): Implement dead code elimination.
24172 (Binary.Resolve): Catch string literals and return a new
24173 concatenated string.
24175 (Unary.Reduce): Implement reduction of unary expressions.
24177 * ecore.cs: Split out the expression core handling here.
24179 (Expression.Reduce): New method used to perform constant folding
24180 and CSE. This is needed to support constant-expressions.
24182 * statement.cs (Statement.EmitBoolExpression): Pass true and false
24183 targets, and optimize for !x.
24185 2001-11-04 Ravi Pratap <ravi@ximian.com>
24187 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
24188 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
24189 set custom atttributes.
24191 * literal.cs (Literal::GetValue): New abstract method to return the actual
24192 value of the literal, cast as an object.
24194 (*Literal): Implement GetValue method.
24196 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
24197 expressions to the arraylist but objects of type Argument.
24199 * class.cs (TypeContainer::Emit): Emit our attributes too.
24201 (Method::Emit, Constructor::Emit): Ditto.
24203 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
24204 to be ignoring earlier.
24206 2001-11-03 Ravi Pratap <ravi@ximian.com>
24208 * attribute.cs (AttributeSection::Define): Implement to do the business
24209 of constructing a CustomAttributeBuilder.
24211 (Attribute): New trivial class. Increases readability of code.
24213 * cs-parser.jay : Update accordingly.
24215 (positional_argument_list, named_argument_list, named_argument): New rules
24217 (attribute_arguments): Use the above so that we are more correct.
24219 2001-11-02 Ravi Pratap <ravi@ximian.com>
24221 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
24222 to perform all checks for a method with a params parameter.
24224 (Invocation::OverloadResolve): Update to use the above method and therefore
24225 cope correctly with params method invocations.
24227 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
24230 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
24231 constructors in our parent too because we can't afford to miss out on
24234 * attribute.cs (AttributeSection): New name for the class Attribute
24236 Other trivial changes to improve readability.
24238 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
24239 use the new class names.
24241 2001-11-01 Ravi Pratap <ravi@ximian.com>
24243 * class.cs (Method::Define): Complete definition for params types too
24245 (Indexer::Define): Ditto.
24247 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
24248 Cope everywhere with a request for info about the array parameter.
24250 2001-11-01 Ravi Pratap <ravi@ximian.com>
24252 * tree.cs (RecordNamespace): Fix up to check for the correct key.
24254 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
24255 local_variable_type to extract the string corresponding to the type.
24257 (local_variable_type): Fixup the action to use the new helper method.
24259 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
24262 * expression.cs : Clean out code which uses the above.
24264 2001-10-31 Ravi Pratap <ravi@ximian.com>
24266 * typemanager.cs (RegisterMethod): Check if we already have an existing key
24267 and bale out if necessary by returning a false.
24269 (RegisterProperty): Ditto.
24271 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
24272 and print out appropriate error messages.
24274 * interface.cs (everywhere): Ditto.
24276 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
24277 location to constructor.
24279 * class.cs (Property, Event, Indexer): Update accordingly.
24281 * ../errors/cs111.cs : Added.
24283 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
24284 of a method, as laid down by the spec.
24286 (Invocation::OverloadResolve): Use the above method.
24288 2001-10-31 Ravi Pratap <ravi@ximian.com>
24290 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
24291 now take a TypeContainer and a Parameters object.
24293 (ParameterData): Modify return type of ParameterModifier method to be
24294 Parameter.Modifier and not a string.
24296 (ReflectionParameters, InternalParameters): Update accordingly.
24298 * expression.cs (Argument::GetParameterModifier): Same here.
24300 * support.cs (InternalParameters::ParameterType): Find a better way of determining
24301 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
24302 symbol in it at all so maybe this is only for now.
24304 2001-10-30 Ravi Pratap <ravi@ximian.com>
24306 * support.cs (InternalParameters): Constructor now takes an extra argument
24307 which is the actual Parameters class.
24309 (ParameterDesc): Update to provide info on ref/out modifiers.
24311 * class.cs (everywhere): Update call to InternalParameters to pass in
24312 the second argument too.
24314 * support.cs (ParameterData): Add ParameterModifier, which is a method
24315 to return the modifier info [ref/out etc]
24317 (InternalParameters, ReflectionParameters): Implement the above.
24319 * expression.cs (Argument::ParameterModifier): Similar function to return
24320 info about the argument's modifiers.
24322 (Invocation::OverloadResolve): Update to take into account matching modifiers
24325 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
24326 a new SetFormalParameters object which we pass to InternalParameters.
24328 2001-10-30 Ravi Pratap <ravi@ximian.com>
24330 * expression.cs (NewArray): Merge into the ArrayCreation class.
24332 2001-10-29 Ravi Pratap <ravi@ximian.com>
24334 * expression.cs (NewArray): Merge classes NewBuiltinArray and
24335 NewUserdefinedArray into one as there wasn't much of a use in having
24338 * expression.cs (Argument): Change field's name to ArgType from Type.
24340 (Type): New readonly property which returns the proper type, taking into
24341 account ref/out modifiers.
24343 (everywhere): Adjust code accordingly for the above.
24345 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
24346 whether we are emitting for a ref or out parameter.
24348 * expression.cs (Argument::Emit): Use the above field to set the state.
24350 (LocalVariableReference::Emit): Update to honour the flag and emit the
24353 * parameter.cs (Attributes): Set the correct flags for ref parameters.
24355 * expression.cs (Argument::FullDesc): New function to provide a full desc.
24357 * support.cs (ParameterData): Add method ParameterDesc to the interface.
24359 (ReflectionParameters, InternalParameters): Implement the above method.
24361 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
24364 (Invocation::FullMethodDesc): Ditto.
24366 2001-10-29 Miguel de Icaza <miguel@ximian.com>
24368 * cs-parser.jay: Add extra production for the second form of array
24371 * expression.cs (ArrayCreation): Update to reflect the above
24374 * Small changes to prepare for Array initialization.
24376 2001-10-28 Miguel de Icaza <miguel@ximian.com>
24378 * typemanager.cs (ImplementsInterface): interface might be null;
24379 Deal with this problem;
24381 Also, we do store negative hits on the cache (null values), so use
24382 this instead of calling t.GetInterfaces on the type everytime.
24384 2001-10-28 Ravi Pratap <ravi@ximian.com>
24386 * typemanager.cs (IsBuiltinType): New method to help determine the same.
24388 * expression.cs (New::DoResolve): Get rid of array creation code and instead
24389 split functionality out into different classes.
24391 (New::FormArrayType): Move into NewBuiltinArray.
24393 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
24396 (NewBuiltinArray): New class to handle creation of built-in arrays.
24398 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
24399 account creation of one-dimensional arrays.
24401 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
24403 (NewUserdefinedArray::DoResolve): Implement.
24405 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
24407 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
24408 we maintain inside the TypeManager. This is necessary to perform lookups on the
24411 (LookupType): Update to perform GetType on the module builders too.
24413 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
24415 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
24417 2001-10-23 Ravi Pratap <ravi@ximian.com>
24419 * expression.cs (New::DoResolve): Implement guts of array creation.
24421 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
24423 2001-10-27 Miguel de Icaza <miguel@ximian.com>
24425 * expression.cs: Fix bug I introduced lsat night that broke
24428 (Expression.Resolve): Report a 246 error (can not resolve name)
24429 if we find a SimpleName in the stream.
24431 (Expression.ResolveLValue): Ditto.
24433 (Expression.ResolveWithSimpleName): This function is a variant of
24434 ResolveName, this one allows SimpleNames to be returned without a
24435 warning. The only consumer of SimpleNames is MemberAccess
24437 2001-10-26 Miguel de Icaza <miguel@ximian.com>
24439 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
24440 might arrive here. I have my doubts that this is correct.
24442 * statement.cs (Lock): Implement lock statement.
24444 * cs-parser.jay: Small fixes to support `lock' and `using'
24446 * cs-tokenizer.cs: Remove extra space
24448 * driver.cs: New flag --checked, allows to turn on integer math
24451 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
24452 Threading.Monitor.Exit
24454 2001-10-23 Miguel de Icaza <miguel@ximian.com>
24456 * expression.cs (IndexerAccess::DoResolveLValue): Set the
24457 Expression Class to be IndexerAccess.
24459 Notice that Indexer::DoResolve sets the eclass to Value.
24461 2001-10-22 Miguel de Icaza <miguel@ximian.com>
24463 * class.cs (TypeContainer::Emit): Emit code for indexers.
24465 * assign.cs (IAssignMethod): New interface implemented by Indexers
24466 and Properties for handling assignment.
24468 (Assign::Emit): Simplify and reuse code.
24470 * expression.cs (IndexerAccess, PropertyExpr): Implement
24471 IAssignMethod, clean up old code.
24473 2001-10-22 Ravi Pratap <ravi@ximian.com>
24475 * typemanager.cs (ImplementsInterface): New method to determine if a type
24476 implements a given interface. Provides a nice cache too.
24478 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
24481 (ConvertReferenceExplicit): Ditto.
24483 * delegate.cs (Delegate::Populate): Update to define the parameters on the
24484 various methods, with correct names etc.
24486 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
24487 Operator.UnaryNegation.
24489 * cs-parser.jay (operator_declarator): Be a little clever in the case where
24490 we have a unary plus or minus operator.
24492 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
24495 * everywhere : update accordingly.
24497 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
24500 * class.cs (Method::Define): For the case where we are implementing a method
24501 inherited from an interface, we need to set the MethodAttributes.Final flag too.
24502 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
24504 2001-10-21 Ravi Pratap <ravi@ximian.com>
24506 * interface.cs (FindMembers): Implement to work around S.R.E
24509 * typemanager.cs (IsInterfaceType): Implement.
24511 (FindMembers): Update to handle interface types too.
24513 * expression.cs (ImplicitReferenceConversion): Re-write bits which
24514 use IsAssignableFrom as that is not correct - it doesn't work.
24516 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
24517 and accordingly override EmitStatement.
24519 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24520 using the correct logic :-)
24522 2001-10-19 Ravi Pratap <ravi@ximian.com>
24524 * ../errors/cs-11.cs : Add to demonstrate error -11
24526 2001-10-17 Miguel de Icaza <miguel@ximian.com>
24528 * assign.cs (Assign::Resolve): Resolve right hand side first, and
24529 then pass this as a hint to ResolveLValue.
24531 * expression.cs (FieldExpr): Add Location information
24533 (FieldExpr::LValueResolve): Report assignment to readonly
24536 (Expression::ExprClassFromMemberInfo): Pass location information.
24538 (Expression::ResolveLValue): Add new method that resolves an
24541 (Expression::DoResolveLValue): Default invocation calls
24544 (Indexers): New class used to keep track of indexers in a given
24547 (IStackStore): Renamed from LValue, as it did not really describe
24548 what this did. Also ResolveLValue is gone from this interface and
24549 now is part of Expression.
24551 (ElementAccess): Depending on the element access type
24553 * typemanager.cs: Add `indexer_name_type' as a Core type
24554 (System.Runtime.CompilerServices.IndexerNameAttribute)
24556 * statement.cs (Goto): Take a location.
24558 2001-10-18 Ravi Pratap <ravi@ximian.com>
24560 * delegate.cs (Delegate::VerifyDelegate): New method to verify
24561 if two delegates are compatible.
24563 (NewDelegate::DoResolve): Update to take care of the case when
24564 we instantiate a delegate from another delegate.
24566 * typemanager.cs (FindMembers): Don't even try to look up members
24567 of Delegate types for now.
24569 2001-10-18 Ravi Pratap <ravi@ximian.com>
24571 * delegate.cs (NewDelegate): New class to take care of delegate
24574 * expression.cs (New): Split the delegate related code out into
24575 the NewDelegate class.
24577 * delegate.cs (DelegateInvocation): New class to handle delegate
24580 * expression.cs (Invocation): Split out delegate related code into
24581 the DelegateInvocation class.
24583 2001-10-17 Ravi Pratap <ravi@ximian.com>
24585 * expression.cs (New::DoResolve): Implement delegate creation fully
24586 and according to the spec.
24588 (New::DoEmit): Update to handle delegates differently.
24590 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24591 because of which we were printing out arguments in reverse order !
24593 * delegate.cs (VerifyMethod): Implement to check if the given method
24594 matches the delegate.
24596 (FullDelegateDesc): Implement.
24598 (VerifyApplicability): Implement.
24600 * expression.cs (Invocation::DoResolve): Update to accordingly handle
24601 delegate invocations too.
24603 (Invocation::Emit): Ditto.
24605 * ../errors/cs1593.cs : Added.
24607 * ../errors/cs1594.cs : Added.
24609 * delegate.cs (InstanceExpression, TargetMethod): New properties.
24611 2001-10-16 Ravi Pratap <ravi@ximian.com>
24613 * typemanager.cs (intptr_type): Core type for System.IntPtr
24615 (InitCoreTypes): Update for the same.
24617 (iasyncresult_type, asynccallback_type): Ditto.
24619 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24622 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24625 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24626 the builders for the 4 members of a delegate type :-)
24628 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24631 * expression.cs (New::DoResolve): Implement guts for delegate creation.
24633 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24635 2001-10-15 Miguel de Icaza <miguel@ximian.com>
24637 * statement.cs (Break::Emit): Implement.
24638 (Continue::Emit): Implement.
24640 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
24641 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
24642 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
24643 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
24646 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24647 properties that track the label for the current loop (begin of the
24648 loop and end of the loop).
24650 2001-10-15 Ravi Pratap <ravi@ximian.com>
24652 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24653 use of emitting anything at all.
24655 * class.cs, rootcontext.cs : Get rid of calls to the same.
24657 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24659 (Populate): Define the constructor correctly and set the implementation
24662 * typemanager.cs (delegate_types): New hashtable to hold delegates that
24665 (AddDelegateType): Implement.
24667 (IsDelegateType): Implement helper method.
24669 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24671 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24672 and accordingly handle it.
24674 * delegate.cs (Populate): Take TypeContainer argument.
24675 Implement bits to define the Invoke method. However, I still haven't figured out
24676 how to take care of the native int bit :-(
24678 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
24679 Qualify the name of the delegate, not its return type !
24681 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24684 (StandardConversionExists): Checking for array types turns out to be recursive.
24686 (ConvertReferenceExplicit): Implement array conversion.
24688 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24690 2001-10-12 Ravi Pratap <ravi@ximian.com>
24692 * cs-parser.jay (delegate_declaration): Store the fully qualified
24693 name as it is a type declaration.
24695 * delegate.cs (ReturnType, Name): Rename members to these. Make them
24698 (DefineDelegate): Renamed from Define. Does the same thing essentially,
24699 as TypeContainer::DefineType.
24701 (Populate): Method in which all the definition of the various methods (Invoke)
24704 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24707 (CloseDelegate): Finally creates the delegate.
24709 * class.cs (TypeContainer::DefineType): Update to define delegates.
24710 (Populate, Emit and CloseType): Do the same thing here too.
24712 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24713 delegates in all these operations.
24715 2001-10-14 Miguel de Icaza <miguel@ximian.com>
24717 * expression.cs: LocalTemporary: a new expression used to
24718 reference a temporary that has been created.
24720 * assign.cs: Handle PropertyAccess back here, so that we can
24721 provide the proper semantic access to properties.
24723 * expression.cs (Expression::ConvertReferenceExplicit): Implement
24724 a few more explicit conversions.
24726 * modifiers.cs: `NEW' modifier maps to HideBySig.
24728 * expression.cs (PropertyExpr): Make this into an
24729 ExpressionStatement, and support the EmitStatement code path.
24731 Perform get/set error checking, clean up the interface.
24733 * assign.cs: recognize PropertyExprs as targets, and if so, turn
24734 them into toplevel access objects.
24736 2001-10-12 Miguel de Icaza <miguel@ximian.com>
24738 * expression.cs: PropertyExpr::PropertyExpr: use work around the
24741 * typemanager.cs: Keep track here of our PropertyBuilders again to
24742 work around lameness in SRE.
24744 2001-10-11 Miguel de Icaza <miguel@ximian.com>
24746 * expression.cs (LValue::LValueResolve): New method in the
24747 interface, used to perform a second resolution pass for LValues.
24749 (This::DoResolve): Catch the use of this in static methods.
24751 (This::LValueResolve): Implement.
24753 (This::Store): Remove warning, assigning to `this' in structures
24756 (Invocation::Emit): Deal with invocation of
24757 methods on value types. We need to pass the address to structure
24758 methods rather than the object itself. (The equivalent code to
24759 emit "this" for structures leaves the entire structure on the
24760 stack instead of a pointer to it).
24762 (ParameterReference::DoResolve): Compute the real index for the
24763 argument based on whether the method takes or not a `this' pointer
24764 (ie, the method is static).
24766 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24767 value types returned from functions when we need to invoke a
24768 method on the sturcture.
24771 2001-10-11 Ravi Pratap <ravi@ximian.com>
24773 * class.cs (TypeContainer::DefineType): Method to actually do the business of
24774 defining the type in the Modulebuilder or Typebuilder. This is to take
24775 care of nested types which need to be defined on the TypeBuilder using
24776 DefineNestedMethod.
24778 (TypeContainer::GetClassBases): Implement. Essentially the code from the
24779 methods in RootContext, only ported to be part of TypeContainer.
24781 (TypeContainer::GetInterfaceOrClass): Ditto.
24783 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24785 * interface.cs (Interface::DefineInterface): New method. Does exactly
24786 what RootContext.CreateInterface did earlier, only it takes care of nested types
24789 (Interface::GetInterfaces): Move from RootContext here and port.
24791 (Interface::GetInterfaceByName): Same here.
24793 * rootcontext.cs (ResolveTree): Re-write.
24795 (PopulateTypes): Re-write.
24797 * class.cs (TypeContainer::Populate): Populate nested types too.
24798 (TypeContainer::Emit): Emit nested members too.
24800 * typemanager.cs (AddUserType): Do not make use of the FullName property,
24801 instead just use the name argument passed in as it is already fully
24804 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24805 to TypeContainer mapping to see if a type is user-defined.
24807 * class.cs (TypeContainer::CloseType): Implement.
24809 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24810 the default constructor.
24812 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24815 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24817 * interface.cs (CloseType): Create the type here.
24819 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24822 Remove all the methods which are now in TypeContainer.
24824 2001-10-10 Ravi Pratap <ravi@ximian.com>
24826 * delegate.cs (Define): Re-write bits to define the delegate
24829 2001-10-10 Miguel de Icaza <miguel@ximian.com>
24831 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24833 * expression.cs (ImplicitReferenceConversion): handle null as well
24834 as a source to convert to any reference type.
24836 * statement.cs (Return): Perform any implicit conversions to
24837 expected return type.
24839 Validate use of return statement.
24841 * codegen.cs (EmitContext): Pass the expected return type here.
24843 * class.cs (Method, Constructor, Property): Pass expected return
24844 type to EmitContext.
24846 2001-10-09 Miguel de Icaza <miguel@ximian.com>
24848 * expression.cs: Make DoResolve take an EmitContext instead of a
24851 Replaced `l' and `location' for `loc', for consistency.
24853 (Error, Warning): Remove unneeded Tc argument.
24855 * assign.cs, literal.cs, constant.cs: Update to new calling
24858 * codegen.cs: EmitContext now contains a flag indicating whether
24859 code is being generated in a static method or not.
24861 * cs-parser.jay: DecomposeQI, new function that replaces the old
24862 QualifiedIdentifier. Now we always decompose the assembled
24863 strings from qualified_identifier productions into a group of
24866 2001-10-08 Miguel de Icaza <miguel@ximian.com>
24868 * rootcontext.cs: Deal with field-less struct types correctly now
24869 by passing the size option to Define Type.
24871 * class.cs: Removed hack that created one static field.
24873 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24875 * statement.cs: Moved most of the code generation here.
24877 2001-10-09 Ravi Pratap <ravi@ximian.com>
24879 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24882 (ElementAccess): Remove useless bits for now - keep checks as the spec
24885 2001-10-08 Ravi Pratap <ravi@ximian.com>
24887 * expression.cs (ElementAccess::DoResolve): Remove my crap code
24888 and start performing checks according to the spec.
24890 2001-10-07 Ravi Pratap <ravi@ximian.com>
24892 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24893 rank_specifiers instead.
24895 (rank_specifiers): Change the order in which the rank specifiers are stored
24897 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24899 * expression.cs (ElementAccess): Implement the LValue interface too.
24901 2001-10-06 Ravi Pratap <ravi@ximian.com>
24903 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24904 except that user defined conversions are not included.
24906 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
24907 perform the conversion of the return type, if necessary.
24909 (New::DoResolve): Check whether we are creating an array or an object
24910 and accordingly do the needful.
24912 (New::Emit): Same here.
24914 (New::DoResolve): Implement guts of array creation.
24916 (New::FormLookupType): Helper function.
24918 2001-10-07 Miguel de Icaza <miguel@ximian.com>
24920 * codegen.cs: Removed most of the code generation here, and move the
24921 corresponding code generation bits to the statement classes.
24923 Added support for try/catch/finalize and throw.
24925 * cs-parser.jay: Added support for try/catch/finalize.
24927 * class.cs: Catch static methods having the flags override,
24928 virtual or abstract.
24930 * expression.cs (UserCast): This user cast was not really doing
24931 what it was supposed to do. Which is to be born in fully resolved
24932 state. Parts of the resolution were being performed at Emit time!
24936 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24938 * expression.cs: Implicity convert the result from UserCast.
24940 2001-10-05 Ravi Pratap <ravi@ximian.com>
24942 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24943 prevented it from working correctly.
24945 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24946 merely ConvertImplicit.
24948 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24950 * typemanager.cs: Make the LookupTypeContainer function static,
24951 and not per-instance.
24953 * class.cs: Make static FindMembers (the one that takes a Type
24956 * codegen.cs: Add EmitForeach here.
24958 * cs-parser.jay: Make foreach a toplevel object instead of the
24959 inline expansion, as we need to perform semantic analysis on it.
24961 2001-10-05 Ravi Pratap <ravi@ximian.com>
24963 * expression.cs (Expression::ImplicitUserConversion): Rename to
24964 UserDefinedConversion.
24966 (Expression::UserDefinedConversion): Take an extra argument specifying
24967 whether we look for explicit user conversions too.
24969 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24971 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24973 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24974 with the appropriate arguments.
24976 * cs-parser.jay (cast_expression): Record location too.
24978 * expression.cs (Cast): Record location info.
24980 (Expression::ConvertExplicit): Take location argument.
24982 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24983 to determine if we are doing explicit conversions.
24985 (UserCast::Emit): Update accordingly.
24987 (Expression::ConvertExplicit): Report an error if everything fails.
24989 * ../errors/cs0030.cs : Add.
24991 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24993 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24994 virtual and newslot bits.
24996 * class.cs (TypeContainer::RegisterRequiredImplementations):
24997 Record methods we need.
24999 (TypeContainer::MakeKey): Helper function to make keys for
25000 MethodBases, since the Methodbase key is useless.
25002 (TypeContainer::Populate): Call RegisterRequiredImplementations
25003 before defining the methods.
25005 Create a mapping for method_builders_to_methods ahead of time
25006 instead of inside a tight loop.
25008 (::RequireMethods): Accept an object as the data to set into the
25009 hashtable so we can report interface vs abstract method mismatch.
25011 2001-10-03 Miguel de Icaza <miguel@ximian.com>
25013 * report.cs: Make all of it static.
25015 * rootcontext.cs: Drop object_type and value_type computations, as
25016 we have those in the TypeManager anyways.
25018 Drop report instance variable too, now it is a global.
25020 * driver.cs: Use try/catch on command line handling.
25022 Add --probe option to debug the error reporting system with a test
25025 * report.cs: Add support for exiting program when a probe
25026 condition is reached.
25028 2001-10-03 Ravi Pratap <ravi@ximian.com>
25030 * expression.cs (Binary::DoNumericPromotions): Fix the case when
25031 we do a forcible conversion regardless of type, to check if
25032 ForceConversion returns a null.
25034 (Binary::error19): Use location to report error.
25036 (Unary::error23): Use location here too.
25038 * ../errors/cs0019.cs : Check in.
25040 * ../errors/cs0023.cs : Check in.
25042 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
25043 case of a non-null MethodInfo object with a length of 0 !
25045 (Binary::ResolveOperator): Flag error if overload resolution fails to find
25046 an applicable member - according to the spec :-)
25047 Also fix logic to find members in base types.
25049 (Unary::ResolveOperator): Same here.
25051 (Unary::report23): Change name to error23 and make first argument a TypeContainer
25052 as I was getting thoroughly confused between this and error19 :-)
25054 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
25055 (::FindMostEncompassedType): Implement.
25056 (::FindMostEncompassingType): Implement.
25057 (::StandardConversionExists): Implement.
25059 (UserImplicitCast): Re-vamp. We now need info about most specific
25060 source and target types so that we can do the necessary conversions.
25062 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
25063 mathematical union with no duplicates.
25065 2001-10-03 Miguel de Icaza <miguel@ximian.com>
25067 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
25068 in order from base classes to child classes, so that we can in
25069 child classes look up in our parent for method names and
25070 attributes (required for handling abstract, virtual, new, override
25071 constructs: we need to instrospect our base class, and if we dont
25072 populate the classes in order, the introspection might be
25073 incorrect. For example, a method could query its parent before
25074 the parent has any methods and would determine that the parent has
25075 no abstract methods (while it could have had them)).
25077 (RootContext::CreateType): Record the order in which we define the
25080 2001-10-02 Miguel de Icaza <miguel@ximian.com>
25082 * class.cs (TypeContainer::Populate): Also method definitions can
25083 fail now, keep track of this.
25085 (TypeContainer::FindMembers): Implement support for
25086 DeclaredOnly/noDeclaredOnly flag.
25088 (Constructor::Emit) Return the ConstructorBuilder.
25090 (Method::Emit) Return the MethodBuilder.
25091 Check for abstract or virtual methods to be public.
25093 * rootcontext.cs (RootContext::CreateType): Register all the
25094 abstract methods required for the class to be complete and the
25095 interface methods that must be implemented.
25097 * cs-parser.jay: Report error 501 (method requires body if it is
25098 not marked abstract or extern).
25100 * expression.cs (TypeOf::Emit): Implement.
25102 * typemanager.cs: runtime_handle_type, new global type.
25104 * class.cs (Property::Emit): Generate code for properties.
25106 2001-10-02 Ravi Pratap <ravi@ximian.com>
25108 * expression.cs (Unary::ResolveOperator): Find operators on base type
25109 too - we now conform exactly to the spec.
25111 (Binary::ResolveOperator): Same here.
25113 * class.cs (Operator::Define): Fix minor quirk in the tests.
25115 * ../errors/cs0215.cs : Added.
25117 * ../errors/cs0556.cs : Added.
25119 * ../errors/cs0555.cs : Added.
25121 2001-10-01 Miguel de Icaza <miguel@ximian.com>
25123 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
25124 single integer which is really efficient
25126 2001-10-01 Ravi Pratap <ravi@ximian.com>
25128 * expression.cs (Expression::ImplicitUserConversion): Use location
25129 even in the case when we are examining True operators.
25131 * class.cs (Operator::Define): Perform extensive checks to conform
25132 with the rules for operator overloading in the spec.
25134 * expression.cs (Expression::ImplicitReferenceConversion): Implement
25135 some of the other conversions mentioned in the spec.
25137 * typemanager.cs (array_type): New static member for the System.Array built-in
25140 (cloneable_interface): For System.ICloneable interface.
25142 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
25143 we start resolving the tree and populating types.
25145 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
25147 2001-10-01 Miguel de Icaza <miguel@ximian.com>
25149 * expression.cs (Expression::ExprClassFromMemberInfo,
25150 Expression::Literalize): Create literal expressions from
25151 FieldInfos which are literals.
25153 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
25154 type casts, because they were wrong. The test suite in tests
25157 (ImplicitNumericConversion): ushort to ulong requires a widening
25160 Int32 constant to long requires widening cast as well.
25162 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
25163 for integers because the type on the stack is not i4.
25165 2001-09-30 Miguel de Icaza <miguel@ximian.com>
25167 * expression.cs (report118): require location argument.
25169 * parameter.cs: Do not dereference potential null value.
25171 * class.cs: Catch methods that lack the `new' keyword when
25172 overriding a name. Report warnings when `new' is used without
25173 anything being there to override.
25175 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
25177 * class.cs: Only add constructor to hashtable if it is non-null
25178 (as now constructors can fail on define).
25180 (TypeManager, Class, Struct): Take location arguments.
25182 Catch field instance initialization in structs as errors.
25184 accepting_filter: a new filter for FindMembers that is static so
25185 that we dont create an instance per invocation.
25187 (Constructor::Define): Catch errors where a struct constructor is
25190 * cs-parser.jay: Pass location information for various new
25193 * delegate.cs (Delegate): take a location argument.
25195 * driver.cs: Do not call EmitCode if there were problesm in the
25196 Definition of the types, as many Builders wont be there.
25198 * decl.cs (Decl::Decl): Require a location argument.
25200 * cs-tokenizer.cs: Handle properly hex constants that can not fit
25201 into integers, and find the most appropiate integer for it.
25203 * literal.cs: Implement ULongLiteral.
25205 * rootcontext.cs: Provide better information about the location of
25206 failure when CreateType fails.
25208 2001-09-29 Miguel de Icaza <miguel@ximian.com>
25210 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
25213 * expression.cs (Binary::CheckShiftArguments): Add missing type
25215 (Binary::ResolveOperator): Add type to the logical and and logical
25216 or, Bitwise And/Or and Exclusive Or code paths, it was missing
25219 (Binary::DoNumericPromotions): In the case where either argument
25220 is ulong (and most signed types combined with ulong cause an
25221 error) perform implicit integer constant conversions as well.
25223 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25225 * expression.cs (UserImplicitCast): Method should always be
25227 (Invocation::BetterConversion): Simplified test for IntLiteral.
25229 (Expression::ImplicitNumericConversion): Split this routine out.
25230 Put the code that performs implicit constant integer conversions
25233 (Expression::Resolve): Become a wrapper around DoResolve so we can
25234 check eclass and type being set after resolve.
25236 (Invocation::Badness): Remove this dead function
25238 (Binary::ResolveOperator): Do not compute the expensive argumnets
25239 unless we have a union for it.
25241 (Probe::Emit): Is needs to do an isinst and then
25242 compare against null.
25244 (::CanConvert): Added Location argument. If the Location argument
25245 is null (Location.Null), then we do not report errors. This is
25246 used by the `probe' mechanism of the Explicit conversion. We do
25247 not want to generate an error for something that the user
25248 explicitly requested to be casted. But the pipeline for an
25249 explicit cast first tests for potential implicit casts.
25251 So for now, if the Location is null, it means `Probe only' to
25252 avoid adding another argument. Might have to revise this
25255 (ClassCast): New class used to type cast objects into arbitrary
25256 classes (used in Explicit Reference Conversions).
25258 Implement `as' as well.
25260 Reverted all the patches from Ravi below: they were broken:
25262 * The use of `level' as a mechanism to stop recursive
25263 invocations is wrong. That was there just to catch the
25264 bug with a strack trace but not as a way of addressing
25267 To fix the problem we have to *understand* what is going
25268 on and the interactions and come up with a plan, not
25269 just get things going.
25271 * The use of the type conversion cache that I proposed
25272 last night had an open topic: How does this work across
25273 protection domains. A user defined conversion might not
25274 be public in the location where we are applying the
25275 conversion, a different conversion might be selected
25276 (ie, private A->B (better) but public B->A (worse),
25277 inside A, A->B applies, but outside it, B->A will
25280 * On top of that (ie, even if the above is solved),
25281 conversions in a cache need to be abstract. Ie, `To
25282 convert from an Int to a Short use an OpcodeCast', not
25283 `To convert from an Int to a Short use the OpcodeCast on
25284 the variable 5' (which is what this patch was doing).
25286 2001-09-28 Ravi Pratap <ravi@ximian.com>
25288 * expression.cs (Invocation::ConversionExists): Re-write to use
25289 the conversion cache
25291 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
25292 cache all conversions done, not just user-defined ones.
25294 (Invocation::BetterConversion): The real culprit. Use ConversionExists
25295 to determine if a conversion exists instead of acutually trying to
25296 perform the conversion. It's faster too.
25298 (Expression::ConvertExplicit): Modify to use ConversionExists to check
25299 and only then attempt the implicit conversion.
25301 2001-09-28 Ravi Pratap <ravi@ximian.com>
25303 * expression.cs (ConvertImplicit): Use a cache for conversions
25304 already found. Check level of recursion and bail out if necessary.
25306 2001-09-28 Miguel de Icaza <miguel@ximian.com>
25308 * typemanager.cs (string_concat_string_string, string_concat_object_object):
25309 Export standard methods that we expect for string operations.
25311 * statement.cs (Block::UsageWarning): Track usage of variables and
25312 report the errors for not used variables.
25314 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
25317 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25319 * codegen.cs: remove unnneded code
25321 * expression.cs: Removed BuiltinTypeAccess class
25323 Fix the order in which implicit conversions are
25326 The previous fixed dropped support for boxed conversions (adding a
25327 test to the test suite now)
25329 (UserImplicitCast::CanConvert): Remove test for source being null,
25330 that code is broken. We should not feed a null to begin with, if
25331 we do, then we should track the bug where the problem originates
25332 and not try to cover it up here.
25334 Return a resolved expression of type UserImplicitCast on success
25335 rather than true/false. Ravi: this is what I was talking about,
25336 the pattern is to use a static method as a "constructor" for
25339 Also, do not create arguments until the very last minute,
25340 otherwise we always create the arguments even for lookups that
25341 will never be performed.
25343 (UserImplicitCast::Resolve): Eliminate, objects of type
25344 UserImplicitCast are born in a fully resolved state.
25346 * typemanager.cs (InitCoreTypes): Init also value_type
25347 (System.ValueType).
25349 * expression.cs (Cast::Resolve): First resolve the child expression.
25351 (LValue): Add new method AddressOf to be used by
25354 Change the argument of Store to take an EmitContext instead of an
25355 ILGenerator, because things like FieldExpr need to be able to call
25356 their children expression to generate the instance code.
25358 (Expression::Error, Expression::Warning): Sugar functions for
25361 (Expression::MemberLookup): Accept a TypeContainer instead of a
25362 Report as the first argument.
25364 (Expression::ResolvePrimary): Killed. I still want to improve
25365 this as currently the code is just not right.
25367 (Expression::ResolveMemberAccess): Simplify, but it is still
25370 (Unary::Resolve): Catch errors in AddressOf operators.
25372 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
25373 index to a byte for the short-version, or the compiler will choose
25374 the wrong Emit call, which generates the wrong data.
25376 (ParameterReference::Emit, ::Store): same.
25378 (FieldExpr::AddressOf): Implement.
25380 * typemanager.cs: TypeManager: made public variable instead of
25383 * driver.cs: document --fatal.
25385 * report.cs (ErrorMessage, WarningMessage): new names for the old
25386 Error and Warning classes.
25388 * cs-parser.jay (member_access): Turn built-in access to types
25389 into a normal simplename
25391 2001-09-27 Ravi Pratap <ravi@ximian.com>
25393 * expression.cs (Invocation::BetterConversion): Fix to cope
25394 with q being null, since this was introducing a bug.
25396 * expression.cs (ConvertImplicit): Do built-in conversions first.
25398 2001-09-27 Ravi Pratap <ravi@ximian.com>
25400 * expression.cs (UserImplicitCast::Resolve): Fix bug.
25402 2001-09-27 Ravi Pratap <ravi@ximian.com>
25404 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
25405 I had introduced long ago (what's new ?).
25407 * expression.cs (UserImplicitCast::CanConvert): Static method to do
25408 the work of all the checking.
25409 (ConvertImplicit): Call CanConvert and only then create object if necessary.
25410 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
25412 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
25413 that is the right way.
25415 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
25416 overloading resolution. Use everywhere instead of cutting and pasting code.
25418 (Binary::ResolveOperator): Use MakeUnionSet.
25420 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
25421 we have to convert to bool types. Not complete yet.
25423 2001-09-27 Miguel de Icaza <miguel@ximian.com>
25425 * typemanager.cs (TypeManager::CSharpName): support ushort.
25427 * expression.cs (Expression::TryImplicitIntConversion): Attempts
25428 to provide an expression that performsn an implicit constant int
25429 conversion (section 6.1.6).
25430 (Expression::ConvertImplicitRequired): Reworked to include
25431 implicit constant expression conversions.
25433 (Expression::ConvertNumericExplicit): Finished.
25435 (Invocation::Emit): If InstanceExpression is null, then it means
25436 that we perform a call on this.
25438 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25440 * expression.cs (Unary::Emit): Remove some dead code.
25441 (Probe): Implement Resolve and Emit for `is'.
25442 (Expression::ConvertImplicitRequired): Attempt to do constant
25443 expression conversions here. Maybe should be moved to
25444 ConvertImplicit, but I am not sure.
25445 (Expression::ImplicitLongConstantConversionPossible,
25446 Expression::ImplicitIntConstantConversionPossible): New functions
25447 that tell whether is it possible to apply an implicit constant
25448 expression conversion.
25450 (ConvertNumericExplicit): Started work on explicit numeric
25453 * cs-parser.jay: Update operator constants.
25455 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
25456 (Parameters::GetSignature): Hook up VerifyArgs here.
25457 (Parameters::VerifyArgs): Verifies that no two arguments have the
25460 * class.cs (Operator): Update the operator names to reflect the
25461 ones that the spec expects (as we are just stringizing the
25464 * expression.cs (Unary::ResolveOperator): Fix bug: Use
25465 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
25466 previous usage did only work for our methods.
25467 (Expression::ConvertImplicit): Handle decimal implicit numeric
25468 conversions as well.
25469 (Expression::InternalTypeConstructor): Used to invoke constructors
25470 on internal types for default promotions.
25472 (Unary::Emit): Implement special handling for the pre/post
25473 increment/decrement for overloaded operators, as they need to have
25474 the same semantics as the other operators.
25476 (Binary::ResolveOperator): ditto.
25477 (Invocation::ConversionExists): ditto.
25478 (UserImplicitCast::Resolve): ditto.
25480 2001-09-26 Ravi Pratap <ravi@ximian.com>
25482 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
25483 operator, return after emitting body. Regression tests pass again !
25485 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
25486 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
25487 (Invocation::OverloadResolve): Ditto.
25488 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
25490 * everywhere : update calls to the above methods accordingly.
25492 2001-09-26 Miguel de Icaza <miguel@ximian.com>
25494 * assign.cs (Assign): Make it inherit from ExpressionStatement.
25496 * expression.cs (ExpressionStatement): New base class used for
25497 expressions that can appear in statements, so that we can provide
25498 an alternate path to generate expression that do not leave a value
25501 (Expression::Emit, and all the derivatives): We no longer return
25502 whether a value is left on the stack or not. Every expression
25503 after being emitted leaves a single value on the stack.
25505 * codegen.cs (EmitContext::EmitStatementExpression): Use the
25506 facilties of ExpressionStatement if possible.
25508 * cs-parser.jay: Update statement_expression.
25510 2001-09-25 Miguel de Icaza <miguel@ximian.com>
25512 * driver.cs: Change the wording of message
25514 2001-09-25 Ravi Pratap <ravi@ximian.com>
25516 * expression.cs (Binary::ResolveOperator): Had forgottten to set
25517 the type of the expression to the return type of the method if
25518 we have an overloaded operator match ! The regression tests pass again !
25519 (Unary::ResolveOperator): Ditto.
25521 * expression.cs (Invocation::ConversionExists): Correct the member lookup
25522 to find "op_Implicit", not "implicit" ;-)
25523 (UserImplicitCast): New class to take care of user-defined implicit conversions.
25524 (ConvertImplicit, ForceConversion): Take TypeContainer argument
25526 * everywhere : Correct calls to the above accordingly.
25528 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25529 (ConvertImplicit): Do user-defined conversion if it exists.
25531 2001-09-24 Miguel de Icaza <miguel@ximian.com>
25533 * assign.cs: track location.
25534 (Resolve): Use implicit conversions on assignment.
25536 * literal.cs: Oops. Not good, Emit of short access values should
25537 pass (Bytes) or the wrong argument will be selected.
25539 * expression.cs (Unary::Emit): Emit code for -expr.
25541 (Unary::ResolveOperator): Handle `Substract' for non-constants
25542 (substract from zero from the non-constants).
25543 Deal with Doubles as well.
25545 (Expression::ConvertImplicitRequired): New routine that reports an
25546 error if no implicit conversion exists.
25548 (Invocation::OverloadResolve): Store the converted implicit
25549 expressions if we make them
25551 2001-09-24 Ravi Pratap <ravi@ximian.com>
25553 * class.cs (ConstructorInitializer): Take a Location argument.
25554 (ConstructorBaseInitializer): Same here.
25555 (ConstructorThisInitializer): Same here.
25557 * cs-parser.jay : Update all calls accordingly.
25559 * expression.cs (Unary, Binary, New): Take location argument.
25560 Update accordingly everywhere.
25562 * cs-parser.jay : Update all calls to the above to take a location
25565 * class.cs : Ditto.
25567 2001-09-24 Ravi Pratap <ravi@ximian.com>
25569 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25570 (Invocation::BetterConversion): Same here
25571 (Invocation::ConversionExists): Ditto.
25573 (Invocation::ConversionExists): Implement.
25575 2001-09-22 Ravi Pratap <ravi@ximian.com>
25577 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25578 Also take an additional TypeContainer argument.
25580 * All over : Pass in TypeContainer as argument to OverloadResolve.
25582 * typemanager.cs (CSharpName): Update to check for the string type and return
25585 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25588 2001-09-21 Ravi Pratap <ravi@ximian.com>
25590 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25591 (Invocation::BetterFunction): Implement.
25592 (Invocation::BetterConversion): Implement.
25593 (Invocation::ConversionExists): Skeleton, no implementation yet.
25595 Okay, things work fine !
25597 2001-09-21 Miguel de Icaza <miguel@ximian.com>
25599 * typemanager.cs: declare and load enum_type, delegate_type and
25602 * expression.cs (Expression::Emit): Now emit returns a value that
25603 tells whether a value is left on the stack or not. This strategy
25604 might be reveted tomorrow with a mechanism that would address
25605 multiple assignments.
25606 (Expression::report118): Utility routine to report mismatches on
25609 (Unary::Report23): Report impossible type/operator combination
25612 (Unary::IsIncrementableNumber): Whether the type can be
25613 incremented or decremented with add.
25614 (Unary::ResolveOperator): Also allow enumerations to be bitwise
25616 (Unary::ResolveOperator): Implement ++, !, ~,
25618 (Invocation::Emit): Deal with new Emit convetion.
25620 * All Expression derivatives: Updated their Emit method to return
25621 whether they leave values on the stack or not.
25623 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25624 stack for expressions that are statements.
25626 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25628 * expression.cs (LValue): New interface. Must be implemented by
25630 (LocalVariableReference, ParameterReference, FieldExpr): Implement
25633 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25634 interface for generating code, simplifies the code.
25636 2001-09-20 Ravi Pratap <ravi@ximian.com>
25638 * expression.cs (everywhere): Comment out return statements in ::Resolve
25639 methods to avoid the warnings.
25641 2001-09-20 Miguel de Icaza <miguel@ximian.com>
25643 * driver.cs (parse): Report error 2001 if we can not open the
25646 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25649 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25652 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25653 otherwise nested blocks end up with the same index.
25655 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25657 * expression.cs: Instead of having FIXMEs in the Resolve
25658 functions, throw exceptions so it is obvious that we are facing a
25661 * cs-parser.jay (invocation_expression): Pass Location information.
25663 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25664 Use a basename for those routines because .NET does not like paths
25667 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25670 2001-09-19 Miguel de Icaza <miguel@ximian.com>
25672 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25673 are loading the correct data types (throws an exception if not).
25674 (TypeManager::InitCoreTypes): Use CoreLookupType
25676 * expression.cs (Unary::ResolveOperator): return the child
25677 expression for expressions which are just +expr.
25678 (Unary::ResolveOperator): Return negative literals for -LITERAL
25679 expressions (otherwise they are Unary {Literal}).
25680 (Invocation::Badness): Take into account `Implicit constant
25681 expression conversions'.
25683 * literal.cs (LongLiteral): Implement long literal class.
25684 (IntLiteral): export the `Value' of the intliteral.
25686 2001-09-19 Ravi Pratap <ravi@ximian.com>
25688 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25690 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
25691 instead of 'Operator'
25693 * expression.cs (Binary::ResolveOperator): Update accordingly.
25694 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25697 * cs-parser.jay (unary_expression): Update to use the new names.
25699 * gen-treedump.cs (GetUnary): Same here.
25701 * expression.cs (Unary::Resolve): Implement.
25702 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
25703 operators are found instead of making noise ;-)
25704 (Unary::ResolveOperator): New method to do precisely the same thing which
25705 Binary::ResolveOperator does for Binary expressions.
25706 (Unary.method, .Arguments): Add.
25707 (Unary::OperName): Implement.
25708 (Unary::ForceConversion): Copy and Paste !
25710 * class.cs (Operator::Define): Fix a small bug for the case when we have
25713 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25714 for the inbuilt operators. Only overloading works for now ;-)
25716 2001-09-18 Miguel de Icaza <miguel@ximian.com>
25718 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25719 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25721 * expression.cs (This::Emit): Implement.
25722 (This::Resolve): Implement.
25723 (TypeOf:Resolve): Implement.
25724 (Expression::ResolveSimpleName): Add an implicit this to instance
25726 (MemberAccess::Resolve): Deal with Parameters and Fields.
25727 Bind instance variable to Field expressions.
25728 (FieldExpr::Instance): New field used to track the expression that
25729 represents the object instance.
25730 (FieldExpr::Resolve): Track potential errors from MemberLookup not
25732 (FieldExpr::Emit): Implement.
25734 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25735 the last instruction contains a return opcode to avoid generating
25736 the last `ret' instruction (this generates correct code, and it is
25737 nice to pass the peverify output).
25739 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25740 initializer for static and instance variables.
25741 (Constructor::Emit): Allow initializer to be null in the case of
25742 static constructors. Only emit initializer for instance
25745 (TypeContainer::FindMembers): Return a null array if there are no
25748 Also fix the code for the MemberTypes.Method branch, as it was not
25749 scanning that for operators (or tried to access null variables before).
25751 * assign.cs (Assign::Emit): Handle instance and static fields.
25755 * driver.cs: Stop compilation if there are parse errors.
25757 * cs-parser.jay (constructor_declaration): Provide default base
25758 initializer for non-static constructors.
25759 (constructor_declarator): Do not provide a default base
25760 initializers if none was specified.
25761 Catch the fact that constructors should not have parameters.
25763 * class.cs: Do not emit parent class initializers for static
25764 constructors, that should be flagged as an error.
25766 2001-09-18 Ravi Pratap <ravi@ximian.com>
25768 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25769 Move back code into TypeContainer::Populate.
25771 2001-09-18 Ravi Pratap <ravi@ximian.com>
25773 * class.cs (TypeContainer::AddConstructor): Fix the check to
25774 compare against Name, not Basename.
25775 (Operator::OpType): Change Plus and Minus to Add and Subtract.
25777 * cs-parser.jay : Update accordingly.
25779 * class.cs (TypeContainer::FindMembers): For the case where we are searching
25780 for methods, don't forget to look into the operators too.
25781 (RegisterMethodBuilder): Helper method to take care of this for
25782 methods, constructors and operators.
25783 (Operator::Define): Completely revamp.
25784 (Operator.OperatorMethod, MethodName): New fields.
25785 (TypeContainer::Populate): Move the registering of builders into
25786 RegisterMethodBuilder.
25787 (Operator::Emit): Re-write.
25789 * expression.cs (Binary::Emit): Comment out code path to emit method
25790 invocation stuff for the case when we have a user defined operator. I am
25791 just not able to get it right !
25793 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25795 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25798 (Expression::MemberLookup): Provide a version that allows to
25799 specify the MemberTypes and BindingFlags.
25801 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25802 so it was not fetching variable information from outer blocks.
25804 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25805 Beforefieldinit as it was buggy.
25807 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25808 that Ravi put here.
25810 * class.cs (Constructor::Emit): Only emit if block is not null.
25811 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25812 deal with this by semantically definining it as if the user had
25815 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25816 constructors as we now "emit" them at a higher level.
25818 (TypeContainer::DefineDefaultConstructor): Used to define the
25819 default constructors if none was provided.
25821 (ConstructorInitializer): Add methods Resolve and Emit.
25823 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25825 2001-09-17 Ravi Pratap <ravi@ximian.com>
25827 * class.cs (TypeContainer::EmitDefaultConstructor): Register
25828 the default constructor builder with our hashtable for methodbuilders
25831 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25832 and argument_count is 0 in which case we have a match.
25833 (Binary::ResolveOperator): More null checking and miscellaneous coding
25836 2001-09-17 Ravi Pratap <ravi@ximian.com>
25838 * rootcontext.cs (IsNameSpace): Compare against null.
25840 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25842 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25843 and Unary::Operator.
25845 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25848 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25849 we have overloaded operators.
25850 (Binary::ResolveOperator): Implement the part which does the operator overload
25853 * class.cs (Operator::Emit): Implement.
25854 (TypeContainer::Emit): Emit the operators we have too.
25856 * expression.cs (Binary::Emit): Update to emit the appropriate code for
25857 the case when we have a user-defined operator.
25859 2001-09-17 Miguel de Icaza <miguel@ximian.com>
25861 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25863 2001-09-16 Ravi Pratap <ravi@ximian.com>
25865 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25866 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25867 (Constructor::Emit): Implement.
25868 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25869 if we have no work to do.
25870 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
25873 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25874 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25876 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25879 2001-09-15 Ravi Pratap <ravi@ximian.com>
25881 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25883 (Tree::RecordNamespace): Method to do what the name says ;-)
25884 (Tree::Namespaces): Property to get at the namespaces hashtable.
25886 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
25889 * rootcontext.cs (IsNamespace): Fixed it :-)
25891 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25893 * class.cs (TypeContainer::FindMembers): Add support for
25895 (MethodCore): New class that encapsulates both the shared aspects
25896 of a Constructor and a Method.
25897 (Method, Constructor): Factored pieces into MethodCore.
25899 * driver.cs: Added --fatal which makes errors throw exceptions.
25900 Load System assembly as well as part of the standard library.
25902 * report.cs: Allow throwing exceptions on errors for debugging.
25904 * modifiers.cs: Do not use `parent', instead use the real type
25905 container to evaluate permission settings.
25907 * class.cs: Put Ravi's patch back in. He is right, and we will
25908 have to cope with the
25910 2001-09-14 Ravi Pratap <ravi@ximian.com>
25912 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25913 FamORAssem, not FamANDAssem.
25915 2001-09-14 Miguel de Icaza <miguel@ximian.com>
25917 * driver.cs: Added --parse option that only parses its input files
25920 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
25921 incorrect. IsTopLevel is not used to tell whether an object is
25922 root_types or not (that can be achieved by testing this ==
25923 root_types). But to see if this is a top-level *class* (not
25924 necessarly our "toplevel" container).
25926 2001-09-14 Ravi Pratap <ravi@ximian.com>
25928 * enum.cs (Enum::Define): Modify to call the Lookup method on the
25929 parent instead of a direct call to GetType.
25931 2001-09-14 Ravi Pratap <ravi@ximian.com>
25933 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25934 Modifiers.TypeAttr. This should just be a call to that method.
25936 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25937 object so that we can determine if we are top-level or not.
25939 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
25942 * enum.cs (Enum::Define): Ditto.
25944 * modifiers.cs (FieldAttr): Re-write.
25946 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25947 (TypeContainer::HaveStaticConstructor): New property to provide access
25948 to precisely that info.
25950 * modifiers.cs (MethodAttr): Re-write.
25951 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25953 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25954 of top-level types as claimed.
25956 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25958 * expression.cs (MemberLookup): Fruitless attempt to lookup
25959 constructors. Maybe I need to emit default constructors? That
25960 might be it (currently .NET emits this for me automatically).
25961 (Invocation::OverloadResolve): Cope with Arguments == null.
25962 (Invocation::EmitArguments): new function, shared by the new
25963 constructor and us.
25964 (Invocation::Emit): Handle static and instance methods. Emit
25965 proper call instruction for virtual or non-virtual invocations.
25966 (New::Emit): Implement.
25967 (New::Resolve): Implement.
25968 (MemberAccess:Resolve): Implement.
25969 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25970 to track instances.
25971 (FieldExpr::Resolve): Set type.
25973 * support.cs: Handle empty arguments.
25975 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25976 SimpleLookup): Auxiliary routines to help parse a qualifier
25979 Update qualifier_identifier rule.
25981 * codegen.cs: Removed debugging messages.
25983 * class.cs: Make this a global thing, this acts just as a "key" to
25984 objects that we might have around.
25986 (Populate): Only initialize method_builders_to_methods once.
25988 * expression.cs (PropertyExpr): Initialize type from the
25991 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25992 Resolve pattern. Attempt to implicitly convert value to boolean.
25995 * expression.cs: Set the type for the int32/int32 argument case.
25996 (Binary::ResolveOperator): Set the return type to boolean for
25997 comparission operators
25999 * typemanager.cs: Remove debugging print code.
26001 (Invocation::Resolve): resolve type.
26003 * class.cs: Allocate a MemberInfo of the correct size, as the code
26004 elsewhere depends on the test to reflect the correct contents.
26006 (Method::) Keep track of parameters, due to System.Reflection holes
26008 (TypeContainer::Populate): Keep track of MethodBuilders to Method
26011 (TypeContainer::FindMembers): Use ArrayList and then copy an array
26012 of the exact size and return that.
26014 (Class::LookupMethodByBuilder): New function that maps
26015 MethodBuilders to its methods. Required to locate the information
26016 on methods because System.Reflection bit us again.
26018 * support.cs: New file, contains an interface ParameterData and
26019 two implementations: ReflectionParameters and InternalParameters
26020 used to access Parameter information. We will need to grow this
26023 * expression.cs (Invocation::GetParameterData): implement a cache
26024 and a wrapper around the ParameterData creation for methods.
26025 (Invocation::OverloadResolve): Use new code.
26027 2001-09-13 Ravi Pratap <ravi@ximian.com>
26029 * class.cs (TypeContainer::EmitField): Remove and move into
26030 (Field::Define): here and modify accordingly.
26031 (Field.FieldBuilder): New member.
26032 (TypeContainer::Populate): Update accordingly.
26033 (TypeContainer::FindMembers): Implement.
26035 2001-09-13 Miguel de Icaza <miguel@ximian.com>
26037 * statement.cs: (VariableInfo::VariableType): New field to be
26038 initialized with the full type once it is resolved.
26040 2001-09-12 Miguel de Icaza <miguel@ximian.com>
26042 * parameter.cs (GetParameterInfo): Use a type cache to compute
26043 things only once, and to reuse this information
26045 * expression.cs (LocalVariableReference::Emit): Implement.
26046 (OpcodeCast::Emit): fix.
26048 (ParameterReference::Resolve): Implement.
26049 (ParameterReference::Emit): Implement.
26051 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
26052 that are expressions need to stay as Expressions.
26054 * typemanager.cs (CSharpName): Returns the C# name of a type if
26057 * expression.cs (Expression::ConvertImplicit): New function that
26058 implements implicit type conversions.
26060 (Expression::ImplicitReferenceConversion): Implements implicit
26061 reference conversions.
26063 (EmptyCast): New type for transparent casts.
26065 (OpcodeCast): New type for casts of types that are performed with
26066 a sequence of bytecodes.
26068 (BoxedCast): New type used for casting value types into reference
26069 types. Emits a box opcode.
26071 (Binary::DoNumericPromotions): Implements numeric promotions of
26072 and computation of the Binary::Type.
26074 (Binary::EmitBranchable): Optimization.
26076 (Binary::Emit): Implement code emission for expressions.
26078 * typemanager.cs (TypeManager): Added two new core types: sbyte
26081 2001-09-12 Ravi Pratap <ravi@ximian.com>
26083 * class.cs (TypeContainer::FindMembers): Method which does exactly
26084 what Type.FindMembers does, only we don't have to use reflection. No
26085 implementation yet.
26087 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
26088 typecontainer objects as we need to get at them.
26089 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
26091 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
26092 typecontainer object.
26094 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
26095 of just a Report object.
26097 2001-09-11 Ravi Pratap <ravi@ximian.com>
26099 * class.cs (Event::Define): Go back to using the prefixes "add_" and
26101 (TypeContainer::Populate): Now define the delegates of the type too.
26102 (TypeContainer.Delegates): Property to access the list of delegates defined
26105 * delegates.cs (Delegate::Define): Implement partially.
26107 * modifiers.cs (TypeAttr): Handle more flags.
26109 2001-09-11 Ravi Pratap <ravi@ximian.com>
26111 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
26113 (Operator::Define): Re-write logic to get types by using the LookupType method
26114 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
26115 (Indexer::Define): Ditto.
26116 (Event::Define): Ditto.
26117 (Property::Define): Ditto.
26119 2001-09-10 Ravi Pratap <ravi@ximian.com>
26121 * class.cs (TypeContainer::Populate): Now define operators too.
26122 (TypeContainer.Operators): New property to access the list of operators
26124 (Operator.OperatorMethodBuilder): New member to hold the method builder
26125 for the operator we are defining.
26126 (Operator::Define): Implement.
26128 2001-09-10 Ravi Pratap <ravi@ximian.com>
26130 * class.cs (Event::Define): Make the prefixes of the accessor methods
26131 addOn_ and removeOn_
26133 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
26134 of the location being passed in too. Ideally, this should go later since all
26135 error reporting should be done through the Report object.
26137 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
26138 (Populate): Iterate thru the indexers we have and define them too.
26139 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
26140 for the get and set accessors.
26141 (Indexer::Define): Implement.
26143 2001-09-09 Miguel de Icaza <miguel@ximian.com>
26145 * expression.cs (Binary::Resolve): Beginning of it. I scratched
26146 my previous implementation, did not work.
26148 * typemanager.cs: Add a couple of missing types (the longs).
26150 * literal.cs: Use TypeManager.bool_type instead of getting it.
26152 * expression.cs (EventExpr): New kind of expressions.
26153 (Expressio::ExprClassFromMemberInfo): finish
26155 2001-09-08 Miguel de Icaza <miguel@ximian.com>
26157 * assign.cs: Emit stores to static fields differently.
26159 2001-09-08 Ravi Pratap <ravi@ximian.com>
26161 * Merge in changes and adjust code to tackle conflicts. Backed out my
26162 code in Assign::Resolve ;-)
26164 2001-09-08 Ravi Pratap <ravi@ximian.com>
26166 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
26167 instead Report.Error and also pass in the location.
26168 (CSharpParser::Lexer): New readonly property to return the reference
26169 to the Tokenizer object.
26170 (declare_local_variables): Use Report.Error with location instead of plain
26174 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
26175 (Operator.CheckBinaryOperator): Ditto.
26177 * cs-parser.jay (operator_declarator): Update accordingly.
26179 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
26180 (CheckBinaryOperator): Same here.
26182 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
26183 on the name without any prefixes of namespace names etc. This is because we
26184 already might have something already fully qualified like
26185 'System.Console.WriteLine'
26187 * assign.cs (Resolve): Begin implementation. Stuck ;-)
26189 2001-09-07 Ravi Pratap <ravi@ximian.com>
26191 * cs-tokenizer.cs (location): Return a string which also contains
26194 * expression.cs (ElementAccess): New class for expressions of the
26195 type 'element access.'
26196 (BaseAccess): New class for expressions of the type 'base access.'
26197 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
26200 * cs-parser.jay (element_access): Implement action.
26201 (base_access): Implement actions.
26202 (checked_expression, unchecked_expression): Implement.
26204 * cs-parser.jay (local_variable_type): Correct and implement.
26205 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
26207 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
26209 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
26210 name and the specifiers.
26212 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
26214 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
26215 making them all public ;-)
26217 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
26220 2001-09-07 Miguel de Icaza <miguel@ximian.com>
26222 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
26224 (FieldExpr, PropertyExprs): New resolved expressions.
26225 (SimpleName::MemberStaticCheck): Perform static checks for access
26226 to non-static fields on static methods. Maybe this should be
26227 generalized for MemberAccesses.
26228 (SimpleName::ResolveSimpleName): More work on simple name
26231 * cs-parser.jay (primary_expression/qualified_identifier): track
26232 the parameter index.
26234 * codegen.cs (CodeGen::Save): Catch save exception, report error.
26235 (EmitContext::EmitBoolExpression): Chain to expression generation
26236 instead of temporary hack.
26237 (::EmitStatementExpression): Put generic expression code generation.
26239 * assign.cs (Assign::Emit): Implement variable assignments to
26240 local variables, parameters and fields.
26242 2001-09-06 Miguel de Icaza <miguel@ximian.com>
26244 * statement.cs (Block::GetVariableInfo): New method, returns the
26245 VariableInfo for a variable name in a block.
26246 (Block::GetVariableType): Implement in terms of GetVariableInfo
26248 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
26249 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
26251 2001-09-06 Ravi Pratap <ravi@ximian.com>
26253 * cs-parser.jay (operator_declaration): Continue on my quest : update
26254 to take attributes argument.
26255 (event_declaration): Ditto.
26256 (enum_declaration): Ditto.
26257 (indexer_declaration): Ditto.
26259 * class.cs (Operator::Operator): Update constructor accordingly.
26260 (Event::Event): Ditto.
26262 * delegate.cs (Delegate::Delegate): Same here.
26264 * enum.cs (Enum::Enum): Same here.
26266 2001-09-05 Ravi Pratap <ravi@ximian.com>
26268 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
26270 * ../tests/cs0658.cs : New file to demonstrate error 0658.
26272 * attribute.cs (Attributes): New class to encapsulate all attributes which were
26273 being passed around as an arraylist.
26274 (Attributes::AddAttribute): Method to add attribute sections.
26276 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
26277 (struct_declaration): Update accordingly.
26278 (constant_declaration): Update.
26279 (field_declaration): Update.
26280 (method_header): Update.
26281 (fixed_parameter): Update.
26282 (parameter_array): Ditto.
26283 (property_declaration): Ditto.
26284 (destructor_declaration): Ditto.
26286 * class.cs (Struct::Struct): Update constructors accordingly.
26287 (Class::Class): Ditto.
26288 (Field::Field): Ditto.
26289 (Method::Method): Ditto.
26290 (Property::Property): Ditto.
26291 (TypeContainer::OptAttribute): update property's return type.
26293 * interface.cs (Interface.opt_attributes): New member.
26294 (Interface::Interface): Update to take the extra Attributes argument.
26296 * parameter.cs (Parameter::Parameter): Ditto.
26298 * constant.cs (Constant::Constant): Ditto.
26300 * interface.cs (InterfaceMemberBase): New OptAttributes field.
26301 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
26302 the attributes as a parameter.
26303 (InterfaceProperty): Update constructor call.
26304 (InterfaceEvent): Ditto.
26305 (InterfaceMethod): Ditto.
26306 (InterfaceIndexer): Ditto.
26308 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
26309 pass the attributes too.
26310 (interface_event_declaration): Ditto.
26311 (interface_property_declaration): Ditto.
26312 (interface_method_declaration): Ditto.
26313 (interface_declaration): Ditto.
26315 2001-09-05 Miguel de Icaza <miguel@ximian.com>
26317 * class.cs (Method::Define): Track the "static Main" definition to
26318 create an entry point.
26320 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
26321 EntryPoint if we find it.
26323 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
26324 (EmitContext::ig): Make this variable public.
26326 * driver.cs: Make the default output file be the first file name
26327 with the .exe extension.
26329 Detect empty compilations
26331 Handle various kinds of output targets. Handle --target and
26332 rename -t to --dumper.
26334 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
26335 methods inherited from Expression return now an Expression. This
26336 will is used during the tree rewriting as we resolve them during
26339 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
26340 the spec. Missing entirely is the information about
26341 accessability of elements of it.
26343 (Expression::ExprClassFromMemberInfo): New constructor for
26344 Expressions that creates a fully initialized Expression based on
26345 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
26348 (Invocation::Resolve): Begin implementing resolution of invocations.
26350 * literal.cs (StringLiteral): Implement Emit.
26352 2001-09-05 Ravi Pratap <ravi@ximian.com>
26354 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
26357 2001-09-04 Ravi Pratap <ravi@ximian.com>
26359 * cs-parser.jay (attribute_arguments): Implement actions.
26360 (attribute): Fix bug in production. Implement action.
26361 (attribute_list): Implement.
26362 (attribute_target): Implement.
26363 (attribute_target_specifier, opt_target_specifier): Implement
26364 (CheckAttributeTarget): New method to check if the attribute target
26366 (attribute_section): Implement.
26367 (opt_attributes): Implement.
26369 * attribute.cs : New file to handle attributes.
26370 (Attribute): Class to hold attribute info.
26372 * cs-parser.jay (opt_attribute_target_specifier): Remove production
26373 (attribute_section): Modify production to use 2 different rules to
26374 achieve the same thing. 1 s/r conflict down !
26375 Clean out commented, useless, non-reducing dimension_separator rules.
26377 * class.cs (TypeContainer.attributes): New member to hold list
26378 of attributes for a type.
26379 (Struct::Struct): Modify to take one more argument, the attribute list.
26380 (Class::Class): Ditto.
26381 (Field::Field): Ditto.
26382 (Method::Method): Ditto.
26383 (Property::Property): Ditto.
26385 * cs-parser.jay (struct_declaration): Update constructor call to
26386 pass in the attributes too.
26387 (class_declaration): Ditto.
26388 (constant_declaration): Ditto.
26389 (field_declaration): Ditto.
26390 (method_header): Ditto.
26391 (fixed_parameter): Ditto.
26392 (parameter_array): Ditto.
26393 (property_declaration): Ditto.
26395 * constant.cs (Constant::Constant): Update constructor similarly.
26396 Use System.Collections.
26398 * parameter.cs (Parameter::Parameter): Update as above.
26400 2001-09-02 Ravi Pratap <ravi@ximian.com>
26402 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
26403 (TypeContainer.delegates): New member to hold list of delegates.
26405 * cs-parser.jay (delegate_declaration): Implement the action correctly
26406 this time as I seem to be on crack ;-)
26408 2001-09-02 Miguel de Icaza <miguel@ximian.com>
26410 * rootcontext.cs (RootContext::IsNamespace): new function, used to
26411 tell whether an identifier represents a namespace.
26413 * expression.cs (NamespaceExpr): A namespace expression, used only
26414 temporarly during expression resolution.
26415 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
26416 utility functions to resolve names on expressions.
26418 2001-09-01 Miguel de Icaza <miguel@ximian.com>
26420 * codegen.cs: Add hook for StatementExpressions.
26422 * class.cs: Fix inverted test for static flag in methods.
26424 2001-09-02 Ravi Pratap <ravi@ximian.com>
26426 * class.cs (Operator::CheckUnaryOperator): Correct error number used
26427 to make it coincide with MS' number.
26428 (Operator::CheckBinaryOperator): Ditto.
26430 * ../errors/errors.txt : Remove error numbers added earlier.
26432 * ../errors/cs1019.cs : Test case for error # 1019
26434 * ../errros/cs1020.cs : Test case for error # 1020
26436 * cs-parser.jay : Clean out commented cruft.
26437 (dimension_separators, dimension_separator): Comment out. Ostensibly not
26438 used anywhere - non-reducing rule.
26439 (namespace_declarations): Non-reducing rule - comment out.
26441 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
26442 with TypeContainer::AddEnum.
26444 * delegate.cs : New file for delegate handling classes.
26445 (Delegate): Class for declaring delegates.
26447 * makefile : Update.
26449 * cs-parser.jay (delegate_declaration): Implement.
26451 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
26453 * class.cs (Event::Define): Implement.
26454 (Event.EventBuilder): New member.
26456 * class.cs (TypeContainer::Populate): Update to define all enums and events
26458 (Events): New property for the events arraylist we hold. Shouldn't we move to using
26459 readonly fields for all these cases ?
26461 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26463 * class.cs (Property): Revamp to use the convention of making fields readonly.
26464 Accordingly modify code elsewhere.
26466 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
26467 the Define method of the Property class.
26469 * class.cs : Clean up applied patch and update references to variables etc. Fix
26471 (TypeContainer::Populate): Update to define all the properties we have. Also
26472 define all enumerations.
26474 * enum.cs (Define): Implement.
26476 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
26478 * cs-parser.jay (overloadable_operator): The semantic value is an
26479 enum of the Operator class.
26480 (operator_declarator): Implement actions.
26481 (operator_declaration): Implement.
26483 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
26484 validity of definitions.
26485 (Operator::CheckBinaryOperator): Static method to check for binary operators
26486 (TypeContainer::AddOperator): New method to add an operator to a type.
26488 * cs-parser.jay (indexer_declaration): Added line to actually call the
26489 AddIndexer method so it gets added ;-)
26491 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
26492 already taken care of by the MS compiler ?
26494 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26496 * class.cs (Operator): New class for operator declarations.
26497 (Operator::OpType): Enum for the various operators.
26499 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
26501 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
26502 ostensibly handle this in semantic analysis.
26504 * cs-parser.jay (general_catch_clause): Comment out
26505 (specific_catch_clauses, specific_catch_clause): Ditto.
26506 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
26507 (catch_args, opt_catch_args): New productions.
26508 (catch_clause): Rewrite to use the new productions above
26509 (catch_clauses): Modify accordingly.
26510 (opt_catch_clauses): New production to use in try_statement
26511 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
26512 and re-write the code in the actions to extract the specific and
26513 general catch clauses by being a little smart ;-)
26515 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
26516 Hooray, try and catch statements parse fine !
26518 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26520 * statement.cs (Block::GetVariableType): Fix logic to extract the type
26521 string from the hashtable of variables.
26523 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26524 I end up making that mistake ;-)
26525 (catch_clauses): Fixed gross error which made Key and Value of the
26526 DictionaryEntry the same : $1 !!
26528 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26530 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26532 * cs-parser.jay (event_declaration): Correct to remove the semicolon
26533 when the add and remove accessors are specified.
26535 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
26537 * cs-parser.jay (IndexerDeclaration): New helper class to hold
26538 information about indexer_declarator.
26539 (indexer_declarator): Implement actions.
26540 (parsing_indexer): New local boolean used to keep track of whether
26541 we are parsing indexers or properties. This is necessary because
26542 implicit_parameters come into picture even for the get accessor in the
26543 case of an indexer.
26544 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26546 * class.cs (Indexer): New class for indexer declarations.
26547 (TypeContainer::AddIndexer): New method to add an indexer to a type.
26548 (TypeContainer::indexers): New member to hold list of indexers for the
26551 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26553 * cs-parser.jay (add_accessor_declaration): Implement action.
26554 (remove_accessor_declaration): Implement action.
26555 (event_accessors_declaration): Implement
26556 (variable_declarators): swap statements for first rule - trivial.
26558 * class.cs (Event): New class to hold information about event
26560 (TypeContainer::AddEvent): New method to add an event to a type
26561 (TypeContainer::events): New member to hold list of events.
26563 * cs-parser.jay (event_declaration): Implement actions.
26565 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
26567 * cs-parser.jay (dim_separators): Implement. Make it a string
26568 concatenating all the commas together, just as they appear.
26569 (opt_dim_separators): Modify accordingly
26570 (rank_specifiers): Update accordingly. Basically do the same
26571 thing - instead, collect the brackets here.
26572 (opt_rank_sepcifiers): Modify accordingly.
26573 (array_type): Modify to actually return the complete type string
26574 instead of ignoring the rank_specifiers.
26575 (expression_list): Implement to collect the expressions
26576 (variable_initializer): Implement. We make it a list of expressions
26577 essentially so that we can handle the array_initializer case neatly too.
26578 (variable_initializer_list): Implement.
26579 (array_initializer): Make it a list of variable_initializers
26580 (opt_array_initializer): Modify accordingly.
26582 * expression.cs (New::NType): Add enumeration to help us
26583 keep track of whether we have an object/delegate creation
26584 or an array creation.
26585 (New:NewType, New::Rank, New::Indices, New::Initializers): New
26586 members to hold data about array creation.
26587 (New:New): Modify to update NewType
26588 (New:New): New Overloaded contructor for the array creation
26591 * cs-parser.jay (array_creation_expression): Implement to call
26592 the overloaded New constructor.
26594 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
26596 * class.cs (TypeContainer::Constructors): Return member
26597 constructors instead of returning null.
26599 2001-08-26 Miguel de Icaza <miguel@ximian.com>
26601 * typemanager.cs (InitCoreTypes): Initialize the various core
26602 types after we have populated the type manager with the user
26603 defined types (this distinction will be important later while
26604 compiling corlib.dll)
26606 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26607 on Expression Classification. Now all expressions have a method
26608 `Resolve' and a method `Emit'.
26610 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26611 generation from working. Also add some temporary debugging
26614 2001-08-24 Miguel de Icaza <miguel@ximian.com>
26616 * codegen.cs: Lots of code generation pieces. This is only the
26617 beginning, will continue tomorrow with more touches of polish. We
26618 handle the fundamentals of if, while, do, for, return. Others are
26619 trickier and I need to start working on invocations soon.
26621 * gen-treedump.cs: Bug fix, use s.Increment here instead of
26624 * codegen.cs (EmitContext): New struct, used during code
26625 emission to keep a context. Most of the code generation will be
26628 * cs-parser.jay: Add embedded blocks to the list of statements of
26629 this block. So code generation proceeds in a top down fashion.
26631 2001-08-23 Miguel de Icaza <miguel@ximian.com>
26633 * statement.cs: Add support for multiple child blocks.
26635 2001-08-22 Miguel de Icaza <miguel@ximian.com>
26637 * codegen.cs (EmitCode): New function, will emit the code for a
26638 Block of code given a TypeContainer and its ILGenerator.
26640 * statement.cs (Block): Standard public readonly optimization.
26641 (Block::Block constructors): Link children.
26642 (Block::Child): Child Linker.
26643 (Block::EmitVariables): Emits IL variable declarations.
26645 * class.cs: Drop support for MethodGroups here, delay until
26647 (Method::): Applied the same simplification that I did before, and
26648 move from Properties to public readonly fields.
26649 (Method::ParameterTypes): Returns the parameter types for the
26650 function, and implements a cache that will be useful later when I
26651 do error checking and the semantic analysis on the methods is
26653 (Constructor::GetCallingConvention): Renamed from CallingConvetion
26654 and made a method, optional argument tells whether this is a class
26655 or a structure to apply the `has-this' bit.
26656 (Method::GetCallingConvention): Implement, returns the calling
26658 (Method::Define): Defines the type, a second pass is performed
26659 later to populate the methods.
26661 (Constructor::ParameterTypes): implement a cache similar to the
26662 one on Method::ParameterTypes, useful later when we do semantic
26665 (TypeContainer::EmitMethod): New method. Emits methods.
26667 * expression.cs: Removed MethodGroup class from here.
26669 * parameter.cs (Parameters::GetCallingConvention): new method.
26671 2001-08-21 Miguel de Icaza <miguel@ximian.com>
26673 * class.cs (TypeContainer::Populate): Drop RootContext from the
26676 (Constructor::CallingConvention): Returns the calling convention.
26677 (Constructor::ParameterTypes): Returns the constructor parameter
26680 (TypeContainer::AddConstructor): Keep track of default constructor
26681 and the default static constructor.
26683 (Constructor::) Another class that starts using `public readonly'
26684 instead of properties.
26686 (Constructor::IsDefault): Whether this is a default constructor.
26688 (Field::) use readonly public fields instead of properties also.
26690 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26691 track of static constructors; If none is used, turn on
26692 BeforeFieldInit in the TypeAttributes.
26694 * cs-parser.jay (opt_argument_list): now the return can be null
26695 for the cases where there are no arguments.
26697 (constructor_declarator): If there is no implicit `base' or
26698 `this', then invoke the default parent constructor.
26700 * modifiers.cs (MethodAttr): New static function maps a set of
26701 modifiers flags into a MethodAttributes enum
26702 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
26703 MethodAttr, TypeAttr to represent the various mappings where the
26704 modifiers are used.
26705 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
26707 2001-08-19 Miguel de Icaza <miguel@ximian.com>
26709 * parameter.cs (GetParameterInfo): Fix bug where there would be no
26712 * interface.cs (PopulateIndexer): Implemented the code generator
26713 for interface indexers.
26715 2001-08-17 Miguel de Icaza <miguel@ximian.com>
26717 * interface.cs (InterfaceMemberBase): Now we track the new status
26720 (PopulateProperty): Implement property population. Woohoo! Got
26721 Methods and Properties going today.
26723 Removed all the properties for interfaces, and replaced them with
26724 `public readonly' fields.
26726 2001-08-16 Miguel de Icaza <miguel@ximian.com>
26728 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26729 initialize their hashtables/arraylists only when they are needed
26730 instead of doing this always.
26732 * parameter.cs: Handle refs and out parameters.
26734 * cs-parser.jay: Use an ArrayList to construct the arguments
26735 instead of the ParameterCollection, and then cast that to a
26738 * parameter.cs: Drop the use of ParameterCollection and use
26739 instead arrays of Parameters.
26741 (GetParameterInfo): Use the Type, not the Name when resolving
26744 2001-08-13 Miguel de Icaza <miguel@ximian.com>
26746 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26747 and instead use public readonly fields.
26749 * class.cs: Put back walking code for type containers.
26751 2001-08-11 Miguel de Icaza <miguel@ximian.com>
26753 * class.cs (MakeConstant): Code to define constants.
26755 * rootcontext.cs (LookupType): New function. Used to locate types
26758 2001-08-08 Miguel de Icaza <miguel@ximian.com>
26760 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
26761 this System.Reflection code is. Kudos to Microsoft
26763 * typemanager.cs: Implement a type cache and avoid loading all
26764 types at boot time. Wrap in LookupType the internals. This made
26765 the compiler so much faster. Wow. I rule!
26767 * driver.cs: Make sure we always load mscorlib first (for
26768 debugging purposes, nothing really important).
26770 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
26771 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
26773 * rootcontext.cs: Lookup types on their namespace; Lookup types
26774 on namespaces that have been imported using the `using' keyword.
26776 * class.cs (TypeContainer::TypeAttr): Virtualize.
26777 (Class::TypeAttr): Return attributes suitable for this bad boy.
26778 (Struct::TypeAttr): ditto.
26779 Handle nested classes.
26780 (TypeContainer::) Remove all the type visiting code, it is now
26781 replaced with the rootcontext.cs code
26783 * rootcontext.cs (GetClassBases): Added support for structs.
26785 2001-08-06 Miguel de Icaza <miguel@ximian.com>
26787 * interface.cs, statement.cs, class.cs, parameter.cs,
26788 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26789 Drop use of TypeRefs, and use strings instead.
26791 2001-08-04 Miguel de Icaza <miguel@ximian.com>
26795 * class.cs (Struct::Struct): set the SEALED flags after
26796 checking the modifiers.
26797 (TypeContainer::TypeAttr): new property, returns the
26798 TypeAttributes for a class.
26800 * cs-parser.jay (type_list): Oops, list production was creating a
26801 new list of base types.
26803 * rootcontext.cs (StdLib): New property.
26804 (GetInterfaceTypeByName): returns an interface by type name, and
26805 encapsulates error handling here.
26806 (GetInterfaces): simplified.
26807 (ResolveTree): Encapsulated all the tree resolution here.
26808 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26811 * driver.cs: Add support for --nostdlib, to avoid loading the
26812 default assemblies.
26813 (Main): Do not put tree resolution here.
26815 * rootcontext.cs: Beginning of the class resolution.
26817 2001-08-03 Miguel de Icaza <miguel@ximian.com>
26819 * rootcontext.cs: Provide better error reporting.
26821 * cs-parser.jay (interface_base): set our $$ to be interfaces.
26823 * rootcontext.cs (CreateInterface): Handle the case where there
26824 are no parent interfaces.
26826 (CloseTypes): Routine to flush types at the end.
26827 (CreateInterface): Track types.
26828 (GetInterfaces): Returns an array of Types from the list of
26829 defined interfaces.
26831 * typemanager.c (AddUserType): Mechanism to track user types (puts
26832 the type on the global type hash, and allows us to close it at the
26835 2001-08-02 Miguel de Icaza <miguel@ximian.com>
26837 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26838 RecordInterface instead.
26840 * cs-parser.jay: Updated to reflect changes above.
26842 * decl.cs (Definition): Keep track of the TypeBuilder type that
26843 represents this type here. Not sure we will use it in the long
26844 run, but wont hurt for now.
26846 * driver.cs: Smaller changes to accomodate the new code.
26848 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26851 * rootcontext.cs (CreateInterface): New method, used to create
26852 the System.TypeBuilder type for interfaces.
26853 (ResolveInterfaces): new entry point to resolve the interface
26855 (CodeGen): Property, used to keep track of the code generator.
26857 2001-07-26 Miguel de Icaza <miguel@ximian.com>
26859 * cs-parser.jay: Add a second production for delegate_declaration
26862 (enum_body): Put an opt_comma here instead of putting it on
26863 enum_body or enum_member_declarations so we can handle trailing
26864 commas on enumeration members. Gets rid of a shift/reduce.
26866 (type_list): Need a COMMA in the middle.
26868 (indexer_declaration): Tell tokenizer to recognize get/set
26870 * Remove old targets.
26872 * Re-add the parser target.
26874 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26876 * cs-parser.jay: Add precendence rules for a number of operators
26877 ot reduce the number of shift/reduce conflicts in the grammar.
26879 2001-07-17 Miguel de Icaza <miguel@ximian.com>
26881 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26884 Get rid of old crufty code.
26886 * rootcontext.cs: Use this to keep track of the parsed
26887 representation and the defined types available to the program.
26889 * gen-treedump.cs: adjust for new convention.
26891 * type.cs: Split out the type manager, and the assembly builder
26894 * typemanager.cs: the type manager will live here now.
26896 * cil-codegen.cs: And the code generator here.
26898 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
26900 * makefile: Fixed up for easy making.
26902 2001-07-13 Simon Cozens <simon@simon-cozens.org>
26904 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26907 (unary_expression): Expand pre_increment_expression and
26908 post_decrement_expression to reduce a shift/reduce.
26910 2001-07-11 Simon Cozens
26912 * cs-tokenizer.cs: Hex numbers should begin with a 0.
26914 Improve allow_keyword_as_indent name.
26916 2001-06-19 Miguel de Icaza <miguel@ximian.com>
26918 * Adjustments for Beta2.
26920 2001-06-13 Miguel de Icaza <miguel@ximian.com>
26922 * decl.cs: Added `Define' abstract method.
26923 (InTransit): new property, used to catch recursive definitions.
26925 * interface.cs: Implement `Define'.
26927 * modifiers.cs: Map Modifiers.constants to
26928 System.Reflection.TypeAttribute flags.
26930 * class.cs: Keep track of types and user-defined types.
26931 (BuilderInit): New method for creating an assembly
26932 (ResolveType): New function to launch the resolution process, only
26933 used by interfaces for now.
26935 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26936 that are inserted into the name space.
26938 2001-06-08 Miguel de Icaza <miguel@ximian.com>
26940 * ARGH. I have screwed up my tree so many times due to the use of
26941 rsync rather than using CVS. Going to fix this at once.
26943 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26946 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26948 * Experiment successful: Use System.Type rather that our own
26951 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26953 * cs-parser.jay: Removed nsAliases from here.
26955 Use new namespaces, handle `using XXX;'
26957 * namespace.cs: Reimplemented namespace handling, use a recursive
26958 definition of the class. Now we can keep track of using clauses
26959 and catch invalid using clauses.
26961 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26963 * gen-treedump.cs: Adapted for all the renaming.
26965 * expression.cs (Expression): this class now has a Type property
26966 which returns an expression Type.
26968 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26969 `Type', as this has a different meaning now in the base
26971 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26973 * interface.cs, class.cs: Removed from all the sources the
26974 references to signature computation, as we can not do method
26975 signature computation during the parsing time, as we are not
26976 trying to solve at that point distinguishing:
26980 void a (NS.Blah x) {}
26983 Which depending on the context might be valid or not, as we do not
26984 know if Blah is the same thing as NS.Blah at that point.
26986 * Redid everything so the code uses TypeRefs now instead of
26987 Types. TypeRefs are just temporary type placeholders, that need
26988 to be resolved. They initially have a pointer to a string and the
26989 current scope in which they are used. This is used later by the
26990 compiler to resolve the reference to an actual Type.
26992 * DeclSpace is no longer a CIR.Type, and neither are
26993 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26994 are all DeclSpaces, but no Types.
26996 * type.cs (TypeRefManager): This implements the TypeRef manager,
26997 which keeps track of all the types that need to be resolved after
26998 the parsing has finished.
27000 2001-05-13 Miguel de Icaza <miguel@ximian.com>
27002 * ARGH. We are going to have to store `foreach' as a class rather
27003 than resolving it, as we need to verify error 1579 after name
27004 resolution. *OR* we could keep a flag that says `This request to
27005 IEnumerator comes from a foreach statement' which we can then use
27006 to generate the error.
27008 2001-05-10 Miguel de Icaza <miguel@ximian.com>
27010 * class.cs (TypeContainer.AddMethod): we now add methods to the
27011 MethodGroup instead of the method hashtable.
27013 * expression.cs: Add MethodGroup abstraction, which gets us one
27014 step closer to the specification in the way we handle method
27017 * cs-parser.jay (primary_expression): qualified_identifier now
27018 tried to match up an identifier to a local variable reference or
27019 to a parameter reference.
27021 current_local_parameters is now a parser global variable that
27022 points to the current parameters for the block, used during name
27025 (property_declaration): Now creates an implicit `value' argument to
27028 2001-05-09 Miguel de Icaza <miguel@ximian.com>
27030 * parameter.cs: Do not use `param' arguments as part of the
27031 signature, per the spec.
27033 2001-05-08 Miguel de Icaza <miguel@ximian.com>
27035 * decl.cs: Base class for classes, structs and interfaces. This
27036 is the "Declaration Space"
27038 * cs-parser.jay: Use CheckDef for checking declaration errors
27039 instead of having one on each function.
27041 * class.cs: Factor out some code for handling error handling in
27042 accordance to the "Declarations" section in the "Basic Concepts"
27043 chapter in the ECMA C# spec.
27045 * interface.cs: Make all interface member classes derive from
27046 InterfaceMemberBase.
27048 2001-05-07 Miguel de Icaza <miguel@ximian.com>
27050 * Many things: all interfaces are parsed and generated in
27051 gen-treedump. Support for member variables, constructors,
27052 destructors, properties, constants is there.
27054 Beginning of the IL backend, but very little done, just there for
27057 2001-04-29 Miguel de Icaza <miguel@ximian.com>
27059 * cs-parser.jay: Fix labeled statement.
27061 * cs-tokenizer.cs (escape): Escape " and ' always.
27062 ref_line, ref_name: keep track of the line/filename as instructed
27063 by #line by the compiler.
27066 2001-04-27 Miguel de Icaza <miguel@ximian.com>
27068 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
27069 to match the values in System.CodeDOM.
27071 Divid renamed to Divide.
27073 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
27075 (Statements.set): remove.
27077 * System.CodeDOM/CodeCatchClause.cs: always have a valid
27080 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
27081 falseStatements always have valid values.
27083 * cs-parser.jay: Use System.CodeDOM now.