1 2005-08-12 Martin Baulig <martin@ximian.com>
3 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4 for nested types here to avoid hitting the cache too early.
6 2005-08-09 Miguel de Icaza <miguel@novell.com>
8 * enum.cs: On the new compiler CLS error 3005 is now a warning not
11 2005-08-03 Martin Baulig <martin@ximian.com>
13 Make iterators in generic methods work; see gtest-191.cs.
16 (Constraints.Resolve): Protect against being called twice.
19 (TypeContainer.GetClassBases): Make this `protected virtual'.
21 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
22 (Iterator.GetClassBases): Override this and compute the base
24 (Iterator.DefineNestedTypes): If we're a generic method, all our
25 method type parameters become class type parameters on the proxy
29 (ToplevelBlock.Parameters): Make this a property, not a field.
30 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
32 2005-08-03 Martin Baulig <martin@ximian.com>
34 * typemanager.cs (TypeManager.IsSubclassOf): Use
35 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
36 (TypeManager.GetFullName_recursed): Improved.
38 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
41 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
42 Private accessor case, using TypeManager.IsPrivateAccessible instead of
43 invocation_type == mi.DeclaringType, since the first one also checks
44 other condition used by generic instances.
46 2005-07-27 Martin Baulig <martin@ximian.com>
48 * anonymous.cs (CaptureContext.AddField): Added
49 `AnonymousContainer am' argument; compute its toplevel scope if
50 it's not already computed. Fixes #75649.
52 2005-07-12 Raja R Harinath <rharinath@novell.com>
54 * statement.cs (Block.Flags); Remove HasVarargs.
55 (Block.HasVarargs): Move to ToplevelBlock.
56 (Block.ThisVariable, Block.AddThisVariable): Likewise.
57 (Block.Variables): Make protected. Initialize variable hashtable
59 (Block.AddVariable): Update.
60 (Block.Resolve): Update to changes.
61 (ToplevelBlock.HasVarargs): New boolean.
62 (ToplevelBlock.ThisVariable): Move here from Block.
63 (ToplevelBlock.AddThisVariable): Likewise.
64 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
65 * expression.cs (This.ResolveBase): Update to changes.
66 (ArglistAccess.DoResolve): Likewise.
68 2005-07-11 Marek Safar <marek.safar@seznam.cz>
71 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
73 * class.cs (TypeContainer.VerifyMembers): Distinguish between
74 not used and not used & assigned.
75 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
77 2005-07-11 Marek Safar <marek.safar@seznam.cz>
80 * expression.cs (Is.DoResolve): null is never provided type.
82 2005-07-08 Marek Safar <marek.safar@seznam.cz>
85 * cs-parser.jay: Less strict event error rule to catch more errors.
87 2005-07-11 Martin Baulig <martin@ximian.com>
89 * generic.cs (ConstructedType.CheckConstraints): Improve the check
90 for the constructor constraint: we do not only have to check
91 whether the class has a public constructor, but also ensure that
92 it's parameterless. Fixes #75492.
94 2005-07-11 Martin Baulig <martin@ximian.com>
96 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
97 between type parameters if they either have the reference type
98 constraint or the class constraint.
100 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
102 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
104 2005-07-07 Marek Safar <marek.safar@seznam.cz>
107 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
108 (ExtractSecurityPermissionSet): Cope with self referencing security
111 * driver.cs (SetOutputFile): Made public property OutputFile.
113 2005-07-07 Raja R Harinath <rharinath@novell.com>
116 * class.cs (TypeContainer.first_nonstatic_field): Rename from
117 has_nonstatic_fields. Make into a FieldBase pointer.
118 (TypeContainer.AddField): Add CS0282 check.
119 (TypeContainer.EmitType): Update.
121 2005-07-06 Miguel de Icaza <miguel@novell.com>
123 * cs-tokenizer.cs (consume_identifier): Do not create strings to
124 compare if they start with __.
126 2005-07-06 Raja R Harinath <rharinath@novell.com>
128 * statement.cs (Switch.SwitchGoverningType): Only look at
129 UserCasts that don't need implicit standard conversions to one of
130 the allowed switch types (Fixes test-322.cs).
131 (LocalInfo.Resolve): Re-enable sanity-test.
133 2005-07-06 Marek Safar <marek.safar@seznam.cz>
135 * cs-tokenizer.cs (consume_identifier): Detect double undescores
137 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
139 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
141 2005-07-06 Raja R Harinath <rharinath@novell.com>
144 * ecore.cs (SimpleName.GetSignatureForError): Add.
145 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
146 (MemberAccess.GetSignatureForError): Add.
148 2005-07-05 Marek Safar <marek.safar@seznam.cz>
150 The big error and warning messages review.
180 * typemanager.cs: Updated.
182 * class.cs: (MethodCore.SetYields): Moved here to share.
183 (PropertyMethod.Define): Moved iterator setup here.
185 * iterators.cs: Add orig_method to have full access to parent
188 2005-07-05 Raja R Harinath <rharinath@novell.com>
190 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
191 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
192 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
193 variable of struct type.
194 * expression.cs (Unary.ResolveOperator): Update to change.
195 (Indirection.VerifyFixed): Likewise.
196 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
197 (ParameterReference.VerifyFixed): Value parameters are fixed.
198 (This.VerifyFixed): Treat 'this' as a value parameter.
199 * statement.cs (LocalInfo.IsFixed): Remove.
201 2005-07-01 Martin Baulig <martin@ximian.com>
203 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
204 `ec.EmitThis ()' to get the correct scope.
206 2005-07-01 Martin Baulig <martin@ximian.com>
208 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
209 instance is a ParameterReference; fixes #75299.
211 2005-06-30 Raja R Harinath <rharinath@novell.com>
214 * expression.cs (Indexers.map): Remove.
215 (Indexers.Append): Filter out inaccessible setters and getters.
216 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
219 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
221 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
222 (FieldExpr.Emit, PropertyExpr.Emit): Update.
223 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
224 * expression.cs (Invocation.EmitCall): Add CS0120 check.
226 2005-06-30 Marek Safar <marek.safar@seznam.cz>
229 * class.cs (FieldBase.GetInitializerExpression): One more field
232 2005-06-28 Miguel de Icaza <miguel@novell.com>
234 * pending.cs: Do not define a proxy if the base method is virtual,
235 it will be picked up by the runtime (bug 75270).
237 2005-07-08 Martin Baulig <martin@ximian.com>
239 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
240 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
242 2005-07-07 Martin Baulig <martin@ximian.com>
244 * generic.cs (ConstructedType.CheckConstraint): Use
245 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
246 called recursively; fixes #75329.
248 2005-07-06 Martin Baulig <martin@ximian.com>
250 * generic.cs (TypeManager.InferTypeArguments): Added support for
251 anonymous methods; fixes #75461.
253 2005-07-01 Martin Baulig <martin@ximian.com>
255 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
256 `ec.EmitThis ()' to get the correct scope.
258 2005-07-01 Martin Baulig <martin@ximian.com>
260 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
261 instance is `This'; fixes #75299.
263 2005-06-30 Martin Baulig <martin@ximian.com>
265 * class.cs (Indexer): Implement IIteratorContainer; added support
266 for iterators in indexers.
269 (EmitContext.CurrentIterator): Make this a property, not a field.
271 * anonymous.cs (AnonymousContainer.Iterator): New public property.
273 2005-06-28 Miguel de Icaza <miguel@novell.com>
275 * pending.cs: Do not define a proxy if the base method is virtual,
276 it will be picked up by the runtime (bug 75270).
278 2005-06-28 Martin Baulig <martin@ximian.com>
280 * cs-parser.jay (interface_method_declaration): Avoid a
281 reduce/reduce conflict by moving some of the code into a separate
282 `interface_method_declaration_body' rule; fixes #75368.
284 2005-06-28 Martin Baulig <martin@ximian.com>
286 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
287 array check after the check for TypeBuilder's.
289 2005-06-21 Raja R Harinath <rharinath@novell.com>
291 * convert.cs (FindMostEncompassedType): Add two trivial special
292 cases (number_of_types == 0 || number_of_types == 1).
293 (FindMostEncompasingType): Likewise.
295 2005-06-17 Raja R Harinath <rharinath@novell.com>
297 Some cleanups preparing for the fix of #75283.
298 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
300 (EventExpr.InstanceResolve): Likewise.
301 (EventExpr.DoResolve): Remove redundant checks.
303 2005-06-08 Miguel de Icaza <miguel@novell.com>
305 * class.cs: Small fix.
307 2005-06-08 Raja R Harinath <rharinath@novell.com>
310 * class.cs (GetPartialBases): Fix return value check of
313 2005-06-07 Raja R Harinath <rharinath@novell.com>
315 Ensure that partial classes are registered in their enclosing
316 namespace. Initial part of fix of #75160.
317 * tree.cs (Tree.RecordDecl): Add new namespace argument.
318 Register declspace with namespace here, not in
319 DeclSpace.RecordDecl.
320 * cs-parser.jay: Pass namespace to RecordDecl.
321 * class.cs (PartialContainer.Create): Likewise.
322 (ClassPart.DefineType): New sanity-check. Throws an exception if
324 * decl.cs (Declspace.RecordDecl): Remove.
325 * namespace.cs (NamespaceEntry.DefineName): Remove.
327 2005-06-06 Marek Safar <marek.safar@seznam.cz>
329 * rootcontext.cs: Reset TargetExt as well.
331 2005-06-03 Raja R Harinath <rharinath@novell.com>
333 * ecore.cs (Expression.Resolve): Emit CS0654 error when
336 2005-06-02 Raja R Harinath <rharinath@novell.com>
338 Fix #75080, cs0119.cs.
339 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
341 (Expression.Resolve): ... this. Use it. Remove bogus code
342 allowing ExprClass.Type and ExprClass.Namespace for
343 ResolveFlags.VariableOrValue.
344 (Expression.Resolve) [1-argument variant]: Change default resolve
345 flags based on language version.
346 (Expression.Error_UnexpectedKind): Use a simple string array
347 rather than an ArrayList.
348 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
350 (TypeOfVoid.DoResolve): Likewise.
351 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
352 flags argument -- it always has the same value.
354 2005-05-31 Raja R Harinath <rharinath@novell.com>
357 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
358 Use it in the error message.
359 * assign.cs, expression.cs, statement.cs: Update.
361 2005-05-30 Raja R Harinath <rharinath@novell.com>
364 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
365 the "almostMatchedMember" case too.
366 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
367 that failed the accessibility checks to 'almost_match'.
369 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
371 * attribute.cs: Use internal MethodBuilder methods to set
372 ExactSpelling and SetLastError on PInvoke methods, instead
373 of passing them via charset. Fixes #75060.
375 2005-05-27 Raja R Harinath <rharinath@novell.com>
377 * parameter.cs (Parameter): Remove TODO comment.
378 (Parameter.DefineParameter): Remove Location parameter.
379 (Parameters.LabelParameters): Likewise.
380 * class.cs (Constructor.Emit): Update to change.
381 (MethodData.Emit): Likewise.
382 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
383 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
385 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
388 Removed Parameters.Location and added Parameter.Location instead.
389 Removed Location parameter from Emit() and GetSignature().
396 Modified all related calls.
398 2005-06-21 Martin Baulig <martin@ximian.com>
400 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
401 left-hand side is not a nullable type; fixes #75328.
403 2005-06-21 Martin Baulig <martin@ximian.com>
406 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
407 (TypeManager.GetFullNameSignature): Likewise.
409 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
410 `source.FullName' and `target.FullName' to check whether there are
411 two conflicting definitions.
413 2005-06-21 Martin Baulig <martin@ximian.com>
415 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
416 a BoxedCast - also for reference types - to be compatible with csc.
418 2005-06-21 Martin Baulig <martin@ximian.com>
420 * expression.cs (MemberAccess.DoResolve): Add support for nested
421 types in a generic instance; fixes #75320.
423 2005-06-20 Martin Baulig <martin@ximian.com>
425 * generic.cs (TypeManager.InferType): Also walk the class
426 hierarchy for generic instances; fixes #75261.
428 2005-06-17 Martin Baulig <martin@ximian.com>
430 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
431 to make things work for corlib.
433 2005-06-15 Martin Baulig <martin@ximian.com>
435 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
436 obsolete `SecurityAction' values.
438 2005-06-06 Marek Safar <marek.safar@seznam.cz>
440 * rootcontext.cs: Reset TargetExt as well.
442 2005-06-09 Martin Baulig <martin@ximian.com>
444 * delegate.cs (Delegate.VerifyMethod): Added
445 `MethodGroupExpr old_mg' argument; inherit its
446 `HasTypeParameters'; fix #75085.
448 2005-06-09 Martin Baulig <martin@ximian.com>
450 * expression.cs (Invocation.OverloadResolve): Correctly handle
451 generic methods for the SetMemberIsUsed(); fix #75064.
453 2005-06-09 Martin Baulig <martin@ximian.com>
455 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
458 2005-06-08 Martin Baulig <martin@ximian.com>
460 * cs-parser.jay (nullable_type_or_conditional): If we put the
461 nullable back and our `type' is a `ComposedCast', remove the
462 nullable from it. Fixes #75156.
464 * expression.cs (ComposedCast.RemoveNullable): New public method.
466 2005-06-08 Martin Baulig <martin@ximian.com>
468 The big Iterators rewrite :-)
470 * iterators.cs: Rewrite this to use the anonymous methods framework.
472 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
473 before the TypeContainers; see 2test-21.cs.
476 (TypeContainer.DefineType): Don't create a new EmitContext if we
477 already have one (this only happens if we're an Iterator).
478 (TypeContainer.Define): Also call Define() on all our iterators.
479 (Method.CreateEmitContext): Added support for iterators.
482 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
483 (AnonymousContainer.CreateMethodHost): Moved here from
484 AnonymousMethod and made abstract.
485 (AnonymousContainer.CreateScopeType): New abstract method.
486 (AnonymousContainer.IsIterator): New public property.
487 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
488 get the ScopeTypeBuilder rather than manually defining it here.
489 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
492 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
493 before RootContext.DefineTypes().
495 * codegen.cs (EmitContext.RemapToProxy): Removed.
496 (EmitContext.CurrentAnonymousMethod): Changed type from
497 AnonymousMethod -> AnonymousContainer.
498 (EmitContext.ResolveTopBlock): Protect from being called twice.
499 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
500 (EmitContext.EmitThis): Removed the iterators hacks; use the
501 anonymous methods framework for that.
504 (ToplevelBlock.Container): Make this a property, not a field.
505 (ToplevelBlock.ReParent): New public method; move the
506 ToplevelBlock into a new container.
507 (Foreach.TemporaryVariable): Simplify.
509 2005-06-05 Martin Baulig <martin@ximian.com>
511 * statement.cs (LocalInfo.CompilerGenerated): New flag.
512 (Block.AddTemporaryVariable): New public method; creates a new
513 `LocalInfo' for a temporary variable.
514 (Block.EmitMeta): Create the LocalBuilders for all the temporary
516 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
517 non-iterator variables.
519 2005-06-05 Martin Baulig <martin@ximian.com>
521 * statement.cs (Foreach.TemporaryVariable): Create the
522 LocalBuilder in the Emit phase and not in Resolve since in some
523 situations, we don't have an ILGenerator during Resolve; see
524 2test-19.cs for an example.
526 2005-06-04 Martin Baulig <martin@ximian.com>
528 The big Foreach rewrite - Part II.
530 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
531 with `PropertyInfo ienumerator_getcurrent'.
533 * codegen.cs (VariableStorage): Removed.
536 (Foreach): Derive from Statement, not ExceptionStatement.
537 (Foreach.CollectionForeach): New nested class. Moved all the code
538 dealing with collection foreach here.
539 (Foreach.ForeachHelperMethods): Removed.
540 (Foreach.TemporaryVariable): Implement IMemoryLocation.
542 2005-05-23 Martin Baulig <martin@ximian.com>
544 * statement.cs (Try.DoResolve): Don't create a `finally' if we
545 don't need to. Fix #75014.
547 2005-05-26 Raja R Harinath <rharinath@novell.com>
549 Improve user-defined conversion handling.
550 * convert.cs (GetConversionOperators): Rewrite. Return only the
551 applicable operators.
552 (AddConversionOperators): New. Helper for GetConversionOperators.
553 (FindMostEncompassedType, FindMostEncompassingType): Verify that
554 there is only one most encompassed/encompassing type.
555 (FindMostSpecificSource, FindMostSpecificTarget): Remove
556 "applicable operator" handling.
557 (UserConversion): Move cache here from GetConversionOperators.
558 Directly cache the chosen operator, rather than the whole
560 (ExplicitNumericConversion): Fix buggy implementation of Decimal
561 case. Allow conversion of decimal to sbyte and byte too.
562 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
563 New static methods. Used to avoid allocating EmptyExpressions in
566 2005-05-24 Duncan Mak <duncan@novell.com>
568 * ecore.cs (CastFromDecimal): New class for casting a decimal to
569 another class, used in Convert.ExplicitNumericConversion.
570 (CastToDecimal): New class, similar to above, but casts to
571 System.Decimal, used in Convert.ImplicitNumericConversion and also
572 in explicit convesion from double/float to decimal.
574 * convert.cs (ImplicitNumericConversion): Handle implicit
575 conversions to System.Decimal.
576 (ExplicitNumericConversion): handle explicit conversions to
581 2005-05-20 Miguel de Icaza <miguel@novell.com>
583 * typemanager.cs: Do not throw an exception in the TypeBuilder
584 case, we take care of it on the TypeCode.
586 2005-05-17 Marek Safar <marek.safar@seznam.cz>
588 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
591 * cs-parser.jay: Catch more lexical errors.
593 * report.cs: Add one more Error method.
596 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
598 2005-05-20 Martin Baulig <martin@ximian.com>
600 * class.cs (TypeContainer.CircularDepException): Removed.
601 (TypeContainer.DefineType): Removed the `InTransit' stuff.
602 (TypeContainer.CheckRecursiveDefinition): Check for circular class
603 (CS0146) and interface (CS0529) dependencies here.
605 2005-05-20 Martin Baulig <martin@ximian.com>
607 * expression.cs (New.DoResolve): Move the CS0712 check above the
608 CS0144 check; otherwise it can never be reached.
610 2005-05-20 Martin Baulig <martin@ximian.com>
612 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
614 2005-05-20 Martin Baulig <martin@ximian.com>
616 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
618 * typemanager.cs (TypeManager.IsAttributeType): New public method.
620 2005-05-19 Martin Baulig <martin@ximian.com>
623 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
624 to disable error reporting.
626 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
627 here since we don't want to report an error; see the new test-336.cs.
629 2005-05-19 Raja R Harinath <rharinath@novell.com>
631 * statement.cs (ToplevelBlock.GetParameterReference)
632 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
633 Move here from class Block.
634 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
635 * expression.cs (ParameterReference.DoResolveBase): Likewise.
637 2005-05-18 Martin Baulig <martin@ximian.com>
642 (FlowBranching.Reachability): Add non-static public And() and Or()
644 (FlowBranchingSwitch): New class; do the `break_origins' thing
645 like in FlowBranchingLoop.
646 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
647 reachability, not just locals and parameters.
648 (FlowBranching.MergeChild): Remove some of the hacks for loop and
649 switch; MergeBreakOrigins() now takes care of that.
651 2005-05-18 Martin Baulig <martin@ximian.com>
653 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
654 a loop and may leave it, reset the barrier; fixes #74974.
656 2005-05-16 Raja R Harinath <rharinath@novell.com>
658 Fix test-382.cs. Emit values of decimal constants.
659 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
661 (TypeContainer.AddField): ... this.
662 (TypeContainer.EmitFieldInitializers): Allow the list of fields
663 with initializers to include 'Const's.
664 (ClassPart.RegisterFieldForInitialization): Forward to
666 * const.cs (Const.Const): Pass initializer to base class.
667 (Const.Define): In case of decimal constants, register them for
668 initialization in a static constructor.
670 2005-05-14 Martin Baulig <martin@ximian.com>
672 * statement.cs (Block.Resolve): Correctly handle unreachable code;
673 do not call ResolveUnreachable() on unreachable statements in
674 here, see the comment in the source code.
676 2005-05-13 Raja R Harinath <rharinath@novell.com>
679 * expression.cs (BinaryResolveOperator): If one of the operands of
680 an equality comparison is 'null' and the other is a pointer type,
681 convert the null to a NullPointer.
682 * convert.cs (ImplicitReferenceConversion): If the expression is a
683 NullLiteral and the target type is a pointer type, return a
685 (ImplicitConversionStandard): Likewise.
687 2005-05-13 Marek Safar <marek.safar@seznam.cz>
689 * cs-parser.jay: Set readonly context based on special constructs.
691 * expression.cs (LocalVariableReference.DoResolveBase): Improved
692 readonly variable error handling.
694 * rootcontext.cs (EmitCode): Don't verify members when error
697 * statement.cs (LocalInfo): Add reaodnly context information.
698 (SetReadOnlyContext, GetReadOnlyContext): New methods.
700 2005-05-17 Martin Baulig <martin@ximian.com>
702 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
705 2005-05-13 Martin Baulig <martin@ximian.com>
707 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
708 handle unreachable blocks.
710 2005-05-13 Martin Baulig <martin@ximian.com>
713 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
714 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
717 2005-05-13 Martin Baulig <martin@ximian.com>
719 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
720 instance variable, not a local. Fix #74873.
721 (Block.ResolveUnreachable): Set it to true here.
723 2005-05-12 Martin Baulig <martin@ximian.com>
725 * cs-parser.jay (property_declaration): Pass the `current_class',
726 not the `current_container' to Property's .ctor. Fixes #74912.
728 2005-05-11 Martin Baulig <martin@ximian.com>
730 * typemanager.cs (Closure): Copy this from MCS and merge all the
731 GMCS-specific changes into it.
733 2005-05-12 Raja R Harinath <harinath@gmail.com>
736 * typemanager.cs (unmanaged_enclosing_types): New.
737 (IsUnmanagedType): Avoid infloops by using
738 'unmanaged_enclosing_types' to talk with recursive invocations.
740 2005-05-11 Duncan Mak <duncan@novell.com>
742 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
743 continuing to process for 'arg'.
744 (handle_preprocessing_directive): Check the argument of the #endif
745 directive and report error CS1025 if there are any trailing
748 According to the C# spec, having even whitespace after the #endif
749 directive is illegal; however, because we call arg.TrimEnd ()
750 beforehand, we have the same behavior as csc, allowing whitespace
755 2005-05-11 Marek Safar <marek.safar@seznam.cz>
759 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
760 (Constructor.GetObsoleteAttribute): Implemented correctly.
762 2005-05-10 Martin Baulig <martin@ximian.com>
764 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
765 resolve the type; fixes #74864.
766 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
767 in DoResolve(); fixes #74862.
769 2005-05-10 Martin Baulig <martin@ximian.com>
771 * support.cs (ReflectionParameters.ParameterModifier): Use
772 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
773 and `ParameterAttributes.In'. Fixes #74884.
775 2005-05-10 Martin Baulig <martin@ximian.com>
777 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
778 the cache if we're just looking for `MemberTypes.NestedType' in a
781 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
782 constraints if we're still resolving the type tree.
783 (Expression.MemberLookup): If we're resolving the type tree, only
784 look for `MemberTypes.NestedType' since we're only interested in
787 * class.cs (TypeContainer.DefineType): Don't resolve the type
788 parameters here; do this later in ResolveType() after the type
789 tree has been resolved.
790 (TypeContainer.ResolveType): New public method; this is called
791 after the type tree is resolved and before the types are being
792 populated. We resolve the generic constraints here.
793 (TypeContainer.DoDefineMember): Check the constraints on our base
794 class and interfaces.
796 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
797 set the `ResolvingTypeTree' flag on the EmitContext.
799 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
801 2005-05-10 Marek Safar <marek.safar@seznam.cz>
803 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
805 * expression.cs (Argument.GetParameterModifier): Turned to property.
806 (Invocation.Error_InvalidArguments): Add more descriptive errors.
808 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
811 2005-05-09 Raja R Harinath <rharinath@novell.com>
814 * decl.cs (MemberCache.AddMethods): Register override methods,
815 rather than non-override methods.
816 * typemanager.cs (RegisterOverride): New.
817 (IsOverride): Update.
819 2005-05-09 Marek Safar <marek.safar@seznam.cz>
821 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
823 2005-05-06 Martin Baulig <martin@ximian.com>
826 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
827 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
829 2005-05-09 Marek Safar <marek.safar@seznam.cz>
833 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
834 recursive declaration.
836 * statement.cs (Block.ResolveMeta): Report any error in resolving.
838 2005-05-06 Marek Safar <marek.safar@seznam.cz>
840 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
842 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
844 2005-05-05 Raja R Harinath <rharinath@novell.com>
847 * decl.cs (DeclSpace.FamilyAccessible):
848 Use TypeManager.IsNestedFamilyAccessible.
851 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
854 2005-05-04 Raja R Harinath <rharinath@novell.com>
855 Abin Thomas <projectmonokochi@rediffmail.com>
856 Anoob V E <projectmonokochi@rediffmail.com>
857 Harilal P R <projectmonokochi@rediffmail.com>
860 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
861 allow access to all static members.
863 2005-05-04 Martin Baulig <martin@ximian.com>
865 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
867 2005-05-04 Martin Baulig <martin@ximian.com>
871 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
872 section at the end; make things work if `default' is not the last
875 2005-05-04 Martin Baulig <martin@ximian.com>
879 * statement.cs (Switch): Replaced the `got_default' field with a
880 `default_section' one.
881 (Switch.CheckSwitch): Set `default_section' here.
882 (Switch.Resolve): If we're a constant switch and the constant is
883 not found, use the default section.
885 2005-05-03 Martin Baulig <martin@ximian.com>
887 * expression.cs (ArrayAccess.EmitGetLength): New public method.
889 * statement.cs (Foreach.ArrayForeach): New nested class.
890 (Foreach.TemporaryVariable): New nested class.
891 (Foreach.EmitArrayForeach): Removed; this is now in the new
894 2005-05-03 Raja R Harinath <rharinath@novell.com>
896 * pending.cs (BaseImplements): Move the #74773 fix here. This is
898 (VerifyPendingMethods): Revert change below.
900 * typemanager.cs (IsOverride, RegisterNonOverride): New.
901 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
902 that used to trigger warning -28. Remove warning -28.
903 * expression.cs (Invocation.OverloadResolve): Use
904 TypeManager.IsOverride to distinguish override methods.
907 * pending.cs (VerifyPendingMethods): If a base type implements the
908 requested interface, don't bother checking individual methods of
909 the base type. As a side-effect, this prevents the creation of
912 2005-05-02 Martin Baulig <martin@ximian.com>
916 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
917 Also `And' the locals if the old vector is null.
918 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
919 null; in this case we basically reset all the variables.
921 2005-05-02 Martin Baulig <martin@ximian.com>
925 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
926 Added `FlowBranching branching' argument; always `and' the
927 variables instead of `or'ing them unless we're an infinite loop.
929 * statement.cs (While.Resolve): Create a new sibling unless we're
932 2005-05-02 Martin Baulig <martin@ximian.com>
936 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
937 arguments; use it instead of creating a new TopLevelBlock.
938 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
939 our ConstructorInitializer.
942 (TopLevelBlock.TopLevelBranching): New public property.
943 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
944 and create our `TopLevelBranching'.
946 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
947 anonymous method host, use `block.TopLevelBranching' rather than
948 creating a new branching.
950 2005-04-20 Miguel de Icaza <miguel@novell.com>
952 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
953 a ScopeInfo, if any of the current children is a child of the new
954 entry, move those children there.
956 2005-04-30 Martin Baulig <martin@ximian.com>
958 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
959 at the beginning of a SwitchSection. Fix #73335.
961 2005-04-27 Marek Safar <marek.safar@seznam.cz>
964 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
966 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
967 (FieldExpr.DoResolve): Obsolete members are ignored for field
970 2005-04-26 Marek Safar <marek.safar@seznam.cz>
972 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
975 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
977 (Field.VerifyClsCompliance): Volatile fields are not compliant.
979 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
982 2005-04-25 Ben Maurer <bmaurer@ximian.com>
984 * cs-parser.jay: Use the prefered version of -unsafe in error
987 2005-04-22 Marek Safar <marek.safar@seznam.cz>
989 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
992 2005-04-20 John Luke <john.luke@gmail.com>
994 * driver.cs: fix typo in error message, --outout to --output
996 2005-04-30 Martin Baulig <martin@ximian.com>
998 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
999 handle the .NET 2.x security attributes.
1001 2005-04-30 Martin Baulig <martin@ximian.com>
1004 (TypeManager.ExpandInterfaces): Don't add things twice.
1007 (TypeContainer.VerifyClsCompliance): Allow generic instances.
1009 2005-04-29 Martin Baulig <martin@ximian.com>
1011 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1013 * anonymous.cs: Added support for anonymous generic methods.
1015 2005-04-29 Martin Baulig <martin@ximian.com>
1017 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1020 2005-04-29 Martin Baulig <martin@ximian.com>
1022 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1024 * expression.cs (New.DoResolve): Fix the CS0304 check.
1026 2005-04-29 Martin Baulig <martin@ximian.com>
1028 * typemanager.cs (TypeManager.GetFullName): Updated to the new
1031 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1032 explicit interface implementation, compare the interface types.
1033 (MethodData.Define): Use the new naming scheme from the latest
1035 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1037 * decl.cs (MemberName.GetMemberName): Removed.
1038 (MemberName.MethodName, FullName): New properties.
1040 2005-04-25 Raja R Harinath <rharinath@novell.com>
1042 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1044 2005-04-22 Martin Baulig <martin@ximian.com>
1046 * generic.cs (GenericMethod): Create the EmitContext in the
1047 `Define()'; in `Define(MethodBuilder)', create the type parameters
1048 before calling `Define()'. Fixes #73933.
1050 2005-04-22 Martin Baulig <martin@ximian.com>
1053 (Constraints.Resolve): Make things work wrt. the new type lookup system.
1054 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
1056 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
1057 ConstructedType, check its constraints.
1059 2005-04-20 Marek Safar <marek.safar@seznam.cz>
1061 * codegen.cs (InRefOutArgumentResolving): New field.
1063 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1064 fields outside contructor.
1066 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1068 2005-04-19 Miguel de Icaza <miguel@novell.com>
1070 * anonymous.cs (CaptureContext.EmitParameterInstance): The
1071 parameter code was not completed ever, so it was not as up-to-date
1072 as local variables. Must finish it.
1074 The bug fix was to compare the Toplevel of the block, not the
1075 current block. Thanks for Ben for pointing this out.
1077 2005-04-19 Raja R Harinath <rharinath@novell.com>
1079 * decl.cs (AddMethods): Use the declaring type of the problem
1080 method to determine if we want to squash a warning.
1082 2005-04-19 Marek Safar <marek.safar@seznam.cz>
1084 * attribute.cs: Removed debug output.
1086 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1088 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1091 2005-04-18 Raja R Harinath <rharinath@novell.com>
1094 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1095 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1096 all null comparisons against reference types.
1098 2005-04-18 Marek Safar <marek.safar@seznam.cz>
1101 * class.cs (TypeContainer.CircularDepException) New nested
1103 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1104 (TypeContainer.DefineType): Removed error, reset InTransit before
1106 (Class.DefineType): Throw exception when is in Transit.
1107 Catch exception and report error.
1108 (Struct.DefineType): Throw exception when is in Transit.
1109 Catch exception and report error.
1110 (Interface.DefineType): Throw exception when is in Transit.
1111 Catch exception and report error.
1113 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1114 handle nested exception handlers.
1116 * flowanalysis.cs (InTryWithCatch): New method, search for try with
1119 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1120 InFinally and InCatch storage.
1122 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1123 (Catch.Resolve): Set and Restore ec.InCatch.
1124 (Try.Resolve): Set and Restore ec.InFinally.
1125 (Try.HasCatch): True when try has catch.
1127 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
1129 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1130 for the same event member, so exclude such cases from warning 419.
1133 2005-04-16 Miguel de Icaza <miguel@novell.com>
1135 * expression.cs (Binary.ResolveOperator): Apply patch from John
1136 Luke to fix bug 59864: operators &, | and ^ on enumerations
1137 require that the same enum type on both sides.
1139 * driver.cs: Add warnings to old flag usage, this is to assist
1140 people who produce Makefiles and hope that the Makefiles will be
1143 * class.cs (TypeContainer.EmitType): Moved the definition of the
1144 special $PRIVATE$ field from the resolve phase to the Emit phase.
1145 During resolve we do not know if we are a struct with
1146 HasExplicitLayout, we know this only after the attributes for the
1149 Set the FieldOffset to zero on the dummy field that we create for
1150 the class. Fixes 74590.
1152 2005-04-16 Raja R Harinath <rharinath@novell.com>
1155 * ecore.cs (PropertyExpr.resolved): New.
1156 (DoResolve): Use it to handle a case of double resolution here.
1157 Handle a case of identical-name-and-type-name.
1158 * expression.cs (ArrayCreation.CheckIndices): Avoid double
1159 resolution by storing the results of expression resolution back
1160 into the "probes" array.
1162 2005-04-15 Raja R Harinath <rharinath@novell.com>
1164 Fix cs0208-7.cs and cs0208-8.cs.
1165 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1166 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
1167 error reporting to point out the reason a struct is not unmanaged.
1169 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
1171 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
1172 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1174 2005-04-13 Raja R Harinath <rharinath@novell.com>
1177 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1178 IdenticalNameAndTypeName here.
1179 (EventExpr.InstanceResolve): Likewise.
1181 2005-04-13 Marek Safar <marek.safar@seznam.cz>
1183 C# 2.0 DefaultCharSetAttribute implementation
1185 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1186 which allows us to set GlobalNamespace for every resolve.
1187 (Attribute.ResolveArguments): Cut from Resolve.
1188 (Attribute.GetCharSetValue): Returns CharSet named argument.
1189 (Attribute.DefinePInvokeMethod): Gets default charset from
1191 (GlobalAttribute.ResolveAsTypeStep): Override.
1192 (GlobalAttribute.ResolveArguments): Override.
1194 * class.cs (TypeAttr): Is protected.
1196 * codegen.cs (ModuleClass.DefaultCharSet): New member.
1197 (ModuleClass.DefaultCharSetType): New memeber.
1198 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1200 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1201 charset from module.
1203 * delegate.cs (TypeAttr): Override.
1204 (Delegate.DefineType): Use this TypeAttr.
1206 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1207 at very early stage (before types are defined) to resolve model
1208 module attributes. It will probably not work with corlib but it
1211 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1212 charset from module.
1214 * typemanager.cs (default_charset_type): New type.
1216 2005-04-13 Raja R Harinath <rharinath@novell.com>
1218 * decl.cs (MemberCache.AddMethods): Don't warn if
1219 System.Object.Finalize has buggy MethodAttributes.
1221 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1224 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
1226 * doc.cs : detect ambiguous reference to overloaded members.
1227 Fixed bug #71603. MS 1.1 csc does not detect it.
1229 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
1231 * doc.cs : delegates must not be referenced with parameters.
1234 2005-04-12 Miguel de Icaza <miguel@novell.com>
1236 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1238 2005-04-10 Miguel de Icaza <miguel@novell.com>
1240 * driver.cs (MainDriver): Stop processing if the CLS stage found
1243 (CompilerCallableEntryPoint.InvokeCompiler): Always
1244 reset after execution; Take a TextWriter argument for the
1247 * report.cs: Use the error stream instead of hardcoding stderr.
1249 2005-04-09 Miguel de Icaza <miguel@novell.com>
1251 * class.cs: Reduce code paths to test, too small of an
1252 optimization to make it worth the extra testing. Always perform
1255 2005-04-08 Raja R Harinath <rharinath@novell.com>
1258 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1259 operators that had errors reported on them.
1261 2005-04-08 Marek Safar <marek.safar@seznam.cz>
1263 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1265 (Attribute.Resolve): Add named argument type checking.
1267 * class.cs (FixedField.Define): Use IsPrimitiveType
1269 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1271 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1272 unsafe parameter types.
1274 * statement.cs (Using.ResolveExpression): Add better error description.
1276 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1278 2005-04-08 Raja R Harinath <rharinath@novell.com>
1281 * attribute.cs (Attribute.GetAttributeUsage): Resolve
1282 AttributeUsageAttribute in the emitcontext of the attribute class,
1283 not in the emitcontext of the attributable entity it was attached to.
1284 * cs-parser.jay: Use 'current_class', not 'current_container',
1285 when creating a GlobalAttribute.
1287 2005-04-08 Alp Toker <alp@atoker.com>
1289 * pending.cs: The fix to #58413 failed to compile methods implementing
1290 interfaces with/without params modifiers and vice versa, even though
1291 params modifiers aren't part of the signature. Make the modifier check
1292 less strict as in csc.
1294 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
1295 Anoob V E <projectmonokochi@rediffmail.com>
1296 Harilal P R <projectmonokochi@rediffmail.com>
1299 * pending.cs (TypeAndMethods.mods): New. Store the parameter
1300 modifiers of pending methods.
1301 (PendingImplementation.PendingImplementation): Initialize it.
1302 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1303 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1304 with ParameterData. Add check for modifiers.
1305 * class.cs (MethodData.Define): Update to changes.
1307 2005-04-07 Raja R Harinath <rharinath@novell.com>
1309 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1311 2005-04-07 Marek Safar <marek.safar@seznam.cz>
1313 * class.cs (PropertyMethod.Define): Check private accessor in abstract
1316 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1319 * typemanager.cs: Registered RequiredAttributeAttribute.
1321 2005-04-06 Marek Safar <marek.safar@seznam.cz>
1323 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1324 Warning CS0169 is back at level 3.
1325 (IMethodData.SetMemberIsUsed): New method.
1327 * decl.cs (IsUsed): New value; moved from FieldBase.Status
1328 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1330 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1332 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1334 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1337 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1340 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1341 to avoid the problems with nested types.
1343 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
1344 Anoob V.E <projectmonokochi@rediffmail.com>
1345 Harilal P.R <projectmonokochi@rediffmail.com>
1346 Raja R Harinath <rharinath@novell.com>
1349 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1351 * typemanager (GetConstructor): Make public.
1353 2005-04-05 John Luke <john.luke@gmail.com>
1354 Raja R Harinath <rharinath@novell.com>
1357 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1358 struct too. Return false quicker in a few cases.
1359 (VerifyUnManaged): Use it.
1361 2005-04-05 Raja R Harinath <rharinath@novell.com>
1364 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1365 not 'unreachable_seen'.
1367 2005-04-04 Marek Safar <marek.safar@seznam.cz>
1369 * attribute.cs (Attribute.GetValue): Removed unused.
1371 * codegen.cs (CodeGen.TrimExt): Removed unused.
1373 * cs-parser.jay (output): Removed unused.
1375 * cs-tokenizer.cs (hex_digits): Removed unused.
1377 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1379 * expression.cs (Indirection.LoadExprValue): Removed unused.
1380 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1382 * iterators.cs (Iterator.param_types): Removed unused.
1384 * statement.cs (Goto.block): Removed unused.
1385 (ToplevelBlock.did): Removed unused.
1386 (Switch.ResolveConstantSwitch): Removed unused.
1388 2005-04-01 Ben Maurer <bmaurer@ximian.com>
1390 * rootcontext.cs: Allow mcs to bootstrap with the compilation
1393 2005-04-19 Martin Baulig <martin@ximian.com>
1395 Merged r42462 from MCS and made it work for GMCS.
1397 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
1399 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
1401 2005-04-01 Raja R Harinath <rharinath@novell.com>
1403 Fix #74232 and cs0208-3.cs.
1404 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1405 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1406 unmanaged type. Don't use FieldBuilders when 't' is a
1407 TypeBuilder. Use ModFlags and MemberType fields.
1408 * class.cs (MemberBase.member_type): Rename from MemberType.
1409 (MemberBase.MemberType): New property. Determines member_type on
1411 (MemberBase.DoDefine): Don't initialize MemberType here.
1412 (FieldMember.Define): Likewise.
1414 2005-04-01 Marek Safar <marek.safar@seznam.cz>
1417 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1418 Attributes are emitted there.
1420 2005-04-01 Raja R Harinath <rharinath@novell.com>
1422 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1423 keyword in 'partial enum' too.
1424 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1426 Report from Kamil Skalski <nazgul@omega.pl>.
1429 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1430 have partial containers too.
1432 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1433 in block' checks to Block.CheckInvariantMeaningInBlock.
1434 * statement.cs (Block.GetKnownVariableInfo): Make private.
1435 (Block.IsVariableUsedInChildBlock): Remove.
1436 (Block.IsVariableUsedInBlock): Likewise.
1437 (Block.CheckInvariantMeaningInBlock): New. Show location of
1438 conflicting declaration.
1439 (Block.AddVariable): Make error messages less long-winded and more
1440 specific. Show location of conflicting declaration.
1441 * parameter.cs (Parameters.Location): New readonly property.
1443 2005-03-31 Raja R Harinath <rharinath@novell.com>
1445 Clean up semantics of invoking ResolveMemberAccess.
1446 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1447 can have an instance, ensure that we pass in a non-TypeExpression
1448 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
1449 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1450 argument. Update to changes and simplify.
1451 (FieldExpr.Emitinstance): Remove CS0120 check.
1452 (PropertyExpr.EmitInstance): Likewise.
1453 * expression.cs (Argument.Resolve): Likewise.
1454 (Invocation.DoResolve): Update to changes in semantics of
1457 2005-03-31 Marek Safar <marek.safar@seznam.cz>
1460 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1463 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1465 2005-03-31 Raja R Harinath <rharinath@novell.com>
1467 Fix difference in behaviour with commandline invocation.
1468 * driver.cs (Driver.Reset): New.
1469 (CompilerCallableEntryPoint): Call it.
1471 * statement.cs (If.Resolve): Avoid spurious "uninitialized
1472 variable" warnings if the boolean expression failed to resolve.
1474 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
1476 * attribute.cs: Fix the union of several permissions when some of them
1477 are unrestricted (so the result isn't an unrestricted permission set).
1480 2005-03-30 Raja R Harinath <rharinath@novell.com>
1482 * ecore.cs (MemberExpr): New class. Convert from interface
1484 (MemberExpr.ResolveMemberAccess): Refactor and move here from
1485 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
1487 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1488 (MethodGroupExpr.IsExplicitImpl): Remove.
1489 (Expression.GetFieldFromEvent): Remove.
1490 (SimpleName.MemberStaticCheck): Remove.
1491 (SimpleName.DoSimpleNameResolve): Update to changes.
1492 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1493 (MemberAccess.IdenticalNameAndTypeName): Remove.
1494 (MemberAccess.error176): Move to MemberExpr.
1495 (MemberAccess.DoResolve): Update to changes.
1496 (BaseAccess.DoResolve): Likewise.
1498 2005-03-30 Marek Safar <marek.safar@seznam.cz>
1500 C# 2.0 Conditional attribute class implementation
1502 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1503 Analyzes class whether it has attribute which has ConditionalAttribute
1504 and its condition is not defined.
1506 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1507 (Class.IsExcluded): New method. Search for at least one defined
1508 condition in ConditionalAttribute of attribute class.
1510 2005-03-30 Raja R Harinath <rharinath@novell.com>
1512 * ecore.cs (PropertyExpr): Derive from Expression, not
1513 ExpressionStatement.
1514 (PropertyExpr.EmitStatement): Remove.
1516 2005-03-29 Raja R Harinath <rharinath@novell.com>
1519 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1520 internal field "value__" of an enum be private. The examples for
1521 "value__" that I found on MSDN all used FieldAttributes.Private.
1523 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1524 Don't mention IL method attribute names.
1526 Fix #47991. Remove a TODO.
1527 * statement.cs (Block.Toplevel): Make into a field.
1528 (Block.Parameters): Move into ToplevelBlock.
1529 (Block.known_variables): Rename from child_variable_names.
1530 (Block.Block): Remove variants that take Parameters. Initialize
1531 'Toplevel' with the immediately surrounding toplevel block.
1532 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
1533 LocalInfo parameter.
1534 (Block.GetKnownVariableInfo): New.
1535 (Block.IsVariableNameUsedInChildBlock): Update.
1536 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
1537 the block, even though it may not be in scope.
1538 (Block.AddVariable): Remove Parameters parameter. Use
1539 Toplevel.Parameters instead.
1540 (Block.AddConstant): Remove Parameters parameter.
1541 (Block.GetParameterReference): Update to use Toplevel.Parameters.
1542 (Block.IsParamaterReference): Likewise.
1543 (Block.IsLocalParameter): Likewise. Simplify a lot.
1544 (ToplevelBlock.Parameters): New. Moved from Block.
1545 (ToplevelBlock.ToplevelBlock): Update to changes. Always
1546 initialize Parameters to a non-null value.
1547 * cs-parser.jay: Update to changes.
1548 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1549 simple names that mean different things in the same block. Use
1550 Block.IsVariableNameUsedInBlock.
1552 2005-03-28 Raja R Harinath <rharinath@novell.com>
1554 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1556 2005-03-26 Raja R Harinath <harinath@acm.org>
1559 * assign.cs (Assign.DoResolve): When the RHS of an assignment
1560 fails to resolve, ensure that the LHS is still resolved as an
1563 2005-03-25 Raja R Harinath <harinath@acm.org>
1565 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1567 (Enum.current_ec): Remove.
1568 (Enum.LookupEnumValue): Remove EmitContext argument.
1569 Just uses the one created during DefineType.
1570 (Enum.FindMembers): Update.
1571 * expression.cs (MemberAccess.DoResolve): Update.
1573 2005-03-22 Marek Safar <marek.safar@seznam.cz>
1575 * assign.cs (Assign.DoResolve): Check for CS1717 when
1576 source and target are same (uses Equals).
1578 * expression.cs (LocalVariableReference, ParameterReference,
1579 This): Implemented Equals, GetHashCode.
1581 * statement.cs (Block.GetParameterReference): Removed useless
1584 2005-03-22 Raja R Harinath <rharinath@novell.com>
1587 * statement.cs (Block.AddVariable): Ensure that we skip implicit
1588 blocks before deciding whether the error is cs0136 or cs0128.
1590 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1591 (using_alias_directive, using_namespace_directive): Pass
1592 MemberName, not an expression to Namespace.UsingAlias and
1594 (MakeName): Use the MemberName of the namespace.
1595 * namespace.cs (Namespace.MemberName): New.
1596 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1597 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1599 * decl.cs (MemberName.Name): Make readonly.
1600 (MemberName.FromDotted): New "constructor".
1601 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1602 (MemberCore.Name): Compute from MemberName on demand.
1603 (MemberCore.SetMemberName): Provide a way to change the
1605 (MemberCore.AddToContainer): Don't take a fullname parameter.
1606 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1607 fully qualified name of the container to the member name.
1608 (TypeContainer.AddToTypeContainer): Use a fully qualified name
1609 only if the type is a member of the root container.
1610 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1611 MemberName.Left rather than searching for an embedded ".".
1612 (PartialContainer.CreatePart): Update to changes in RootContext.
1613 (MemberBase.ShortName): Turn into a property. Use
1614 MemberCore.SetMemberName.
1615 (MemberBase.ExplicitInterfaceName): Remove.
1616 (MemberBase.UpdateMemberName): Remove.
1617 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1618 (PropertyBase.SetMemberName): New override.
1619 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1620 (Tree.GetDecl): New.
1621 (Tree.AllDecls): Rename from Decls.
1622 * attribute.cs, enum.cs, report.cs: Update to changes.
1623 * driver.cs (MainDriver): Use MemberName.FromDotted on
1624 RootContext.MainClass.
1626 2005-03-21 Marek Safar <marek.safar@seznam.cz>
1628 * class.cs (FixedField.Define): Check for CS1664 and more sanity
1631 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1633 2005-03-18 Marek Safar <marek.safar@seznam.cz>
1635 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1636 property accessor modifiers.
1638 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1639 fixed buffer attribute (CS1716).
1640 (PropertyMethod.HasCustomAccessModifier): When property accessor
1641 has custom modifier.
1643 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1645 (PropertyExpr.DoResolveLValue): Add CS0272.
1647 2005-03-17 Miguel de Icaza <miguel@novell.com>
1649 * convert.cs: When converting to a pointer, use the proper Conv.U
1650 or Conv.I depending on the source data type.
1652 * cs-tokenizer.cs: Make the size for large decimal constants,
1655 2005-03-17 Martin Baulig <martin@ximian.com>
1657 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1658 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
1660 2005-03-17 Martin Baulig <martin@ximian.com>
1662 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1663 to bool so we can return an error condition.
1664 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1667 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
1669 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1672 2005-03-16 Raja R Harinath <rharinath@novell.com>
1674 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1675 Refactor to avoid traversing the list of assemblies, and to avoid
1676 string concatenation.
1677 * typemanager.cs (guid_attr_type): Remove.
1678 (negative_hits, pointers, references): Remove hashes.
1680 (GetConstructedType): New. Uses type_hash to handle constructed
1681 types (arrays, references, pointers).
1682 (GetReferenceType, GetPointerType): Use it.
1683 (GetNestedType): New. Uses type_hash to handle nested types of
1685 (LookupType, LookupTypeDirect): Remove.
1686 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
1687 'types' hash and LookupTypeReflection directly.
1688 (params_string, params_object): Use GetConstructedType.
1689 * namespace.cs (Namespace.cached_types): New. Cache of reflected
1691 (Namespace.Lookup): Use cached_types.
1692 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1693 provided by old TypeManager.LookupType.
1694 * rootcontext.cs (MakeFQN): Remove.
1695 * decl.cs (DeclSpace.MakeFQN): Likewise.
1696 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1697 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1698 TypeManager.GetConstructedType.
1699 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1701 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
1703 * cs-parser.jay: Fix build.
1705 2005-03-15 Marek Safar <marek.safar@seznam.cz>
1707 * class.cs (TypeContainer.CircularDepException) New nested
1708 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
1710 * cs-parser.jay: Reports CS1527 for any namespace element.
1712 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1715 * expression.cs (ParameterReference.IsAssigned): Changed error to
1717 (Error_WrongNumArguments): Moved CS0245 detection here.
1719 * statement.cs (Return.Resolve): Add CS1622 report.
1721 2005-03-11 Marek Safar <marek.safar@seznam.cz>
1723 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1725 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
1727 * attribute.cs expression.cs: Get rid of some allocations.
1729 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
1731 * doc.cs : just eliminate the latest change.
1733 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
1735 * doc.cs : commented out the latest change. It breaks xml-030.cs
1737 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
1739 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1740 fail. So invoke CreateType() in FindDocumentedType().
1742 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
1744 * cs-tokenizer.cs : added IsKeyword().
1745 * doc.cs : Detect keyword incorrectly used as identifier.
1746 Allow identifiers prefixed by @.
1748 2005-03-10 Marek Safar <marek.safar@seznam.cz>
1750 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1751 It caused exception in namespace resolving (again!).
1753 * class.cs (Class.ctor): Removed exit.
1754 (PropertyMethod.ctor): ditto.
1756 * codegen.cs (Codegen.Reset): Reset static data.
1757 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1759 * cs-tokenizer.cs (Cleanup): Removed.
1761 * driver.cs (GetSystemDir): Rewrote to one line command.
1762 It caused problem with unloaded dynamic modules.
1763 (UnixParseOption): Removed Exit.
1764 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1765 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1766 Now can be mcs used as library.
1768 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1771 * location.cs (Reset): Reset static data.
1773 * namespace.cs (Reset): Reset static data.
1775 * report.cs (Report.Reset): Reset static data.
1777 * rootcontext.cs (RootContext.Reset): Reset static data.
1779 * tree.cs (RootTypes.ctor): Use Location.Null
1781 * typemanager.cs (TypeManager.Reset): Reset static data.
1782 (CoreLookupType): Removed Exit.
1783 (TypeHandle.Reset): Reset static data.
1785 2005-03-10 Raja R Harinath <rharinath@novell.com>
1788 * typemanager.cs (ComputeNamespaces): Import namespaces from
1789 referenced modules too.
1791 2005-03-09 Raja R Harinath <rharinath@novell.com>
1793 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1796 2005-03-09 Raja R Harinath <rharinath@novell.com>
1798 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1799 enclosing DeclSpace. This ensures that a name-lookup populates
1800 more caches and there are fewer 'TypeExpression's. Carve out
1801 nested type lookup into ...
1802 (LookupNestedTypeInHierarchy): ... this.
1804 2005-04-15 Martin Baulig <martin@ximian.com>
1806 Merged r41590 from MCS and make it work in the generics land.
1808 * generic.cs (TypeParameter.UpdateConstraints): Removed the
1811 * class.cs (PartialContainer.UpdateConstraints): Removed.
1812 (PartialContainer.CheckConstraints): Removed.
1813 (PartialContainer.SetParameterInfo): Store the constraints here.
1814 (PartialContainer.DefineTypeParameters): New public method;
1815 resolve the type parameter's constraints here. Note that the
1816 PartialContainer doesn't have an EmitContext anymore, so we must
1817 do this in the ClassPart.
1819 2005-03-09 Raja R Harinath <rharinath@novell.com>
1821 Clean up a few partial-class semantics.
1822 Fixes test-357.cs and cs1618-2.cs.
1823 * cs-parser.jay (struct_declaration): Use 'current_class' as
1824 parent of newly-created struct. Remove call to Register ().
1825 Use 'pop_current_class' to complete handing the current struct.
1826 (interface_declaration): Likewise.
1827 (class_declaration): Likewise.
1828 (enum_declaration): Use 'current_class' as parent of newly created
1830 (delegate_declaration): Likewise.
1831 (pop_current_class): New function. This is used to handle closing
1832 up the 'current_class' and 'current_container', and pointing them
1833 to the enclosing class/container.
1834 (CSharpParser): Initialize 'current_class' too.
1835 * decl.cs (MemberCore): Add check for invariant: a partial
1836 container is not a parsed entity, and thus does not enclose any
1838 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1839 (DeclSpace.BaseTypeExpr): Use it.
1840 (DeclSpace.LookupType): Add check for invariant.
1841 * class.cs (TypeContainer): Add check for invariant: a nested
1842 class should have the same NamespaceEntry as its enclosing class.
1843 (TypeContainer.EmitFieldInitializers): Make virtual.
1844 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1846 (TypeContainer.Register): Remove.
1847 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1848 null. Use TypeResolveEmitContext for resolving base types and
1849 interfaces. Move initialization of Parts.TypeBuilder here from
1851 (TypeContainer.DefineNestedTypes): ... here.
1852 (PartialContainer): Take a Namespace not a NamespaceEntry.
1853 (PartialContainer.Create): Don't use Register. Call the
1854 appropriate Add... function directly.
1855 (ClassPart): Take both the PartialContainer and the enclosing
1856 class as constructor arguments.
1857 (ClassPart.EmitFieldInitializers): Override.
1858 (ClassPart.PartFindNestedTypes): Remove.
1859 (FieldBase.GetInitializerExpression): Resolve the initializer
1860 expression in the emit context of the enclosing class.
1861 * tree.cs (RootTypes): Remove Register ().
1863 2005-03-08 Marek Safar <marek.safar@seznam.cz>
1865 * cs-parser.jay: Removed CS0134.
1867 * driver.cs: Removed CS1901.
1869 * expression.cs (SizeOf.DoResolve): Don't report CS0233
1870 for predefined types.
1872 2005-03-07 Duncan Mak <duncan@novell.com>
1874 * codegen.cs (Save): Catch UnauthorizedAccessException as
1875 well. Fixes bug #73454.
1877 2005-03-07 Marek Safar <marek.safar@seznam.cz>
1879 * cs-tokenizer.cs (xtoken): Add CS1035.
1881 * class.cs (MethodData.Define): Add CS0683.
1882 (FieldMember.ctor): Add CS0681.
1884 2005-03-07 Raja R Harinath <rharinath@novell.com>
1886 * ecore.cs (SimpleName.DoResolve): Rename from
1887 SimpleName.DoResolveAllowStatic.
1888 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1889 Pass 'intermediate' flag to MemberStaticCheck.
1890 (SimpleName.MemberStaticCheck): Skip "static check" only in case
1891 of "intermediate" lookups via MemberAccess.
1892 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
1893 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1895 2005-03-07 Raja R Harinath <rharinath@novell.com>
1898 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1899 slipped in because of variable names that are identical to a
1900 builtin type's BCL equivalent ('string String;', 'int Int32;').
1901 (PropertyExpr.EmitInstance): Likewise.
1903 2005-03-04 Marek Safar <marek.safar@seznam.cz>
1905 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1907 * report.cs (warning_ignore_table): Made public.
1909 2005-03-04 Raja R Harinath <rharinath@novell.com>
1912 * class.cs (MethodData.Emit): Pass 'container' to
1913 container.GetObsoleteAttribute instead of 'container.Parent'.
1915 2005-03-03 Marek Safar <marek.safar@seznam.cz>
1917 * cs-parser.jay: Add 1534 error test.
1919 * iterators.cs (Yield.CheckContext): Add error 1629.
1920 (Iterator.ctor): Save unsafe modifier.
1921 (MoveNextMethod.DoEmit): Restore unsafe context.
1923 * namespace.cs (UsingAlias): Better error message.
1925 2005-03-03 Dan Winship <danw@novell.com>
1927 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1928 the warning message [#73219]
1930 2005-03-03 Raja R Harinath <rharinath@novell.com>
1932 Fix compile with MCS 1.0.0.0.
1933 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1934 w_restore to not depend on string constant folding.
1936 2005-03-03 Raja R Harinath <rharinath@novell.com>
1938 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
1939 CS0246 check to users who passed 'silent = false'.
1940 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
1942 (SimpleName.SimpleNameResolve): Update.
1943 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
1944 (MemberAccess.IdenticalNameAndTypeName): Update.
1945 * doc.cs (FindDocumentedTypeNonArray): Update.
1947 2005-03-03 Raja R Harinath <rharinath@novell.com>
1949 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
1950 * parameters.cs (ComputeAndDefineParameters): Remove.
1951 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
1952 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
1953 Use GetParameterInfo.
1955 2005-03-02 Marek Safar <marek.safar@seznam.cz>
1957 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
1959 2005-03-02 Raja R Harinath <rharinath@novell.com>
1961 Unify DeclSpace.LookupType and DeclSpace.FindType.
1962 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
1963 is in charge of defining nested types on demand.
1964 (DeclSpace.LookupType): Use it when the current_type is a
1965 TypeBuilder. Use LookupTypeDirect for reflected types.
1966 (DeclSpace.FindType): Remove.
1967 (DeclSpace.LookupInterfaceOrClass): Likewise.
1968 (DeclSpace.DefineTypeAndParents): Likewise.
1969 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
1970 DeclSpace.LookupType.
1971 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
1972 * typemanager.cs (LookupType): Simplify.
1973 (AddUserType): Remove type from negative_hits.
1974 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
1975 * class.cs (TypeContainer.FindMembers): Move handling of nested
1977 (TypeContainer.FindMembers_NestedTypes): ... here.
1978 (TypeContainer.FindNestedType): Implement override.
1979 (ClassPart.FindNestedType): Delegate to PartialContainer.
1980 (ClassPart.PartFindNestedType): Looks up the nested types of the
1983 2005-04-14 Martin Baulig <martin@ximian.com>
1985 * generic.cs (ConstructedType): Moved all the type lookup and
1986 nested class logic into SimpleName.
1987 (ConstructedType.ResolveConstructedType): Our underlying type is
1988 already fully resolved; all the type lookup stuff is in
1991 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
1992 constructed types here instead of in ConstructedType.
1994 * decl.cs (MemberName.GetTypeExpression): Always create a
1995 SimpleName, not a ConstructedType.
1996 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
1998 2005-03-02 Martin Baulig <martin@ximian.com>
2000 * class.cs (TypeContainer.DoDefineMembers): We also need a default
2001 static constructor in static classes.
2003 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
2005 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2006 sizeParamIndex is not specified.
2008 2005-03-01 Marek Safar <marek.safar@seznam.cz>
2011 * report.cs (WarningMessage.IsEnabled): Missing null check.
2013 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2015 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2016 in the fields and not in the properties.
2018 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
2020 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
2023 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2025 * attribute.cs: Small refactoring (improved robustness).
2026 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2027 (ValidateGuid): Removed.
2028 (Resolve): Removed referenced to above mentioned.
2029 (GetAttributeUsage): Made private and changed to work without
2031 (GetIndexerAttributeValue): Don't crash.
2032 (GetConditionalAttributeValue): Ditto.
2033 (GetClsCompliantAttributeValue): Ditto.
2034 (ExtractSecurityPermissionSet): All attributes exceptions are
2036 (GetPropertyValue): New helper.
2037 (GetMethodImplOptions): New method.
2038 (DefinePInvokeMethod): Reuse common code. Implemented handling of
2039 some missing properties.
2041 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2042 (Method.ApplyAttributeBuilder): Updated.
2044 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2047 2005-02-28 Raja R Harinath <rharinath@novell.com>
2050 * report.cs (Report.SymbolRelatedToPreviousError): Handle
2051 non-simple types (array, pointer, reference).
2053 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2055 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2057 * class.cs (MethodCore.IsDuplicateImplementation): Special error
2059 (Method.CheckBase): Catch wrong destructor here.
2060 (MethodData.Define): Add errors 550, 668.
2062 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2064 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2066 * pending.cs (VerifyPendingMethods): Add error 551.
2068 * typemanager.cs (CSharpName): Next error report helper.
2070 2005-02-25 Marek Safar <marek.safar@seznam.cz>
2072 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2073 attributes. Removed useless attribute double check.
2074 It saves almost 2MBs for corlib.
2076 2005-02-25 Raja R Harinath <rharinath@novell.com>
2079 * statement.cs (ExpressionStatement.Resolve): Make robust to being
2080 called twice in case of error.
2082 2005-02-23 Chris Toshok <toshok@ximian.com>
2084 Fix compiler portions of #72827.
2085 * statement.cs (Block.Emit): call Begin/EndScope on the
2086 EmitContext instead of the ILGenerator.
2088 * codegen.cs (EmitContext.BeginScope): new method, call
2089 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2091 (EmitContext.BeginScope): same, but EndScope and CloseScope
2093 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2094 offset and call the superclass's OpenScope(int) with it.
2095 (SymbolWriter.CloseScope): get the current il
2096 offset and call superclass's CloseScope(int) with it.
2098 2005-02-23 Marek Safar <marek.safar@seznam.cz>
2100 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2101 CS1677 for out and ref as well.
2103 * class.cs (Method.Define): Add error CS1599 detection.
2105 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2107 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2109 * delegate.cs (Delegate.Define): Add error CS1599 detection.
2111 * support.cs.cs (ModifierDesc): New helper method.
2113 2005-02-23 Raja R Harinath <rharinath@novell.com>
2114 Abin Thomas <projectmonokochi@rediffmail.com>
2115 Anoob V E <projectmonokochi@rediffmail.com>
2116 Harilal P R <projectmonokochi@rediffmail.com>
2119 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2120 MemberLookup (used for error reporting) actually returns a result.
2121 Fix error report number (122, not 112).
2123 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
2124 Anoob V E <projectmonokochi@rediffmail.com>
2125 Harilal P R <projectmonokochi@rediffmail.com>
2128 * pending.cs (PendingImplementation.GetAbstractMethods):
2129 Find NonPublic members too.
2131 2005-02-22 Marek Safar <marek.safar@seznam.cz>
2133 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2136 * class.cs (MethodCore.CheckMethodAgainstBase):
2137 Add error 239 report.
2139 2005-02-21 Marek Safar <marek.safar@seznam.cz>
2141 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2143 * class.cs (Operator.Define): Add error 217 report.
2145 2005-02-21 Raja R Harinath <rharinath@novell.com>
2148 * expression.cs (Invocation.IsApplicable): Make public.
2149 (Invocation.IsParamsMethodApplicable): Likewise.
2150 * delegate.cs (Delegate.VerifyApplicability): Don't use
2151 Invocation.VerifyArgumentCompat for parameter applicability
2152 testing. Use Invocation.IsApplicable and
2153 Invocation.IsParamsMethodApplicable.
2155 2005-02-21 Marek Safar <marek.safar@seznam.cz>
2157 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2159 * class.cs (Operator.Define): Add error 217 report.
2161 2005-02-21 Raja R Harinath <rharinath@novell.com>
2163 * namespace.cs (UsingEntry.Resolve): Undo change below.
2165 2005-02-21 Raja R Harinath <rharinath@novell.com>
2168 * ecore.cs (Expression.MemberLookupFailed): Add argument to
2169 disable the error message when the extended MemberLookup also
2171 (Expression.MemberLookupFinal): Update.
2172 (SimpleName.DoSimpleNameResolve): Update.
2173 * expression.cs (MemberAccess.ResolveNamespaceOrType):
2174 Don't use MemberLookupFinal.
2175 (New.DoResolve): Update.
2176 (BaseAccess.CommonResolve): Update.
2178 2005-02-21 Raja R Harinath <rharinath@novell.com>
2181 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2182 occured previously, don't resolve again.
2184 2005-02-21 Marek Safar <marek.safar@seznam.cz>
2187 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2188 argument. Call ResolveAttributeUsage for unresolved.
2189 when types doesn't match ctor arguments.
2191 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2192 for nested attribute classes.
2193 (Class.attribute_usage): Removed.
2194 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2195 for attribute class.
2197 * ecore.cs (IsAttribute): Removed.
2199 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2201 * rootcontext.cs (RegisterAttribute): Removed, attributes are
2203 (attribute_types): Removed.
2204 (EmitCode): Global attributes are emited as the latest.
2206 2005-02-18 Marek Safar <marek.safar@seznam.cz>
2208 * class.cs (EmitFieldInitializers): Don't emit field initializer
2209 for default values when optimilization is on.
2211 * constant.cs (Constant.IsDefaultValue): New property.
2213 * driver.cs: Add /optimize handling.
2217 * literal.cs: Implement new IsDefaultValue property.
2219 * rootcontext.cs (Optimize): New field, holds /optimize option.
2221 2005-02-18 Raja R Harinath <rharinath@novell.com>
2223 Fix crasher in re-opened #72347.
2224 * namespace.cs (Namespace.Lookup): Return null if
2225 DeclSpace.DefineType returns null.
2228 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2230 2005-02-18 Raja R Harinath <rharinath@novell.com>
2232 Fix remainder of #63202. Change semantics of DoResolveLValue: it
2233 now returns null if it cannot resolve to an lvalue.
2234 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2235 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2236 returned null. Remove check for SimpleName.
2237 (EventExpr.DoResolveLValue): New.
2238 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2239 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
2241 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
2243 (Unary.ResolveOperator): Move CS0211 check ...
2244 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
2246 (Unary.DoResolveLValue): Simplify.
2247 (AddressOf.DoResolveLValue): New.
2248 (ArrayAccess.DoResolveLValue): New.
2250 2005-02-16 Marek Safar <marek.safar@seznam.cz>
2252 * attribute.cs (Attribute.Resolve): Add arguments casting for
2253 when types doesn't match ctor arguments.
2255 2005-02-16 Raja R Harinath <rharinath@novell.com>
2257 Fix parts of #63202.
2258 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2259 lookup of operator in base type. Ensure that all checks happen
2260 when the operator resolves to an "op_..." method.
2262 2005-02-15 Raja R Harinath <rharinath@novell.com>
2265 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2266 'ignore_cs0104' parameter. Pass it to ...
2267 (NamespaceEntry.Lookup): ... this.
2268 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2269 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2270 (TypeLookupExpression.DoResolveAsTypeStep): Update.
2271 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2272 Update. Request that cs0104 errors be ignored.
2273 (ComposedCast.ResolveAsTypeStep): Update.
2275 2005-02-14 Raja R Harinath <rharinath@novell.com>
2278 * expression.cs (Invocation.BetterFunction): Remove support for
2279 comparing virtual functions and their overrides.
2280 (Invocation.IsOverride): New.
2281 (Invocation.OverloadResolve): Don't consider 'override' functions
2282 during candidate selection. Store them in a lookaside list.
2283 If the selected method is a 'virtual' function, use the list to
2284 find any overrides that are closer to the LHS type.
2286 2005-02-14 Marek Safar <marek.safar@seznam.cz>
2288 * expression.cs (New.DoResolve): Add complex core type reduction.
2289 (New.Constantify): Converts complex core type syntax like 'new int ()'
2292 2005-02-14 Raja R Harinath <rharinath@novell.com>
2294 * decl.cs (EntryType.EntryType): New constructor to create an
2295 updated copy of a cache entry.
2296 (MemberCache.AddMethods): Use it.
2297 (MemberCache.ClearDeclaredOnly): Remove.
2298 (MemberCache.MemberCache): Update.
2300 2005-02-11 Miguel de Icaza <miguel@novell.com>
2302 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2303 variable. This one is represents the actual low-level declaration
2304 of the method, as opposed to the semantic level `IsStatic'.
2306 An anonymous method which is hosted into a static method might be
2307 actually an instance method. IsStatic would reflect the
2308 container, while MethodIsStatic represents the actual code
2311 * expression.cs (ParameterReference): Use the new MethodIsStatic
2312 instead of IsStatic.
2314 * anonymous.cs (AnonymousMethod.Compatible): Pass the
2315 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2316 set on the current EmitContext.
2318 * expression.cs (Cast): Overload DoResolveLValue so we can pass
2319 resolve our casted expression as an LValue. This triggers the
2320 proper LValue processing that is later required by Assign.
2324 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2326 2005-02-11 Marek Safar <marek.safar@seznam.cz>
2328 C# 2.0 Fixed buffer implementation
2330 * anonymous.cs: Update after RegisterHelperClass renaming.
2332 * attribute.cs (AttributeTester.fixed_buffer_cache):
2333 Cache of external fixed buffers.
2334 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2335 implementation if field is fixed buffer else null.
2338 (TypeContainer.AddField): Accept FieldMember instead of Field.
2339 (FieldBase.IsFieldClsCompliant): Extracted code from
2340 VerifyClsCompliance descendant customization.
2341 (FixedField): New class handles fixed buffer fields.
2342 (FixedFieldExternal): Keeps information about imported fixed
2344 (IFixedField): Make access to internal or external fixed buffer
2347 * cs-parser.jay: Add fixed buffer parsing.
2349 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2352 * expression.cs (Indirection): Extended implementation to accept
2354 (PointerArithmetic.Emit): Get element from fixed buffer as well.
2355 (ElementAccess.MakePointerAccess): Get type as parameter.
2356 (DoResolve): Add fixed buffer field expression conversion.
2357 (DoResolveLValue): Ditto.
2358 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2359 (ArrayPtr): Derives from FixedBufferPtr.
2360 (ArrayPtr.Emit): Add extra emit for array elements.
2362 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2364 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2365 for compiler generated types.
2366 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2368 * statement.cs (Fixed): Refactored to be easier add fixed buffer
2369 and consume less memory.
2370 (Fixed.Resolve): Add fixed buffer case.
2372 * typemanager.cs (compiler_generated_attr_ctor,
2373 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2374 (HasElementType): Add our own implementation to work on every
2377 2005-02-11 Miguel de Icaza <miguel@novell.com>
2379 * anonymous.cs (CaptureContext): Track whether `this' has been
2382 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
2383 only captured `this' if it was implicitly done (instance
2384 methods/variables were used).
2386 * codegen.cs (EmitContext.CaptureThis): New method to flag that
2387 `this' must be captured.
2389 2005-01-30 Miguel de Icaza <miguel@novell.com>
2391 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2392 is null it means that there has been no need to capture anything,
2393 so we just create a sibling.
2395 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2397 Just a partial fix. The other half is fairly elusive.
2399 2005-02-10 Raja R Harinath <rharinath@novell.com>
2401 Fix #52586, cs0121-4.cs.
2402 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
2403 and return a hashtable.
2404 (MemberCache.ClearDeclaredOnly): New.
2405 (MemberCache.MemberCache): Update to change. Make a deep copy of
2406 the method_hash of a base type too.
2407 (MemberCache.AddMethods): Adapt to having a deep copy of the base
2408 type methods. Overwrite entries with the same MethodHandle so
2409 that the ReflectedType is correct. The process leaves in base
2410 virtual functions and their overrides as distinct entries.
2411 (CacheEntry): Now a class instead of a struct. It shouldn't alter
2412 matters since it was boxed in a ArrayList before.
2413 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2415 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
2416 case of a virtual function and its override (choose the overload
2418 (Invocation.OverloadResolve): Avoid 'override' members during
2419 'applicable_type' calculation.
2421 2005-03-28 Raja R Harinath <rharinath@novell.com>
2423 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2424 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2425 GetTypeHandle. It is possible for a reflected type to derive from
2426 a TypeBuilder (e.g., int[] derives from the TypeBuilder
2427 System.Array during mscorlib compilation).
2428 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2429 contain a method_hash, don't create one either. Don't create a
2430 deep copy of the base cache's method_hash.
2431 (MemberCache.SetupCache): Rename back from DeepCopy.
2432 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2433 already initialized. If we see an override function, add its
2434 underlying base virtual function to the member_hash too.
2436 2005-02-09 Raja R Harinath <rharinath@novell.com>
2438 Combine two near-redundant caches.
2439 * typemanager.cs (method_params): Rename from method_internal_params.
2440 (TypeManager.GetParameterData): New. Replace
2441 Invocation.GetParameterData.
2442 (TypeManager.LookupParametersByBuilder): Remove.
2443 * expression.cs (Invocation.method_parameter_cache): Remove.
2444 (Invocation.GetParameterData): Remove.
2446 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2449 2005-02-08 Raja R Harinath <rharinath@novell.com>
2452 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2453 TypeManager.multicast_delegate_type is null, resolve it by looking
2454 up "System.MulticastDelegate".
2455 * rootcontext.cs (RootContext.ResolveCore): Simplify.
2457 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
2458 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
2459 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
2462 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2463 (LabeledStatement.AddReference): New. Set 'referenced'.
2464 (Goto.Resolve): Use it.
2466 2005-02-05 John Luke <john.luke@gmail.com>
2468 * driver.cs: remove duplicate -doc line in Usage ()
2470 2005-02-04 Raja R Harinath <rharinath@novell.com>
2472 * location.cs (Location.AddFile): Fix CS2002 error report.
2474 2005-02-02 Martin Baulig <martin@ximian.com>
2476 * delegate.cs (Delegate.DefineType): Report an internal error if
2477 TypeManager.multicast_delegate_type is null. See bug #72015 for
2480 2005-02-02 Raja R Harinath <rharinath@novell.com>
2482 Fix a crasher in a variant of #31984.
2483 * const.cs (Constant.CheckBase): New override that defers the
2484 new-or-override check in case the base type hasn't been populated
2486 (Constant.Define): Ensure the new-or-override check is performed.
2488 2005-02-01 Duncan Mak <duncan@ximian.com>
2490 * const.cs (LookupConstantValue): Check that `ce' is not null
2491 before calling GetValue ().
2493 2005-02-01 Raja R Harinath <rharinath@novell.com>
2495 Fix test-334.cs (#69519).
2496 * cs-parser.jay (using_alias_directive): Pass in an expression to
2497 NamespaceEntry.UsingAlias.
2498 (using_namespace_directive): Pass in an expression to
2499 NamespaceEntry.Using.
2500 (namespace_name): Don't flatten to a string.
2501 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2502 (NamespaceEntry.AliasEntry.Resolve): Lookup using
2504 (NamespaceEntry.UsingEntry): Likewise.
2505 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2507 (NamespaceEntry.LookupForUsing): Remove.
2508 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2510 (NamespaceEntry.Lookup): Remove support for dotted names.
2512 2005-02-01 Raja R Harinath <rharinath@novell.com>
2514 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2516 (NamespaceEntry.ImplicitParent): Compute on demand.
2517 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2518 parallels the current.
2519 (NamespaceEntry.LookupForUsing): Use it.
2520 (NamespaceEntry.Lookup): If the current namespace-entry is
2521 implicit, don't search aliases and using tables.
2523 2005-02-01 Raja R Harinath <rharinath@novell.com>
2526 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2528 (TypeContainer.BaseCache): Compute on demand.
2529 (TypeContainer.FindMembers): Define constants and types if they're
2530 not already created.
2531 (FieldMember.Define): Move resetting of ec.InUnsafe before error
2533 * const.cs (Constant.Define): Make idempotent.
2535 2005-01-29 Miguel de Icaza <miguel@novell.com>
2537 * pending.cs: Produce better code (no nops produced by using Ldarg
2540 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2541 i - 1' it should be arg + 1.
2545 2005-01-28 Raja R Harinath <rharinath@novell.com>
2547 * attribute.cs (Attribute.CheckAttributeType): Make private
2549 (Attribute.ResolveType): Make virtual.
2550 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2551 handling of RootContext.Tree.Types.
2553 2005-01-27 Raja R Harinath <rharinath@novell.com>
2555 Update attribute-handling to use the SimpleName/MemberAccess
2557 * cs-parser.jay (attribute): Pass in an expression to the
2558 constructors of Attribute and GlobalAttribute.
2559 * attribute.cs (Attribute): Take an expression for the name.
2560 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
2561 passed in attribute name expression.
2562 (Attribute.CheckAttributeType): Use it.
2563 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2564 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2565 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
2566 argument to prevent error messages if the lookup fails.
2568 2005-01-27 Marek Safar <marek.safar@seznam.cz>
2570 * expression.cs (Indirection): Implemented IVariable interface
2571 to support indirection in AddressOf operator.
2572 (PointerArithmetic.Emit): Add optimalization for case where
2573 result can be precomputed.
2575 2005-01-26 Martin Baulig <martin@ximian.com>
2577 * class.cs (TypeContainer.AttributeTargets): Return the correct
2578 AttributeTargets depending on our `Kind' instead of throwing an
2579 exception; fixes #71632.
2581 2005-01-26 Marek Safar <marek.safar@seznam.cz>
2584 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2587 2005-03-17 Martin Baulig <martin@ximian.com>
2589 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2590 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2592 2005-03-17 Martin Baulig <martin@ximian.com>
2594 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2595 to bool so we can return an error condition.
2596 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2599 2005-03-17 Martin Baulig <martin@ximian.com>
2601 * generic.cs (TypeMananager.IsIEnumerable): New public method.
2603 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
2604 converting from an array-type of T to `IEnumerable<T>'.
2606 2005-03-16 Martin Baulig <martin@ximian.com>
2608 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
2609 (Nullable.LiftedUnaryMutator): New public class.
2611 * expression.cs (UnaryMutator.DoResolve): Added support for
2614 2005-03-14 Martin Baulig <martin@ximian.com>
2616 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
2618 2005-03-14 Martin Baulig <martin@ximian.com>
2620 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
2621 the comparision operators `<', `>', `<=' and `>='.
2623 2005-03-13 Martin Baulig <martin@ximian.com>
2626 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
2627 avoid confusion with the `NullLiteral'.
2628 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2630 2005-03-13 Martin Baulig <martin@ximian.com>
2632 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
2633 comparing arbitrary types with the null literal.
2635 2005-03-13 Martin Baulig <martin@ximian.com>
2637 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
2638 boolean operators '&&', '||', '&' and '|'.
2639 (Nullable.OperatorTrueOrFalse): New public class.
2641 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
2642 instead of a `StaticCallExpr'; added support for nullables.
2644 2005-03-10 Martin Baulig <martin@ximian.com>
2647 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
2648 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
2650 2005-03-07 Martin Baulig <martin@ximian.com>
2652 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
2653 it work if `expr' is not an IMemoryLocation.
2654 (Nullable.Lifted): Implement IMemoryLocation.
2655 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
2658 2005-03-05 Martin Baulig <martin@ximian.com>
2660 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
2661 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
2662 (Nullable): Added support for lifted unary and binary operators.
2664 * expression.cs (Unary.DoResolve): Added support for nullable types.
2665 (Binary.DoResolve): Likewise.
2666 (Conditional.DoResolve): Likewise.
2668 2005-03-02 Martin Baulig <martin@ximian.com>
2670 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
2672 * class.cs (ClassPart.SetParameterInfo): Override this.
2673 (PartialContainer.SetParameterInfo): Override this.
2674 (TypeContainer.CheckConstraints): New protected method.
2675 (PartialContainer.CheckConstraints): Override this and check
2676 whether the same contraints were specified in all parts of a
2677 partial generic type definition.
2678 (PartialContainer.UpdateConstraints): New public method.
2680 * generic.cs (TypeParameter.UpdateConstraints): New public method.
2682 2005-03-02 Martin Baulig <martin@ximian.com>
2684 Committing a patch from Carlos Alberto Cortez to fix #72887.
2686 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
2687 casts from `T []' to `int []'.
2689 2005-03-02 Martin Baulig <martin@ximian.com>
2691 * generic.cs (TypeManager.IsEqual): Make this symmetric.
2693 * expression.cs (Binary.ResolveOperator): When resolving a
2694 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
2695 `=='. Fixes #71866. See gen-127.cs.
2697 2005-03-02 Martin Baulig <martin@ximian.com>
2699 * class.cs (TypeContainer.DoDefineMembers): We also need a default
2700 static constructor in static classes.
2702 2005-03-02 Martin Baulig <martin@ximian.com>
2705 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
2706 (Nullable.LiftedConversion): Added support for user-defined
2709 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
2711 * cs-parser.jay: Use ComposedCast everywhere instead of
2712 NullableType, so we don't need to check for NullableType
2714 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
2715 case where we'll be resolved into a `parenthesized_expression_0'
2719 (Convert.UserDefinedConversion): Added nullable conversions.
2721 2005-02-28 Martin Baulig <martin@ximian.com>
2723 * generic.cs (TypeManager.IsNullableType): New static method.
2724 (Nullable): New abstract class.
2725 (Nullable.NullLiteral): New public class.
2726 (Nullable.LiftedConversion): New public class.
2728 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
2729 `builtin_types opt_nullable'.
2732 (Convert.ImplicitConversionStandard): Added nullable conversions.
2733 (Convert.ExplicitConversionStandard): Likewise.
2734 (Convert.ExplicitConversion): Likewise.
2736 2005-02-26 Martin Baulig <martin@ximian.com>
2738 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
2739 begin with a "?", for instance "?[]". Don't do a type lookup if
2742 2005-02-25 Martin Baulig <martin@ximian.com>
2744 The first part of Nullable Types :-)
2746 * generic.cs (NullableType): New public class.
2747 (NullCoalescingOperator): New public class.
2748 (TypeArguments.Resolve): Add a CS0306 check.
2750 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
2751 (opt_nullable): New rule.
2752 (type): Added `opt_nullable' to `namespace_or_type_name',
2753 `builtin_types' and `pointer_type'.
2754 (array_type): Added `opt_nullable'.
2755 (opt_rank_specifier_or_nullable): New rule; this is the
2756 combination of `opt_rank_specifier' and `opt_nullable'.
2757 (opt_error): New rule; catch errors here.
2758 (nullable_type_or_conditional): New rule; we use this to check for
2759 nullable and still detect the conditional operator.
2760 (local_variable_type): Use `opt_rank_specifier_or_nullable'
2761 instead `opt_rank_specifier'.
2763 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
2766 2005-02-24 Martin Baulig <martin@ximian.com>
2768 * README, README.Changes: Removed; they're old and obsolete.
2770 2005-02-22 Martin Baulig <martin@ximian.com>
2772 * generic.cs (TypeParameter.Resolve): If resolving the constraints
2773 returned an error, set `constraints' to null to avoid a crash
2775 (TypeParameter.ResolveType): Likewise.
2777 2005-02-22 Martin Baulig <martin@ximian.com>
2780 (Constraints.ResolveTypes): Protect against being called twice.
2781 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
2782 (TypeParameter.ResolveType): New public method; calls
2783 constraints.ResolveTypes().
2784 (TypeParameter.DefineType): Moved constraints.ResolveType() out
2785 into the new ResolveType().
2786 (GenericMethod.Define): Call ResolveType() on all our
2789 2005-02-21 Martin Baulig <martin@ximian.com>
2792 (TypeManager.generic_nullable_type): New static public field.
2793 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
2796 (RootContext.ResolveCore): Resolve "System.Nullable`1".
2798 2005-02-15 Martin Baulig <martin@ximian.com>
2800 * generic.cs (ConstructedType.Constraints): Correctly check
2801 constraints if the argument type is a type parameter; fixes
2804 2005-02-02 Martin Baulig <martin@ximian.com>
2806 * delegate.cs (Delegate.DefineType): Report an internal error if
2807 TypeManager.multicast_delegate_type is null. See bug #72015 for
2810 2005-01-29 Miguel de Icaza <miguel@novell.com>
2812 * pending.cs: Produce better code (no nops produced by using Ldarg
2815 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2816 i - 1' it should be arg + 1.
2820 2005-01-26 Martin Baulig <martin@ximian.com>
2822 * cs-parser.jay (indexer_declarator): Don't report an error if we
2823 have type parameters since we can be an explicit interface
2824 implementation; fixes #71449.
2826 2005-01-26 Martin Baulig <martin@ximian.com>
2828 * class.cs (TypeContainer.AttributeTargets): Return the correct
2829 AttributeTargets depending on our `Kind' instead of throwing an
2830 exception; fixes #71632.
2832 2005-01-26 Martin Baulig <martin@ximian.com>
2834 * delegate.cs (Delegate.DefineType): Correctly define our type
2835 parameters. Fixes #71483.
2837 2005-01-25 Raja R Harinath <rharinath@novell.com>
2840 * expression.cs (MemberAccess.DoResolve): Don't complain with
2841 cs0572 when the LHS of a member access has identical name and type
2844 2005-01-25 Marek Safar <marek.safar@seznam.cz>
2847 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2849 Create custom PermissionSet only for PermissionSetAttribute.
2851 2005-01-24 Marek Safar <marek.safar@seznam.cz>
2854 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2855 delegates in static class.
2857 2005-01-24 Martin Baulig <martin@ximian.com>
2859 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2860 merging an implicit block, just use its reachability.
2862 * statement.cs (Block.Resolve): Make the unreachable code check
2863 work wrt. implicit blocks; see test-337 from #63842.
2865 2005-01-21 Alp Toker <alp@atoker.com>
2867 * cs-parser.jay: destructor_declaration's container is PartialContainer
2868 not Class when partial types are used, so use Kind prop instead of
2871 2005-01-22 Miguel de Icaza <miguel@ximian.com>
2873 * cs-parser.jay: Improve error reporting when an interface
2876 2005-01-20 Dick Porter <dick@ximian.com>
2878 * support.cs: SeekableStreamReader fix from Sandor Dobos
2879 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2880 chars are read. Fixes bug 70369.
2882 2005-01-20 Raja R Harinath <rharinath@novell.com>
2884 * cs-parser.jay (catch_clause): Simplify current_block handling
2887 2005-01-17 Miguel de Icaza <miguel@ximian.com>
2889 * convert.cs (ImplicitStandardConversionExists): Synchronize the
2890 code with ImplicitStandardConversion to handle the implicit
2891 conversion of method groups into valid delegate invocations.
2893 The problem is that in parameter handling we were using this code
2894 path. Fixes bug #64698
2896 2005-01-19 Raja R Harinath <rharinath@novell.com>
2898 * cs-parser.jay: Fix several infelicities.
2899 - Avoid assigning to the parser value stack. Code like
2900 '$3 = null' is unclean. Synthesize a value for the code block
2902 - Avoid using oob_stack for storing location information. Use ...
2903 (_mark_): ... this. New (empty) rule. Saves the current location
2905 (foreach_statement): Avoid using oob_stack for current_block
2906 handling. Use technique used in for_statement and
2907 using_statement. Synthesize a value for the code block to store
2908 additional intermediate information.
2910 2005-01-13 Miguel de Icaza <miguel@ximian.com>
2912 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2913 of a different type is only allowed to private fields of a
2914 containing type, not on fields of a base class.
2916 See test-174.cs and error cs0122-9.cs
2918 2005-01-13 Raja R Harinath <rharinath@novell.com>
2920 Fix test-335.cs (bug #58126).
2921 * cs-parser.jay (argument): Split out non-expression parts of the
2922 rule into 'non_simple_argument'.
2923 (invocation_expression): Support parenthesized invocations with
2924 multiple arguments, and with single non-simple arguments.
2926 2005-01-13 Raja R Harinath <rharinath@novell.com>
2928 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2931 2005-01-12 Raja R Harinath <rharinath@novell.com>
2933 Fix cs0038-1.cs, cs1640-6.cs.
2934 * ecore.cs (Expression.Resolve): Remove special-case for
2935 SimpleName in error-handling.
2936 (Expression.almostMatchedMembers): Relax access permission to
2938 (Expression.MemberLookupFailed): Handle duplicates in
2939 almostMatchedMembers list.
2940 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2941 * expression.cs (New.DoResolve): Report CS1540 for more cases.
2942 * typemanager.cs (GetFullNameSignature): Use the MethodBase
2943 overload if the passed in MemberInfo is a MethodBase.
2945 2005-01-25 Martin Baulig <martin@ximian.com>
2948 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
2950 2005-01-12 Marek Safar <marek.safar@seznam.cz>
2953 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2954 for non-CAS & merge permission sets properly.
2956 2005-01-11 Raja R Harinath <rharinath@novell.com>
2958 Improve standard-compliance of simple name and member access
2959 resolution. Fixes bugs #52697, #57200, #67520, #69519.
2960 * ecore.cs (FullNamedExpression): New abstract base class
2961 for Namespaces and TypeExpressions.
2962 (ResolveFlags.SimpleName): Remove.
2963 (SimpleName): Remove support for dotted names.
2964 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
2965 DeclSpace.FindType and DeclSpace.LookupType.
2966 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2967 (Expression.ExprClassName): Make member function.
2968 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2969 a namespace. Remove creation of dotted "SimpleName"s.
2970 (MemberAccess.DoResolve): Likewise.
2971 * decl.cs (DeclSpace.Cache): Make private.
2972 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2973 (DeclSpace.FindType): Update.
2974 (DeclSpace.LookupType): Move here from RootContext. Return a
2975 FullNamedExpression.
2976 * namespace.cs (Namespace): Derive from FullNamedExpression
2977 so that it can be part of expression resolution.
2978 (Namespace.Lookup): Return an FullNamedExpression.
2979 (NamespaceEntry.LookupAlias): Lookup aliases only in current
2981 * rootcontext.cs (NamespaceLookup): Remove.
2982 (LookupType): Move to DeclSpace.
2983 * attribute.cs (CheckAttributeType): Update.
2984 * doc.cs (FindDocumentedType): Remove allowAlias argument.
2985 (FindDocumentedTypeNonArray): Likewise.
2987 2005-01-11 Raja R Harinath <rharinath@novell.com>
2989 Fix cs0509.cs, cs1632.cs.
2990 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2991 is the same as IsInterface.
2992 (TypeContainer.GetClassBases): Likewise.
2993 * statement.cs (LabeledStatement.ig): New field.
2994 (LabeledStatement.LabelTarget): Save ILGenerator which created the
2996 (LabeledStatement.DoEmit): Check that the label was created with
2997 the same ILGenerator.
2999 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3002 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3003 accessors to its properties.
3005 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3006 from accessors to property.
3008 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3011 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3014 2005-01-08 Miguel de Icaza <miguel@ximian.com>
3016 * attribute.cs: Check for null and empty strings.
3018 I have lost another battle to Paolo.
3020 2005-01-07 Marek Safar <marek.safar@seznam.cz>
3023 * class.cs (PropertyMethod): Set Parent field in ctors.
3024 (SetMethod.InternalParameters): Add unsafe switch hack.
3025 Override MarkForDuplicationCheck where it is appropriate.
3027 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3028 It says whether container allows members with the same name.
3030 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3031 Removed is_method parameter.
3033 2005-01-06 Duncan Mak <duncan@ximian.com>
3035 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3036 because the previous change led to incorrect reporting of CS1032
3037 ("Cannot define/undefine preprocessor symbols after first token in
3038 file"). Instead of using `tokens_seen' as the only flag that
3039 triggers CS1040, introduce `comments_seen'. This new flag is used
3040 to signify having seen comments on the current line, so it is
3041 unset after a newline.
3043 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
3045 * doc.cs : When searching for a type, find nested type too.
3046 This fixes bug #71040.
3048 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
3051 - Warn missing member comment on those classes which also does not
3052 have doc comments. Fixed bug #71041.
3053 - Don't warn missing doc comment on default constructor.
3056 2005-01-06 Duncan Mak <duncan@ximian.com>
3058 * cs-tokenizer.cs (xtoken): After handling traditional C-style
3059 comments, set `tokens_seen' to true. This allows us to detect
3060 misplaced preprocessor directives (i.e. not at the beginning of
3061 the a line, nor after whitespaces). In that case, report error
3062 CS1040. This fixes bug #56460.
3064 * cs-parser.jay (interface_member_declaration): Add checks for
3065 IsExplicitImpl, and report CS0541 error if an interface member is
3066 defined as an explicit interface declaration.
3068 2005-01-06 Marek Safar <marek.safar@seznam.cz>
3071 * class.cs (PropertyMethod): Set Parent field in ctors.
3072 (SetMethod.InternalParameters): Add unsafe switch hack.
3074 * decl.cs (MemberCore.Parent): Cannot be readonly.
3076 2005-01-06 Raja R Harinath <rharinath@novell.com>
3078 * decl.cs (DeclSpace.ResolveType): Remove.
3079 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3080 Merge in code from ...
3081 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
3082 * class.cs, enum.cs: Update to changes.
3084 2005-01-06 Miguel de Icaza <miguel@ximian.com>
3086 * anonymous.cs: Ensure that we init the scope of our parent if it
3087 has not been initialized yet.
3089 2004-12-30 Duncan Mak <duncan@ximian.com>
3091 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3092 if field.FieldBuilder is null. Fixes #70758.
3094 * convert.cs: Fixed some typos and updated some of the comments.
3095 (ImplicitStandardConversionExists):
3096 (TryImplicitIntConversion): If `target_type' is an interface and
3097 the type of `ic' implements this interface, return true or a new
3098 BoxedCast instead of null. This fixes #70468.
3100 2004-12-29 Duncan Mak <duncan@ximian.com>
3102 * expression.cs (Argument.Emit): Check that Expr is
3103 IMemoryLocation before casting to it, and report CS1510 otherwise.
3107 2004-12-21 Ben Maurer <bmaurer@ximian.com>
3109 * statement.cs (Block.ThisVariable): remove the recursion here, to
3110 make the --profile more sane.
3112 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
3114 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3115 assembly, by JB Evain.
3117 2004-12-17 Raja R Harinath <rharinath@novell.com>
3119 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
3120 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3121 "parent" refers to enclosing type/class. "base" refers to superclass.
3123 2004-12-17 Raja R Harinath <rharinath@novell.com>
3125 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3126 Ensure that we only have GlobalAttributes.
3127 * attribute.cs (Attribute.Emit): Make non-virtual.
3128 (GlobalAttribute.Emit): Remove.
3129 (Attribute.Resolve): Make virtual.
3130 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
3131 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3132 the argument. Don't create one.
3133 (Attribute.GetObsoleteAttribute): Likewise.
3134 (Attribute.GetClsCompliantAttributeValue): Likewise.
3135 * class.cs, decl.cs: Update to changes.
3137 2004-12-17 Marek Safar <marek.safar@seznam.cz>
3139 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3141 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3143 * statement.cs (Foreach.Resolve): Add error 186 report.
3145 2004-12-16 Marek Safar <marek.safar@seznam.cz>
3147 * expression.cs (Conditional.DoResolve): Add warning 429.
3149 * statement.cs (If.Resolve): Add warning 665.
3151 2004-12-16 Raja R Harinath <rharinath@novell.com>
3153 New invariant: RootContext.Tree.Types.NamespaceEntry == null
3154 except when in the parser, and in GlobalAttribute.
3155 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3156 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3157 RootContext.Tree.Types.NamespaceEntry once work is done.
3158 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
3159 and resets RootContext.Tree.Types.NamespaceEntry.
3161 2004-12-15 Marek Safar <marek.safar@seznam.cz>
3163 * cs-parser.jay: Don't create a block for every variable.
3165 2004-12-14 Miguel de Icaza <miguel@ximian.com>
3167 * location.cs: Provide extra information.
3169 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3170 variables from the captured environment, it is the ldarg_0.
3172 2004-12-14 Marek Safar <marek.safar@seznam.cz>
3174 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3177 * class.cs: Changed warning level for 169 to avoid developer
3178 displeasure from warning flooding. It will be changed back when they
3179 fix most of current BCL warnings.
3181 * RootContext.cs: Pushed default WarningLevel to 3.
3183 * statement.cs: Removed unused variable.
3185 2004-12-14 Marek Safar <marek.safar@seznam.cz>
3187 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3188 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3189 Add error 502 report.
3190 (StaticClass.DefineType): Add error 441 report.
3191 (Class.AllowedModifiersProp): New virtual property as temporary
3192 extension to AllowedModifiers.
3193 (Class.DefineType): Add error 418 report. Moved ModFlags check here
3194 to share implementation with StaticClass and don't call virtual
3197 * driver.cs (MainDriver): Add error 1558 test.
3199 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3200 report. Moved error 36 test here.
3202 * statement.cs (Throw.Resolve): Add error 724 report.
3204 * typemanager.cs: Add out_attribute_type core type.
3206 2004-12-13 Marek Safar <marek.safar@seznam.cz>
3208 * class.cs (TypeContainer.VerifyClsCompliance): Add error
3210 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3212 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3215 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3217 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
3218 Add error 3023 report.
3219 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3221 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3224 2004-12-12 John Luke <john.luke@gmail.com>
3226 * driver.cs (AddArgs): take -- into account when
3227 adding arguments, fixes bug 65710
3229 2004-12-12 Martin Baulig <martin@ximian.com>
3231 * expression.cs (Unary.TryReduceNegative): Added support for
3232 SByteConstant and ByteConstant.
3233 (Unary.Reduce): Check error values from TryReduceNegative().
3235 2004-12-10 Marek Safar <marek.safar@seznam.cz>
3237 * attributes.cs (Attribute.Resolve): Avoid multiple error report
3238 and report exception as error 182.
3240 2004-12-10 Raja R Harinath <rharinath@novell.com>
3242 * driver.cs (Main): Fix message when there are warnings.
3244 2004-12-09 Miguel de Icaza <miguel@ximian.com>
3246 * delegate.cs: Fixed my fix from yesterday, sorry about that.
3248 2004-12-09 Marek Safar <marek.safar@seznam.cz>
3250 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
3251 Reduced number of warnings.
3253 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3255 2004-12-08 Miguel de Icaza <miguel@ximian.com>
3257 * driver.cs: Removed message.
3259 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3261 2004-12-08 <vargaz@freemail.hu>
3263 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3265 2004-12-08 Martin Baulig <martin@ximian.com>
3267 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3268 instead of a CS3002 for properties and indexer.
3270 2004-12-08 Martin Baulig <martin@ximian.com>
3272 * decl.cs (MemberName.ToString): Make this work again.
3274 2004-12-08 Marek Safar <marek.safar@seznam.cz>
3276 * attribute.cs (Resolve): Add error 591 detection.
3278 * class.cs (FieldMember.Define): Add error 1547 detection.
3279 (Indexer.Define): Add error 620 detection.
3280 (Operator.Define): Add error 590 detection.
3282 * ecore.cs: Missing argument for error 79.
3284 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3287 2004-12-07 Marek Safar <marek.safar@seznam.cz>
3290 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3293 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
3295 * cs-parser.jay : handle doc comments on implicit/explicit operators.
3296 Some operator comments were suppressed.
3297 * doc.cs : Implicit/explicit operator name in doc comments are like
3298 "op_Explicit(type)~returnType", so added suffix handling.
3300 2005-01-21 Alp Toker <alp@atoker.com>
3302 * cs-parser.jay: destructor_declaration's container is PartialContainer
3303 not Class when partial types are used, so use Kind prop instead of 'is'.
3305 2004-12-12 Martin Baulig <martin@ximian.com>
3307 * expression.cs (Unary.TryReduceNegative): Added support for
3308 SByteConstant and ByteConstant.
3309 (Unary.Reduce): Check error values from TryReduceNegative().
3311 2004-12-11 Martin Baulig <martin@ximian.com>
3313 * support.cs (ReflectionParameters.ParameterName): If we have a
3314 `gpd', call `ParameterName' on it.
3316 * parameter.cs (Parameter.GetParameterAttributes): New static method.
3318 * pending.cs (PendingImplementation.DefineProxy): Call
3319 DefineParameter() for all of the MethodBuilder's arguments.
3321 2004-12-09 Martin Baulig <martin@ximian.com>
3323 * doc.cs (DocUtil): Make this a static class.
3325 2004-12-09 Martin Baulig <martin@ximian.com>
3327 * expression.cs (Invocation.InferType): Moved the type inference
3328 implementation into TypeManager.
3330 * generics.cs (TypeManager): Moved the type inference
3331 implementation here.
3333 2004-12-09 Martin Baulig <martin@ximian.com>
3335 * typemanager.cs (TypeManager): Make this a partial class.
3338 (TypeManager): Move the generics part of `TypeManager' here.
3340 2004-12-08 Martin Baulig <martin@ximian.com>
3342 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3343 instead of a CS3002 for properties and indexer. Added CS3024
3344 check for generic interfaces.
3346 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
3347 instances are not CLS-compliant.
3349 2004-12-08 Martin Baulig <martin@ximian.com>
3352 (void_pointer_expression): New rule for `void*', `void**' etc.
3353 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
3355 2004-12-08 Martin Baulig <martin@ximian.com>
3357 * expression.cs (Invocation.InferType): Removed the hack for
3358 MethodCore.MayUnify().
3360 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
3363 * class.cs (MethodCore.MayUnify): Use
3364 TypeManager.MayBecomeEqualGenericTypes().
3366 2004-12-08 Martin Baulig <martin@ximian.com>
3368 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
3369 parameter, box it. Fixes #69233.
3371 2004-12-08 Martin Baulig <martin@ximian.com>
3373 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
3374 have the ctor constraint. Fixes #68326.
3376 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
3378 * cs-parser.jay : interface comment was not consumed because of
3379 extra opt_semicolon before doc handling.
3381 2004-12-03 Raja R Harinath <rharinath@novell.com>
3383 Fix test-327.cs, test-328.cs, and put in early infrastructure
3384 for eventually fixing #52697.
3385 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3386 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3388 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3389 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3390 (VerifyUsing, error246): Update.
3391 * rootcontext.cs (RootContext.NamespaceLookup): Just use
3392 'NamespaceEntry.LookupNamespaceOrType'.
3394 2004-12-07 Martin Baulig <martin@ximian.com>
3396 * driver.cs: Call it "BETA SOFTWARE" :-)
3398 2004-12-06 Raja R Harinath <rharinath@novell.com>
3400 Fix crash on cs0657-17.cs.
3401 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3402 Use RootContext.Tree.Types, not 'new RootTypes ()'.
3403 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3404 the case where the NamespaceEntry gets overwritten.
3406 2004-12-06 Marek Safar <marek.safar@seznam.cz>
3408 Fixed #69195, #56821
3409 * ecore.cs (ResolveBoolean): Tiny refactoring.
3411 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3412 of right expression resolving when left is false constant and
3413 operator is LogicalAnd OR true constant and operator is LogicalOr.
3415 * statement.cs (ResolveUnreachable): Always reports warning.
3417 2004-12-05 Miguel de Icaza <miguel@ximian.com>
3419 * class.cs: Distinguish between 1721 and 1722 (just a little help
3420 for the programmer).
3422 2004-12-03 Miguel de Icaza <miguel@ximian.com>
3424 * delegate.cs: Only allow this on new versions of the language.
3426 2004-12-02 Duncan Mak <duncan@ximian.com>
3428 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3430 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3431 here as a static method. Take an additional bool out parameter
3432 `must_do_cs1540_check' for signaling to InstanceResolve.
3433 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3434 member field from PropertyExpr class and made it an argument of
3436 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3437 check for MarshalByRefObject, and report CS0122 instead of CS1540.
3438 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3439 and `remove_accessor' as well as InstanceResolve: report CS0122
3444 2004-12-07 Martin Baulig <martin@ximian.com>
3446 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
3447 and CS0692 where appropriate.
3449 2004-12-06 Martin Baulig <martin@ximian.com>
3451 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
3452 IsDuplicateImplementation() and improved it.
3454 * expression.cs (Invocation.InferTypeArguments): Added
3455 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
3456 and removed the "ref" modifier from `infered_types'.
3458 * decl.cs (MemberName.ToString): Removed the exception.
3460 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
3462 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3463 comments are allowed.
3465 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3467 * delegate.cs: Add checks for subtypes in paramaters and return values
3468 in VerifyMethod () to add support for Covariance/Contravariance
3471 2004-12-02 Miguel de Icaza <miguel@ximian.com>
3473 * report.cs: Remove extra closing parenthesis.
3475 * convert.cs (Error_CannotImplicitConversion): If the name of the
3476 types are the same, provide some extra information.
3478 2004-12-02 Marek Safar <marek.safar@seznam.cz>
3481 * attribute.cs (Resolve): Improved implementation of params
3482 attribute arguments.
3484 * support.cs (ParameterData): Add HasParams to be faster.
3486 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
3488 all things are for /doc support:
3490 * doc.cs: new file that supports XML documentation generation.
3491 * mcs.exe.sources: added doc.cs.
3493 Handle /doc command line option.
3494 Report error 2006 instead of 5 for missing file name for /doc.
3495 Generate XML documentation when required, after type resolution.
3497 Added support for picking up documentation (/// and /** ... */),
3498 including a new XmlCommentState enumeration.
3500 Added lines to fill Documentation element for field, constant,
3501 property, indexer, method, constructor, destructor, operator, event
3502 and class, struct, interface, delegate, enum.
3503 Added lines to warn incorrect comment.
3505 Added Documentation field (passed only when /doc was specified).
3507 Added DocComment, DocCommentHeader, GenerateDocComment() and
3508 OnGenerateDocComment() and some supporting private members for
3509 /doc feature to MemberCore.
3511 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3513 Added overriden DocCommentHeader.
3515 Added overriden DocCommentHeader and GenerateDocComment().
3517 2004-12-01 Miguel de Icaza <miguel@ximian.com>
3519 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3520 unwrapping the enumeration values, chain to
3521 DoConstantNumericPromotions again, so we can promote things to the
3522 fundamental types (takes care of enums that are bytes, sbytes).
3526 2004-12-01 Raja R Harinath <rharinath@novell.com>
3528 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3529 Fix long-standing bug in type-lookup. Use FindType instead of
3530 LookupType when ec.ResolvingTypeTree.
3531 (Attribute.ResolveType, Attribute.Resolve)
3532 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3534 (Attributes.Search): Remove internal version. Update.
3535 (Attributes.SearchMulti): Update.
3536 (Attributes.GetClsCompliantAttribute): Remove.
3537 (Attributes.GetIndexerNameAttribute): Remove.
3538 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3539 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3540 * class.cs (Indexer.Define): Likewise.
3542 2004-12-01 Marek Safar <marek.safar@seznam.cz>
3545 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3546 MarshallByReference members access.
3548 * expression.cs: Use CheckMarshallByRefAccess;
3549 Better error CS0197 message.
3551 * report.cs: Print whole related error message.
3553 2004-11-29 Marek Safar <marek.safar@seznam.cz>
3555 * class (GetClassBases): Better error 60 report.
3556 (EventProperty): Disabled warning 67 detection.
3558 2004-11-29 Marek Safar <marek.safar@seznam.cz>
3561 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3563 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3566 2004-11-29 Marek Safar <marek.safar@seznam.cz>
3569 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3571 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3573 2004-11-26 Miguel de Icaza <miguel@ximian.com>
3575 * attribute.cs (Attribute.Resolve): Refine error reporting and
3576 report a cs0117 if the identifier does not exist, to distinguish
3577 from 0617 which is a miss-use of the actual identifier.
3579 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3580 between cs0070 and cs0079.
3582 * class.cs (MemberBase.DoDefine): When reporting a wrong
3583 accessibility level, we use MethodCore to compare instead of
3584 Method (this was a regression in some refactoring effort).
3586 So now we correctly report cs0056 again.
3588 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3589 testing the target_type (which was known to be object_type) and
3590 not the source type (which is anonymous_method).
3592 Fixed reporting of error cs1660.
3594 * expression.cs (UserCast.Source): Expose the underlying cast.
3596 * statement.cs (Switch.SwitchGoverningType): Sort the list of
3597 allowed types to find a match to int32 first (most common).
3599 In addition, it ignores any ImplicitUserConversions that did an
3600 internal implicit conversion (as the switch statement allows only
3601 one integral conversion to exist).
3603 * class.cs (PartialContainer.Create): rename `name' to
3604 `member_name' for clarity. Then replace the string calls with a
3605 call to MemberName.GetPartialName, as now using
3606 MemberName.ToString is an error (this is due to the side effects
3607 it had, that were fixed in the past).
3609 This will restore the error reporting on a number of partial class
3610 errors that were missusing this (and getting an exception as a
3611 results, which is now just a plain textual warning, because
3612 yyparse debug output would crash otherwise).
3614 2004-11-26 Raja R Harinath <rharinath@novell.com>
3616 * Makefile (PROGRAM_INSTALL_DIR): Remove.
3618 2004-11-25 Ben Maurer <bmaurer@ximian.com>
3620 * rootcontext.cs (LookupType): Make sure to cache lookups that
3621 don't give us a negative result. This saves about 5% of corlib
3624 2004-11-25 Miguel de Icaza <miguel@ximian.com>
3626 * report.cs (AbstractMessage.Print): messages are sent to stderr
3628 * class.cs (TypeContainer.GetClassBases): It is an error to have a
3629 non-interface in the list of interfaces (at this point, either
3630 parent was properly set, or a base class is being listed in the
3631 interfaces section).
3633 This flags error 1722, and resolves the crash from bug 69259.
3635 2004-11-25 Ben Maurer <bmaurer@ximian.com>
3637 * statement.cs (Using.EmitExpressionFinally): make this work right
3638 for valuetypes. Fixes 69926.
3640 2004-11-25 Miguel de Icaza <miguel@ximian.com>
3642 * const.cs (Const.ChangeType): Cope with the "0 literal can be
3643 converted to an enum" here, before we try to change the underlying
3644 type. This code exists, but it is a different code path than the
3645 one used while encoding constants.
3647 (ImplicitReferenceConversionExists): In addition, resynchronized
3648 the code here, so it matches the same code in
3649 ImplicitReferenceConversionExists for the `from any class-type S
3650 to any interface-type T'.
3652 2004-11-25 Marek Safar <marek.safar@seznam.cz>
3654 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3656 2004-11-24 Miguel de Icaza <miguel@ximian.com>
3658 * cs-parser.jay: Use verbosity accordingly.
3660 2004-11-24 Marek Safar <marek.safar@seznam.cz>
3662 * expression.cs (Unary.ResolveOperator): Do not report warning;
3663 AddressOf reads from variable.
3665 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3667 2004-11-24 Marek Safar <marek.safar@seznam.cz>
3671 * attribute.cs (Attributable): Removed CheckTargets.
3672 (Attributes.Emit): Explicit attribute targets are tested here.
3674 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3675 not enabled for interfaces.
3677 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3678 (GetAssemblyName): Ouch next bug there.
3680 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3682 * expression.cs: Error 275 added.
3684 2004-11-23 Marek Safar <marek.safar@seznam.cz>
3686 Fix bug #69177 (Implemented decimal constant support)
3688 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3689 (BinaryFold): Add DecimalConstant.
3691 * const.cs (Define): Decimal constant
3693 (ChangeType): Add decimal type handling.
3694 (LookupConstantValue): Don't set value for decimal type but
3695 emit DecimalConstantAttribute. Needed for constant optimization.
3697 * constant.cs (ToDecimal): New method.
3698 (ConvertToDecimal): New method.
3699 (IntConstant): Implemented ConvertToDecimal.
3700 (DecimalConstant.Emit): Emit optimized version for decimals in
3703 * expression.cs (ResolveOperator): Changed order of constant
3704 reduction to work correctly with native types which have
3705 overloaded operators.
3706 (ResolveMemberAccess): Extract constant value from attribute
3709 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3711 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3712 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3713 (ChangeType): Decimal is special.
3714 (TypeToCoreType): Add decimal type.
3716 2004-11-22 Marek Safar <marek.safar@seznam.cz>
3718 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3721 2004-11-22 Marek Safar <marek.safar@seznam.cz>
3723 * class.cs (EventField.ApplyAttributeBuilder): Fix error
3726 2004-11-19 Marek Safar <marek.safar@seznam.cz>
3728 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3730 * pending.cs (PendingImplementation): Grab only interfaces.
3732 2004-11-19 Marek Safar <marek.safar@seznam.cz>
3734 * statement.cs (ForeachHelperMethods): Add location member and
3735 error 202 detection.
3737 2004-11-18 Marek Safar <marek.safar@seznam.cz>
3739 * expression.cs (DoResolveBase): Fixed wrong warning for out
3742 2004-12-04 Martin Baulig <martin@ximian.com>
3744 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
3745 to check whether the conversion is ok.
3747 * typemanager.cs (TypeManager.GetTypeArguments): Just return
3748 `Type.EmptyTypes' if we're not a generic TypeContainer.
3750 2004-11-25 Miguel de Icaza <miguel@ximian.com>
3752 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3753 old bug: when converting from the null literal to a pointer,
3754 return an EmptyCast, not the NullLiteral.
3756 This fixes #69921, the recent null_type changes probably made this
3759 2004-12-03 Martin Baulig <martin@ximian.com>
3761 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3762 method as our child, call AnonymousMethod.Compatible() on it.
3764 2004-12-02 Miguel de Icaza <miguel@ximian.com>
3766 * class.cs (FieldBase): Use an unused bit field from the field to
3767 encode the `has_offset' property from the FieldMember. This saves
3768 a couple of Ks on bootstrap compilation.
3770 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3771 method as our child, return the AnonymousMethod resolved
3774 * expression.cs (New.DoResolve): Allow return values from
3775 NewDelegate to also include AnonymousMethods.
3779 2004-11-29 Raja R Harinath <rharinath@novell.com>
3781 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
3783 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
3784 System.Runtime.InteropServices._Exception, since it's a base
3785 interface of the core type System.Exception in the net_2_0 profile.
3787 2004-11-27 Martin Baulig <martin@ximian.com>
3789 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
3791 2004-11-26 Raja R Harinath <rharinath@novell.com>
3793 * Makefile: Convert to use executable.make.
3794 * gmcs.exe.sources: New.
3796 2004-11-25 Martin Baulig <martin@ximian.com>
3798 * expression.cs (Invocation.InferType): Added support for byref types.
3800 2004-11-25 Martin Baulig <martin@ximian.com>
3802 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
3803 in TypeManager.TypeToCoreType().
3805 2004-11-25 Martin Baulig <martin@ximian.com>
3807 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
3808 "Dispose" method from the `current_type'.
3809 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
3810 DoDefineMembers() instead of using the MethodBuilder; this is
3811 required for generic iterators.
3813 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
3815 2004-11-24 Martin Baulig <martin@ximian.com>
3817 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
3819 2004-11-20 Martin Baulig <martin@ximian.com>
3821 * expression.cs (Invocation.InferType): Correctly infer generic
3822 instances; see gen-103.cs.
3823 (Invocation.InferTypeArguments): If a generic method doesn't have
3824 any unbound type parameters, we don't need to infer anything.
3826 2004-11-19 Raja R Harinath <rharinath@novell.com>
3828 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
3830 2004-11-17 Raja R Harinath <rharinath@novell.com>
3832 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3833 (TypeHandle.GetMemberCache): New.
3834 (TypeHandle.TypeHandle): Update.
3835 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3836 (TypeManager.LookupParentInterfacesCache):
3837 Rename from LookupInterfaceCache. Optimize slightly.
3838 (TypeManager.MemberLookup_FindMembers): Update.
3839 * decl.cs (MemberCache.MemberCache): Set Container to null in the
3841 (AddCacheContents): Rename from AddHashtable.
3842 * class.cs (TypeContainer.parent_container): Remove.
3843 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3844 (TypeContainer.DoDefineMembers): Don't initialize it.
3845 Update to name changes.
3847 2004-11-17 Miguel de Icaza <miguel@ximian.com>
3849 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3850 that factors the code to check access modifiers on override.
3852 (PropertyBase): Use the code here.
3854 Patch from Lluis S'anchez, fixes bug #69361.
3856 2004-11-15 Miguel de Icaza <miguel@ximian.com>
3858 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3859 routine that is used to report the use of a captured variable
3860 whose address has been taken.
3862 There are two checks: one when variables are being captured and
3863 the other check is when the address of a variable is taken.
3865 (because an anonymous methods might be resolved before *or* after
3866 the address has been taken) and
3868 * expression.cs (Conditional.DoResolve): Remove the special
3869 casing that Martin added to trueExpr and falseExpr being both
3870 NullLiteral. We get the right behavior now just by introducing
3871 the null_type into the compiler.
3873 * convert.cs (ExplicitConversion): Change the code to use
3874 null_type instead of testing `expr is NullLiteral'.
3875 (ImplicitConversionStandard): use null_type too.
3876 (ImplicitReferenceConversionExists): use null_type too.
3877 (ImplicitReferenceConversion): use null_type too.
3879 * literal.cs: The type of `NullLiteral' is now null_type instead
3881 (Resolve): Set the type here.
3883 * typemanager.cs: Introduce null_type.
3885 2004-11-18 Martin Baulig <martin@ximian.com>
3888 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
3890 2004-11-18 Martin Baulig <martin@ximian.com>
3892 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
3894 2004-11-18 Martin Baulig <martin@ximian.com>
3896 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
3897 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
3898 call ResolveConstructedType() on it to resolve it without checking
3900 (Constraints.ResolveTypes): Check them here.
3901 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
3902 but don't check constraints.
3903 (ConstructedType.ResolveAsTypeTerminal): Override this and also
3904 check constraints here.
3905 (ConstructedType.ResolveConstructedType): New public method. This
3906 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
3907 resolve ourselves without checking constraints.
3909 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
3911 2004-11-18 Martin Baulig <martin@ximian.com>
3914 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
3916 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
3918 2004-11-18 Martin Baulig <martin@ximian.com>
3920 * ecore.cs (TypeExpr.ResolveType): Removed.
3921 (Expression.ResolveAsTypeTerminal): We always return a fully
3922 resolved `TypeExpr', so we can just access its `Type'.
3924 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
3926 2004-11-17 Martin Baulig <martin@ximian.com>
3928 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
3929 sure we don't return any unresolved TypeExpr's.
3930 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
3932 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
3934 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
3935 unresolved `ConstructedType's.
3937 2004-11-17 Martin Baulig <martin@ximian.com>
3939 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
3941 2004-11-17 Martin Baulig <martin@ximian.com>
3944 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
3946 * decl.cs (DeclSpace.ResolveType): Removed.
3947 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
3949 2004-11-17 Martin Baulig <martin@ximian.com>
3951 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3952 direction, like FindMembers() does. Fixes #69546, testcase is in
3955 2004-11-16 Martin Baulig <martin@ximian.com>
3957 This is based on a patch from Marek Safar, see bug #69082.
3958 Fixes bugs #63705 and #67130.
3960 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3961 method; create a MemberCache for an interface type and cache the
3964 * decl.cs (IMemberContainer.ParentContainer): Removed.
3965 (IMemberContainer.ParentCache): New property.
3966 (MemberCache.SetupCacheForInterface): Removed.
3967 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3968 to create a cache for an interface's "parent".
3970 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3973 2004-11-14 Ben Maurer <bmaurer@ximian.com>
3975 * statement.cs: Avoid adding bools to a hashtable.
3977 2004-11-15 Martin Baulig <martin@ximian.com>
3979 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
3981 2004-11-11 Martin Baulig <martin@ximian.com>
3983 * typemanager.cs (TypeManager.GetMethodName): New method.
3985 * class.cs (MethodData.Define): Include the generic arity in the
3986 name of an explicit interface; also add it to the method name.
3988 * pending.cs (PendingImplementation.InterfaceMethod): The method
3989 name now includes the generic arity.
3991 2004-11-07 Miguel de Icaza <miguel@ximian.com>
3993 * expression.cs (Invocation.OverloadResolve): Flag error if we are
3994 calling an unsafe method from a safe location.
3996 2004-11-06 Marek Safar <marek.safar@seznam.cz>
3999 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4001 2004-11-06 Miguel de Icaza <miguel@ximian.com>
4003 * namespace.cs (VerifyUsing): use GetPartialName instead of
4006 2004-11-05 Miguel de Icaza <miguel@ximian.com>
4008 * statement.cs (Return.Resolve): Fix regression in typo: if
4009 `in_exc', we have to request a NeedReturnLabel, this was a typo
4010 introduced in the anonymous method check-in. Fixes #69131.
4012 * Indexers were using the ShortName when defining themselves,
4013 causing a regression in the compiler bootstrap when applying the
4014 patch from 2004-11-02 (first part), now they use their full name
4015 and the bug is gone.
4017 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
4019 * driver.cs: Strip the path from the names of embedded resources. Fixes
4022 2004-11-04 Raja R Harinath <rharinath@novell.com>
4024 Fix error message regression: cs0104-2.cs.
4025 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4026 (AliasEntry.Resolve): Update.
4027 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
4029 (RootContext.LookupType): Update.
4031 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
4033 * cs-parser.jay: Add support for handling accessor modifiers
4034 * class: Add support port accessor modifiers and error checking,
4035 define PropertyMethod.Define as virtual (not abstract anymore)
4036 * ecore.cs: Add checking for proeprties access with access modifiers
4037 * iterators.cs: Modify Accessor constructor call based in the modified
4039 2004-11-02 Ben Maurer <bmaurer@ximian.com>
4041 * expression.cs (StringConcat): Handle being called twice,
4042 as when we have a concat in a field init with more than two
4045 2004-11-02 Miguel de Icaza <miguel@ximian.com>
4047 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4048 special case explicit implementations, we should always produce
4049 the .property or .event declaration.
4051 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4052 since it will not return correct data if people use this
4053 unresolved in the presence of using statements (see test-313).
4055 * class.cs (MethodData.Define): If we are an explicit interface
4056 implementation, set the method name to the full name of the
4057 interface plus the name of the method.
4059 Notice that using the method.MethodName.GetFullName() does not
4060 work, as it will only contain the name as declared on the source
4061 file (it can be a shorthand in the presence of using statements)
4062 and not the fully qualifed type name, for example:
4066 class D : ICloneable {
4067 object ICloneable.Clone () {
4071 Would produce a method called `ICloneable.Clone' instead of
4072 `System.ICloneable.Clone'.
4074 * namespace.cs (Alias.Resolve): Use GetPartialName.
4076 2004-11-01 Marek Safar <marek.safar@seznam.cz>
4078 * cs-parser.jay: Add error 1055 report.
4080 2004-11-01 Miguel de Icaza <miguel@ximian.com>
4082 * assign.cs (Assign.DoResolve): Only do the transform of
4083 assignment into a New if the types are compatible, if not, fall
4084 through and let the implicit code deal with the errors and with
4085 the necessary conversions.
4087 2004-11-01 Marek Safar <marek.safar@seznam.cz>
4089 * cs-parser.jay: Add error 1031 report.
4091 * cs-tokenizer.cs: Add location for error 1038.
4093 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4095 * cs-parser.jay: Add error 1016 report.
4097 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4099 * cs-parser.jay: Add errors 1575,1611 report.
4101 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4103 * cs-parser.jay: Add error 1001 report.
4105 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4108 * attribute.cs (GetMarshal): Add method argument for
4109 caller identification.
4111 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4112 agument for GetMarshal and RuntimeMissingSupport.
4114 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4116 * attribute.cs (ExtractSecurityPermissionSet): Removed
4117 TypeManager.code_access_permission_type.
4119 * typemanager.cs: Removed TypeManager.code_access_permission_type.
4121 2004-10-27 Miguel de Icaza <miguel@ximian.com>
4123 * expression.cs (LocalVariableReference.DoResolveLValue): Check
4124 for obsolete use of a variable here. Fixes regression on errors
4125 cs0619-25 and cs0619-26.
4127 2004-10-27 Marek Safar <marek.safar@seznam.cz>
4129 Fix #62358, implemented security attribute encoding.
4131 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4132 Tests permitted SecurityAction for assembly or other types.
4133 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4134 data from SecurityPermissionAttribute to PermisionSet class.
4136 * class.cs (ApplyAttributeBuilder): Added special handling
4137 for System.Security.Permissions.SecurityAttribute based types.
4139 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4140 special handling for System.Security.Permissions.SecurityAttribute
4143 * enum.cs (ApplyAttributeBuilder): Added special handling
4144 for System.Security.Permissions.SecurityAttribute based types.
4146 * parameter.cs (ApplyAttributeBuilder): Added special handling
4147 for System.Security.Permissions.SecurityAttribute based types.
4149 * rootcontext.cs: Next 2 core types.
4151 * typemanager.cs (TypeManager.security_permission_attr_type):
4152 Built in type for the SecurityPermission Attribute.
4153 (code_access_permission_type): Build in type.
4155 2004-10-17 Miguel de Icaza <miguel@ximian.com>
4157 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4158 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4159 all of this information into
4160 EmitContext.EmitCapturedVariableInstance.
4162 * codegen.cs (EmitCapturedVariableInstance): move here the
4163 funcionality of emitting an ldarg.0 in the presence of a
4164 remapping. This centralizes the instance emit code.
4166 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4167 then emit a load of this: it means that we have reached the
4168 topmost ScopeInfo: the one that contains the pointer to the
4169 instance of the class hosting the anonymous method.
4171 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4172 captures to the topmost CaptureContext.
4174 2004-10-12 Miguel de Icaza <miguel@ximian.com>
4176 * expression.cs (LocalVariableReference): Move the knowledge about
4177 the iterators into codegen's EmitCapturedVariableInstance.
4179 2004-10-11 Miguel de Icaza <miguel@ximian.com>
4181 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4182 all code paths return a value from an anonymous method (it is the
4183 same as the 161 error, but for anonymous methods).
4185 2004-10-08 Miguel de Icaza <miguel@ximian.com>
4187 The introduction of anonymous methods in the compiler changed
4188 various ways of doing things in the compiler. The most
4189 significant one is the hard split between the resolution phase
4190 and the emission phases of the compiler.
4192 For instance, routines that referenced local variables no
4193 longer can safely create temporary variables during the
4194 resolution phase: they must do so from the emission phase,
4195 since the variable might have been "captured", hence access to
4196 it can not be done with the local-variable operations from the runtime.
4200 (Block.Flags): New flag `IsTopLevel' to indicate that this block
4201 is a toplevel block.
4203 (ToplevelBlock): A new kind of Block, these are the blocks that
4204 are created by the parser for all toplevel method bodies. These
4205 include methods, accessors and anonymous methods.
4207 These contain some extra information not found in regular blocks:
4208 A pointer to an optional CaptureContext (for tracking captured
4209 local variables and parameters). A pointer to the parent
4212 (Return.Resolve): Catch missmatches when returning a value from an
4213 anonymous method (error 1662).
4214 Invoke NeedReturnLabel from the Resolve phase instead of the emit
4217 (Break.Resolve): ditto.
4219 (SwitchLabel): instead of defining the labels during the
4220 resolution phase, we now turned the public ILLabel and ILLabelCode
4221 labels into methods called GetILLabelCode() and GetILLabel() that
4222 only define the label during the Emit phase.
4224 (GotoCase): Track the SwitchLabel instead of the computed label
4225 (its contained therein). Emit the code by using
4226 SwitchLabel.GetILLabelCode ().
4228 (LocalInfo.Flags.Captured): A new flag has been introduce to track
4229 whether the Local has been captured or not.
4231 (LocalInfo.IsCaptured): New property, used to tell whether the
4232 local has been captured.
4234 * anonymous.cs: Vastly updated to contain the anonymous method
4237 The main classes here are: CaptureContext which tracks any
4238 captured information for a toplevel block and ScopeInfo used to
4239 track the activation frames for various local variables.
4241 Each toplevel block has an optional capture context associated
4242 with it. When a method contains an anonymous method both the
4243 toplevel method and the anonymous method will create a capture
4244 context. When variables or parameters are captured, they are
4245 recorded on the CaptureContext that owns them, for example:
4249 MyDelegate d = delegate {
4254 Here `a' will be recorded as captured on the toplevel
4255 CapturedContext, the inner captured context will not have anything
4256 (it will only have data if local variables or parameters from it
4257 are captured in a nested anonymous method.
4259 The ScopeInfo is used to track the activation frames for local
4260 variables, for example:
4262 for (int i = 0; i < 10; i++)
4263 for (int j = 0; j < 10; j++){
4264 MyDelegate d = delegate {
4269 At runtime this captures a single captured variable `i', but it
4270 captures 10 different versions of the variable `j'. The variable
4271 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4272 recorded on a child.
4274 The toplevel ScopeInfo will also track information like the `this'
4275 pointer if instance variables were referenced (this is necessary
4276 as the anonymous method lives inside a nested class in the host
4277 type of the method).
4279 (AnonymousMethod): Expanded to track the Toplevel, implement
4280 `AnonymousMethod.Compatible' to tell whether an anonymous method
4281 can be converted to a target delegate type.
4283 The routine now also produces the anonymous method content
4285 (AnonymousDelegate): A helper class that derives from
4286 DelegateCreation, this is used to generate the code necessary to
4287 produce the delegate for the anonymous method that was created.
4289 * assign.cs: API adjustments for new changes in
4290 Convert.ImplicitStandardConversionExists.
4292 * class.cs: Adjustments to cope with the fact that now toplevel
4293 blocks are of type `ToplevelBlock'.
4295 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4296 insteda of standard blocks.
4298 Flag errors if params arguments are passed to anonymous methods.
4300 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4301 `CurrentAnonymousMethod' which points to the current Anonymous
4302 Method. The variable points to the AnonymousMethod class that
4303 holds the code being compiled. It is set in the new EmitContext
4304 created for the anonymous method.
4306 (EmitContext.Phase): Introduce a variable and an enumeration to
4307 assist in enforcing some rules about when and where we are allowed
4308 to invoke certain methods (EmitContext.NeedsReturnLabel is the
4309 only one that enfonces this right now).
4311 (EmitContext.HaveCaptureInfo): new helper method that returns
4312 whether we have a CapturedContext initialized.
4314 (EmitContext.CaptureVariable): New method used to register that a
4315 LocalInfo must be flagged for capturing.
4317 (EmitContext.CapturedParameter): New method used to register that a
4318 parameters must be flagged for capturing.
4320 (EmitContext.CapturedField): New method used to register that a
4321 field must be flagged for capturing.
4323 (EmitContext.HaveCapturedVariables,
4324 EmitContext.HaveCapturedFields): Return whether there are captured
4325 variables or fields.
4327 (EmitContext.EmitMethodHostInstance): This is used to emit the
4328 instance for the anonymous method. The instance might be null
4329 (static methods), this (for anonymous methods that capture nothing
4330 and happen to live side-by-side with the current method body) or a
4331 more complicated expression if the method has a CaptureContext.
4333 (EmitContext.EmitTopBlock): Routine that drives the emission of
4334 code: it will first resolve the top block, then emit any metadata
4335 and then emit the code. The split is done so that we can extract
4336 any anonymous methods and flag any captured variables/parameters.
4338 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4339 during this phase, the ILGenerator should not be used as labels
4340 and local variables declared here might not be accessible to any
4341 code that is part of an anonymous method.
4343 Exceptions to this include the temporary variables that are
4344 created by some statements internally for holding temporary
4347 (EmitContext.EmitMeta): New routine, in charge of emitting all the
4350 (EmitContext.TemporaryReturn): This method is typically called
4351 from the Emit phase, and its the only place where we allow the
4352 ReturnLabel to be defined other than the EmitMeta. The reason is
4353 that otherwise we would have to duplicate a lot of logic in the
4354 Resolve phases of various methods that today is on the Emit
4357 (EmitContext.NeedReturnLabel): This no longer creates the label,
4358 as the ILGenerator is not valid during the resolve phase.
4360 (EmitContext.EmitThis): Extended the knowledge in this class to
4361 work in anonymous methods in addition to iterators.
4363 (EmitContext.EmitCapturedVariableInstance): This emits whatever
4364 code is necessary on the stack to access the instance to a local
4365 variable (the variable will be accessed as a field).
4367 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4368 EmitContext.EmitAddressOfParameter): Routines to support
4369 parameters (not completed at this point).
4371 Removals: Removed RemapLocal and RemapLocalLValue. We probably
4372 will also remove the parameters.
4374 * convert.cs (Convert): Define a `ConstantEC' which points to a
4375 null. This is just to prefity some code that uses
4376 ImplicitStandardConversion code and do not have an EmitContext
4379 The idea is to flag explicitly that at that point in time, it is
4380 known that the conversion will not trigger the delegate checking
4381 code in implicit conversions (which requires a valid
4384 Everywhere: pass new EmitContext parameter since
4385 ImplicitStandardConversionExists now requires it to check for
4386 anonymous method conversions.
4388 (Convert.ImplicitStandardConversionExists): If the type of an
4389 expression is the anonymous_method_type, and the type is a
4390 delegate, we invoke the AnonymousMethod.Compatible method to check
4391 whether an implicit conversion is possible.
4393 (Convert.ImplicitConversionStandard): Only do implicit method
4394 group conversions if the language level is not ISO_1.
4396 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4397 MethodInfo for the Invoke method. used by Delegate and
4400 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4401 method conversions if the target type is a delegate.
4403 Removed extra debugging nops.
4405 (LocalVariableReference): Turn the `local_info' into a public
4408 Add `prepared' field, the same hack used for FieldExprs to cope
4409 with composed assignments, as Local variables do not necessarily
4410 operate purely on the stack as they used to: they can be captured
4413 Add `temp' for a temporary result, like fields.
4415 Refactor DoResolve and DoResolveLValue into DoResolveBase.
4417 It now copes with Local variables that are captured and emits the
4418 proper instance variable to load it from a field in the captured
4421 (ParameterReference.DoResolveBase): During the resolve phase,
4422 capture parameters if we are in an anonymous method.
4424 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4425 anonymous method, use the EmitContext helper routines to emit the
4426 parameter reference.
4428 * iterators.cs: Set RemapToProxy to true/false during the
4431 * parameters.cs (GetParameterByName): New helper method.
4433 * typemanager.cs (anonymous_method_type) a new type that
4434 represents an anonyous method. This is always an internal type,
4435 used as a fencepost to test against the anonymous-methodness of an
4438 2004-10-20 Marek Safar <marek.safar@seznam.cz>
4440 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4442 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4444 2004-11-10 Martin Baulig <martin@ximian.com>
4446 * expression.cs (Invocation.BetterFunction): If two methods have
4447 equal parameter types, but only one of them is generic, the
4448 non-generic one wins.
4449 (New.DoResolve): Don't set `is_struct' to false if we're a generic
4450 instance; just use `Type.IsValueType' to determine whether
4451 something is a struct or not.
4452 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
4453 so we can be called multiple times.
4455 2004-11-10 Martin Baulig <martin@ximian.com>
4457 * generic.cs (TypeParameter.DefineConstraints): New public method.
4458 (TypeParameter.CheckAccessLevel): Override this and return true.
4459 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
4460 override ResolveType() anymore.
4461 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
4463 2004-11-10 Martin Baulig <martin@ximian.com>
4465 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
4466 call DeclSpace.ResolveNestedType() on it.
4468 2004-11-10 Martin Baulig <martin@ximian.com>
4470 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
4471 non-null, call ParameterModifier() on it.
4473 2004-11-10 Martin Baulig <martin@ximian.com>
4476 (Iterators): Added `current_type' and `this_type' fields.
4477 (Iterators.DefineIterator): Create a new EmitContext and store it
4478 in `ec'; compute `this_type'.
4480 2004-11-10 Martin Baulig <martin@ximian.com>
4483 (TypeManager.IsPrivateAccessible): New public method.
4484 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
4486 2004-11-10 Martin Baulig <martin@ximian.com>
4488 * class.cs (TypeContainer.DefineType): Call
4489 TypeBuilder.DefineGenericParameters() before resolving the type
4491 (MethodData.parent_method): New protected field.
4492 (MethodData..ctor): Added `MethodInfo parent_method' argument.
4493 (MethodData.Define): Compute `parent_method'.
4496 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4497 (MemberCore.GetClsCompliantAttributeValue): Likewise.
4498 (DeclSpace.ec): New protected field; store the EmitContext here.
4499 (DeclSpace.EmitContext): New public property.
4500 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
4501 (DeclSpace.ResolveNestedType): New public method.
4502 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
4503 (DeclSpace.NestedAccessible): Added `Type tb' argument.
4504 (DeclSpace.FamilyAccessible): Likewise.
4505 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
4506 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4509 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
4512 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4513 (Enum.Emit): Don't create a new EmitContext.
4515 2004-10-18 Martin Baulig <martin@ximian.com>
4517 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4518 `Type' directly, but call ResolveType() on it.
4519 (Catch.Resolve): Likewise.
4520 (Foreach.Resolve): Likewise.
4522 2004-10-18 Martin Baulig <martin@ximian.com>
4524 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4525 `Type' directly, but call ResolveType() on it.
4526 (Probe.DoResolve): Likewise.
4527 (ArrayCreation.LookupType): Likewise.
4528 (TypeOf.DoResolve): Likewise.
4529 (SizeOf.DoResolve): Likewise.
4531 2004-10-18 Raja R Harinath <rharinath@novell.com>
4533 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4536 2004-10-17 John Luke <john.luke@gmail.com>
4538 * class.cs (Operator.GetSignatureForError): use CSharpName
4540 * parameter.cs (Parameter.GetSignatureForError): Returns
4541 correct name even if was not defined.
4543 2004-10-13 Raja R Harinath <rharinath@novell.com>
4546 * class.cs (TypeContainer.EmitContext): New property.
4547 (DefineNestedTypes): Create an emitcontext for each part.
4548 (MethodCore.DoDefineParameters): Use container's emitcontext.
4549 Pass type array to InternalParameters.
4550 (MemberBase.DoDefine): Use container's emitcontext.
4551 (FieldMember.Define): Likewise.
4552 (Event.Define): Likewise.
4553 (SetMethod.GetParameterInfo): Change argument to EmitContext.
4554 Pass type array to InternalParameters.
4555 (SetIndexerMethod.GetParameterInfo): Likewise.
4556 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4557 * delegate.cs (Define): Pass emitcontext to
4558 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
4559 array to InternalParameters.
4560 * expression.cs (ParameterReference.DoResolveBase): Pass
4561 emitcontext to GetParameterInfo.
4562 (ComposedCast.DoResolveAsTypeStep): Remove check on
4563 ec.ResolvingTypeTree.
4564 * parameter.cs (Parameter.Resolve): Change argument to
4565 EmitContext. Use ResolveAsTypeTerminal.
4566 (Parameter.GetSignature): Change argument to EmitContext.
4567 (Parameters.ComputeSignature): Likewise.
4568 (Parameters.ComputeParameterTypes): Likewise.
4569 (Parameters.GetParameterInfo): Likewise.
4570 (Parameters.ComputeAndDefineParameterTypes): Likewise.
4571 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
4572 * support.cs (InternalParameters..ctor): Remove variant that takes
4574 * typemanager.cs (system_intptr_expr): New.
4575 (InitExpressionTypes): Initialize it.
4577 2004-10-12 Chris Toshok <toshok@ximian.com>
4579 * cs-parser.jay: fix location for try_statement and catch_clause.
4581 2004-10-18 Martin Baulig <martin@ximian.com>
4583 * class.cs (FieldMember.Define): Don't access the TypeExpr's
4584 `Type' directly, but call ResolveType() on it.
4585 (MemberBase.DoDefine): Likewise.
4587 * expression.cs (New.DoResolve): Don't access the TypeExpr's
4588 `Type' directly, but call ResolveType() on it.
4589 (ComposedCast.DoResolveAsTypeStep): Likewise.
4591 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4592 `Type' directly, but call ResolveType() on it.
4594 2004-10-17 John Luke <john.luke@gmail.com>
4596 * class.cs (Operator.GetSignatureForError): use CSharpName
4598 * parameter.cs (Parameter.GetSignatureForError): Returns
4599 correct name even if was not defined.
4601 2004-10-13 Raja R Harinath <rharinath@novell.com>
4604 * class.cs (TypeContainer.EmitContext): New property.
4605 (DefineNestedTypes): Create an emitcontext for each part.
4606 (MethodCore.DoDefineParameters): Use container's emitcontext.
4607 Pass type array to InternalParameters.
4608 (MemberBase.DoDefine): Use container's emitcontext.
4609 (FieldMember.Define): Likewise.
4610 (Event.Define): Likewise.
4611 (SetMethod.GetParameterInfo): Change argument to EmitContext.
4612 Pass type array to InternalParameters.
4613 (SetIndexerMethod.GetParameterInfo): Likewise.
4614 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4615 * delegate.cs (Define): Pass emitcontext to
4616 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
4617 array to InternalParameters.
4618 * expression.cs (ParameterReference.DoResolveBase): Pass
4619 emitcontext to GetParameterInfo.
4620 (ComposedCast.DoResolveAsTypeStep): Remove check on
4621 ec.ResolvingTypeTree.
4622 * parameter.cs (Parameter.Resolve): Change argument to
4623 EmitContext. Use ResolveAsTypeTerminal.
4624 (Parameter.GetSignature): Change argument to EmitContext.
4625 (Parameters.ComputeSignature): Likewise.
4626 (Parameters.ComputeParameterTypes): Likewise.
4627 (Parameters.GetParameterInfo): Likewise.
4628 (Parameters.ComputeAndDefineParameterTypes): Likewise.
4629 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
4630 * support.cs (InternalParameters..ctor): Remove variant that takes
4632 * typemanager.cs (system_intptr_expr): New.
4633 (InitExpressionTypes): Initialize it.
4635 2004-10-12 Chris Toshok <toshok@ximian.com>
4637 * cs-parser.jay: fix location for try_statement and catch_clause.
4639 2004-10-07 Raja R Harinath <rharinath@novell.com>
4641 More DeclSpace.ResolveType avoidance.
4642 * decl.cs (MemberCore.InUnsafe): New property.
4643 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
4644 with newly created EmitContext.
4645 (FieldMember.Define): Likewise.
4646 * delegate.cs (Delegate.Define): Likewise.
4647 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4648 only if normal name-lookup fails.
4649 (TypeExpr.DoResolve): Enable error-checking.
4650 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4651 (SizeOf.DoResolve): Likewise.
4652 (ComposedCast.DoResolveAsTypeStep): Likewise.
4653 (StackAlloc.DoResolve): Likewise.
4654 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4655 (Block.Unsafe): New property.
4656 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4657 (Unsafe): Set 'unsafe' flag of contained block.
4658 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4659 (Fixed.Resolve): Likewise.
4660 (Catch.Resolve): Likewise.
4661 (Using.ResolveLocalVariableDecls): Likewise.
4662 (Foreach.Resolve): Likewise.
4664 2004-10-05 John Luke <john.luke@gmail.com>
4666 * cs-parser.jay: add location to error CS0175
4668 2004-10-04 Miguel de Icaza <miguel@ximian.com>
4670 * ecore.cs (Expression.Constantity): Add support for turning null
4673 * const.cs (Const.Define): Allow constants to be reference types
4674 as long as the value is Null.
4676 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
4678 * namespace.cs (NamespaceEntry.Using): No matter which warning
4679 level is set, check if this namespace name has already been added.
4681 2004-10-03 Ben Maurer <bmaurer@ximian.com>
4683 * expression.cs: reftype [!=]= null should always use br[true,false].
4686 2004-10-03 Marek Safar <marek.safar@seznam.cz>
4689 * attribute.cs: Enum conversion moved to
4690 GetAttributeArgumentExpression to be applied to the all
4693 2004-10-01 Raja R Harinath <rharinath@novell.com>
4695 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4696 * class.c (TypeContainer.DefineType): Flag error if
4697 base types aren't accessible due to access permissions.
4698 * decl.cs (DeclSpace.ResolveType): Move logic to
4699 Expression.ResolveAsTypeTerminal.
4700 (DeclSpace.ResolveTypeExpr): Thin layer over
4701 Expression.ResolveAsTypeTerminal.
4702 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4703 Refactor code into NestedAccess. Use it.
4704 (DeclSpace.NestedAccess): New.
4705 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4706 argument to silence errors. Check access permissions.
4707 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4708 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4709 (Cast.DoResolve): Likewise.
4710 (New.DoResolve): Likewise.
4711 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4712 (TypeOf.DoResolve): Likewise.
4714 * expression.cs (Invocation.BetterConversion): Return the Type of
4715 the better conversion. Implement section 14.4.2.3 more faithfully.
4716 (Invocation.BetterFunction): Make boolean. Make correspondence to
4717 section 14.4.2.2 explicit.
4718 (Invocation.OverloadResolve): Update.
4719 (Invocation): Remove is_base field.
4720 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
4721 (Invocation.Emit): Likewise.
4723 2004-09-24 Marek Safar <marek.safar@seznam.cz>
4725 * cs-parser.jay: Reverted 642 warning fix.
4727 2004-09-23 Marek Safar <marek.safar@seznam.cz>
4730 * decl.cs (FindMemberWithSameName): Indexer can have more than
4733 2004-09-23 Marek Safar <marek.safar@seznam.cz>
4735 * expression.cs (LocalVariableReference.DoResolveLValue):
4736 Do not report warning 219 for out values.
4737 (EmptyExpression.Null): New member to avoid extra allocations.
4739 2004-09-23 Marek Safar <marek.safar@seznam.cz>
4741 * cs-parser.jay: Fix wrong warning 642 report.
4743 * cs-tokenizer.cs (CheckNextToken): New helper;
4744 Inspect next character if is same as expected.
4746 2004-09-23 Martin Baulig <martin@ximian.com>
4748 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4749 (Convert.ImplicitReferenceConversionExists): Likewise.
4751 2004-11-09 Raja R Harinath <rharinath@novell.com>
4753 * Makefile (DISTFILES): Comment out a few missing files.
4755 2004-10-29 Raja R Harinath <rharinath@novell.com>
4757 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
4758 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
4759 (gmcs.exe): Invoke bootstrap-libs.
4760 (clean-local): Clean the net_2_0_bootstrap profile too.
4761 (PROGRAM_INSTALL_DIR): New.
4762 (install-local): Use it.
4764 2004-10-13 Martin Baulig <martin@ximian.com>
4766 * generic.cs (TypeManager.InflatedConstraints): New nested class.
4767 (TypeParameter.DefineType): If we're a method type parameter and
4768 that method is overriding something, "inflate" its constraints.
4770 2004-10-12 Martin Baulig <martin@ximian.com>
4772 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
4773 and have type arguments, create and resolve a ConstructedType.
4775 2004-10-12 Martin Baulig <martin@ximian.com>
4777 * decl.cs (MemberCache.FindMemberToOverride): Use
4778 TypeManager.IsEqual() to compare the parameters and Type.Equals()
4779 to compare the invocationType.
4781 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
4782 When comparing two type parameters, only do the signature-only
4783 comparision for method type parameters.
4785 2004-10-11 Martin Baulig <martin@ximian.com>
4787 * report.cs: Don't make --fatal abort on warnings, we have
4788 -warnaserror for that.
4790 2004-10-11 Martin Baulig <martin@ximian.com>
4793 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
4794 (TypeManager.IsEqual): Call ourself recursively instead of using
4797 2004-10-11 Martin Baulig <martin@ximian.com>
4799 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
4800 on our own type parameters, not on the ones we inherit from a containing
4803 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
4806 * generic.cs (TypeParameter.Define): We may only be called once.
4808 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
4809 instead of TypeManager.IsEqual().
4811 2004-09-28 Martin Baulig <martin@ximian.com>
4814 (GenericConstraints.EffectiveBaseClass): New public property.
4815 (TypeParameter.GenericConstraints): New public property.
4816 (ConstructedType.CheckConstraints): Improved.
4818 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
4819 (Convert.TypeParameterConversion): New private method; use this in
4820 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
4821 for all conversions related to type parameters.
4823 2004-09-24 Martin Baulig <martin@ximian.com>
4825 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
4826 type parameter conversions for type parameters which are known to
4829 2004-09-24 Martin Baulig <martin@ximian.com>
4831 * generic.cs (GenericConstraints): Added `IsReferenceType' and
4832 `IsValueType' properties.
4834 * support.cs (ReflectionConstraints): Use
4835 Type.GetGenericParameterConstraints() instead of the old hack.
4837 2004-09-24 Martin Baulig <martin@ximian.com>
4839 * generic.cs (GenericConstraints): Moved here and made it an
4842 * support.cs (GenericConstraints): Moved to generic.cs.
4844 2004-09-24 Martin Baulig <martin@ximian.com>
4847 (ReflectionConstraints): Un-nested this class and made it public.
4850 (TypeManager.GetTypeParameterConstraints): New public method.
4851 (TypeManager.HasConstructorConstraint): Use the attributes.
4853 2004-09-24 Martin Baulig <martin@ximian.com>
4855 * support.cs (GenericConstraints): Replaced `HasConstructor',
4856 `IsReferenceType' and `IsValueType' with `Attributes'.
4857 (ReflectionParameters.ReflectionConstraints): Removed the Create()
4858 method and made the .ctor public.
4860 * generic.cs (Constraints.Attributes): New public property.
4861 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
4862 `IsReferenceType' -> `HasReferenceTypeConstraint' and
4863 `IsValueType' -> `HasValueTypeConstraint'.
4865 2004-09-23 Martin Baulig <martin@ximian.com>
4867 * generic.cs (Constraints): Reflect latest runtime changes.
4869 2004-09-23 Martin Baulig <martin@ximian.com>
4871 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4872 (Convert.ImplicitReferenceConversionExists): Likewise.
4874 2004-09-23 Marek Safar <marek.safar@seznam.cz>
4876 * class.cs (Operator.Define): Add error 448 and 559 report.
4878 2004-09-22 Marek Safar <marek.safar@seznam.cz>
4880 * class.cs (MemberBase.IsTypePermitted): New protected
4881 method for checking error CS0610.
4883 2004-09-22 Marek Safar <marek.safar@seznam.cz>
4885 * class.cs (TypeContainer.HasExplicitLayout): New property
4886 Returns whether container has StructLayout attribute set Explicit.
4887 (FieldMember): New abstract class for consts and fields.
4888 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4889 (Field): Reuse FieldMember.
4891 * const.cs (Const): Reuse FieldMember.
4893 * rootcontext.cs: EmitConstants call moved to class.
4895 2004-09-22 Martin Baulig <martin@ximian.com>
4897 Marek and me just fixed one of our oldest bugs: #28562 :-)
4899 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4901 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4902 we're an EnumConstant, just return that.
4903 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4904 an EnumConstant. In this case, we need to use GetValueAsEnumType()
4905 to get the value which'll actually be written into the attribute.
4906 However, we have to use GetValue() to access the attribute's value
4909 2004-09-22 Marek Safar <marek.safar@seznam.cz>
4911 * constant.cs (Constant.IsNegative): New abstract property
4914 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4915 (StackAlloc.DoResolve): Reused IsNegative.
4917 2004-09-22 Martin Baulig <martin@ximian.com>
4919 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
4920 public method; like LookupTypeContainer, but also works for
4923 * report.cs (Report.SymbolRelatedToPreviousError): Use
4924 TypeManager.LookupGenericTypeContainer().
4926 2004-09-22 Martin Baulig <martin@ximian.com>
4928 Thanks to Peter Sestoft for this bug report.
4930 * expression.cs (Conditional): If both the `trueExpr' and the
4931 `falseExpr' is a NullLiteral, return a NullLiteral.
4933 2004-09-22 Martin Baulig <martin@ximian.com>
4935 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4936 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4937 for the "get_Current" call.
4939 2004-09-21 Martin Baulig <martin@ximian.com>
4941 * convert.cs (Convert.ImplicitReferenceConversion): When
4942 converting to an interface type, first check whether we're
4943 converting from a reference type.
4945 2004-09-14 Martin Baulig <martin@ximian.com>
4947 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4949 2004-09-14 Marek Safar <marek.safar@seznam.cz>
4952 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4953 called and is obsolete then this member suppress message
4954 when call is inside next [Obsolete] method or type.
4956 * expression.cs: Use TestObsoleteMethodUsage member.
4958 2004-09-14 Martin Baulig <martin@ximian.com>
4960 * genericparser.cs: Removed.
4962 2004-09-13 Marek Safar <marek.safar@seznam.cz>
4964 * class.cs (MethodCore.CheckBase): Fix bug #65757.
4966 2004-09-12 Marek Safar <marek.safar@seznam.cz>
4968 * attribute.cs (Attribute.Resolve): Add error 653 report.
4970 * class.cs (Class.ApplyAttributeBuilder): Add error 641
4972 (Method.ApplyAttributeBuilder): Add error 685 report.
4973 (Operator.Define): Add error 564 report.
4975 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4977 * expression.cs (Invocation.DoResolve): Add error
4980 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4983 2004-09-11 Marek Safar <marek.safar@seznam.cz>
4985 * class.cs (ConstructorInitializer.Resolve):
4986 Wrong error number (515->516).
4988 2004-09-11 Marek Safar <marek.safar@seznam.cz>
4990 * class.cs (Indexer.Define): Add error 631 report.
4992 2004-09-11 Marek Safar <marek.safar@seznam.cz>
4994 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4996 2004-09-11 Marek Safar <marek.safar@seznam.cz>
4998 * expression.cs (Probe.DoResolve): Add error CS0241 report.
5000 2004-09-10 Marek Safar <marek.safar@seznam.cz>
5002 * cs-parser.jay: Added error CS0241 report.
5004 2004-09-10 Raja R Harinath <rharinath@novell.com>
5006 * cs-parser.jay (fixed_statement): Introduce a scope for the
5007 declaration in the 'fixed' statement.
5009 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5011 * cs-parser.jay: Added CS0230 error report.
5013 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5015 * cs-parser.jay: Added errors CS0231 and CS0257 report.
5017 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5019 * expression.cs (Argument.Resolve): Added error CS0192 and
5022 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5024 C# 2.0 #pragma warning feature
5026 * cs-tokenizer.cs (PreProcessPragma): New method;
5027 Handles #pragma directive.
5029 * report.cs (WarningRegions): New class; Support
5030 class for #pragma warning directive. It tests whether
5031 warning is enabled for a given line.
5033 2004-09-08 Miguel de Icaza <miguel@ximian.com>
5035 * const.cs: Add more descriptive error report, tahnks to
5038 2004-09-08 Marek Safar <marek.safar@seznam.cz>
5040 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5042 2004-09-07 Miguel de Icaza <miguel@ximian.com>
5044 * expression.cs: Apply patch from Ben: Remove dead code from
5045 ArrayCreation, and remove the TurnintoConstant call in const.cs,
5046 as that code just threw an exception anwyays.
5048 * const.cs: Remove the call to the turnintoconstant, for details
5051 * literal.cs: The type of the null-literal is the null type; So
5052 we use a placeholder type (literal.cs:System.Null, defined here)
5055 * expression.cs (Conditional.DoResolve): Remove some old code that
5056 is no longer needed, conversions have been fixed.
5058 (ArrayCreationExpression.DoResolve): Return false if we fail to
5059 resolve the inner expression.
5061 2004-09-07 Raja R Harinath <rharinath@novell.com>
5064 * cs-parser.jay (delegate_declaration): Record a delegate
5065 declaration as a type declaration.
5066 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5068 2004-09-06 Miguel de Icaza <miguel@ximian.com>
5070 * parameter.cs: Do not crash if the type can not be resolved.
5072 * expression.cs: Report errors with unsafe pointers, fixes #64896
5074 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
5076 * expression.cs: Pointer arith always needs to do a conv.i
5077 if the operand is a long. fix 65320
5079 2004-09-04 Marek Safar <marek.safar@seznam.cz>
5081 Fixed cs0619-37.cs, cs0619-38.cs
5083 * enum.cs (GetObsoleteAttribute): Removed.
5085 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5086 on Enum member is double staged. The first is tested member
5089 2004-09-04 Marek Safar <marek.safar@seznam.cz>
5091 Fixed #56986, #63631, #65231
5093 * class.cs: (TypeContainer.AddToMemberContainer): New method,
5094 adds member to name container.
5095 (TypeContainer.AddToTypeContainer): New method, adds type to
5097 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5098 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5099 AddOperator): Simplified by reusing AddToMemberContainer.
5100 (TypeContainer.UserDefinedStaticConstructor): Changed to property
5102 (Method.CheckForDuplications): Fixed implementation to test all
5104 (MemberBase): Detection whether member is explicit interface
5105 implementation is now in constructor.
5106 (MemberBase.UpdateMemberName): Handles IndexerName.
5107 (Accessor): Changed to keep also location information.
5108 (AbstractPropertyEventMethod): Is derived from MemberCore.
5109 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5110 will be emited or not.
5111 (PropertyBase.AreAccessorsDuplicateImplementation):
5112 Tests whether accessors are not in collision with some method.
5113 (Operator): Is derived from MethodCore to simplify common
5116 * decl.cs (Flags.TestMethodDuplication): Test for duplication
5118 (DeclSpace.AddToContainer): Adds the member to defined_names
5119 table. It tests for duplications and enclosing name conflicts.
5121 * enum.cs (EnumMember): Clean up to reuse the base structures
5123 2004-09-03 Martin Baulig <martin@ximian.com>
5125 Merged latest changes into gmcs. Please keep this comment in
5126 here, it makes it easier for me to see what changed in MCS since
5127 the last time I merged.
5129 2004-09-03 Martin Baulig <martin@ximian.com>
5131 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5132 into TypeContainer, to make partial classes work again.
5134 2004-09-03 Martin Baulig <martin@ximian.com>
5136 * rootcontext.cs (RootContext.V2): Removed.
5138 2004-03-23 Martin Baulig <martin@ximian.com>
5140 * expression.cs (Invocation.OverloadResolve): Added `bool
5141 may_fail' argument and use it instead of the Location.IsNull() hack.
5143 2004-09-09 Martin Baulig <martin@ximian.com>
5145 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
5147 2004-09-09 Martin Baulig <martin@ximian.com>
5149 * generic.cs (TypeParameter.DefineType): Added support for
5150 explicit interface methods.
5152 2004-09-09 Martin Baulig <martin@ximian.com>
5154 * README.Changes: New document. Started to list important changes
5155 between MCS and GMCS here.
5157 2004-09-08 Martin Baulig <martin@ximian.com>
5160 (TypeContainer.CheckRecursiveDefinition): New protected method.
5161 (TypeContainer.DefineType): Move the CS0146 check into
5162 CheckRecursiveDefinition().
5164 2004-09-06 Martin Baulig <martin@ximian.com>
5166 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
5167 types for the constructor constraint.
5169 2004-09-03 Martin Baulig <martin@ximian.com>
5171 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5172 into TypeContainer, to make partial classes work again.
5174 2004-09-03 Martin Baulig <martin@ximian.com>
5176 * rootcontext.cs (RootContext.V2): Removed.
5178 2004-03-23 Martin Baulig <martin@ximian.com>
5180 * expression.cs (Invocation.OverloadResolve): Added `bool
5181 may_fail' argument and use it instead of the Location.IsNull() hack.
5183 2004-09-03 Martin Baulig <martin@ximian.com>
5185 Merged latest changes into gmcs. Please keep this comment in
5186 here, it makes it easier for me to see what changed in MCS since
5187 the last time I merged.
5189 2004-09-03 Raja R Harinath <rharinath@novell.com>
5192 * expression.cs (BetterConversion): Don't allow either conversion
5193 to be null. Remove redundant implicit conversion test when 'q ==
5194 null' -- when this function is invoked, we already know that the
5195 implicit conversion exists.
5196 (BetterFunction): Assume that 'best' is non-null. Remove
5197 redundant reimplementation of IsApplicable when 'best' is null.
5198 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5199 number of arguments.
5200 (IsAncestralType): Extract from OverloadResolve.
5201 (OverloadResolve): Make robust to the MethodGroupExpr being
5202 unsorted. Implement all the logic of Section 14.5.5.1, and
5203 support overloading of methods from multiple applicable types.
5204 Clean up logic somewhat. Don't pass null methods to BetterFunction.
5206 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5207 (RealError, Warning): Append type of report to related symbol.
5209 2004-09-03 Marek Safar <marek.safar@seznam.cz>
5211 * enum.cs: Fixed CLS-Compliance checks for enum members.
5212 Error tests cs3008-8.cs, cs3014-8.cs
5214 2004-09-02 Marek Safar <marek.safar@seznam.cz>
5216 Fixed bug #62342, #63102
5217 * class.cs: ImplementIndexer uses member.IsExplicitImpl
5218 like ImplementMethod.
5220 2004-09-02 Marek Safar <marek.safar@seznam.cz>
5222 * attribute.cs (Attribute.GetAttributeArgumentExpression):
5225 2004-09-02 Martin Baulig <martin@ximian.com>
5227 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5228 TypeManager.GetArgumentTypes() rather than calling GetParameters()
5231 2004-09-01 Marek Safar <marek.safar@seznam.cz>
5233 C# 2.0 Static classes implemented
5235 * class.cs (TypeContainer): instance_constructors,
5236 initialized_fields, initialized_static_fields,
5237 default_constructor, base_inteface_types are protected to be
5238 accessible from StaticClass.
5239 (TypeContainer.DefineDefaultConstructor): New virtual method
5240 for custom default constructor generating
5241 (StaticClass): New class to handle "Static classes" feature.
5243 * cs-parser.jay: Handle static keyword on class like instance
5246 * driver.cs: Added "/langversion" command line switch with two
5247 options (iso-1, default).
5249 2004-08-31 Marek Safar <marek.safar@seznam.cz>
5251 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5253 2004-08-31 Miguel de Icaza <miguel@ximian.com>
5255 * delegate.cs: Style.
5257 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
5259 * delegate.cs: Add seperate instance expr field for miguel.
5261 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
5263 * PointerArithmetic (Resolve): make sure we are not doing
5264 pointer arith on void*. Also, make sure we are resolved
5265 by not setting eclass until resolve.
5267 All callers: Make sure that PointerArithmetic gets resolved.
5269 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
5271 * ArrayCreation (LookupType): If the type does not resolve
5272 to an array, give an error.
5274 2004-08-27 Marek Safar <marek.safar@seznam.cz>
5276 * statement.cs (Try.Resolve): Fixed bug #64222
5278 2004-08-27 Martin Baulig <martin@ximian.com>
5281 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5284 2004-08-26 Marek Safar <marek.safar@seznam.cz>
5286 * ecore.cs (Constantify): Get underlying type via
5287 System.Enum.GetUnderlyingType to avoid StackOverflow on the
5288 Windows in special cases.
5290 2004-08-26 Marek Safar <marek.safar@seznam.cz>
5292 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5293 for obtaining also private methods.
5294 (GetRemoveMethod): Used GetRemoveMethod (true)
5295 for obtaining also private methods.
5297 2004-09-02 Martin Baulig <martin@ximian.com>
5299 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5300 TypeManager.GetArgumentTypes() rather than calling GetParameters()
5303 2004-08-27 Martin Baulig <martin@ximian.com>
5306 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5309 2004-08-25 Martin Baulig <martin@ximian.com>
5311 * support.cs (ReflectionParameters..ctor): If this is a generic
5312 method, retrieve and store its type parameters.
5313 (InternalParameters..ctor): Added `TypeParameter[]' argument.
5314 (ReflectionParameters.GenericConstraints): The argument specifies
5315 the type parameter, not the method parameter.
5316 (InternalParameters.GenericConstraints): Likewise.
5318 * generic.cs (TypeParameter.DefineType): Correctly handle
5319 constraints wrt. generic methods in interfaces and their
5322 2004-08-24 Martin Baulig <martin@ximian.com>
5324 * generic.cs (TypeParameter.IsSubclassOf): New public method.
5325 (Constraints.IsSubclassOf): New internal method.
5327 * typemanager.cs (TypeManager.FindMembers): Added special support
5328 for GenericTypeParameterBuilder's.
5329 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
5332 2004-08-24 Martin Baulig <martin@ximian.com>
5335 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5336 this for accessibility checks.
5337 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5338 IsNestedFamilyAccessible.
5339 (TypeManager.IsSubclassOf): New method, do what the name actually
5342 2004-08-24 Martin Baulig <martin@ximian.com>
5344 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
5345 as a SimpleName, include the generic arity.
5347 2004-08-24 Martin Baulig <martin@ximian.com>
5349 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5350 MethodAttributes.HideBySig for operators.
5352 2004-08-23 Martin Baulig <martin@ximian.com>
5354 Back to the old error reporting system :-)
5356 * report.cs (Message): Removed.
5357 (Report.MessageData, ErrorData, WarningData): Removed.
5358 (Report.Error, Warning): Back to the old system.
5360 2004-08-23 Martin Baulig <martin@ximian.com>
5362 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5364 * class.cs (TypeContainer.ParentContainer): New public virtual
5365 method; replaces the explicit interface implementation.
5366 (ClassPart.ParentContainer): Override.
5368 2004-08-23 Martin Baulig <martin@ximian.com>
5370 * statement.cs (Switch): Added support for constant switches; see
5371 #59428 or test-285.cs.
5373 2004-08-22 Marek Safar <marek.safar@seznam.cz>
5376 * statement.cs (GetEnumeratorFilter): Removed useless
5377 logic because C# specs is strict. GetEnumerator must be
5380 2004-08-22 Martin Baulig <martin@ximian.com>
5382 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5383 a switch and may break, reset the barrier. Fixes #59867.
5385 2004-08-22 Marek Safar <marek.safar@seznam.cz>
5387 CLS-Compliance speed up (~5% for corlib)
5389 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5390 New method. Tests container for CLS-Compliant names
5392 * class.cs (TypeContainer.VerifyClsName): New method.
5393 Checks whether container name is CLS Compliant.
5394 (Constructor): Implements IMethodData.
5396 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5397 low-case table for CLS Compliance test.
5398 (MemberCache.VerifyClsParameterConflict): New method.
5399 Checks method parameters for CS3006 error.
5401 * enum.cs (EnumMember): Is derived from MemberCore.
5402 (Enum.VerifyClsName): Optimized for better performance.
5404 2004-08-06 Marek Safar <marek.safar@seznam.cz>
5406 * report.cs: Renamed Error_T to Error and changed all
5409 2004-08-06 Marek Safar <marek.safar@seznam.cz>
5411 * class.cs (TypeContainer.IndexerArrayList): New inner class
5412 container for indexers.
5413 (TypeContainer.DefaultIndexerName): New constant for default
5414 indexer name. Replaced all "Item" with this constant.
5415 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5417 * typemanager.cs (TypeManager.default_member_ctor): Cache here
5418 DefaultMemberAttribute constructor.
5420 2004-08-05 Martin Baulig <martin@ximian.com>
5422 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5425 2004-08-05 Marek Safar <marek.safar@seznam.cz>
5427 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5428 multi platforms problem.
5430 * compiler.csproj: Included shared files.
5432 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5434 Fix bug 60333, 55971 in the more general way
5435 * attribute.cs (Attribute.GetAttributeArgumentExpression):
5436 Added arg_type argument for constant conversion.
5437 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5439 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5442 * class.cs (TypeContainer ): New inner classes MethodArrayList,
5443 OperatorArrayList, MethodCoreArrayList for typecontainer
5444 containers. Changed class member types to these new types.
5445 (MethodArrayList.DefineMembers): Added test for CS0659.
5447 2004-08-04 Miguel de Icaza <miguel@ximian.com>
5449 * cfold.cs: Synchronize the folding with the code in expression.cs
5450 Binary.DoNumericPromotions for uint operands.
5452 * attribute.cs: Revert patch from Raja, it introduced a regression
5453 while building Blam-1.2.1 (hard to isolate a test case).
5455 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5459 (TypeContainer.Define): Renamed to DefineContainerMembers because of
5461 (MethodCore.parent_method): New member. The method we're overriding
5462 if this is an override method.
5463 (MethodCore.CheckBase): Moved from Method class and made common.
5464 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5466 (MethodCore.CheckForDuplications): New abstract method. For custom
5467 member duplication search in a container
5468 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5469 method and its return type.
5470 (Event.conflict_symbol): New member. Symbol with same name in the
5474 (MemberCache.FindMemberWithSameName): New method. The method
5475 is looking for conflict with inherited symbols.
5477 2004-08-04 Martin Baulig <martin@ximian.com>
5479 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5481 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5483 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5485 * report.cs (Message): New enum for better error, warning reference in
5487 (MessageData): New inner abstract class. It generally handles printing of
5488 error and warning messages.
5489 Removed unused Error, Warning, Message methods.
5491 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5493 Fix for cs0592-8.cs test
5495 (Attributable.ValidAttributeTargets): Made public.
5496 (Attribute.ExplicitTarget): New member for explicit target value.
5497 (Attribute.CheckTargets): Now we translate explicit attribute
5498 target to Target here.
5500 2004-08-03 Ben Maurer <bmaurer@ximian.com>
5502 * ecore.cs (MethodGroupExpr): new IsBase property.
5504 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5506 * delegate.cs (DelegateCreation): store a MethodGroupExpr
5507 rather than an instance expr.
5509 (DelegateCreation.Emit): Use the method group rather than
5510 the instance expression. Also, if you have base.Foo as the
5511 method for a delegate, make sure to emit ldftn, not ldftnvirt.
5513 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
5515 (NewDelegate.DoResolve): Only check for the existance of Invoke
5516 if the method is going to be needed. Use MethodGroupExpr.
5518 (NewDelegate.Emit): Remove, DelegateCreation implements this.
5520 * expression.cs: For pointer arith., make sure to use
5521 the size of the type, not the size of the pointer to
5524 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5527 * class.cs (Class): Added error CS0502 test.
5529 2004-08-03 John Luke <jluke@cfl.rr.com>
5530 Raja R Harinath <rharinath@novell.com>
5533 * attribute.cs (Attribute.complained_before): New flag.
5534 (Attribute.ResolveType, Attribute.Resolve),
5535 (Attribute.DefinePInvokeMethod): Set it.
5536 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5538 2004-08-03 Martin Baulig <martin@ximian.com>
5540 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5541 use a user-defined operator; we still need to do numeric
5542 promotions in case one argument is a builtin type and the other
5543 one has an implicit conversion to that type. Fixes #62322.
5545 2004-08-18 Martin Baulig <martin@ximian.com>
5547 * class.cs (Method.Define): Use the correct method name when
5548 creating the MethodBuilder for a generic method.
5550 2004-08-17 Martin Baulig <martin@ximian.com>
5552 * generic.cs (Constraints): Support type parameter constraints.
5554 2004-08-16 Martin Baulig <martin@ximian.com>
5556 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
5557 (Token.GENERIC_DIMENSION): New token; this is returned if we
5558 encounter an unbound generic type in a typeof() expression.
5560 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
5561 this token is only generated while parsing a typeof() expression.
5562 (typeof_expression): Removed the old unbound_type hack.
5564 * generic.cs (TypeArguments.IsUnbound): New public property.
5566 * decl.cs (MemberName): Added support for unbound types.
5568 2004-08-14 Martin Baulig <martin@ximian.com>
5571 (TypeManager.IsEqualGenericInstance): New static method.
5572 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
5573 just used to check accessibility, so follow the rules of 26.1.6.
5575 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
5576 ConstructedType instead of a TypeExpression if we have type arguments.
5578 * cs-parser.jay (typeof_expression): Support unbound generic types.
5580 * ecore.cs (UnboundTypeExpression): New public class.
5582 2004-08-12 Martin Baulig <martin@ximian.com>
5584 * typemanager.cs (TypeManager.IsNestedChildOf): Use
5585 TypeManager.IsEqual() rather than `=='.
5587 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
5588 generic instances as well.
5590 2004-08-12 Martin Baulig <martin@ximian.com>
5592 * expression.cs (Invocation.InferType): We can only infer method
5593 type parameters. Fixes #62647.
5595 2004-08-11 Martin Baulig <martin@ximian.com>
5597 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
5598 before resolving the base classes.
5600 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
5602 * Makefile: install .mdb file too.
5604 2004-08-05 Martin Baulig <martin@ximian.com>
5606 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
5607 initializer, the current type is just the TypeBuilder, not the
5608 instantiated generic type.
5609 (FieldExpr.IsFieldInitializer): New public property.
5611 2004-08-04 Martin Baulig <martin@ximian.com>
5613 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5615 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5617 2004-08-03 Martin Baulig <martin@ximian.com>
5619 * class.cs (MethodData.Define): If we're an explicit
5620 implementation, remove the generic arity from the type name.
5622 2004-08-03 Martin Baulig <martin@ximian.com>
5624 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5625 use a user-defined operator; we still need to do numeric
5626 promotions in case one argument is a builtin type and the other
5627 one has an implicit conversion to that type. Fixes #62322.
5629 2004-08-02 Martin Baulig <martin@ximian.com>
5631 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
5633 (TypeContainer.GetClassBases): Return the unexpanded list of
5634 interfaces; we expand them later.
5635 (TypeContainer.DefineType): After creating the TypeBuilder, call
5636 TypeManager.ExpandInterfaces() to get an expanded and resolved
5639 * ecore.cs (TypeExpr.GetInterfaces): Removed
5641 * generics.cs (Constraints.InterfaceConstraints): Remove.
5642 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
5643 register the interface constraints.
5646 (TypeManager.AddUserType): Removed the `ifaces' argument.
5647 (TypeManager.AddTypeParameter): Likewise.
5648 (TypeManager.AddUserInterface): Removed, was unused.
5649 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
5650 `TypeExpr[]' array for the interfaces.
5651 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
5652 has been defined, returns a list of the resolved interfaces types.
5653 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
5654 (TypeManager.GetExplicitInterfaces): Likewise.
5656 2004-08-02 Martin Baulig <martin@ximian.com>
5658 * expression.cs (Invocation.EmitCall): If we're invoking a method
5659 on a type parameter, use the new `Constrained' prefix opcode.
5661 2004-08-02 Martin Baulig <martin@ximian.com>
5663 * statement.cs (LocalInfo.Flags): Added `IsThis'.
5664 (LocalInfo.IsThis): New public property.
5665 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5667 2004-08-01 Martin Baulig <martin@ximian.com>
5669 * class.cs (TypeContainer.GetClassBases): Don't set the default
5670 here since we may get called from GetPartialBases().
5671 (TypeContainer.DefineType): If GetClassBases() didn't return a
5672 parent, use the default one.
5674 2004-07-30 Martin Baulig <martin@ximian.com>
5676 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5678 * class.cs (SourceMethod): New public class, derive from the
5679 symbol writer's ISourceMethod.
5680 (Method): Use the new symbol writer API.
5682 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5683 as argument and use the new symbol writer.
5686 (SourceFile): Implement the symbol writer's ISourceFile.
5687 (Location.SymbolDocument): Removed.
5688 (Location.SourceFile): New public property.
5690 * symbolwriter.cs: Use the new symbol writer API.
5692 2004-07-30 Raja R Harinath <rharinath@novell.com>
5694 * Makefile (install-local): Remove. Functionality moved to
5697 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
5699 * Makefile: Install mcs.exe.config file together with mcs.exe.
5700 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5701 correct runtime version.
5703 2004-07-25 Martin Baulig <martin@ximian.com>
5706 (TypeContainer.RegisterOrder): Removed, this was unused.
5707 (TypeContainer, interface_order): Removed.
5708 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5709 TypeContainer as argument since we can also be called with a
5710 `PartialContainer' for a partial class/struct/interface.
5711 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5712 of checking whether we're an `Interface' - we could be a
5714 (PartialContainer.Register): Override; call
5715 AddClass()/AddStruct()/AddInterface() on our parent.
5717 * cs-parser.jay (interface_member_declaration): Add things to the
5718 `current_container', not the `current_class'.
5720 * rootcontext.cs (RegisterOrder): The overloaded version which
5721 takes an `Interface' was unused, removed.
5723 * typemanager.cs (TypeManager.LookupInterface): Return a
5724 `TypeContainer', not an `Interface'.
5725 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5726 contain a `PartialContainer' for an interface, so check it's
5727 `Kind' to figure out what it is.
5729 2004-07-25 Martin Baulig <martin@ximian.com>
5731 * class.cs (Class.DefaultTypeAttributes): New public constant.
5732 (Struct.DefaultTypeAttributes): Likewise.
5733 (Interface.DefaultTypeAttributes): Likewise.
5734 (PartialContainer.TypeAttr): Override this and add the
5735 DefaultTypeAttributes.
5737 2004-07-25 Martin Baulig <martin@ximian.com>
5739 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5740 we can just use the `Parent' field instead.
5742 2004-07-25 Martin Baulig <martin@ximian.com>
5744 * class.cs (TypeContainer.Emit): Renamed to EmitType().
5746 2004-07-25 Martin Baulig <martin@ximian.com>
5748 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5749 our parts before defining any methods.
5750 (TypeContainer.VerifyImplements): Make this virtual.
5751 (ClassPart.VerifyImplements): Override and call VerifyImplements()
5752 on our PartialContainer.
5754 2004-07-25 Martin Baulig <martin@ximian.com>
5756 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5758 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5759 argument, we can just use the `Parent' field instead.
5762 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
5763 (MemberBase.DoDefine): Likewise.
5765 2004-07-24 Martin Baulig <martin@ximian.com>
5767 * decl.cs (MemberCore.Parent): New public field.
5768 (DeclSpace.Parent): Moved to MemberCore.
5770 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5771 (MemberBase.ctor): Added TypeContainer argument, pass it to our
5773 (FieldBase, Field, Operator): Likewise.
5774 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5775 (EventField, Event): Likewise.
5777 2004-07-23 Martin Baulig <martin@ximian.com>
5779 * class.cs (PartialContainer): New public class.
5780 (ClassPart): New public class.
5781 (TypeContainer): Added support for partial classes.
5782 (TypeContainer.GetClassBases): Splitted some of the functionality
5783 out into GetNormalBases() and GetPartialBases().
5785 * cs-tokenizer.cs (Token.PARTIAL): New token.
5786 (Tokenizer.consume_identifier): Added some hacks to recognize
5787 `partial', but only if it's immediately followed by `class',
5788 `struct' or `interface'.
5790 * cs-parser.jay: Added support for partial clases.
5792 2004-07-23 Martin Baulig <martin@ximian.com>
5794 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5795 a `DeclSpace' and also made it readonly.
5796 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5797 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5798 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5800 * cs-parser.jay: Pass the `current_class', not the
5801 `current_container' (at the moment, this is still the same thing)
5802 to a new Method, Property, Event, Indexer or Constructor.
5804 2004-07-23 Martin Baulig <martin@ximian.com>
5806 * cs-parser.jay (CSharpParser): Added a new `current_class' field
5807 and removed the `current_interface' one.
5808 (struct_declaration, class_declaration, interface_declaration):
5809 Set `current_class' to the newly created class/struct/interface;
5810 set their `Bases' and call Register() before parsing their body.
5812 2004-07-23 Martin Baulig <martin@ximian.com>
5814 * class.cs (Kind): New public enum.
5815 (TypeContainer): Made this class abstract.
5816 (TypeContainer.Kind): New public readonly field.
5817 (TypeContainer.CheckDef): New public method; moved here from
5819 (TypeContainer.Register): New public abstract method.
5820 (TypeContainer.GetPendingImplementations): New public abstract
5822 (TypeContainer.GetClassBases): Removed the `is_class' and
5823 `is_iface' parameters.
5824 (TypeContainer.DefineNestedTypes): Formerly known as
5826 (ClassOrStruct): Made this class abstract.
5828 * tree.cs (RootTypes): New public type.
5830 2004-07-20 Martin Baulig <martin@ximian.com>
5832 * tree.cs (Tree.RecordNamespace): Removed.
5833 (Tree.Namespaces): Removed.
5835 * rootcontext.cs (RootContext.IsNamespace): Removed.
5837 * cs-parser.jay (namespace_declaration): Just create a new
5838 NamespaceEntry here.
5840 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
5842 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
5843 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
5844 entry to make sure it runs in the correct runtime version.
5846 2004-07-18 Martin Baulig <martin@ximian.com>
5848 * generic.cs (ConstructedType.CheckConstraints): Improved
5849 constraints checking.
5851 2004-07-18 Martin Baulig <martin@ximian.com>
5853 * expression.cs (Invocation.BetterMethod): Call
5854 TypeManager.TypeToCoreType() on all types and removed my previous
5855 hack; we're already doig the right thing here.
5857 2004-07-17 Martin Baulig <martin@ximian.com>
5859 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
5861 2004-07-16 Martin Baulig <martin@ximian.com>
5863 * iterators.cs: Added generics support.
5865 2004-07-16 Martin Baulig <martin@ximian.com>
5867 * iterators.cs: Rewrote this. We're now using one single Proxy
5868 class for both the IEnumerable and the IEnumerator interface and
5869 `Iterator' derives from Class so we can use the high-level API.
5871 * class.cs (TypeContainer.AddIterator): New method.
5872 (TypeContainer.DoDefineType): New protected virtual method, which
5873 is called from DefineType().
5874 (TypeContainer.DoDefineMembers): Call DefineType() and
5875 DefineMembers() on all our iterators.
5876 (TypeContainer.Emit): Call Emit() on all our iterators.
5877 (TypeContainer.CloseType): Call CloseType() on all our iterators.
5879 * codegen.cs (EmitContext.CurrentIterator): New public field.
5881 2004-07-15 Martin Baulig <martin@ximian.com>
5884 (TypeManager.not_supported_exception_type): New type.
5886 2004-07-14 Martin Baulig <martin@ximian.com>
5889 (TypeManager.generic_ienumerable_type): New type.
5890 (TypeManager.generic_ienumerator_type): New type.
5893 (RootContext.interfaces_first_stage): Added
5894 "System.Collections.Generic.IEnumerator`1" and
5895 "System.Collections.Generic.IEnumerable`1".
5897 2004-07-14 Martin Baulig <martin@ximian.com>
5899 * iterators.cs: Use real error numbers.
5901 2004-07-14 Martin Baulig <martin@ximian.com>
5903 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5904 requires this to be a System.Collection.IEnumerable and not a
5905 class implementing that interface.
5906 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
5908 2004-07-13 Marek Safar <marek.safar@seznam.cz>
5910 * class.cs: Fixed previous fix, it broke some error tests.
5912 2004-07-12 Martin Baulig <martin@ximian.com>
5914 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5917 2004-07-14 Martin Baulig <martin@ximian.com>
5919 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
5920 an exclamation mark (!) for the generic arity to reflect the
5921 latest spec changes; ie. use "System.Collections.Generic.IList`1".
5923 2004-07-13 Martin Baulig <martin@ximian.com>
5925 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
5926 specifiers being part of a type argument.
5928 2004-07-13 Martin Baulig <martin@ximian.com>
5930 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
5931 name for generic types.
5933 2004-07-13 Martin Baulig <martin@ximian.com>
5935 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
5938 2004-07-09 Miguel de Icaza <miguel@ximian.com>
5940 * assign.cs (LocalTemporary): Add new argument: is_address,If
5941 `is_address' is true, then the value that we store is the address
5942 to the real value, and not the value itself.
5944 * ecore.cs (PropertyExpr): use the new local temporary
5945 stuff to allow us to handle X.Y += z (where X is a struct)
5947 2004-07-08 Martin Baulig <martin@ximian.com>
5949 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5950 not always return, just like we're doing in Using.Resolve().
5952 2004-07-07 Miguel de Icaza <miguel@ximian.com>
5954 * cs-parser.jay (fixed_statement): flag this as Pinned.
5956 2004-07-06 Miguel de Icaza <miguel@ximian.com>
5958 * typemanager.cs (TypeManager): Removed MakePinned method, this
5959 mechanism is replaced with the .NET 2.x compatible mechanism of
5960 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5962 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
5963 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5964 `IsFixed' property which has a different meaning.
5966 2004-07-02 Raja R Harinath <rharinath@novell.com>
5968 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5969 visible from inside a nested class, not just the names of the
5970 immediately enclosing class.
5973 2004-06-24 Raja R Harinath <rharinath@novell.com>
5975 * expression.cs (BetterConversion): Remove buggy special-case
5976 handling of "implicit constant expression conversions". At this
5977 point, we already know that the conversion is possible -- we're
5978 only checking to see which is better.
5980 2004-06-24 Marek Safar <marek.safar@seznam.cz>
5982 * cs-parser.jay: Added error CS0210 test.
5984 2004-06-24 Marek Safar <marek.safar@seznam.cz>
5986 * cs-parser.jay: Added error CS0134 test.
5988 2004-06-24 Marek Safar <marek.safar@seznam.cz>
5991 * cs-parser.jay: Added error CS0145 test.
5993 2004-06-24 Marek Safar <marek.safar@seznam.cz>
5995 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5997 2004-06-23 Ben Maurer <bmaurer@ximian.com>
5999 * expression.cs (StackAlloc.Resolve): The argument may not
6000 be a constant; deal with this case.
6002 2004-06-23 Marek Safar <marek.safar@seznam.cz>
6004 * attribute.cs (IndexerName_GetIndexerName): Renamed to
6005 GetIndexerAttributeValue.
6006 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6008 * class.cs (Indexer.Define): Added error tests for CS0415,
6011 2004-06-23 Miguel de Icaza <miguel@ximian.com>
6013 * attribute.cs (Attribute.Resolve): Keep field code in sync with
6016 2004-06-23 Martin Baulig <martin@ximian.com>
6018 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6019 neither return nor throw, reset the barrier as well. Fixes #60457.
6021 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
6023 * class.cs : EventAttributes is now set to None by default.
6024 This fixes bug #60459.
6026 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6029 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6030 Don't throw exception but return null (it's sufficient now).
6032 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6034 * typemanager.cs (GetArgumentTypes): Faster implementation.
6036 2004-06-18 Martin Baulig <martin@ximian.com>
6038 * attribute.cs (Attribute.Resolve): Check whether we're an
6039 EmptyCast which a Constant child. Fixes #60333.
6041 2004-06-17 Ben Maurer <bmaurer@ximian.com>
6043 * statement.cs (EmitCollectionForeach): Account for the fact that
6044 not all valuetypes are in areas which we can take the address of.
6045 For these variables, we store to a temporary variable. Also, make
6046 sure that we dont emit a `callvirt' on a valuetype method.
6048 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6050 * expression.cs (StackAlloc.DoReSolve): Added test for
6051 negative parameter (CS0247).
6053 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6056 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6058 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6061 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6064 2004-06-14 Marek Safar <marek.safar@seznam.cz>
6066 Fix bug #58254 & cs1555.cs, cs1556.cs
6067 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6069 2004-06-14 Marek Safar <marek.safar@seznam.cz>
6071 * cs-parser.jay: Added error CS1669 test for indexers.
6073 2004-06-18 Martin Baulig <martin@ximian.com>
6075 * generics.cs (GenericMethod.ctor): Don't take an Attributes
6076 argument. Fixes #60441.
6078 2004-06-16 Ben Maurer <bmaurer@ximian.com>
6079 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
6080 The name needs to have the actual name of the method in order
6081 for other tests (such as the one in OverloadResolve for Invoke
6082 on a delegate) to work. As well, it does not really help
6083 error reporting because the method group had multiple methods.
6084 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
6085 Make profiling work.
6087 2004-06-13 Martin Baulig <martin@ximian.com>
6089 * cs-parser.jay: Don't allow generic attributes.
6091 2004-06-13 Martin Baulig <martin@ximian.com>
6093 * class.cs (MemberBase.DoDefineBase): New protected method.
6094 (MemberBase.DoDefine): Compute the `flags' in the new
6095 DoDefineBase() which must be called first.
6096 (Method.Define): Call DoDefineBase() first so we have the flags
6097 when defining the generic method.
6099 * cs-parser.jay (interface_method_declaration): Support generic methods.
6101 2004-06-13 Martin Baulig <martin@ximian.com>
6103 * decl.cs (TypeName): Removed.
6104 (MemberName): Removed TypeName and MemberNow; now we just have
6107 * cs-parser.jay: Don't distinguish between type arguments and type
6108 parameters in the grammar and simplified the rules a bit. The
6109 reduce/reduce conflicts are now gone (except the one we inherited
6112 2004-06-11 Martin Baulig <martin@ximian.com>
6114 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6115 call this twice: for params and varargs methods.
6117 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6120 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6122 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6124 * attribute.cs (Attribute.GetValidTargets): Made public.
6127 (AbstractPropertyEventMethod): New class for better code sharing.
6128 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6130 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6132 2004-06-09 Martin Baulig <martin@ximian.com>
6134 * cs-parser.jay: Removed a reduce/reduce conflict.
6136 2004-06-03 Martin Baulig <martin@ximian.com>
6138 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
6139 GetSimpleName() and return a SimpleName.
6141 * ecore.cs (SimpleName.Arguments): New public field.
6142 (SimpleName): Added overloaded ctor which takes an additional
6143 TypeArguments argument.
6144 (SimpleName.SimpleNameResolve): Added support for generic methods.
6145 (MethodGroupExpr.ResolveGeneric): New public method. The code was
6146 formerly in MemberAccess.DoResolve(), but we also need it in
6147 SimpleNameResolve().
6149 * expression.cs (MemberAccess.DoResolve): Use the new
6150 MethodGroupExpr.ResolveGeneric().
6152 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6154 * decl.cs: If possible, use lookuptypedirect here. We can only do
6155 this if there is no `.' after the namespace. Avoids using
6156 LookupType, which does lots of slow processing.
6157 (FindNestedType) New method, does what it says :-).
6158 * namespace.cs: use LookupTypeDirect.
6159 * rootcontext.cs: use membercache, if possible.
6160 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6162 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6165 According to the spec,
6167 In a member access of the form E.I, if E is a single identifier,
6168 and if the meaning of E as a simple-name (§7.5.2) is a constant,
6169 field, property, localvariable, or parameter with the same type as
6170 the meaning of E as a type-name (§3.8), then both possible
6171 meanings of E are permitted.
6173 We did not check that E as a simple-name had the same type as E as
6176 This trivial check gives us 5-7% on bootstrap time.
6178 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6180 * expression.cs (Invocation.OverloadResolve): Avoid the
6181 use of hashtables and boxing here by allocating on demand.
6183 2004-05-30 Martin Baulig <martin@ximian.com>
6185 * rootcontext.cs (RootContext.LookupType): Don't cache things if
6186 we're doing a silent lookup. Don't try to lookup nested types in
6187 TypeManager.object_type (thanks to Ben Maurer).
6189 2004-05-30 Martin Baulig <martin@ximian.com>
6191 Committing a patch from Ben Maurer.
6193 * rootcontext.cs (RootContext.LookupType): Cache negative results.
6195 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6197 * convert.cs: add a trivial cache for overload operator resolution.
6199 2004-05-31 Marek Safar <marek.safar@seznam.cz>
6202 (AttributeTester.GetObsoleteAttribute): Returns instance of
6203 ObsoleteAttribute when type is obsolete.
6206 (TypeContainer.VerifyObsoleteAttribute): Override.
6207 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6208 (MethodCode.VerifyObsoleteAttribute): Override.
6209 (MemberBase.VerifyObsoleteAttribute): Override.
6212 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6213 and report proper error.
6216 (Delegate.VerifyObsoleteAttribute): Override.
6219 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6220 and report proper error.
6221 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6224 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6228 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6229 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6230 Added test for ObsoleteAttribute.
6233 (Catch): Derived from Statement.
6235 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6237 * decl.cs: If possible, use lookuptypedirect here. We can only do
6238 this if there is no `.' after the namespace. Avoids using
6239 LookupType, which does lots of slow processing.
6240 (FindNestedType) New method, does what it says :-).
6241 * namespace.cs: use LookupTypeDirect.
6242 * rootcontext.cs: use membercache, if possible.
6243 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6245 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6248 According to the spec,
6250 In a member access of the form E.I, if E is a single identifier,
6251 and if the meaning of E as a simple-name (§7.5.2) is a constant,
6252 field, property, localvariable, or parameter with the same type as
6253 the meaning of E as a type-name (§3.8), then both possible
6254 meanings of E are permitted.
6256 We did not check that E as a simple-name had the same type as E as
6259 This trivial check gives us 5-7% on bootstrap time.
6261 2004-05-30 Marek Safar <marek.safar@seznam.cz>
6263 Fixed bug #59071 & cs0160.cs
6264 * statement.cs (Try.Resolve): Check here whether order of catch
6265 clauses matches their dependencies.
6267 2004-05-30 Marek Safar <marek.safar@seznam.cz>
6270 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
6273 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6275 * expression.cs (Invocation.OverloadResolve): Avoid the
6276 use of hashtables and boxing here by allocating on demand.
6278 2004-05-30 Martin Baulig <martin@ximian.com>
6280 * rootcontext.cs (RootContext.LookupType): Don't cache things if
6281 we're doing a silent lookup. Don't try to lookup nested types in
6282 TypeManager.object_type (thanks to Ben Maurer).
6284 2004-05-30 Martin Baulig <martin@ximian.com>
6286 Committing a patch from Ben Maurer.
6288 * rootcontext.cs (RootContext.LookupType): Cache negative results.
6290 2004-05-29 Martin Baulig <martin@ximian.com>
6292 * class.cs (IMethodData.ShouldIgnore): New method.
6294 * typemanager.cs (TypeManager.MethodFlags): Don't take a
6295 `Location' argument, we don't need it anywhere. Use
6296 `IMethodData.ShouldIgnore ()' instead of
6297 `MethodData.GetMethodFlags ()'.
6298 (TypeManager.AddMethod): Removed.
6299 (TypeManager.AddMethod2): Renamed to AddMethod.
6301 2004-05-29 Martin Baulig <martin@ximian.com>
6303 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6305 * convert.cs (Convert.ImplicitReferenceConversion): If we're
6306 converting from a class type S to an interface type and we already
6307 have an object on the stack, don't box it again. Fixes #52578.
6309 2004-05-29 Martin Baulig <martin@ximian.com>
6311 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6312 Added support for `params' parameters. Fixes #59267.
6314 2004-05-29 Martin Baulig <martin@ximian.com>
6316 * literal.cs (NullPointer): Provide a private .ctor which sets
6317 `type' to TypeManager.object_type. Fixes #59048.
6319 2004-05-29 Martin Baulig <martin@ximian.com>
6321 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6322 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
6324 * ecore.cs (EventExpr.instance_expr): Make the field private.
6326 2004-05-26 Marek Safar <marek.safar@seznam.cz>
6328 Fixed bug #50080 & cs0214-2.cs
6329 * expression.cs (Cast.DoResolve): Check unsafe context here.
6331 * statement.cs (Resolve.DoResolve): Likewise.
6333 2004-05-26 Martin Baulig <martin@ximian.com>
6335 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6337 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6338 (RootContext.LookupType): Pass down the `silent' flag.
6340 2004-05-25 Martin Baulig <martin@ximian.com>
6343 (MethodGroupExpr.IdenticalTypeName): New public property.
6344 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6345 expression actually refers to a type.
6347 2004-05-25 Martin Baulig <martin@ximian.com>
6349 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6350 for #56176 and made it actually work.
6352 2004-05-25 Martin Baulig <martin@ximian.com>
6354 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6355 (FieldExpr, PropertyExpr): Override and implement
6356 CacheTemporaries. Fixes #52279.
6358 2004-05-25 Miguel de Icaza <miguel@ximian.com>
6360 * location.cs: In the new compiler listing a file twice is a
6361 warning, not an error.
6363 2004-05-24 Martin Baulig <martin@ximian.com>
6365 * enum.cs (Enum.DefineType): For the `BaseType' to be a
6366 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
6368 2004-05-24 Martin Baulig <martin@ximian.com>
6370 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6371 walking the `using' list. Fixes #53921.
6373 2004-05-24 Martin Baulig <martin@ximian.com>
6375 * const.cs (Const.LookupConstantValue): Added support for
6376 EmptyCast's; fixes #55251.
6378 2004-05-24 Martin Baulig <martin@ximian.com>
6380 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6381 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6382 which does the CS0135 check. The reason is that we first need to
6383 check whether the variable actually exists.
6385 2004-05-24 Martin Baulig <martin@ximian.com>
6387 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6388 than RootContext.LookupType() to find the explicit interface
6391 2004-05-24 Raja R Harinath <rharinath@novell.com>
6393 * Makefile: Simplify. Use executable.make.
6394 * mcs.exe.sources: New file. List of sources of mcs.exe.
6396 2004-05-24 Anders Carlsson <andersca@gnome.org>
6400 Use the invariant culture when doing String.Compare for CLS case
6403 2004-05-23 Martin Baulig <martin@ximian.com>
6405 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6406 don't have any dots. Fixes #52622, added cs0246-8.cs.
6408 * namespace.cs (NamespaceEntry.Lookup): Likewise.
6410 2004-05-23 Marek Safar <marek.safar@seznam.cz>
6412 * class.cs (MemberBase.Define): Reuse MemberType member for
6413 resolved type. Other methods can use it too.
6415 2004-05-23 Martin Baulig <martin@ximian.com>
6417 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6418 the variable also exists in the current block (otherwise, we need
6419 to report a CS0103). Fixes #58670.
6421 2004-05-23 Martin Baulig <martin@ximian.com>
6423 * flowanalysis.cs (Reachability.Reachable): Compute this
6424 on-the-fly rather than storing it as a field.
6426 2004-05-23 Martin Baulig <martin@ximian.com>
6428 * flowanalysis.cs (Reachability.And): Manually compute the
6429 resulting `barrier' from the reachability.
6431 2004-05-23 Marek Safar <marek.safar@seznam.cz>
6434 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6435 instance of ObsoleteAttribute when symbol is obsolete.
6438 (IMethodData): Extended interface for ObsoleteAttribute support.
6440 2004-05-22 Marek Safar <marek.safar@seznam.cz>
6442 * attribute.cs: Fix bug #55970
6444 2004-05-22 Marek Safar <marek.safar@seznam.cz>
6448 (GetObsoleteAttribute): New method. Creates the instance of
6450 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6451 ObsoleteAttribute when member is obsolete.
6452 (AttributeTester.Report_ObsoleteMessage): Common method for
6453 Obsolete error/warning reporting.
6456 (TypeContainer.base_classs_type): New member for storing parent type.
6459 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6460 for this MemberCore.
6462 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6464 * attribute.cs, const.cs: Fix bug #58590
6466 2004-05-21 Martin Baulig <martin@ximian.com>
6468 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6469 out parameters if the end of the method is unreachable. Fixes
6472 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6474 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6475 Hari was right, why extra method.
6477 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6479 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6481 2004-05-20 Martin Baulig <martin@ximian.com>
6483 * delegate.cs: Convert this file to Unix mode - like the original
6486 2004-05-20 Martin Baulig <martin@ximian.com>
6488 * attribute.cs: Convert this file to Unix mode - like the original
6491 2004-05-19 Marek Safar <marek.safar@seznam.cz>
6493 Fix bug #58688 (MCS does not report error when the same attribute
6496 * attribute.cs (Attribute.Emit): Distinction between null and default.
6498 2004-05-19 Raja R Harinath <rharinath@novell.com>
6500 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6501 of a top-level attribute without an attribute target.
6502 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
6504 (Attribute.Conditional_GetConditionName),
6505 (Attribute.Obsolete_GetObsoleteMessage): Update.
6506 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
6507 part of ScanForIndexerName.
6508 (Attribute.CanIgnoreInvalidAttribute): New function.
6509 (Attribute.ScanForIndexerName): Move to ...
6510 (Attributes.ScanForIndexerName): ... here.
6511 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6512 (Attributes.Search): New internal variant that can choose not to
6513 complain if types aren't resolved. The original signature now
6515 (Attributes.GetClsCompliantAttribute): Use internal variant, with
6516 complaints suppressed.
6517 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6518 only if it not useful.
6519 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6520 top-level for attributes that are shared between the assembly
6521 and a top-level class.
6522 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6523 * class.cs: Update to reflect changes.
6524 (DefineIndexers): Fuse loops.
6525 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
6526 a couple more variants of attribute names.
6528 2004-05-18 Marek Safar <marek.safar@seznam.cz>
6530 Fix bug #52585 (Implemented explicit attribute declaration)
6533 (Attributable.ValidAttributeTargets): New abstract method. It gets
6534 list of valid attribute targets for explicit target declaration.
6535 (Attribute.Target): It holds target itself.
6536 (AttributeSection): Removed.
6537 (Attribute.CheckTargets): New method. It checks whether attribute
6538 target is valid for the current element.
6541 (EventProperty): New class. For events that are declared like
6542 property (with add and remove accessors).
6543 (EventField): New class. For events that are declared like field.
6546 * cs-parser.jay: Implemented explicit attribute target declaration.
6548 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
6549 Override ValidAttributeTargets.
6552 (ReturnParameter): Class for applying custom attributes on
6554 (ParameterAtribute): New class. Class for applying custom
6555 attributes on the parameter type.
6557 2004-05-17 Miguel de Icaza <miguel@ximian.com>
6559 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6562 (Method): Allow UNSAFE here.
6564 * modifiers.cs: Support unsafe reporting.
6566 2004-05-17 Marek Safar <marek.safar@seznam.cz>
6568 * decl.cs: Fix bug #58478.
6570 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6572 * statement.cs: When checking for unreachable code on an EmptyStatement,
6573 set the location. Fixes bug #58488.
6575 2004-05-13 Miguel de Icaza <miguel@ximian.com>
6577 * driver.cs: Add -pkg handling.
6579 From Gonzalo: UseShelLExecute=false
6581 2004-05-12 Marek Safar <marek.safar@seznam.cz>
6584 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6586 (Attribute.IsClsCompliaceRequired): Moved to base for better
6588 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6589 when attribute is AttributeUsageAttribute.
6590 (Attribute.GetValidTargets): Simplified.
6591 (Attribute.GetAttributeUsage): New method returns AttributeUsage
6592 attribute for this type.
6593 (Attribute.ApplyAttributes): Method renamed to Emit and make
6595 (GlobalAttributeSection): New class for special handling of global
6596 attributes (assembly, module).
6597 (AttributeSection.Emit): New method.
6599 * class.cs: Implemented Attributable abstract methods.
6600 (MethodCore.LabelParameters): Moved to Parameter class.
6601 (Accessor): Is back simple class.
6602 (PropertyMethod): Implemented Attributable abstract class.
6603 (DelegateMethod): Implemented Attributable abstract class.
6604 (Event): New constructor for disctintion between normal Event
6605 and Event with accessors.
6607 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6609 * codegen.cs, const.cs, decl.cs, delegate.cs:
6610 (CommonAssemblyModulClass): Implemented Attributable abstract class
6613 * enum.cs: Implement IAttributeSupport interface.
6614 (EnumMember): New class for emum members. Implemented Attributable
6618 (ParameterBase): Is abstract.
6619 (ReturnParameter): New class for easier [return:] attribute handling.
6621 * typemanager.cs: Removed builder_to_attr.
6623 2004-05-11 Raja R Harinath <rharinath@novell.com>
6626 * attribute.cs (Attribute.GetPositionalValue): New function.
6627 * class.cs (TypeContainer.VerifyMembers): New function.
6628 (TypeContainer.Emit): Use it.
6629 (ClassOrStruct): New base class for Class and Struct.
6630 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
6631 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6633 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6634 then each non-static field should have a FieldOffset attribute.
6635 Otherwise, none of the fields should have a FieldOffset attribute.
6636 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
6637 and FieldOffset attributes.
6638 * typemanager.cs (TypeManager.struct_layout_attribute_type)
6639 (TypeManager.field_offset_attribute_type): New core types.
6640 (TypeManager.InitCoreTypes): Initialize them.
6642 2004-05-11 Michal Moskal <malekith@pld-linux.org>
6644 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6645 Return correct type.
6648 2004-05-09 Miguel de Icaza <miguel@ximian.com>
6650 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6651 be implicitly converted to ulong.
6653 * expression.cs: The logic for allowing operator &, | and ^ worked
6654 was wrong, it worked before because we did not report an error in
6655 an else branch. Fixes 57895.
6657 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6658 allow volatile fields to be reference types.
6660 2004-05-07 Miguel de Icaza <miguel@ximian.com>
6662 * driver.cs: Add support for /debug-
6664 2004-05-07 Raja R Harinath <rharinath@novell.com>
6666 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
6667 Add a 'complain' parameter to silence errors.
6668 (Attribute.Resolve): Update to changes. Put in sanity check to catch
6669 silently overlooked type-resolutions.
6670 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6672 (Attributes.Search): New function.
6673 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6674 (Attributes.GetAttributeFullName): Remove hack.
6675 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
6676 Update to reflect changes.
6677 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6678 Use Attributes.Search instead of nested loops.
6680 2004-05-07 Marek Safar <marek.safar@seznam.cz>
6683 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6684 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6685 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6687 * report.cs: (Report.Warning): Renamed to Warning_T because of
6688 parameter collision.
6690 2004-05-05 Raja R Harinath <rharinath@novell.com>
6692 * expression.cs (MemberAccess.ResolveMemberAccess):
6693 Exit with non-zero status after Report.Error.
6694 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6696 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6698 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
6700 * support.cs: Don't hang when the file is empty.
6702 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
6704 * support.cs: In SeekableStreamReader, compute the preamble size of the
6705 underlying stream. Position changes should take into account that initial
6708 2004-05-03 Todd Berman <tberman@sevenl.net>
6710 * driver.cs: remove unused GetSysVersion function.
6712 2004-05-03 Todd Berman <tberman@sevenl.net>
6714 * driver.cs: Remove the hack from saturday, as well as the hack
6715 from jackson (LoadAssemblyFromGac), also adds the CWD to the
6716 link_paths to get that bit proper.
6718 2004-05-01 Todd Berman <tberman@sevenl.net>
6720 * driver.cs: Try a LoadFrom before a Load, this checks the current
6721 path. This is currently a bug in mono that is be fixed, however, this
6722 provides a workaround for now. This will be removed when the bug
6725 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
6727 * CryptoConvert.cs: Updated to latest version. Fix issue with
6728 incomplete key pairs (#57941).
6730 2004-05-01 Todd Berman <tberman@sevenl.net>
6732 * driver.cs: Remove '.' from path_chars, now System.* loads properly
6735 2004-04-30 Jackson Harper <jackson@ximian.com>
6737 * codegen.cs: Open keys readonly.
6739 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6741 * typemanager.cs: don't report cyclic struct layout when a struct
6742 contains 2 or more fields of the same type. Failed for Pango.AttrShape
6743 which has 2 Pango.Rectangle fields.
6745 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
6747 * expression.cs: Handle IntPtr comparisons with IL code
6748 rather than a method call.
6750 2004-04-29 Martin Baulig <martin@ximian.com>
6752 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
6753 the list of PropertyInfo's in class hierarchy and find the
6754 accessor. Fixes #56013.
6756 2004-04-29 Martin Baulig <martin@ximian.com>
6758 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6760 2004-04-29 Martin Baulig <martin@ximian.com>
6762 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6764 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6766 2004-04-29 Martin Baulig <martin@ximian.com>
6768 * class.cs (ConstructorInitializer.Resolve): Check whether the
6769 parent .ctor is accessible. Fixes #52146.
6771 2004-04-29 Martin Baulig <martin@ximian.com>
6773 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6775 * statement.cs (Using.EmitLocalVariableDecls): Use
6776 TypeManager.idisposable_type, not typeof (IDisposable).
6777 (Foreach.EmitCollectionForeach): Added support for valuetypes.
6779 2004-04-29 Martin Baulig <martin@ximian.com>
6781 * class.cs (Event.Define): Don't emit the field and don't set
6782 RTSpecialName and SpecialName for events on interfaces. Fixes
6785 2004-04-29 Raja R Harinath <rharinath@novell.com>
6787 Refactor Attribute.ApplyAttributes.
6788 * attribute.cs (Attributable): New base class for objects that can
6789 have Attributes applied on them.
6790 (Attribute): Make AttributeUsage fields public.
6791 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6792 (Attribute.IsInternalCall): New property.
6793 (Attribute.UsageAttr): Convert to a public read-only property.
6794 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6795 (Attribute.ResolveType, Attribute.Resolve)
6796 (Attribute.ScanForIndexerName): Update to reflect changes.
6797 (Attribute.CheckAttributeTarget): Re-format.
6798 (Attribute.ApplyAttributes): Refactor, to various
6799 Attributable.ApplyAttributeBuilder methods.
6800 * decl.cs (MemberCore): Make Attributable.
6801 * class.cs (Accessor): Make Attributable.
6802 (MethodData.ApplyAttributes): Use proper attribute types, not
6804 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6805 (TypeContainer.ApplyAttributeBuilder)
6806 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6807 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
6808 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6809 (Operator.ApplyAttributeBuilder): New factored-out methods.
6810 * const.cs (Const.ApplyAttributeBuilder): Likewise.
6811 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6812 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6813 * parameter.cs (ParameterBase): New Attributable base class
6814 that can also represent Return types.
6815 (Parameter): Update to the changes.
6817 2004-04-29 Jackson Harper <jackson@ximian.com>
6819 * driver.cs: Prefer the corlib system version when looking for
6820 assemblies in the GAC. This is still a hack, but its a better hack
6823 2004-04-29 Marek Safar <marek.safar@seznam.cz>
6825 * decl.cs, enum.cs: Improved error 3005 reporting.
6827 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6828 (related_symbols): New private member for list of symbols
6829 related to reported error/warning.
6831 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6833 2004-04-29 Martin Baulig <martin@ximian.com>
6835 * ecore.cs (Expression.Constantify): If we're an enum and
6836 TypeManager.TypeToCoreType() doesn't give us another type, use
6837 t.UnderlyingSystemType. Fixes #56178.
6839 2004-04-29 Martin Baulig <martin@ximian.com>
6841 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6842 interfaces and for each interface, only add members directly
6843 declared in that interface. Fixes #53255.
6845 2004-04-28 Martin Baulig <martin@ximian.com>
6847 * expression.cs (ConditionalLogicalOperator): Use a temporary
6848 variable for `left' to avoid that we evaluate it more than once;
6851 2004-04-28 Martin Baulig <martin@ximian.com>
6853 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6856 2004-04-28 Martin Baulig <martin@ximian.com>
6858 * statement.cs (LocalInfo.Resolve): Check whether the type is not
6861 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6862 whether the type is not void (CS1547).
6864 2004-04-28 Martin Baulig <martin@ximian.com>
6866 * expression.cs (Unary.DoResolveLValue): Override this and report
6867 CS0131 for anything but Operator.Indirection.
6869 2004-04-28 Martin Baulig <martin@ximian.com>
6871 Committing a patch from Ben Maurer; see bug #50820.
6873 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6876 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6879 2004-04-28 Martin Baulig <martin@ximian.com>
6881 Committing a patch from Ben Maurer; see bug #50820.
6883 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6886 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6889 2004-04-28 Martin Baulig <martin@ximian.com>
6891 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6892 (Block.AddLabel): Call DoLookupLabel() to only search in the
6895 2004-04-28 Martin Baulig <martin@ximian.com>
6897 * cfold.cs (ConstantFold.BinaryFold): Added special support for
6898 comparing StringConstants and NullLiterals in Equality and Inequality.
6900 2004-04-28 Jackson Harper <jackson@ximian.com>
6902 * driver.cs: Attempt to load referenced assemblies from the
6903 GAC. This is the quick and dirty version of this method that
6904 doesnt take into account versions and just takes the first
6905 canidate found. Will be good enough for now as we will not have more
6906 then one version installed into the GAC until I update this method.
6908 2004-04-28 Martin Baulig <martin@ximian.com>
6910 * typemanager.cs (TypeManager.CheckStructCycles): New public
6911 static method to check for cycles in the struct layout.
6913 * rootcontext.cs (RootContext.PopulateTypes): Call
6914 TypeManager.CheckStructCycles() for each TypeContainer.
6915 [Note: We only need to visit each type once.]
6917 2004-04-28 Martin Baulig <martin@ximian.com>
6919 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6921 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6922 success and added `out object value'. Use a `bool resolved' field
6923 to check whether we've already been called rather than
6924 `ConstantValue != null' since this breaks for NullLiterals.
6926 2004-04-28 Raja R Harinath <rharinath@novell.com>
6928 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6929 setting of this flag, since the 'set' method may be non-public.
6931 2004-04-28 Raja R Harinath <rharinath@novell.com>
6933 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6934 check on current_vector.Block.
6936 2004-04-27 Martin Baulig <martin@ximian.com>
6938 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6939 a field initializer. Fixes #56459.
6941 2004-04-27 Martin Baulig <martin@ximian.com>
6943 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6944 we're not attempting to use an indexer. Fixes #52154.
6946 2004-04-27 Martin Baulig <martin@ximian.com>
6948 * statement.cs (Return): Don't create a return label if we don't
6949 need it; reverts my change from January 20th. Thanks to Ben
6952 2004-04-27 Martin Baulig <martin@ximian.com>
6954 According to the spec, `goto' can only leave a nested scope, but
6957 * statement.cs (Block.LookupLabel): Only lookup in the current
6958 block, don't recurse into parent or child blocks.
6959 (Block.AddLabel): Check in parent and child blocks, report
6960 CS0140/CS0158 if we find a duplicate.
6961 (Block): Removed this indexer for label lookups.
6962 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6963 this already does the error reporting for us.
6966 (FlowBranching.UsageVector.Block): New public variable; may be null.
6967 (FlowBranching.CreateSibling): Added `Block' argument.
6968 (FlowBranching.LookupLabel): New public virtual method. Lookup a
6969 label for the target of a `goto' and check whether we're not
6970 leaving a `finally'.
6972 2004-04-27 Martin Baulig <martin@ximian.com>
6974 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6975 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6978 2004-04-27 Martin Baulig <martin@ximian.com>
6980 * statement.cs (Block.AddLabel): Also check for implicit blocks
6981 and added a CS0158 check.
6983 2004-04-27 Martin Baulig <martin@ximian.com>
6985 * flowanalysis.cs (FlowBranchingLoop): New class.
6986 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6987 UsageVector's instead of an ArrayList.
6988 (FlowBranching.Label): Likewise.
6989 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6990 (FlowBranching.AddBreakVector): New method.
6992 2004-04-27 Miguel de Icaza <miguel@ximian.com>
6994 * attribute.cs: Small regression fix: only convert the type if we
6995 the type is different, fixes System.Drawing build.
6997 2004-04-27 Martin Baulig <martin@ximian.com>
6999 * attribute.cs (Attribute.Resolve): If we have a constant value
7000 for a named field or property, implicity convert it to the correct
7003 2004-04-27 Raja R Harinath <rharinath@novell.com>
7005 * statement.cs (Block.Block): Implicit blocks share
7006 'child_variable_names' fields with parent blocks.
7007 (Block.AddChildVariableNames): Remove.
7008 (Block.AddVariable): Mark variable as "used by a child block" in
7009 every surrounding block.
7010 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7011 been used in a child block, complain about violation of "Invariant
7012 meaning in blocks" rule.
7013 * cs-parser.jay (declare_local_variables): Don't use
7014 AddChildVariableNames.
7015 (foreach_statement): Don't create an implicit block: 'foreach'
7018 2004-04-23 Miguel de Icaza <miguel@ximian.com>
7020 * convert.cs (ImplicitNumericConversion): 0 is also positive when
7021 converting from 0L to ulong. Fixes 57522.
7023 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7025 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7026 derived class hides via 'new' keyword field from base class (test-242.cs).
7027 TODO: Handle this in the more general way.
7029 * class.cs (CheckBase): Ditto.
7031 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7033 * decl.cs (caching_flags): New member for storing cached values
7035 (MemberCore.Flags): New enum where bit flags for caching_flags
7037 (MemberCore.cls_compliance): Moved to caching_flags.
7038 (DeclSpace.Created): Moved to caching_flags.
7040 * class.cs: Use caching_flags instead of DeclSpace.Created
7042 2004-04-21 Miguel de Icaza <miguel@ximian.com>
7044 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7045 if we are only a derived class, not a nested class.
7047 * typemanager.cs: Same as above, but do this at the MemberLookup
7048 level (used by field and methods, properties are handled in
7049 PropertyExpr). Allow for the qualified access if we are a nested
7052 2004-04-21 Marek Safar <marek.safar@seznam.cz>
7054 * class.cs: Refactoring.
7055 (IMethodData): New inteface; Holds links to parent members
7056 to avoid member duplication (reduced memory allocation).
7057 (Method): Implemented IMethodData interface.
7058 (PropertyBase): New inner classes for get/set methods.
7059 (PropertyBase.PropertyMethod): Implemented IMethodData interface
7060 (Event): New inner classes for add/remove methods.
7061 (Event.DelegateMethod): Implemented IMethodData interface.
7063 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7064 EmitContext (related to class.cs refactoring).
7066 2004-04-21 Raja R Harinath <rharinath@novell.com>
7068 * delegate.cs (Delegate.VerifyApplicability): If the number of
7069 arguments are the same as the number of parameters, first try to
7070 verify applicability ignoring any 'params' modifier on the last
7074 2004-04-08 Martin Baulig <martin@ximian.com>
7076 Merged latest changes into gmcs. Please keep this comment in
7077 here, it makes it easier for me to see what changed in MCS since
7078 the last time I merged.
7080 2004-04-16 Raja R Harinath <rharinath@novell.com>
7082 * class.cs (TypeContainer.AddIndexer): Use
7083 'ExplicitInterfaceName' to determine if interface name was
7084 explicitly specified. 'InterfaceType' is not initialized at this time.
7085 (TypeContainer.DefineIndexers): Remove use of temporary list. The
7086 Indexers array is already in the required order. Initialize
7087 'IndexerName' only if there are normal indexers.
7088 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7089 (TypeContainer.Emit): Emit DefaultMember attribute only if
7090 IndexerName is initialized.
7093 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
7095 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7098 2004-04-15 Raja R Harinath <rharinath@novell.com>
7100 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7104 * attribute.cs (Attribute.Resolve): Check for duplicate named
7108 2004-04-15 Miguel de Icaza <miguel@ximian.com>
7110 * iterators.cs (MarkYield): track whether we are in an exception,
7111 and generate code accordingly. Use a temporary value to store the
7112 result for our state.
7114 I had ignored a bit the interaction of try/catch with iterators
7115 since their behavior was not entirely obvious, but now it is
7116 possible to verify that our behavior is the same as MS .NET 2.0
7120 2004-04-14 Miguel de Icaza <miguel@ximian.com>
7122 * iterators.cs: Avoid creating temporaries if there is no work to
7125 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7126 Enumerations, use TypeManager.EnumToUnderlying and call
7129 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7132 (This.Emit): Use EmitContext.EmitThis to emit our
7135 (This.EmitAssign): Ditto.
7137 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7138 codepaths, we will move all the functionality into
7141 (FieldExpr.EmitAssign): Ditto.
7143 This fixes several hidden bugs that I uncovered while doing a code
7144 review of this today.
7146 * codegen.cs (EmitThis): reworked so the semantics are more clear
7147 and also support value types "this" instances.
7149 * iterators.cs: Changed so that for iterators in value types, we
7150 do not pass the value type as a parameter.
7152 Initialization of the enumerator helpers is now done in the caller
7153 instead of passing the parameters to the constructors and having
7154 the constructor set the fields.
7156 The fields have now `assembly' visibility instead of private.
7158 2004-04-11 Miguel de Icaza <miguel@ximian.com>
7160 * expression.cs (Argument.Resolve): Check if fields passed as ref
7161 or out are contained in a MarshalByRefObject.
7163 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7164 another compiler type.
7166 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
7168 * class.cs (Indexer.Define): use the new name checking method.
7169 Also, return false on an error.
7170 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7171 (is_identifier_[start/part]_character): make static.
7173 2004-04-10 Miguel de Icaza <miguel@ximian.com>
7175 * expression.cs (Binary.ResolveOperator): Do no append strings
7176 twice: since we can be invoked more than once (array evaluation)
7177 on the same concatenation, take care of this here. Based on a fix
7178 from Ben (bug #56454)
7180 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
7182 * codegen.cs: Fix another case where CS1548 must be reported (when
7183 delay-sign isn't specified and no private is available #56564). Fix
7184 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
7185 error when MCS is used on the MS runtime and we need to delay-sign
7186 (which seems unsupported by AssemblyBuilder - see #56621).
7188 2004-04-08 Marek Safar <marek.safar@seznam.cz>
7190 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7191 (TypeManager.ComputeNamespaces): Faster implementation for
7194 * compiler.csproj: Updated AssemblyName to mcs.
7196 2004-05-11 Jackson Harper <jackson@ximian.com>
7198 * Makefile: Preserve MONO_PATH
7200 2004-05-11 Jackson Harper <jackson@ximian.com>
7202 * Makefile: Use mono and mcs to build gmcs
7204 2004-05-03 Miguel de Icaza <miguel@ximian.com>
7206 * codegen.cs: Add patch from Robert Shade
7207 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
7210 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
7212 * CryptoConvert.cs: Updated to latest version. Fix issue with
7213 incomplete key pairs (#57941).
7215 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
7217 * codegen.cs: Fix another case where CS1548 must be reported (when
7218 delay-sign isn't specified and no private is available #56564). Fix
7219 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
7220 error when MCS is used on the MS runtime and we need to delay-sign
7221 (which seems unsupported by AssemblyBuilder - see #56621).
7223 2004-04-29 Jackson Harper <jackson@ximian.com>
7225 * Makefile: Set MONO_PATH to use the bootstrap corlib
7226 * driver.cs: Check the GAC for referenced assemblies.
7228 2004-04-29 Martin Baulig <martin@ximian.com>
7230 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
7232 2004-04-07 Martin Baulig <martin@ximian.com>
7234 * expression.cs (Binary.ResolveOperator): Added special case for
7235 Equality/Inequality between a type parameter and a null literal.
7237 2004-04-07 Martin Baulig <martin@ximian.com>
7239 * convert.cs: Check null literal -> type parameter conversions.
7241 2004-04-07 Martin Baulig <martin@ximian.com>
7243 * generic.cs (ConstructedType.CheckConstraints): Enforce the
7244 `class' and `struct' constraints.
7246 2004-04-07 Martin Baulig <martin@ximian.com>
7248 * generic.cs (SpecialConstraint): New public enum.
7249 (Constraints.Resolve): Added support for the `class' and `struct'
7252 * cs-parser.jay (type_parameter_constraint): Added support for the
7253 `class' and `struct' constraints.
7255 2004-04-07 Martin Baulig <martin@ximian.com>
7257 * support.cs (GenericConstraints): Replaced `Types' by
7258 `ClassConstraint' and `InterfaceConstraints'; added
7259 `HasClassConstraint'.
7261 2004-04-07 Martin Baulig <martin@ximian.com>
7264 (Constraints.InterfaceConstraints): New public property.
7265 (Constraints.Types): Make this property public
7266 (TypeParameter): Implement IMemberContainer.
7267 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
7268 instead of a TypeBuilder/MethodBuilder; pass the interface
7269 constraints to TypeManager.AddTypeParameter().
7270 (TypeParameter.DefineType): Just take an EmitContext and no
7271 TypeBuilder/MethodBuilder. Use the new public API.
7273 * typemanager.cs (TypeManager.AddTypeParameter): Added
7274 `TypeExpr[]' argument; add the interfaces to the
7275 `builder_to_ifaces' hash.
7276 (TypeManager.LookupMemberContainer): For
7277 GenericTypeParameterBuilders, get the TypeParameter from the
7278 `builder_to_type_param'.
7279 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
7280 the TypeParameter and call FindMembers on it.
7282 2004-04-07 Martin Baulig <martin@ximian.com>
7285 (MethodCore.GenericMethod): Moved this field here from Method.
7286 (MethodCore.IsDuplicateImplementation): Take the number of type
7287 parameters into account if we're a generic method.
7289 * expression.cs (Invocation.InferTypeArguments): Don't return true
7290 if `arguments' is null; we still need to check whether we actually
7291 don't need to infer anything in this case.
7292 (MemberAccess): Merged the functionality from GenericMemberAccess
7295 * generic.cs (GenericMemberAccess): Removed.
7297 2004-04-05 Martin Baulig <martin@ximian.com>
7299 * decl.cs (MemberCore): For generic classes, interfaces and
7300 structs, `Name' now includes the number of type parameters
7302 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
7303 encode the number of type arguments in the type name.
7305 * expression.cs (Expression.MemberLookup): Removed the
7306 `num_type_args' argument; we now encode the number of type
7307 arguments in the type name.
7309 * ecore.cs (SimpleName): Encode the number of type arguments in
7310 the type name itself.
7312 * generic.cs (ConstructedType): Likewise.
7314 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
7315 `MemberName'; we now include the number of type parameters in the
7318 * typemanager.cs (TypeManager.CheckGeneric): Removed.
7319 (TypeManager.MemberLookup): Removed the
7320 `num_type_args' argument; we now encode the number of type
7321 arguments in the type name.
7323 2004-04-03 Martin Baulig <martin@ximian.com>
7325 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
7326 (MemberCore.MemberName): Moved here from MemberBase.
7327 (DeclSpace.SetParameterInfo): Just take the constraints as an
7328 ArrayList; we already have the type parameters in our
7329 `MemberName'; also do the CS0080 reporting here.
7331 * cs-parser.jay (struct_declaration): Use `member_name' instead of
7332 `IDENTIFIER opt_type_parameter_list'; when constructing our
7333 `MemberName', it'll already include our type parameters.
7334 (class_declaration, interface_declaration): Likewise.
7335 (delegate_declaration): Likewise.
7336 (MakeName): Take a MemberName and return a MemberName.
7337 The following two changes are required to avoid shift/reduce conflicts:
7338 (member_name): Don't include a TypeName anymore; ie. this is now
7339 just 'IDENTIFIER opt_type_parameter_list'.
7340 (property_declaration, event_declaration): Use a
7341 `namespace_or_type_name' instead of a `member_name'.
7343 2004-04-03 Martin Baulig <martin@ximian.com>
7345 * decl.cs (MemberName): Renamed to `TypeName' and created a new
7347 (TypeName): Formerly known as MemberName.
7349 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
7350 instead of a `MemberName'.
7352 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
7353 (member_name): New rule; create a MemberName.
7355 2004-04-02 Martin Baulig <martin@ximian.com>
7357 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
7358 (CS0305 and CS0308).
7360 2004-04-02 Martin Baulig <martin@ximian.com>
7362 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
7363 support for nested types.
7365 2004-04-02 Martin Baulig <martin@ximian.com>
7367 * ecore.cs (IAlias): New public interface.
7368 (TypeExpr, TypeExpression): Implement IAlias.
7369 (TypeAliasExpression): New public class.
7371 * namespace.cs (Namespace): Implement IAlias.
7372 (Namespace.Lookup): Return an IAlias instead on an object.
7373 (Namespace.DefineName): Take an IAlias instead of an object.
7374 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
7376 (NamespaceEntry.UsingAlias): Take a Membername instead of an
7378 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
7380 (NamespaceEntry.Lookup): Likewise.
7382 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
7385 * decl.cs (DeclSpace): Implement IAlias.
7386 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
7388 * generic.cs (ConstructedType): Improved error checking.
7390 2004-04-02 Martin Baulig <martin@ximian.com>
7392 * convert.cs: Added type parameter conversions.
7395 (UnboxCast.Emit): Emit an `unbox.any' for type params.
7396 (ClassCast.Emit): If the source type is a type parameter, box it.
7397 If the target type is a type parameter, emit an `unbox.any'
7398 instead of a `classcast'.1
7400 2004-04-01 Martin Baulig <martin@ximian.com>
7402 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
7404 2004-04-01 Martin Baulig <martin@ximian.com>
7406 * generic.cs (ConstructedType.CheckConstraints): Use
7407 Convert.ImplicitStandardConversionExists(); user-defined implicit
7408 conversions are not allowed according to the spec.
7410 2004-03-30 Martin Baulig <martin@ximian.com>
7412 * expression.cs (New): Added support for type parameters.
7415 (TypeManager.activator_type): New public static field.
7416 (TypeManager.activator_create_instance): Likewise.
7418 2004-03-30 Martin Baulig <martin@ximian.com>
7420 * typemanager.cs (TypeManager.HasConstructorConstraint): New
7423 2004-03-30 Martin Baulig <martin@ximian.com>
7425 * generic.cs (ConstructedType.CheckConstraints): Actually follow
7426 the spec here: the argument type must be convertible to the
7429 2004-03-30 Martin Baulig <martin@ximian.com>
7432 (TypeParameter.Define, TypeParameter.DefineMethod): Call
7433 TypeManager.AddTypeParameter().
7434 (ConstructedType.CheckConstraints): Re-enable this and actually
7435 check whether we have a constructor constraint.
7438 (TypeManager.builder_to_type_param): New static field.
7439 (TypeManager.AddTypeParameter): New static method.
7440 (TypeManager.LookupTypeParameter): New public method.
7442 2004-03-30 Martin Baulig <martin@ximian.com>
7444 * generic.cs (TypeParameter.DefineType): Return a boolean and use
7445 the new API to actually define the constructor constraint.
7448 (TypeManager.new_constraint_attr_type): New static field.
7449 (TypeManager.InitCoreTypes): Initialize it.
7451 2004-03-30 Martin Baulig <martin@ximian.com>
7453 * generic.cs (Constraints): Completed error checking, use correct
7456 2004-03-29 Martin Baulig <martin@ximian.com>
7458 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
7460 * expression.cs (Invocation.InferTypeArguments): Added overloaded
7461 public version which takes a `ParameterData pd' instead of an
7464 2004-03-29 Martin Baulig <martin@ximian.com>
7466 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
7469 2004-03-29 Martin Baulig <martin@ximian.com>
7471 * expression.cs (Argument.ResolveMethodGroup): If we're a
7472 ConstructedType, call GetMemberAccess() on it.
7474 2004-03-29 Martin Baulig <martin@ximian.com>
7476 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
7477 (MethodCore.CheckGenericOverride): When overriding a generic
7478 method, check whether the constraints match.
7480 * support.cs (GenericConstraints): New public interface.
7481 (ParameterData.GenericConstraints): New public method.
7483 * parameter.cs (Parameter.Resolve): Check whether we're a generic
7484 method parameter and compute our constraints if appropriate.
7485 (Parameter.GenericConstraints): New public property.
7487 * generic.cs (Constraints): Implement GenericConstraints.
7489 2004-03-29 Martin Baulig <martin@ximian.com>
7491 * decl.cs (MemberCache.FindMemberToOverride): Use
7492 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
7494 2004-03-29 Martin Baulig <martin@ximian.com>
7496 * generic.cs (GenericMethod.Define): Resolve our type parameters.
7498 2004-03-29 Martin Baulig <martin@ximian.com>
7500 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
7501 not allowed on non-generic declarations").
7503 2004-03-29 Martin Baulig <martin@ximian.com>
7505 * expression.cs (Invocation.InferTypeArguments): Added overloaded
7506 public version of this method.
7508 * class.cs (MethodCore.IsDuplicateImplementation): Use
7509 Invocation.InferTypeArguments() to check this.
7511 2004-03-29 Martin Baulig <martin@ximian.com>
7513 * convert.cs: Use TypeManager.IsDelegateType() instead of
7514 comparing types correctly.
7516 2004-03-29 Martin Baulig <martin@ximian.com>
7518 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
7519 types directly to make it work for generic instances.
7521 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
7523 2004-03-29 Martin Baulig <martin@ximian.com>
7525 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
7528 2004-03-24 Martin Baulig <martin@ximian.com>
7530 * decl.cs (DeclSpace.FindType): Also use
7531 TypeManager.CheckGeneric() for types from the using clauses.
7533 2004-03-23 Martin Baulig <martin@ximian.com>
7535 * expression.cs (Invocation.OverloadResolve): Added `bool
7536 may_fail' argument and use it instead of the Location.IsNull() hack.
7538 2004-03-23 Martin Baulig <martin@ximian.com>
7540 * expression.cs (Invocation.InferType): Use correct type inference
7543 2004-03-23 Martin Baulig <martin@ximian.com>
7545 * ecore.cs (MethodGroupExpr.Name): Use
7546 TypeManager.CSharpSignature() instead of just the name.
7548 * expression.cs (Invocation.OverloadResolve): Provide better error
7550 (Invocation.DoResolve): OverloadResolve() never returns null
7551 without reporting an error, so removed the error -6 reporting here.
7553 2004-03-23 Martin Baulig <martin@ximian.com>
7555 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
7558 * cs-parser.jay (delegate_declaration): Support generic delegates.
7560 * delegate.cs: Support generic delegates.
7562 2004-03-22 Martin Baulig <martin@ximian.com>
7564 * expression.cs (Invocation.InferParamsTypeArguments): New static
7565 method; does type inference for params arguments.
7567 2004-03-21 Martin Baulig <martin@ximian.com>
7569 * typemanager.cs (TypeManager.IsGenericMethod): New public static
7570 method; checks whether a method is a generic method.
7572 * expression.cs (Invocation.InferTypeArguments): New static method;
7573 infer type arguments for generic method invocation.
7575 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
7576 property; we set this to true if we're resolving a generic method
7577 invocation and the user specified type arguments, ie. we're not
7578 doing type inference.
7580 2004-03-20 Martin Baulig <martin@ximian.com>
7582 * class.cs (MethodData.DeclaringType): New public property.
7583 (MethodData.Define): Set DeclaringType here.
7584 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
7585 instead of OperatorMethodBuilder.DeclaringType.
7587 2004-03-20 Martin Baulig <martin@ximian.com>
7589 * cs-tokenizer.cs (xtoken): Return a special
7590 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
7592 * cs-parser.jay (default_value_expression): Switch to the new
7595 2004-03-19 Martin Baulig <martin@ximian.com>
7597 * decl.cs (MemberName): New class. We use this to "construct"
7598 namespace_or_type_name's.
7600 * generics.cs (TypeArguments.GetDeclarations): New public method;
7601 returns the type arguments as a string[] and reports a CS0081 if
7602 one of them is not an identifier.
7604 * class.cs (MemberBase): The .ctor now takes the name as a
7605 MemberName instead of a string.
7606 (MemberBase.ExplicitInterfaceName): Changed type from string to
7608 (MemberBase.DoDefine): If we're an explicit implementation, the
7609 InterfaceType may be a generic instance.
7611 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
7612 (namespace_name): Call MemberName.GetName () to transform the
7613 MemberName into a string and ensure we don't have any type
7615 (type_name): Call MemberName.GetTypeExpression() to transfrom the
7616 MemberName into an expression.
7617 (method_header): Use namespace_or_type_name instead of member_name.
7619 2004-04-07 Miguel de Icaza <miguel@ximian.com>
7621 * rootcontext.cs: Add new types to the boot resolution.
7623 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7624 MulticastDelegate is not allowed.
7626 * typemanager.cs: Add new types to lookup: System.TypedReference
7629 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7630 check for TypedReference or ArgIterator, they are not allowed.
7632 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7633 makes us properly catch 1510 in some conditions (see bug 56016 for
7636 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
7638 * CryptoConvert.cs: update from corlib version
7641 2004-04-05 Miguel de Icaza <miguel@ximian.com>
7643 * class.cs (Indexer.Define): Check indexername declaration
7645 2004-04-05 Marek Safar <marek.safar@seznam.cz>
7647 * attribute.cs (IsClsCompliant): Fixed problem with handling
7648 all three states (compliant, not-compliant, undetected).
7650 2004-03-30 Marek Safar <marek.safar@seznam.cz>
7652 * attribute.cs (Attribute): Location is now public.
7653 (Resolve): Store resolved arguments (pos_values) in attribute class.
7654 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7655 (GetClsCompliantAttributeValue): New method that gets
7656 CLSCompliantAttribute value.
7657 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7658 if exists else null.
7659 (AttributeTester): New class for CLS-Compliant verification routines.
7661 * class.cs (Emit): Add CLS-Compliant verification.
7662 (Method.GetSignatureForError): Implemented.
7663 (Constructor.GetSignatureForError): Implemented
7664 (Constructor.HasCompliantArgs): Returns if constructor has
7665 CLS-Compliant arguments.
7666 (Constructor.Emit): Override.
7667 (Construcor.IsIdentifierClsCompliant): New method; For constructors
7668 is needed to test only parameters.
7669 (FieldBase.GetSignatureForError): Implemented.
7670 (TypeContainer): New member for storing base interfaces.
7671 (TypeContainer.FindMembers): Search in base interfaces too.
7673 * codegen.cs (GetClsComplianceAttribute): New method that gets
7674 assembly or module CLSCompliantAttribute value.
7675 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7677 (ModuleClass.Emit): Add error 3012 test.
7679 * const.cs (Emit): Override and call base for CLS-Compliant tests.
7681 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7682 state for all decl types.
7683 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7684 if CLS-Compliant tests are required.
7685 (IsClsCompliaceRequired): New method. Analyze whether code
7686 must be CLS-Compliant.
7687 (IsExposedFromAssembly): New method. Returns true when MemberCore
7688 is exposed from assembly.
7689 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7690 value or gets cached value.
7691 (HasClsCompliantAttribute): New method. Returns true if MemberCore
7692 is explicitly marked with CLSCompliantAttribute.
7693 (IsIdentifierClsCompliant): New abstract method. This method is
7694 used to testing error 3005.
7695 (IsIdentifierAndParamClsCompliant): New method. Common helper method
7696 for identifier and parameters CLS-Compliant testing.
7697 (VerifyClsCompliance): New method. The main virtual method for
7698 CLS-Compliant verifications.
7699 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7700 null. I don't know why is null (too many public members !).
7701 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7702 and get value of first CLSCompliantAttribute that found.
7704 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7705 (VerifyClsCompliance): Override and add extra tests.
7707 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7708 clscheck- disable CLS-Compliant verification event if assembly is has
7709 CLSCompliantAttribute(true).
7711 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7712 ApllyAttribute is now called in emit section as in the other cases.
7713 Possible future Emit integration.
7714 (IsIdentifierClsCompliant): New override.
7715 (VerifyClsCompliance): New override.
7716 (GetEnumeratorName): Returns full enum name.
7718 * parameter.cs (GetSignatureForError): Implemented.
7720 * report.cs (WarningData): New struct for Warning message information.
7721 (LocationOfPreviousError): New method.
7722 (Warning): New method. Reports warning based on the warning table.
7723 (Error_T): New method. Reports error based on the error table.
7725 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7726 verifications are done here.
7728 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7730 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7731 CLSCompliantAttribute.
7732 (all_imported_types): New member holds all imported types from other
7734 (LoadAllImportedTypes): New method fills static table with exported types
7735 from all referenced assemblies.
7736 (Modules): New property returns all assembly modules.
7738 2004-03-30 Miguel de Icaza <miguel@ximian.com>
7740 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7741 throwing a parser error.
7743 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7744 which removes the hardcoded get_/set_ prefixes for properties, as
7745 IL allows for the properties to be named something else.
7749 * expression.cs: Do not override operand before we know if it is
7752 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
7754 * typemanager.cs: support for pinned variables.
7756 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
7758 * decl.cs, typemanager.cs: Avoid using an arraylist
7759 as a buffer if there is only one result set.
7761 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
7763 * expression.cs: Make sure you cant call a static method
7764 with an instance expression, bug #56174.
7766 2004-03-29 Miguel de Icaza <miguel@ximian.com>
7768 * class.cs (IsDuplicateImplementation): Improve error reporting to
7769 flag 663 (method only differs in parameter modifier).
7771 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7772 in preprocessor directives.
7774 * location.cs (LookupFile): Allow for the empty path.
7776 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
7777 better approach for some of that patch, but its failing with the
7778 CharSet enumeration. For now try/catch will do.
7780 * typemanager.cs: Do not crash if a struct does not have fields.
7783 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
7785 * expression.cs: cs0213, cant fix a fixed expression.
7788 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
7790 * cs-parser.jay: detect invalid embeded statements gracefully.
7793 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
7795 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7798 the invocation type may not be a subclass of the tye of the item/
7799 The type of the item must be a subclass of the invocation item.
7804 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
7806 * attribute.cs: Added methods to get a string and a bool from an
7807 attribute. Required to information from AssemblyKeyFileAttribute,
7808 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7809 * codegen.cs: Modified AssemblyName creation to include support for
7810 strongnames. Catch additional exceptions to report them as CS1548.
7811 * compiler.csproj: Updated include CryptoConvert.cs.
7812 * compiler.csproj.user: Removed file - user specific configuration.
7813 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
7814 Mono.Security assembly. The original class is maintained and tested in
7815 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7816 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7817 like CSC 8.0 (C# v2) supports.
7818 * Makefile: Added CryptoConvert.cs to mcs sources.
7819 * rootcontext.cs: Added new options for strongnames.
7821 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
7823 * driver.cs: For --expect-error, report error code `2'
7824 if the program compiled with no errors, error code `1' if
7825 it compiled with an error other than the one expected.
7827 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
7829 * compiler.csproj: Updated for Visual Studio .NET 2003.
7830 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7831 * compiler.sln: Updated for Visual Studio .NET 2003.
7833 2004-03-24 Ravi Pratap M <ravi@ximian.com>
7835 * expression.cs: Fix bug #47234. We basically need to apply the
7836 rule that we prefer the conversion of null to a reference type
7837 when faced with a conversion to 'object' (csc behaviour).
7839 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7841 * statement.cs: Shorter form for foreach, eliminates
7842 a local variable. r=Martin.
7844 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7846 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7847 checks if we can use brtrue/brfalse to test for 0.
7848 * expression.cs: use the above in the test for using brtrue/brfalse.
7851 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7853 * expression.cs: Rewrite string concat stuff. Benefits:
7855 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7856 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7857 rather than a concat chain.
7859 * typemanager.cs: Add lookups for more concat overloads.
7861 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
7863 * expression.cs: Emit shorter il code for array init.
7880 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
7882 * statement.cs: Before, two switch blocks would be merged if the
7883 total size of the blocks (end_item - begin_item + 1) was less than
7884 two times the combined sizes of the blocks.
7886 Now, it will only merge if after the merge at least half of the
7891 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
7893 * class.cs : csc build fix for GetMethods(). See bug #52503.
7895 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
7897 * expression.cs: Make sure fp comparisons work with NaN.
7898 This fixes bug #54303. Mig approved this patch a long
7899 time ago, but we were not able to test b/c the runtime
7902 2004-03-19 Miguel de Icaza <miguel@ximian.com>
7904 * ecore.cs (TypExpr.GetHashCode): implement this overload.
7906 2004-03-19 Martin Baulig <martin@ximian.com>
7908 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
7909 two overloads may unify for some type parameter substitutions and
7910 report a CS0408 if appropriate.
7912 2004-03-19 Martin Baulig <martin@ximian.com>
7914 * class.cs (MemberCore.IsDuplicateImplementation): Report the
7915 error here and not in our caller.
7917 2004-03-19 Martin Baulig <martin@ximian.com>
7919 * interface.cs: Completely killed this file.
7920 (Interface): We're now a TypeContainer and live in class.cs.
7922 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7923 argument; we're now also called for interfaces.
7924 (TypeContainer.DefineMembers): Allow this method being called
7926 (TypeContainer.GetMethods): New public method; formerly known as
7927 Interface.GetMethod(). This is used by PendingImplementation.
7928 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7929 it's now private and non-static.
7930 (Interface): Moved this here; it's now implemented similar to
7932 (Method, Property, Event, Indexer): Added `bool is_interface'
7933 argument to their .ctor's.
7934 (MemberBase.IsInterface): New public field.
7936 * cs-parser.jay: Create normal Method, Property, Event, Indexer
7937 instances instead of InterfaceMethod, InterfaceProperty, etc.
7938 (opt_interface_base): Removed; we now use `opt_class_base' instead.
7939 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7941 2004-03-19 Martin Baulig <martin@ximian.com>
7943 * class.cs (MethodCore.IsDuplicateImplementation): New private
7944 method which does the CS0111 checking.
7945 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7946 Use IsDuplicateImplementation().
7948 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
7950 * decl.cs (FindMemberToOverride): New method to find the correct
7951 method or property to override in the base class.
7953 - Make Method/Property use the above method to find the
7954 version in the base class.
7955 - Remove the InheritableMemberSignatureCompare as it is now
7958 This patch makes large code bases much faster to compile, as it is
7959 O(n) rather than O(n^2) to do this validation.
7961 Also, it fixes bug 52458 which is that nested classes are not
7962 taken into account when finding the base class member.
7964 Reviewed/Approved by Martin.
7966 2004-03-17 Martin Baulig <martin@ximian.com>
7968 * expression.cs (MemberAccess.DoResolve): Take the parent's number
7969 of type arguments into account; use the `real_num_type_args'
7970 approach like in DoResolveAsTypeStep().
7972 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
7975 2004-03-17 Marek Safar <marek.safar@seznam.cz>
7977 * interface.cs: In all interface classes removed redundant
7978 member initialization.
7980 2004-03-16 Martin Baulig <martin@ximian.com>
7982 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7984 2004-03-15 Miguel de Icaza <miguel@ximian.com>
7986 * decl.cs (DefineTypeAndParents): New helper method to define a
7987 type's containers before the type itself is defined; This is a
7988 bug exposed by the recent changes to Windows.Forms when an
7989 implemented interface was defined inside a class that had not been
7992 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7994 (Check): Loop correctly to report errors modifiers
7995 (UNSAFE was not in the loop, since it was the same as TOP).
7997 * interface.cs: Every interface member now takes a ModFlags,
7998 instead of a "is_new" bool, which we set on the base MemberCore.
8000 Every place where we called "UnsafeOk" in the interface, now we
8001 call the proper member (InterfaceMethod.UnsafeOK) instead to get
8002 the unsafe settings from the member declaration instead of the
8003 container interface.
8005 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
8007 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8008 `set_indexer_name' to the pending bits (one per type).
8010 We fixed a bug today that was picking the wrong method to
8011 override, since for properties the existing InterfaceMethod code
8012 basically ignored the method name. Now we make sure that the
8013 method name is one of the valid indexer names.
8015 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
8017 * support.cs (SeekableStreamReader): Keep track of stream byte
8018 positions and don't mix them with character offsets to the buffer.
8020 Patch from Gustavo Giráldez
8022 2004-03-15 Marek Safar <marek.safar@seznam.cz>
8024 * interface.cs (InterfaceSetGetBase): Removed double member
8025 initialization, base class does it as well.
8027 2004-03-13 Martin Baulig <martin@ximian.com>
8029 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8030 when compiling corlib.
8032 2004-03-13 Miguel de Icaza <miguel@ximian.com>
8034 * convert.cs (ExplicitConversion): We were reporting an error on
8035 certain conversions (object_type source to a value type, when the
8036 expression was `null') before we had a chance to pass it through
8037 the user defined conversions.
8039 * driver.cs: Replace / and \ in resource specifications to dots.
8042 * class.cs: Add check for duplicate operators. Fixes 52477
8044 2004-03-11 Miguel de Icaza <miguel@ximian.com>
8046 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8047 that are in the middle of the statements, not only at the end.
8050 * class.cs (TypeContainer.AddField): No longer set the
8051 `HaveStaticConstructor' flag, now we call it
8052 `UserDefineStaticConstructor' to diferentiate the slightly
8053 semantic difference.
8055 The situation is that we were not adding BeforeFieldInit (from
8056 Modifiers.TypeAttr) to classes that could have it.
8057 BeforeFieldInit should be set to classes that have no static
8062 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8064 And most importantly Zoltan's comment:
8066 http://bugzilla.ximian.com/show_bug.cgi?id=44229
8068 "I think beforefieldinit means 'it's ok to initialize the type sometime
8069 before its static fields are used', i.e. initialization does not need
8070 to be triggered by the first access to the type. Setting this flag
8071 helps the JIT to compile better code, since it can run the static
8072 constructor at JIT time, and does not need to generate code to call it
8073 (possibly lots of times) at runtime. Unfortunately, mcs does not set
8074 this flag for lots of classes like String.
8076 csc sets this flag if the type does not have an explicit static
8077 constructor. The reasoning seems to be that if there are only static
8078 initalizers for a type, and no static constructor, then the programmer
8079 does not care when this initialization happens, so beforefieldinit
8082 This bug prevents the AOT compiler from being usable, since it
8083 generates so many calls to mono_runtime_class_init that the AOT code
8084 is much slower than the JITted code. The JITted code is faster,
8085 because it does not generate these calls if the vtable is type is
8086 already initialized, which is true in the majority of cases. But the
8087 AOT compiler can't do this."
8089 2004-03-10 Miguel de Icaza <miguel@ximian.com>
8091 * class.cs (MethodData.Emit): Refactor the code so symbolic
8092 information is generated for destructors; For some reasons we
8093 were taking a code path that did not generate symbolic information
8096 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
8098 * class.cs: Create a Constructor.CheckBase method that
8099 takes care of all validation type code. The method
8100 contains some code that was moved from Define.
8102 It also includes new code that checks for duplicate ctors.
8103 This fixes bug #55148.
8105 2004-03-09 Joshua Tauberer <tauberer@for.net>
8107 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8108 a { ... }-style array creation invokes EmitStaticInitializers
8109 which is not good for reference-type arrays. String, decimal
8110 and now null constants (NullCast) are not counted toward
8111 static initializers.
8113 2004-03-05 Martin Baulig <martin@ximian.com>
8115 * location.cs (SourceFile.HasLineDirective): New public field;
8116 specifies whether the file contains or is referenced by a "#line"
8118 (Location.DefineSymbolDocuments): Ignore source files which
8119 either contain or are referenced by a "#line" directive.
8121 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
8123 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8124 direct access to our parent, so check the method inline there.
8126 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
8128 * expression.cs (Invocation.EmitCall): Miguel's last commit
8129 caused a regression. If you had:
8134 In Foo the implict this would be null.
8136 2004-02-27 Miguel de Icaza <miguel@ximian.com>
8138 * expression.cs (Invocation.EmitCall): If the method is not
8139 virtual, do not emit a CallVirt to it, use Call.
8141 * typemanager.cs (GetFullNameSignature): Improve the method to
8142 cope with ".ctor" and replace it with the type name.
8144 * class.cs (ConstructorInitializer.Resolve): Now the method takes
8145 as an argument the ConstructorBuilder where it is being defined,
8146 to catch the recursive constructor invocations.
8148 2004-03-16 Martin Baulig <martin@ximian.com>
8150 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
8151 ConstructedType, call ResolveType() on it to get the type rather
8152 than just using `expr.Type'.
8154 2004-03-16 Martin Baulig <martin@ximian.com>
8156 * generics.cs (ConstructedType.GetMemberAccess): Take the
8157 EmitContext instead on the TypeExpr and use
8158 ec.TypeContainer.CurrentType/ec.ContainerType.
8160 2004-03-16 Martin Baulig <martin@ximian.com>
8162 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
8163 parameters before aliases.
8165 2004-03-16 Martin Baulig <martin@ximian.com>
8167 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
8168 New oublic function; checks whether two generic instances may become
8169 equal under some instantiations (26.3.1).
8171 * class.cs (TypeContainer.Define): Call
8172 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
8175 2004-03-16 Martin Baulig <martin@ximian.com>
8177 * class.cs (TypeContainer.GetClassBases): Moved
8178 Error_TypeParameterAsBase() here and also check whether the base
8179 class is not an attribute.
8181 2004-03-16 Martin Baulig <martin@ximian.com>
8183 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8185 2004-03-16 Martin Baulig <martin@ximian.com>
8187 * class.cs (Error_TypeParameterAsBase): Use correct error number
8190 2004-03-16 Martin Baulig <martin@ximian.com>
8192 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
8195 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
8198 2004-03-15 Martin Baulig <martin@ximian.com>
8200 * typemanager.cs (TypeManager.GetFullName): New public method.
8201 (TypeManager.MemberLookup): Added `int_num_type_arguments'
8202 argument; only return members with the correct number of type
8204 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
8205 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
8206 whether the number of type arguments matches.
8208 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
8209 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
8211 * expression.cs (MemberAccess): Added public `NumTypeArguments'
8212 field; it's set by the protected .ctor when we're actually a
8213 GenericMemberAccess.
8214 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
8215 arguments and pass it to MemberLookupFinal ().
8217 * ecore.cs (Expression.MemberLookup): Added `int
8218 num_type_arguments' argument; only return members with the correct
8219 number of type arguments.
8220 (Expression.MemberLookupFailed): Check whether the MemberLookup
8221 failed because we did not have the correct number of type
8222 arguments; report CS0305 in this case.
8224 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
8225 `e.ResolveAsTypeTerminal()' already did so.
8227 2004-03-15 Martin Baulig <martin@ximian.com>
8229 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
8230 we're a ConstructedType; in this case, the caller must report an
8231 error (for instance CS0131).
8233 * generic.cs (TypeArguments): Added Location argument to the .ctor.
8234 (TypeArguments.Resolve): Actually report errors here.
8236 2004-03-15 Miguel de Icaza <miguel@ximian.com>
8238 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8239 `set_indexer_name' to the pending bits (one per type).
8241 We fixed a bug today that was picking the wrong method to
8242 override, since for properties the existing InterfaceMethod code
8243 basically ignored the method name. Now we make sure that the
8244 method name is one of the valid indexer names.
8246 2004-03-15 Martin Baulig <martin@ximian.com>
8248 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
8249 for generic instances.
8251 2004-03-13 Martin Baulig <martin@ximian.com>
8253 * class.cs (TypeContainer.DefineType): Call
8254 TypeManager.AddUserType() immediately after creating the
8255 TypeBuilder; pass all type parameters when creating the
8258 * decl.cs (DeclSpace.FindNestedType): New public method.
8259 (DeclSpace.FindType): Added `int num_type_args' argument; only
8260 return types with the correct number of type parameters.
8261 (DeclSpace.CountTypeParams): New public property.
8263 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
8264 the number of type parameters; defaults to zero.
8266 * generic.cs (TypeArguments.Count): New public property.
8267 (ConstructedType.DoResolveAsTypeStep): First call
8268 ds.FindNestedType() to find out whether we're nested in the
8269 current generic type; in this case, we inherit all type parameters
8270 from the current class.
8272 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
8273 num_type_args' argument.
8274 (RootContext.LookupType): Added overloaded version which takes the
8275 number of type arguments; only return types with the correct
8276 number of type arguments.
8278 * typemanager.cs (TypeManager.CheckGeneric): New public function;
8279 checks whether `Type t' has `int num_type_args'.
8281 2004-03-13 Martin Baulig <martin@ximian.com>
8283 * generic.cs (GenericMethod.DefineType): New method; calls
8284 DefineType() on all the type parameters.
8286 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
8287 (MethodData.Define): If we're a generic method, call
8288 GenericMethod.DefineType() to define the type parameters.
8290 2004-03-10 Martin Baulig <martin@ximian.com>
8292 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
8293 instead of IsAssignableFrom.
8295 2004-03-10 Martin Baulig <martin@ximian.com>
8297 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
8299 * support.cs (ParameterData.HasArrayParameter): New property.
8300 (ReflectionParameters.ctor): Take a MethodBase instead of a
8301 ParameterInfo[]. If we have any type parameters, get the generic
8302 method definition and ask it whether we have variable arguments.
8304 2004-02-26 Miguel de Icaza <miguel@ximian.com>
8306 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8307 routines to check if a type is an enumerable/enumerator allow
8308 classes that implement the IEnumerable or IEnumerator interfaces.
8310 * class.cs (Property, Operator): Implement IIteratorContainer, and
8311 implement SetYields.
8313 (Property.Define): Do the block swapping for get_methods in the
8314 context of iterators. We need to check if Properties also
8315 include indexers or not.
8317 (Operator): Assign the Block before invoking the
8318 OperatorMethod.Define, so we can trigger the Iterator code
8321 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
8322 Property and Operator classes are not created when we parse the
8323 declarator but until we have the block completed, so we use a
8324 singleton SimpleIteratorContainer.Simple to flag whether the
8325 SetYields has been invoked.
8327 We propagate this setting then to the Property or the Operator to
8328 allow the `yield' to function.
8330 2004-02-25 Marek Safar <marek.safar@seznam.cz>
8332 * codegen.cs: Implemented attribute support for modules.
8333 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8334 Assembly/Module functionality.
8336 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8337 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8338 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8340 2004-02-16 Marek Safar <marek.safar@seznam.cz>
8342 * interface.cs (FindMembers): The operation is performed on all base
8343 interfaces and not only on the first. It is required for future CLS Compliance patch.
8345 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
8347 * statement.cs, codegen.cs:
8348 This patch deals with patterns such as:
8350 public class List : IEnumerable {
8352 public MyEnumerator GetEnumerator () {
8353 return new MyEnumerator(this);
8356 IEnumerator IEnumerable.GetEnumerator () {
8360 public struct MyEnumerator : IEnumerator {
8365 Before, there were a few things we did wrong:
8366 1) we would emit callvirt on a struct, which is illegal
8367 2) we emited ldarg when we needed to emit ldarga
8368 3) we would mistakenly call the interface methods on an enumerator
8369 type that derived from IEnumerator and was in another assembly. For example:
8371 public class MyEnumerator : IEnumerator
8373 Would have the interface methods called, even if there were public impls of the
8374 method. In a struct, this lead to invalid IL code.
8376 2004-02-11 Marek Safar <marek.safar@seznam.cz>
8378 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8381 * delegate.cs (Define): Fixed crash when delegate type is undefined.
8383 2004-02-11 Miguel de Icaza <miguel@ximian.com>
8385 * cs-parser.jay: Fix small regression: we were not testing V2
8386 compiler features correctly.
8388 * interface.cs: If the emit context is null, then create one
8390 2004-02-09 Marek Safar <marek.safar@seznam.cz>
8392 * decl.cs (GetSignatureForError): New virtual method to get full name
8395 * attribute.cs (IAttributeSupport): New interface for attribute setting.
8396 Now it is possible to rewrite ApplyAttributes method to be less if/else.
8398 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8399 Duplicated members and code in these classes has been removed.
8400 Better encapsulation in these classes.
8402 2004-02-07 Miguel de Icaza <miguel@ximian.com>
8404 * assign.cs (Assign.DoResolve): When dealing with compound
8405 assignments, there is a new rule in ECMA C# 2.4 (might have been
8406 there before, but it is documented here) that states that in:
8410 If b is of type int, and the `op' is a shift-operator, then the
8411 above is evaluated as:
8415 * expression.cs (Binary.ResolveOperator): Instead of testing for
8416 int/uint/long/ulong, try to implicitly convert to any of those
8417 types and use that in pointer arithmetic.
8419 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8420 method to print information for from the type, not from the
8421 null-method we were given.
8423 2004-02-01 Duncan Mak <duncan@ximian.com>
8425 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8426 parsing for cmd, fixes bug #53694.
8428 2004-02-04 Marek Safar <marek.safar@seznam.cz>
8430 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8431 in the member name duplication tests. Property and operator name duplication
8432 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8434 2004-02-03 Marek Safar <marek.safar@seznam.cz>
8436 * interface.cs (PopulateMethod): Fixed crash when interface method
8437 returns not existing type (error test cs0246-3.cs).
8439 2004-02-02 Ravi Pratap M <ravi@ximian.com>
8441 * cs-parser.jay (interface_accessors): Re-write actions to also
8442 store attributes attached to get and set methods. Fix spelling
8445 (inteface_property_declaration): Modify accordingly.
8447 (InterfaceAccessorInfo): New helper class to store information to pass
8448 around between rules that use interface_accessors.
8450 * interface.cs (Emit): Apply attributes on the get and set
8451 accessors of properties and indexers too.
8453 * attribute.cs (ApplyAttributes): Modify accordingly to use the
8454 right MethodBuilder when applying attributes to the get and set accessors.
8456 2004-01-31 Miguel de Icaza <miguel@ximian.com>
8458 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8460 2004-01-26 Miguel de Icaza <miguel@ximian.com>
8462 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8464 2004-01-25 Miguel de Icaza <miguel@ximian.com>
8466 * cs-parser.jay: Remove YIELD token, instead use the new grammar
8467 changes that treat `yield' specially when present before `break'
8470 * cs-tokenizer.cs: yield is no longer a keyword.
8472 2004-01-23 Marek Safar <marek.safar@seznam.cz>
8474 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8475 setting for default constructors.
8476 For default constructors are almost every time set wrong Modifier. The
8477 generated IL code has been alright. But inside mcs this values was
8478 wrong and this was reason why several of my CLS Compliance tests
8481 2004-02-27 Martin Baulig <martin@ximian.com>
8483 * generics.cs (ConstructedType.ResolveType): Make the nested type
8484 stuff actually work.
8486 2004-02-25 Martin Baulig <martin@ximian.com>
8488 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
8489 property; returns the type parameters just from the current type,
8490 ie. with the ones from outer classes.
8491 (DeclSpace.LookupGeneric): First search in the current class, then
8493 (DeclSpace.initialize_type_params): When hiding a type parameter
8494 from an outer class, put it into the `type_param_list' anyways.
8496 * expression.cs (MemberAccess.expr): Made this field protected.
8498 * class.cs (TypeContainer.Define): The `CurrentType' just contains
8499 the type parameters from the current class.
8501 * generic.cs (ConstructedType.ResolveType): Support nested generic
8502 types by taking the type parameters which we inherit from outer
8503 classes into account.
8504 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
8505 support for nested generic types.
8507 2004-02-23 Martin Baulig <martin@ximian.com>
8509 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
8510 field and check whether we're nested inside a generic type.
8511 (DeclSpace.ResolveType): If we're resolving to a generic type
8512 definition, create a ConstructedType and return its resolved type.
8513 (DeclSpace.initialize_type_params): New private method;
8514 initializes the `type_param_list' field from the type parameters
8515 from this and all enclosing classes.
8516 (DeclSpace.TypeParameters): Call initialize_type_params() unless
8517 we're already initialized.
8519 2004-02-23 Martin Baulig <martin@ximian.com>
8521 * class.cs (Method.Define): Create the generic method before
8523 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
8524 the TypeContainer one); we use this for generic methods.
8526 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
8527 parent's TypeBuilder.
8529 2004-02-18 Martin Baulig <martin@ximian.com>
8531 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
8532 to check for equality.
8534 2004-02-05 Martin Baulig <martin@ximian.com>
8536 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
8537 `ec.TypeContainer.CurrentType', use it instead of
8538 `ec.ContainerType' to check whether we're in the type's ctor.
8540 2004-01-29 Martin Baulig <martin@ximian.com>
8542 * expression.cs (Invocation.DoResolve): If we're a
8543 `ConstructedType', then we're actually a generic method, so
8544 rewrite the expr as a GenericMemberAccess.
8546 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
8547 here; manually parse it into a string.
8549 2004-01-28 Martin Baulig <martin@ximian.com>
8551 * typemanager.cs (TypeManager.IsEqual): New static method.
8552 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
8553 check for equality instead of using `=='.
8555 2004-01-26 Martin Baulig <martin@ximian.com>
8557 * decl.cs (DeclSpace.CurrentType): New public field.
8559 * expression.cs (This.ResolveBase): If we have an
8560 `ec.TypeContainer.CurrentType', use it instead of
8563 * class.cs (TypeContainer.DefineType): If we're a generic type,
8564 create the `CurrentType' (unresolved).
8565 (TypeContainer.GenericType): New private field.
8566 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
8567 it and store it in `GenericType' before creating the MemberCache.
8568 (TypeContainer.GetMembers): If we have a `GenericType', call
8569 TypeManager.FindMembers() on it.
8571 * interface.cs (Interface.GenericType): New private field.
8572 (Interface.DefineType): If we're a generic type, create the
8573 `CurrentType' (unresolved).
8574 (Interface.DefineMembers): If we have a `CurrentType', resolve it
8575 and store it in `GenericType' before creating the MemberCache.
8576 (Interface.GetMembers): If we have a `GenericType', call
8577 TypeManager.FindMembers() on it.
8579 2004-01-22 Martin Baulig <martin@ximian.com>
8581 * cs-parser.jay (namespace_or_type_name): Return an Expression,
8582 not a QualifiedIdentifier. This is what `type_name_expression'
8583 was previously doing.
8584 (type_name_expression): Removed; the code is now in
8585 `namespace_or_type_name'.
8586 (qualified_identifier): Removed, use `namespace_or_type_name'
8588 (QualifiedIdentifier): Removed this class.
8590 2004-01-22 Martin Baulig <martin@ximian.com>
8592 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8593 not a string as alias name.
8595 2004-01-21 Miguel de Icaza <miguel@ximian.com>
8597 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8598 #52730 bug, and instead compute correctly the need to use a
8599 temporary variable when requesting an address based on the
8600 static/instace modified of the field and the constructor.
8602 2004-01-21 Martin Baulig <martin@ximian.com>
8604 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8605 class and namespace before looking up aliases. Fixes #52517.
8607 2004-01-21 Martin Baulig <martin@ximian.com>
8609 * flowanalysis.cs (UsageVector.Merge): Allow variables being
8610 assinged in a 'try'; fixes exception4.cs.
8612 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8613 * class.cs : Implemented parameter-less constructor for TypeContainer
8615 * decl.cs: Attributes are now stored here. New property OptAttributes
8617 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8619 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8621 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8623 * typemanager.cs (CSharpSignature): Now reports also inner class name.
8624 (CSharpSignature): New method for indexer and property signature.
8626 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8628 * pending.cs (IsVirtualFilter): Faster implementation.
8630 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8632 * typemanager.cs: Avoid inclusion of same assembly more than once.
8634 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8636 * cs-parser.jay: Fixed problem where the last assembly attribute
8637 has been applied also to following declaration (class, struct, etc.)
8639 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8641 * class.cs: Added error CS0538, CS0539 reporting.
8642 Fixed crash on Microsoft runtime when field type is void.
8644 * cs-parser.jay: Added error CS0537 reporting.
8646 * pending.cs: Added error CS0535 reporting.
8647 Improved error report for errors CS0536, CS0534.
8649 2004-01-20 Miguel de Icaza <miguel@ximian.com>
8651 Merge a few bits from the Anonymous Method MCS tree.
8653 * statement.cs (ToplevelBlock): New class for toplevel methods,
8654 will hold anonymous methods, lifted variables.
8656 * cs-parser.jay: Create toplevel blocks for delegates and for
8657 regular blocks of code.
8659 2004-01-20 Martin Baulig <martin@ximian.com>
8661 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8662 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8663 and `NeedExplicitReturn'; added `IsLastStatement'.
8664 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8665 have a `ReturnLabel' or we're not unreachable.
8667 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8668 child's reachability; don't just override ours with it. Fixes
8669 #58058 (lluis's example).
8670 (FlowBranching): Added public InTryOrCatch(), InCatch(),
8671 InFinally(), InLoop(), InSwitch() and
8672 BreakCrossesTryCatchBoundary() methods.
8674 * statement.cs (Return): Do all error checking in Resolve().
8675 Unless we are the last statement in a top-level block, always
8676 create a return label and jump to it.
8677 (Break, Continue): Do all error checking in Resolve(); also make
8678 sure we aren't leaving a `finally'.
8679 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8680 statement in a top-level block.
8681 (Block.Flags): Added `IsDestructor'.
8682 (Block.IsDestructor): New public property.
8684 2004-01-20 Martin Baulig <martin@ximian.com>
8686 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8688 2004-01-20 Martin Baulig <martin@ximian.com>
8690 * statement.cs (Statement.ResolveUnreachable): New public method.
8691 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8692 (Block.Resolve): Resolve unreachable statements.
8694 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
8696 * expression.cs: We need to fix the case where we do
8697 not have a temp variable here.
8699 * assign.cs: Only expression compound assignments need
8700 temporary variables.
8702 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
8704 * flowanalysis.cs: Reduce memory allocation in a few ways:
8705 - A block with no variables should not allocate a bit
8707 - A method with no out parameters does not need any tracking
8708 for assignment of the parameters, so we need not allocate
8711 public readonly Type[] VariableTypes;
8712 public readonly string[] VariableNames;
8713 Are redundant. The data is already stored in the variable
8714 map, so we need not allocate another array for it.
8715 - We need to add alot of checks for if (params | locals) == null
8716 due to the first two changes.
8718 2004-01-18 Miguel de Icaza <miguel@ximian.com>
8720 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8721 implement IMemoryLocation, we store a copy on a local variable and
8722 take the address of it. Patch from Benjamin Jemlich
8724 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8725 to use a special "type_name_expression" rule which reduces the
8726 number of "QualifiedIdentifier" classes created, and instead
8727 directly creates MemberAccess expressions.
8729 2004-01-17 Miguel de Icaza <miguel@ximian.com>
8731 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8732 that fixes #52853. Null literal assignment to ValueType
8734 * class.cs (MethodData.Emit): Instead of checking the name of the
8735 method to determine if its a destructor, create a new derived
8736 class from Method called Destructor, and test for that.
8738 * cs-parser.jay: Create a Destructor object instead of a Method.
8740 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8744 2004-01-16 Miguel de Icaza <miguel@ximian.com>
8746 * expression.cs (Binary.ResolveOperator): Perform an implicit
8747 conversion from MethodGroups to their delegate types on the
8750 * delegate.cs: Introduce a new class DelegateCreation that is the
8751 base class for `NewDelegate' and `ImplicitDelegateCreation',
8752 factor some code in here.
8754 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8755 conversion from MethodGroups to compatible delegate types.
8757 * ecore.cs (Expression.Resolve): Do not flag error 654
8758 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8759 we allow conversions from MethodGroups to delegate types now.
8761 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8762 assignments in v2 either.
8764 2004-01-10 Miguel de Icaza <miguel@ximian.com>
8766 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8767 static read-only fields in ctors.
8769 Applied patch from Benjamin Jemlich
8771 * expression.cs (UnaryMutator): Avoid leaking local variables.
8773 2004-01-09 Miguel de Icaza <miguel@ximian.com>
8775 * cs-tokenizer.cs (IsCastToken): Allow the various native types
8776 here to return true, as they can be used like this:
8780 Fixed 49836 and all the other dups
8782 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
8784 * driver.cs: Implement /win32res and /win32icon.
8786 2004-01-08 Miguel de Icaza <miguel@ximian.com>
8788 * cs-parser.jay: Add a rule to improve error handling for the
8789 common mistake of placing modifiers after the type.
8791 2004-01-07 Miguel de Icaza <miguel@ximian.com>
8793 * cs-parser.jay (interface_event_declaration): Catch
8794 initialization of events on interfaces, and report cs0068
8796 * cs-parser.jay (interface_event_declaration): Catch
8797 initialization of events.
8799 * ecore.cs: Better report missing constructors.
8801 * expression.cs (Binary.ResolveOperator): My previous bug fix had
8802 the error reporting done in the wrong place. Fix.
8804 * expression.cs (Binary.ResolveOperator): Catch the
8805 operator + (E x, E y) error earlier, and later allow for implicit
8806 conversions in operator +/- (E e, U x) from U to the underlying
8809 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8810 52596, if the container class is abstract, the default constructor
8811 is protected otherwise its public (before, we were always public).
8813 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8816 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8817 Jemlich that fixes bug #52597, MCS was generating invalid code for
8818 idisposable structs. Thanks to Ben for following up with this
8821 2004-01-06 Miguel de Icaza <miguel@ximian.com>
8823 * driver.cs: Allow assemblies without code to be generated, fixes
8826 2004-01-07 Nick Drochak <ndrochak@gol.com>
8828 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8830 2004-01-05 Miguel de Icaza <miguel@ximian.com>
8832 * cs-parser.jay: Add rules to improve error reporting if fields or
8833 methods are declared at the namespace level (error 116)
8835 * Add rules to catch event add/remove
8837 2004-01-04 David Sheldon <dave-mono@earth.li>
8839 * expression.cs: Added matching ")" to error message for
8842 2004-01-03 Todd Berman <tberman@gentoo.org>
8844 * ecore.cs, attribute.cs:
8845 Applying fix from #52429.
8847 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8849 * ecore.cs, expression.cs, statement.cs:
8850 Total rewrite of how we handle branching. We
8851 now handle complex boolean expressions with fewer
8852 jumps. As well if (x == 0) no longer emits a ceq.
8854 if (x is Foo) is much faster now, because we generate
8857 Overall, we get a pretty big improvement on our benchmark
8858 tests. The code we generate is smaller and more readable.
8860 I did a full two-stage bootstrap. The patch was reviewed
8861 by Martin and Miguel.
8863 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8865 * cs-parser.jay: Make primary_expression not take a QI.
8866 we dont need this because the member_access rule covers
8867 us here. So we replace the rule with just IDENTIFIER.
8869 This has two good effects. First, we remove a s/r conflict.
8870 Second, we allocate many fewer QualifiedIdentifier objects.
8872 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8874 * attribute.cs: Handle MarshalAs attributes as pseudo, and
8875 set the correct information via SRE. This prevents
8876 hanging on the MS runtime. Fixes #29374.
8878 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
8880 * convert.cs: correctly handle conversions to value types
8881 from Enum and ValueType as unboxing conversions.
8883 Fixes bug #52569. Patch by Benjamin Jemlich.
8885 2004-01-02 Ravi Pratap <ravi@ximian.com>
8887 * expression.cs (BetterConversion): Prefer int -> uint
8888 over int -> ulong (csc's behaviour). This fixed bug #52046.
8890 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
8892 * decl.cs (MemberCache.FindMembers): now returns a
8895 * typemanager.cs: In general, go with with ^^.
8896 (CopyNewMethods): take an IList.
8897 (RealMemberLookup): Only allocate an arraylist
8898 if we copy from two sets of methods.
8900 This change basically does two things:
8901 1) Fewer array lists allocated due to CopyNewMethods.
8902 2) the explicit cast in MemberList costed ALOT.
8904 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
8906 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8907 a hashtable to avoid needless string allocations when an identifier is
8908 used more than once (the common case).
8910 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
8912 * pending.cs: MS's TypeBuilder.GetInterfaces ()
8913 is broken, it will not return anything. So, we
8914 have to use the information we have in mcs to
8917 * typemanager.cs: Add a cache for GetInterfaces,
8918 since this will now be used more often (due to ^^)
8920 (GetExplicitInterfaces) New method that gets the
8921 declared, not effective, interfaces on a type
8922 builder (eg, if you have interface IFoo, interface
8923 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8926 This patch makes MCS able to bootstrap itself on
8929 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
8931 * expression.cs: Remove the Nop's that Miguel put
8934 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
8936 * report.cs, codegen.cs: Give the real stack trace to
8937 the error when an exception is thrown.
8939 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
8941 * decl.cs: only allocate hashtables for ifaces if
8944 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
8946 * expression.cs: fix the error from cs0121-2.cs
8947 (a parent interface has two child interfaces that
8948 have a function with the same name and 0 params
8949 and the function is called through the parent).
8951 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
8953 * class.cs, rootcontext.cs, typmanager.cs: do not
8956 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
8958 * codegen.cs: remove stack for the ec flow branching.
8959 It is already a linked list, so no need.
8961 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
8963 * Makefile: Allow custom profiler here.
8965 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
8967 * typemanager.cs (LookupType):
8968 - Use a static char [], because split takes
8969 a param array for args, so it was allocating
8971 - Do not store true in a hashtable, it boxes.
8973 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
8975 * flowanalysis.cs: bytify common enums.
8977 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
8979 * modifiers.cs: Add a new set of flags for the
8980 flags allowed on explicit interface impls.
8981 * cs-parser.jay: catch the use of modifiers in
8982 interfaces correctly.
8983 * class.cs: catch private void IFoo.Blah ().
8985 All related to bug #50572.
8987 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
8989 * decl.cs: Rewrite the consistant accessability checking.
8990 Accessability is not linear, it must be implemented in
8991 a tableish way. Fixes #49704.
8993 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
8995 * expression.cs: Handle negation in a checked context.
8996 We must use subtraction from zero. Fixes #38674.
8998 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9000 * class.cs: Ignore static void main in DLLs.
9001 * rootcontext.cs: Handle the target type here,
9002 since we are have to access it from class.cs
9003 * driver.cs: account for the above.
9005 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9007 * report.cs: Give line numbers and files if available.
9009 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
9011 * driver.cs: Implement /addmodule.
9013 * typemanager.cs: Change 'modules' field so it now contains Modules not
9016 2003-12-20 Martin Baulig <martin@ximian.com>
9018 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9019 (FieldBase.IsAssigned): Removed this field.
9020 (FieldBase.SetAssigned): New public method.
9021 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9023 2003-12-20 Martin Baulig <martin@ximian.com>
9025 * expression.cs (LocalVariableReference.DoResolve): Don't set
9026 `vi.Used' if we're called from DoResolveLValue().
9028 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9029 returns the usage vector it just merged into the current one -
9030 pass this one to UsageWarning().
9031 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9032 of the `EmitContext', don't call this recursively on our children.
9034 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
9036 * driver.cs: Implement /target:module.
9038 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
9040 * support.cs (CharArrayHashtable): New helper class.
9042 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
9043 char arrays, not strings, so we can avoid creating a string in
9044 consume_identifier if the identifier is a keyword.
9046 2003-12-16 Martin Baulig <martin@ximian.com>
9048 * statement.cs (LocalInfo.Assigned): Removed this property.
9049 (LocalInfo.Flags): Removed `Assigned'.
9050 (LocalInfo.IsAssigned): New public method; takes the EmitContext
9051 and uses flow analysis.
9052 (Block.UsageWarning): Made this method private.
9053 (Block.Resolve): Call UsageWarning() if appropriate.
9055 * expression.cs (LocalVariableReference.DoResolve): Always set
9056 LocalInfo.Used here.
9058 2003-12-13 Martin Baulig <martin@ximian.com>
9060 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9061 any value here; we're now using flow analysis to figure out
9062 whether a statement/block returns a value.
9064 2003-12-13 Martin Baulig <martin@ximian.com>
9066 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9068 (FlowBranching.MergeFinally): Don't call
9069 `branching.CheckOutParameters()' here, this is called in
9071 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9072 when adding the `finally' vector.
9074 2003-12-13 Martin Baulig <martin@ximian.com>
9077 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9078 actually work and also fix #48962.
9080 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
9082 * decl.cs: Do not check System.Object for nested types,
9083 since we know it does not have any. Big bang for buck:
9088 corlib: 17.99 seconds
9092 corlib: 17.39 seconds
9094 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
9096 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9097 time we are returning 0 members, so we save alot here.
9099 2003-12-11 Martin Baulig <martin@ximian.com>
9101 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9102 `MergeChild()', also just take the `FlowBranching' as argument;
9103 call Merge() on it and return the result.
9104 (FlowBranching.Merge): We don't need to do anything if we just
9107 2003-12-11 Martin Baulig <martin@ximian.com>
9109 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9110 them in an `ArrayList' to reduce memory usage. Thanks to Ben
9111 Maurer for this idea.
9113 2003-12-11 Martin Baulig <martin@ximian.com>
9115 * flowanalysis.cs (MergeResult): This class is now gone; we now
9116 use the `UsageVector' for this. The reason for this is that if a
9117 branching just has one sibling, we don't need to "merge" them at
9118 all - that's the next step to do.
9119 (FlowBranching.Merge): We now return a `UsageVector' instead of a
9122 2003-12-11 Martin Baulig <martin@ximian.com>
9124 Reworked flow analyis and made it more precise and bug-free. The
9125 most important change is that we're now using a special `Reachability'
9126 class instead of having "magic" meanings of `FlowReturns'. I'll
9127 do some more cleanups and optimizations and also add some more
9128 documentation this week.
9130 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9131 largely reworked this class.
9132 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9133 the new `Reachability' class instead of having "magic" values here.
9134 (FlowBranching): We're now using an instance of `Reachability'
9135 instead of having separate `Returns', `Breaks' etc. fields.
9137 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9138 based on flow analysis; ignore the return value of block.Emit ().
9140 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
9142 * driver.cs typemanager.cs: Find the mono extensions to corlib even
9143 if they are private.
9145 2003-12-09 Martin Baulig <martin@ximian.com>
9147 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9148 call them directly on the UsageVector.
9150 2003-12-09 Martin Baulig <martin@ximian.com>
9152 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9153 Changed return type from `FlowReturns' to `Reachability'.
9155 2003-12-09 Martin Baulig <martin@ximian.com>
9157 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9158 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9159 `Reachable' fields with a single `Reachability' one.
9161 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
9163 * class.cs (FindMembers): Remove foreach's.
9176 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
9181 This patch does a few things:
9182 1. EmptyStatement is now a singleton, so it is never reallocated.
9183 2. All blah is EmptyStatement constructs have been changed to
9184 blah == EmptyStatement.Value, which is much faster and valid
9185 now that EmptyStatement is a singleton.
9186 3. When resolving a block, rather than allocating a new array for
9187 the non-empty statements, empty statements are replaced with
9188 EmptyStatement.Value
9189 4. Some recursive functions have been made non-recursive.
9190 Mainly the performance impact is from (3), however (1) and (2) are needed for
9191 this to work. (4) does not make a big difference in normal situations, however
9192 it makes the profile look saner.
9197 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9198 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9199 Total memory allocated: 56397 KB
9202 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9203 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9204 Total memory allocated: 55666 KB
9206 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
9208 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9209 than the hashtable in a hashtable version
9211 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9212 we always end up concating a string. This results in a huge perf
9213 loss, because many strings have to be tracked by the GC. In this
9214 patch, we first use a hashtable that works with two keys, so that
9215 the strings do not need to be concat'ed.
9226 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
9228 * Makefile: Add a new target `do-time' that does a quick and simple
9229 profile, leaving easy to parse output.
9231 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
9233 * codegen.cs (Init): Create the dynamic assembly with
9234 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9236 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
9238 * support.cs: Make the PtrHashtable use only one
9239 instance of its comparer.
9241 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
9243 * typemanager.cs: Fix lookup of GetNamespaces.
9245 2003-11-29 Miguel de Icaza <miguel@ximian.com>
9247 * expression.cs: Removed redundant line.
9249 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9250 ArrayLists, use for loops with bounds.
9252 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9255 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9256 arraylists, use for loop with bounds.
9258 The above three changes give us a 0.071 second performance
9259 improvement out of 3.294 seconds down to 3.223. On my machine
9260 the above changes reduced the memory usage by 1,387 KB during
9263 * cs-parser.jay (QualifiedIdentifier): New class used to represent
9264 QualifiedIdentifiers. Before we created a new string through
9265 concatenation, and mostly later on, the result would be
9266 manipulated by DecomposeQI through string manipulation.
9268 This reduced the compiler memory usage for bootstrapping from
9269 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9270 compile times in 0.05 seconds.
9272 2003-11-28 Dick Porter <dick@ximian.com>
9274 * support.cs: Do string compares with the Invariant culture.
9282 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9283 the comparison is done with the Invariant culture.
9285 2003-11-27 Miguel de Icaza <miguel@ximian.com>
9287 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9288 GetEnumerator method.
9290 (ProbeCollectionType): Iterate starting at the most specific type
9291 upwards looking for a GetEnumerator
9293 * expression.cs: Shift count can be up to 31 for int/uint and 63
9296 2003-11-26 Miguel de Icaza <miguel@ximian.com>
9298 * statement.cs (Block.LookupLabel): Also look for the label on the
9299 children blocks. Use a hash table to keep track of visited
9302 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9303 we actually did transform the other operand, otherwise fall back
9304 to the common codepath that casts to long.
9306 * cs-tokenizer.cs: Use the same code pattern as the int case.
9307 Maybe I should do the parsing myself, and avoid depending on the
9308 Parse routines to get this done.
9310 2003-11-25 Miguel de Icaza <miguel@ximian.com>
9312 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
9313 which fixes bug 51347. This time test it.
9315 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9316 attributes for example can not tell the difference between these.
9317 The difference was only a syntax feature of the language.
9319 * attribute.cs: Apply attributes to delegates.
9321 * delegate.cs: Call the apply attributes method.
9323 2003-11-24 Miguel de Icaza <miguel@ximian.com>
9325 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9326 comparing 0 vs Byte.MinValue, not the value
9328 (ImplicitConversionRequired): When reporting a conversion error,
9329 use error 31 to print out the constant error instead of the
9332 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
9333 which fixes bug 51347.
9335 2003-11-22 Miguel de Icaza <miguel@ximian.com>
9337 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
9338 which fixes the -warnaserror command line option.
9340 2003-11-21 Miguel de Icaza <miguel@ximian.com>
9342 * cfold.cs (DoNumericPromotions): During constant folding of
9343 additions on UIntConstant, special case intconstants with
9344 IntConstants like we do on the expression binary operator.
9346 2003-11-12 Miguel de Icaza <miguel@ximian.com>
9348 * convert.cs (ImplicitReferenceConversion): We were missing a case
9349 (System.Enum are not value types or class types, so we need to
9350 classify them separatedly).
9352 * driver.cs: We do not support error 2007.
9354 2003-11-12 Jackson Harper <jackson@ximian.com>
9356 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9357 system directory. Also use the full file name so users can
9358 libraries names mscorlib-o-tron.dll in a non system dir.
9360 2004-01-04 David Sheldon <dave-mono@earth.li>
9362 * expression.cs: Added matching ")" to error message for CS0077.
9364 2003-12-19 Martin Baulig <martin@ximian.com>
9366 * typemanager.cs (TypeManager.IsEqualGenericType): New public
9367 static method; see documentation in the method.
9368 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
9370 * convert.cs (Convert.ImplicitReferenceConversion,
9371 Convert.ImplicitReferenceConversionExists): Add support for
9372 generic type declarations; see gen-36.cs.
9374 2003-12-19 Martin Baulig <martin@ximian.com>
9376 * pending.cs (Pending.InterfaceMethod): Use
9377 `Type.IsAssignableFrom()' instead of `=='.
9379 2003-12-18 Martin Baulig <martin@ximian.com>
9381 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
9384 * convert.cs (Convert.ImplicitStandardConversionExists): Use
9385 `expr_type.Equals (target_type)' instead of `=='.
9387 2003-12-08 Martin Baulig <martin@ximian.com>
9389 * generics.cs (Constraints.Types): Removed.
9390 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
9392 (Constraints.ResolveTypes): New public method; resolves the
9393 TypeExpr's to Type's.
9394 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
9395 longer takes the constraints.
9396 (TypeParameter.DefineMethod): Likewise.
9397 (TypeParameter.DefineType): New public method. Calls
9398 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
9401 2003-12-08 Martin Baulig <martin@ximian.com>
9403 * convert.cs (Convert.ImplicitConversionStandard): Use
9404 `expr_type.Equals (target_type)' instead of `=='.
9406 2003-12-08 Martin Baulig <martin@ximian.com>
9408 * typemanager.cs (TypeManager.GetReferenceType): Call
9409 `Type.MakeByRefType ()'.
9411 2003-12-08 Martin Baulig <martin@ximian.com>
9413 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
9414 just has some special meaning in some situations. For instance,
9415 it is allowed to use `where' as the name of a variable etc.
9417 2003-12-04 Martin Baulig <martin@ximian.com>
9419 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9420 `Type.MakeArrayType()' for array types.
9422 2003-11-18 Miguel de Icaza <miguel@ximian.com>
9424 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
9427 (SizeOf.DoResolve): assign the `type_queried' field. This gets
9430 2003-11-16 Martin Baulig <martin@ximian.com>
9432 * codegen.cs (EmitContext.IsGeneric): Removed.
9434 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
9435 ResolveGeneric() on the DeclSpace.
9437 2003-11-16 Martin Baulig <martin@ximian.com>
9439 * generic.cs (TypeArguments.Resolve):
9440 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
9441 `ResolveType()' on it to get the Type.
9443 2003-11-15 Martin Baulig <martin@ximian.com>
9445 * generic.cs (ConstructedType.GetInterfaces): Override this.
9447 2003-11-14 Martin Baulig <martin@ximian.com>
9449 * interface.cs (Interface.DefineType): Define all type parameters
9450 before adding the interfaces we inherit.
9452 2003-11-11 Martin Baulig <martin@ximian.com>
9454 * generic.cs (ConstructedType.ResolveType): Always call
9455 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
9457 2003-11-10 Martin Baulig <martin@ximian.com>
9459 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9460 (TypeManager.InitCoreTypes): Initialize them here, but instead of
9461 calling `ResolveType()' on them, directly assign their `Type'.
9463 2003-11-08 Martin Baulig <martin@ximian.com>
9465 * generic.cs (ConstructedType): Override `IsClass' etc.
9467 2003-11-08 Martin Baulig <martin@ximian.com>
9469 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9470 return value and the `out parent' parameter.
9471 (TypeContainer.DefineType): Moved the CS0644 check into
9472 GetClassBases(). Don't pass the interface types to the
9473 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9474 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9476 * ecore.cs (TypeExpr.IsAttribute): New property.
9477 (TypeExpr.GetInterfaces): New method.
9479 * interface.cs (Interface.GetInterfaceTypeByName): Return a
9480 TypeExpr instead of a Type.
9481 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9482 (Interface.DefineType): Don't pass the interface types to the
9483 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9484 them later and then call `TypeBulider.AddInterfaceImplementation()'.
9486 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9487 instead of a `Type[]'.
9488 (TypeManager.RegisterBuilder): Likewise.
9489 (TypeManager.AddUserInterface): Likewise.
9490 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9491 `Type[]' and also return a `TypeExpr[]'.
9492 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9494 2003-11-08 Martin Baulig <martin@ximian.com>
9496 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9499 2003-11-08 Martin Baulig <martin@ximian.com>
9501 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9502 TypeManager.ResolveExpressionTypes().
9504 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9505 instead of an Expression.
9506 (TypeExpr): This is now an abstract base class for `TypeExpression'.
9507 (TypeExpression): New public class; formerly known as `TypeExpr'.
9509 * expression.cs (ComposedCast): Derive from TypeExpr.
9511 * typemanager.cs (TypeManager.system_*_expr): These are now
9512 TypExpr's instead of Expression's.
9513 (TypeManager.ResolveExpressionTypes): New public static function;
9514 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9517 2003-11-06 Miguel de Icaza <miguel@ximian.com>
9519 * expression.cs (New.DoResolve): Do not dereference value that
9520 might be a null return.
9522 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9523 sure that the constant value has the right type. Fixes an
9524 unreported bug, similar to 50425.
9526 * const.cs (Const.LookupConstantValue): Call
9527 ImplicitStandardConversionExists before doing a conversion to
9528 avoid havng the TypeManager.ChangeType do conversions.
9530 Reduced the number of casts used
9532 (Const.ChangeType): New routine to enable reuse of the constant
9533 type changing code from statement.
9535 * typemanager.cs (ChangeType): Move common initialization to
9536 static global variables.
9540 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9541 every value type to go through, even if it was void. Fix that.
9543 * cs-tokenizer.cs: Use is_identifier_start_character on the start
9544 character of the define, and the is_identifier_part_character for
9545 the rest of the string.
9547 2003-11-05 Miguel de Icaza <miguel@ximian.com>
9549 * expression.cs (UnaryMutator.EmitCode): When I updated
9550 LocalVariableReference.DoResolve, I overdid it, and dropped an
9551 optimization done on local variable references.
9553 2003-11-04 Miguel de Icaza <miguel@ximian.com>
9555 * ecore.cs: Convert the return from Ldlen into an int.
9557 2003-10-20 Miguel de Icaza <miguel@ximian.com>
9559 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9560 the accessibility, this is a special case for toplevel non-public
9561 classes (internal for instance).
9563 2003-10-20 Nick Drochak <ndrochak@gol.com>
9565 * ecore.cs: Fix typo and build. Needed another right paren.
9567 2003-10-19 Miguel de Icaza <miguel@ximian.com>
9569 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
9570 `internal' case regular and protected, but not allowing protected
9571 to be evaluated later. Bug 49840
9573 2003-10-15 Miguel de Icaza <miguel@ximian.com>
9575 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9576 to kb.Nlast, and not the kb.nFirst to isolate the switch
9579 Extract the underlying type, so enumerations of long/ulong are
9580 treated like long/ulong.
9582 2003-10-14 Miguel de Icaza <miguel@ximian.com>
9584 * expression.cs (New): Overload the meaning of RequestedType to
9585 track the possible creation of the NewDelegate type, since
9586 DoResolve is invoked more than once for new constructors on field
9589 See bugs: #48800 and #37014
9591 * cs-parser.jay (declare_local_constants): Take an arraylist
9592 instead of a single constant.
9594 (local_constant_declaration): It should take a
9595 constant_declarators, not a constant_declarator. Fixes 49487
9597 * convert.cs: Fix error report.
9599 2003-10-13 Jackson Harper <jackson@ximian.com>
9601 * typemanager.cs (TypeToCoreType): Add float and double this fixes
9604 2003-11-03 Martin Baulig <martin@ximian.com>
9606 * expression.cs (ArrayAccess.GetStoreOpcode): Added
9607 `out bool has_type_arg'; if set, we need to pass the type to
9609 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
9610 Stelem_Any/Ldelem_Any for generic parameters.
9612 2003-11-02 Martin Baulig <martin@ximian.com>
9614 * expression.cs (Invocation.EmitCall): Use
9615 `TypeManager.IsValueType()' to check whether it's a value type.
9616 Don't set `struct_call' when calling a method on a type parameter.
9618 2003-11-02 Martin Baulig <martin@ximian.com>
9620 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
9621 and removed the TypeBuilder argument.
9623 * typemanager.cs (TypeManager.IsValueType): Return
9624 `t.IsGenericParameter || t.IsValueType'.
9626 2003-10-25 Martin Baulig <martin@ximian.com>
9628 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
9629 call ConstructedType.Resolve() on it.
9631 * generic.cs (ConstructedType.Resolve): Set `type' on success.
9633 2003-10-25 Martin Baulig <martin@ximian.com>
9635 * class.cs (TypeContainer.GetClassBases): Changed
9636 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
9637 CS8214 reporting here.
9638 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
9639 instead of a `Type' for our parent. In case of a recursive
9640 declaration (see tests/gen-23.cs for an example), our parent is a
9641 ConstructedType and it doesn't have its type set. So, first
9642 create our own TypeBuilder, then call constructed.Resolve() to get
9643 the parent's type and finally TypeBuilder.SetParent() it.
9645 * ecore.cs (TypeExpr.Name): New public virtual property.
9648 (ConstructedType): We're now a TypeExpr and not just an Expression.
9649 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
9650 arguments here; this is done later.
9651 (ConstructedType.Resolve): New public method to resolve the type
9652 arguments and bind them.
9654 2003-10-21 Martin Baulig <martin@ximian.com>
9656 * convert.cs: Use `TypeManager.IsValueType' instead of
9657 'type.IsValueType' everywhere.
9659 * typemanager.cs (TypeManager.IsValueType): Return true for type
9660 parameters. The reason for this is that we need to box a type
9661 parameter when converting it to a reference type.
9663 * cs-parser.jay: Added support for default value expressions.
9665 * generics.cs (DefaultValueExpression): New public class.
9667 2003-10-17 Martin Baulig <martin@ximian.com>
9669 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
9670 TypeContainer so we can also use this for Interfaces.
9671 (TypeParameter.Resolve): Likewise.
9673 * interface.cs (Interface.DefineType): Added support for generic
9676 * cs-parser.jay: Added support for generic structs and interfaces.
9678 2003-10-17 Martin Baulig <martin@ximian.com>
9680 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
9681 call generic methods :-)
9683 2003-10-16 Martin Baulig <martin@ximian.com>
9685 * cs-parser.jay (namespace_or_type_name): Only create a
9686 GenericMemberAccess if we actually have type arguments.
9688 2003-10-13 Martin Baulig <martin@ximian.com>
9690 * class.cs (Method.Define): If we're a generic method, call
9691 TypeBuilder.DefineGenericMethod () before resolving
9693 (MethodData): Added .ctor which takes an additional MethodBuilder
9694 argument; this is used for generic methods.
9695 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
9696 we already have a MethodBuilder.
9698 2003-10-10 Martin Baulig <martin@ximian.com>
9700 * class.cs (Method): Added .ctor which takes a `GenericMethod'
9701 instead of a `DeclSpace'. This is used for generic methods.
9703 * cs-parser.jay (method_header): Added support for generic
9704 methods; create a `GenericMethod' instance and pass it to the
9705 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
9706 parameters and locals.
9708 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
9709 since we already have the location. Check whether we're a generic
9710 type declaration or a generic method and create the correct type
9713 * generic.cs (TypeParameter.DefineMethod): New public method.
9714 (GenericMethod): New public class; derives from DeclSpace and is
9715 used for generic methods.
9717 2003-10-09 Martin Baulig <martin@ximian.com>
9719 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9721 (MethodCore.DoDefineParameters): Removed the TypeContainer
9722 argument; use the DeclSpace which was passed to the .ctor instead.
9723 (MethodCore.CheckParameter): Take a DeclSpace instead of a
9724 TypeContainer; we only need a DeclSpace here.
9726 2003-10-09 Martin Baulig <martin@ximian.com>
9728 * class.cs (MethodData): Added additional `DeclSpace ds' argument
9730 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9731 EmitContext's .ctor.
9733 2003-10-09 Martin Baulig <martin@ximian.com>
9735 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9736 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9737 AsAccessible(), moved them as well.
9739 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9741 2003-10-07 Miguel de Icaza <miguel@ximian.com>
9743 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9744 generation for >=, as spotted by Paolo, bug 48679.
9745 Patch from David Waite.
9747 * cs-tokenizer.cs: Add handling for #pragma.
9749 * cs-parser.jay: Allow for both yield and yield return in the
9750 syntax. The anti-cobolization of C# fight will go on!
9752 * class.cs (TypeBuilder.DefineType): Catch error condition here
9753 (Parent.DefineType erroring out and returning null).
9755 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9756 coping with enumerations variables, we were mistakenly processing
9757 them as a regular value type instead of built-in types. Fixes the
9760 * typemanager.cs (IsBuiltinOrEnum): New method.
9762 2003-09-30 Miguel de Icaza <miguel@ximian.com>
9764 * cs-parser.jay: Upgrade: yield now needs the return clause.
9766 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9768 * cs-parser.jay : Renamed yyName to yyNames related to jay.
9770 2003-09-29 Martin Baulig <martin@ximian.com>
9772 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
9773 inflated generic methods.
9775 * generics.cs (ConstructedType): Distinguish between open and
9776 closed constructed types; correctly resolve the arguments.
9778 2003-09-22 Martin Baulig <martin@ximian.com>
9780 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
9781 all type arguments meet their constraints.
9783 2003-09-19 Martin Baulig <martin@ximian.com>
9785 * decl.cs (MemberCache.SetupCacheForInterface): Take a
9786 `MemberCache parent' argument. Normally, an interface doesn't
9787 have a parent type except System.Object, but we use this in gmcs
9788 for generic type parameters.
9790 2003-09-18 Martin Baulig <martin@ximian.com>
9792 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9793 on `type.IsInterface'; don't check whether the type has a parent
9794 to determine whether it's an interface.
9796 2003-09-17 Martin Baulig <martin@ximian.com>
9798 * generic.cs (ConstructedType.ToString): Always use `name' as the
9801 2003-09-15 Martin Baulig <martin@ximian.com>
9803 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
9805 * generic.cs (Constraints.Resolve): New public method; this is
9806 called to resolve the constraint types and to check whether all
9807 the constraints are correct.
9808 (Constraints.Types): New public property.
9809 (TypeParameter.Resolve): New public method; resolves all the
9812 * class.cs (TypeContainer.DefineType): Call
9813 TypeParameter.Resolve() before actually defining the type.
9815 2003-09-15 Martin Baulig <martin@ximian.com>
9817 * class.cs (TypeContainer.DefineType): Added an error flag to
9818 avoid reporting duplicate CS0146's ("class definition is
9821 * driver.cs (Driver.MainDriver): Abort if
9822 RootContext.ResolveTree() reported any errors.
9824 2003-09-07 Martin Baulig <martin@ximian.com>
9826 * report.cs (Error, Warning): Added overloaded versions which take
9827 a `params object[] args' and call String.Format().
9829 2003-09-07 Martin Baulig <martin@ximian.com>
9831 * decl.cs (DeclSpace..ctor): Don't call
9832 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9833 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
9834 (DeclSpace.RecordDecl): New method.
9836 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9838 2003-09-02 Ravi Pratap <ravi@ximian.com>
9840 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9841 value attributes to be applied to ParameterBuilders.
9843 * class.cs (MethodCore.LabelParameters): Make static and more
9844 generic so that it can be used from other places - like interface
9845 methods, for instance.
9847 * interface.cs (Interface.Emit): Call LabelParameters before
9848 emitting attributes on the InterfaceMethod.
9850 2003-09-07 Martin Baulig <martin@ximian.com>
9852 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
9853 if the number of type parameters doesn't match.
9855 2003-09-04 Martin Baulig <martin@ximian.com>
9857 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
9858 for arrays of generic type params (ie. `!0[]').
9860 2003-09-04 Martin Baulig <martin@ximian.com>
9862 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
9865 2003-09-04 Martin Baulig <martin@ximian.com>
9867 * decl.cs (DeclSpace.LookupGeneric): New method.
9868 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
9871 * generic.cs (TypeParameterExpr): Take a TypeParameter as
9872 argument, not just a string.
9873 (TypeParameter.Define): New public method; this is called to
9874 actually define the generic parameter; after this, you can use the
9875 new `Type' property to get the type.
9877 2003-09-04 Martin Baulig <martin@ximian.com>
9879 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
9880 is now an ArrayList; initialize the result of the `TypeParameters'
9882 (DeclSpace.GetGenericData): Removed.
9883 (DeclSpace.LookupGeneric): Temporarily removed; we need to
9884 implement this in a different way.
9885 (DeclSpace.GetTypeParameters): Removed; there's now a
9886 `TypeParameters' property.
9887 (DeclSpace.TypeParameters): New public property.
9889 * generic.cs (Constraints): Make this class public.
9890 (TypeParameter): New public class.
9892 2003-09-04 Martin Baulig <martin@ximian.com>
9894 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
9897 * class.cs (TypeContainer.DefineType): Call
9898 TypeBuilder.DefineGenericParameter () on all generic parameters if
9899 this is a generic type.
9901 2003-08-28 Martin Baulig <martin@ximian.com>
9903 * sample-stack.il: Compile this with ilasm: "ilasm /dll
9906 * sample-hello.cs: Compile this with gmcs: "gmcs
9907 /r:sample-stack.dll sample-hello.cs".
9909 2003-08-28 Martin Baulig <martin@ximian.com>
9911 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
9912 the parameters to the generic type.
9914 2003-08-28 Martin Baulig <martin@ximian.com>
9916 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
9918 2003-08-28 Martin Baulig <martin@ximian.com>
9920 * cs-parser.jay (opt_type_argument_list): Use
9921 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
9922 (primary_expression): Replace `qualified_identifier' with `type_name'.
9923 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
9925 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
9926 parser to check whether it is syntactically a type parameter list;
9927 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
9930 2003-08-26 Martin Baulig <martin@ximian.com>
9932 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9933 resolving aliases; fixes #47927.
9935 2003-08-26 Martin Baulig <martin@ximian.com>
9937 * statement.cs (Using.DoResolve): This is internally emitting a
9938 try/finally clause, so we need to set ec.NeedExplicitReturn if we
9939 do not always return. Fixes #47681.
9941 2003-08-26 Martin Baulig <martin@ximian.com>
9943 * decl.cs (MemberCore): Moved WarningNotHiding(),
9944 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9946 (AdditionResult): Make this nested in DeclSpace.
9947 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9948 argument; call NamespaceEntry.Define() unless we're nested in a
9951 * namespace.cs (Namespace.DefineName): New public function. This
9952 is called from DeclSpace's .ctor to add
9953 (Namespace.Lookup): Include DeclSpaces in the lookup.
9955 * class.cs (Operator): Derive from MemberBase, not MemberCore.
9957 * const.cs (Const): Derive from MemberBase, not MemberCore.
9959 2003-08-25 Martin Baulig <martin@ximian.com>
9961 * convert.cs (Convert.ExplicitReferenceConversion): When
9962 converting from an interface type to a class, unbox if the target
9963 type is a struct type. Fixes #47822.
9965 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9967 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9970 2003-08-22 Martin Baulig <martin@ximian.com>
9972 * class.cs (TypeManager.DefineType): When defining a nested type,
9973 call DefineType() on our parent; fixes #47801.
9975 2003-08-22 Martin Baulig <martin@ximian.com>
9977 * class.cs (MethodData.Define): While checking if a method is an
9978 interface implementation, improve the test a bit more to fix #47654.
9980 2003-08-22 Martin Baulig <martin@ximian.com>
9982 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9983 correctly; fixes #47722.
9985 2003-08-22 Martin Baulig <martin@ximian.com>
9987 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9988 LocalVariableReference, ensure it's not read-only. Fixes #47536.
9990 * statement.cs (Fixed.DoResolve): Make all variables read-only.
9992 2003-08-22 Martin Baulig <martin@ximian.com>
9994 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9995 can only be assigned in static constructors. Fixes #47161.
9997 2003-08-22 Martin Baulig <martin@ximian.com>
9999 Rewrote and improved the flow analysis code.
10001 * flowbranching.cs (FlowBranching): Make this class abstract.
10002 (FlowBranching.CreateBranching): New static function to create a
10003 new flow branching.
10004 (FlowBranchingBlock, FlowBranchingException): New classes.
10005 (FlowBranching.UsageVector.Type): New public readonly field.
10006 (FlowBranching.UsageVector.Breaks): Removed the setter.
10007 (FlowBranching.UsageVector.Returns): Removed the setter.
10008 (FlowBranching.UsageVector): Added Break(), Return(),
10009 NeverReachable() and Throw() methods to modify the reachability.
10010 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10011 done by FlowBranching.Merge().
10012 (FlowBranching.UsageVector.MergeChild): New method; merges the
10013 merge result into the current vector.
10014 (FlowBranching.Merge): New abstract method to merge a branching.
10016 2003-08-12 Martin Baulig <martin@ximian.com>
10018 * expression.cs (Indirection.CacheTemporaries): Create the
10019 LocalTemporary with the pointer type, not its element type.
10021 2003-08-10 Miguel de Icaza <miguel@ximian.com>
10023 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10024 token was a keyword or not.
10026 Add `error' options where an IDENTIFIER was expected; Provide
10027 CheckToken and CheckIdentifierToken convenience error reporting
10030 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10032 * decl.cs: Rename `NamespaceEntry Namespace' public field into
10033 NameSpaceEntry NameSpaceEntry.
10035 (LookupInterfaceOrClass): Avoid creating a full qualified name
10036 from namespace and name: avoid doing lookups when we know the
10037 namespace is non-existant. Use new Tree.LookupByNamespace which
10038 looks up DeclSpaces based on their namespace, name pair.
10040 * driver.cs: Provide a new `parser verbose' to display the
10041 exception thrown during parsing. This is turned off by default
10042 now, so the output of a failure from mcs is more graceful.
10044 * namespace.cs: Track all the namespaces defined in a hashtable
10047 (IsNamespace): New method
10049 2003-08-09 Miguel de Icaza <miguel@ximian.com>
10051 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
10052 we know that we need to concatenate (full typename can never be
10057 * statement.cs: Use a bitfield; Do not initialize to null things
10058 which are done by the constructor by default.
10060 * cs-parser.jay: bug fix, parameter was 4, not 3.
10062 * expression.cs: Just use the property;
10064 * statement.cs: No need for GetVariableInfo method.
10066 2003-08-08 Martin Baulig <martin@ximian.com>
10068 * flowanalysis.cs (FlowReturns): This is now nested in the
10069 `FlowBranching' class.
10070 (MyBitVector): Moved this here from statement.cs.
10071 (FlowBranching.SiblingType): New enum type.
10072 (FlowBranching.CreateSibling): Added `SiblingType' argument.
10074 2003-08-07 Martin Baulig <martin@ximian.com>
10076 * flowanalysis.cs (FlowBranchingType): This is now nested in the
10077 `FlowBranching' class and called `BranchingType'.
10079 2003-08-07 Martin Baulig <martin@ximian.com>
10081 * flowanalysis.cs: Moved all the control flow analysis code into
10084 2003-08-07 Martin Baulig <martin@ximian.com>
10086 * assign.cs (Assign.DoResolve): `target' must either be an
10087 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
10090 2003-08-07 Miguel de Icaza <miguel@ximian.com>
10092 * expression.cs (BinaryMethod): This kind of expression is created by the
10093 Binary class if it determines that the operator has to be handled
10096 (BinaryDelegate): This kind of expression is created if we are
10097 dealing with a + or - operator on delegates.
10099 (Binary): remove method, argumetns, and DelegateOperator: when
10100 dealing with methods,
10102 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10104 * statement.cs (Block): use bitfields for the three extra booleans
10105 we had in use. Remove unused topblock parameter.
10107 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10109 * assign.cs: Drop extra unneeded tests.
10111 2003-08-06 Miguel de Icaza <miguel@ximian.com>
10113 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10115 * statement.cs (Foreach): Use VariableStorage instead of
10118 * codegen.cs (VariableStorage): New class used by clients that
10119 require a variable stored: locals or fields for variables that
10120 need to live across yield.
10122 Maybe provide a convenience api for EmitThis+EmitLoad?
10124 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
10127 2003-08-05 Miguel de Icaza <miguel@ximian.com>
10129 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
10130 RemapParameterLValue): New methods that are used to turn a
10131 precomputed FieldInfo into an expression like this:
10135 The idea is to use this instead of making LocalVariableReference
10136 have more than one meaning.
10138 * cs-parser.jay: Add error production to BASE.
10140 * ecore.cs: Deal with TypeManager.GetField returning null, which
10141 is now a valid return value.
10143 (FieldExprNoAddress): New expression for Fields whose address can
10146 * expression.cs (LocalVariableReference): During the resolve
10147 phases, create new expressions if we are in a remapping context.
10148 Remove code that dealt with remapping here.
10150 (ParameterReference): same.
10152 (ProxyInstance): New expression, like the `This' expression, but
10153 it is born fully resolved. We know what we are doing, so remove
10154 the errors that are targeted to user-provided uses of `this'.
10156 * statement.cs (Foreach): our variable is now stored as an
10157 Expression; During resolution, follow the protocol, dont just
10158 assume it will return this.
10160 2003-08-06 Martin Baulig <martin@ximian.com>
10162 * support.cs (SeekableStreamReader.cs): New public class.
10164 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
10165 SeekableStreamReader instead of the normal StreamReader.
10167 2003-08-04 Martin Baulig <martin@ximian.com>
10169 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
10170 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
10171 deambiguate casts and delegate invocations.
10172 (parenthesized_expression): Use the new tokens to ensure this is
10173 not a cast of method invocation.
10175 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
10176 when reading a `)' and Deambiguate_CloseParens () was previously
10179 * expression.cs (ParenthesizedExpression): New class. This is
10180 just used for the CS0075 test.
10181 (Binary.DoResolve): Check for CS0075.
10183 2003-07-29 Ravi Pratap <ravi@ximian.com>
10185 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
10186 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
10187 reference comparison.
10189 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
10190 examine the ReturnType for equality - this is necessary in the
10191 cases of implicit and explicit operators whose signature also
10192 includes the return type.
10194 2003-07-26 Miguel de Icaza <miguel@ximian.com>
10196 * namespace.cs: Cache the result of the namespace computation,
10197 instead of computing it every time.
10199 2003-07-24 Miguel de Icaza <miguel@ximian.com>
10201 * decl.cs: Use a global arraylist that we reuse over invocations
10202 to avoid excesive memory consumption. Reduces memory usage on an
10203 mcs compile by one meg (45 average).
10205 * typemanager.cs (LookupTypeReflection): In .NET pointers are
10206 private, work around that.
10208 2003-07-23 Miguel de Icaza <miguel@ximian.com>
10210 * literal.cs (IntLiteral): Define Zero and One static literals.
10212 * cs-parser.jay (integer_literal): use static literals to reduce
10213 memory usage for the most used literals (0, 1 and -1). 211kb
10214 reduced in memory usage.
10216 Replace all calls to `new ArrayList' with `new
10217 ArrayList(4)' which is a good average number for most allocations,
10218 and also requires only 16 bytes of memory for its buffer by
10221 This reduced MCS memory usage in seven megabytes for the RSS after
10224 2003-07-28 Ravi Pratap <ravi@ximian.com>
10226 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10227 handle params methods the correct way by forming only one
10228 applicable set with params and normal methods in them. Earlier we
10229 were looking at params methods only if we found no normal methods
10230 which was not the correct thing to do.
10232 (Invocation.BetterFunction): Take separate arguments indicating
10233 when candidate and the best method are params methods in their
10236 This fixes bugs #43367 and #46199.
10238 * attribute.cs: Documentation updates.
10240 (CheckAttribute): Rename to CheckAttributeTarget.
10241 (GetValidPlaces): Rename to GetValidTargets.
10243 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10244 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10248 2003-07-28 Miguel de Icaza <miguel@ximian.com>
10250 * codegen.cs: Compute IsGeneric correctly.
10252 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
10255 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
10256 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
10257 regressions, and I was chasing more bugs than I required.
10259 * interface.cs: Use expressions for base type names (like classes
10260 and structs have been doing for a while now), and resolve that.
10261 This patch should probably go into head as well.
10263 This makes it one less user of FindType.
10265 2003-07-24 Miguel de Icaza <miguel@ximian.com>
10267 This compiler can not self host currently. Need to fix that.
10269 * Makefile: compile to `gmcs.exe'
10271 * driver.cs: Turn on v2 by default on gmcs.
10273 * generic.cs (ConstructedType): Does no longer take a container
10274 type argument; That will be taken care of later.
10276 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
10277 Use SimpleName to resolve for now, so we can continue the work on
10278 the parser, until we get Type.GetType that understands generics.
10280 (ConstructedType.ToString): Implement
10282 (TypeArguments.Resolve): Resolve the child expressions as types.
10284 * cs-parser.jay: Rename interface_constraints to
10285 type_parameter_constraints
10287 (namespace_or_type_name): Only use constructed types for the basic
10288 construction, we will deal with identifier<...> later.
10290 (type/type_name): No longer call DecomposeQI, as
10291 namespace_or_type_name is always decoded now.
10293 2003-07-22 Ravi Pratap <ravi@ximian.com>
10295 * expression.cs (Invocation.OverloadResolve): Follow the spec more
10296 closely: we eliminate methods in base types when we have an
10297 applicable method in a top-level type.
10299 Please see section 14.5.5.1 for an exact description of what goes
10302 This fixes bug #45127 and a host of other related to corlib compilation.
10304 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10305 array is the method corresponding to the top-level type (this is
10306 because of the changes made to icall.c) so we change this
10309 (MethodGroupExpr.Name): This too.
10311 * typemanager.cs (GetElementType): New method which does the right
10312 thing when compiling corlib.
10314 * everywhere: Make use of the above in the relevant places.
10316 2003-07-22 Martin Baulig <martin@ximian.com>
10318 * cs-parser.jay (invocation_expression): Moved
10319 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10320 `cast_expression', but create a InvocationOrCast which later
10321 resolves to either an Invocation or a Cast.
10323 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10324 method; call this before EmitStatement() to make sure that this
10325 expression can be used as a statement.
10327 * expression.cs (InvocationOrCast): New class; resolves to either
10328 an Invocation or a Cast.
10330 * statement.cs (StatementExpression): Call ResolveStatement() on
10331 the ExpressionStatement before emitting it.
10333 2003-07-21 Martin Baulig <martin@ximian.com>
10335 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10336 `ref' and `out' attributes match; fixes #46220.
10337 (MemberAccess.ResolveMemberAccess): You can't reference a type
10338 through an expression; fixes #33180.
10339 (Indexers.GetIndexersForType): Don't return the indexers from
10340 interfaces the class implements; fixes #46502.
10342 2003-07-21 Martin Baulig <martin@ximian.com>
10344 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10345 CS0661 checks; fixes bug #30442.
10347 2003-07-21 Martin Baulig <martin@ximian.com>
10349 * decl.cs (AdditionResult): Added `Error'.
10351 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10353 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
10354 cs0031.cs actually work.
10356 2003-07-20 Miguel de Icaza <miguel@ximian.com>
10358 * cs-parser.jay (namespace_name): do not use
10359 namespace_or_type_name, use qualified_identifier, because
10360 namespace_or_type_name will soon return a composed expression
10361 instead of a string.
10363 (namespace_or_type_name): Instead of returning a string, now this
10364 production returns an expression.
10366 * codegen.cs (EmitContext): Setup IsGeneric property based on
10367 whether our DeclSpace is generic, our the method is generic.
10369 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
10370 the method is generic.
10372 * cs-parser.jay (type_arguments, opt_type_argument_list,
10373 type_parameters, type_parameter_list, opt_type_parameter_list,
10374 type_parameter,, opt_type_parameter_constraints_clauses,
10375 type_parameter_constraints_clauses,
10376 type_parameter_constraint_clause, type_parameter_constraint,
10377 interface_constraints): Add new production
10379 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
10380 DeclSpace is generic or not.
10382 (DeclSpace.SetParameterInfo): New routine, used to set the
10383 parameter info for a type.
10385 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
10386 returns a GenericTypeExpr
10388 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
10389 generic, lookup the generic argument.
10391 * attribute.cs: Do not allow TypeParameterExpressions in
10394 * class.cs: Do not allow the Main method to be defined in a
10397 * expression.cs (SizeOf): Do not allow generic types to be used as
10398 arguments to sizeof.
10400 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
10401 it: whether a type is generic or not. Only works for types we are
10402 currently building for now.
10404 2003-07-20 Martin Baulig <martin@ximian.com>
10406 * namespace.cs: Fixed that bug which caused a crash when compiling
10407 the debugger's GUI.
10409 2003-07-20 Miguel de Icaza <miguel@ximian.com>
10411 * typemanager.cs (LookupTypeReflection): Never expose types which
10412 are NotPublic, NestedPrivate, NestedAssembly, or
10413 NestedFamANDAssem. We used to return these, and later do a check
10414 that would report a meaningful error, but the problem is that we
10415 would not get the real match, if there was a name override.
10417 2003-07-18 Miguel de Icaza <miguel@ximian.com>
10419 * namespace.cs (Namespace, Name): Do not compute the namespace
10420 name dynamically, compute it in the constructor. This reduced
10421 memory usage by 1697 KB.
10423 * driver.cs: Use --pause to pause at the end.
10425 2003-07-17 Peter Williams <peter@newton.cx>
10427 * Makefile: Change the name of the test target so that it doesn't
10428 conflict with the recursive test target.
10430 2003-07-17 Miguel de Icaza <miguel@ximian.com>
10432 * expression.cs (LocalVariableReference.Emit, EmitAssign,
10433 AddressOf): Do not use EmitThis, that was wrong, use the actual
10436 2003-07-15 Miguel de Icaza <miguel@ximian.com>
10438 * class.cs (MethodData.Define): While checking if a method is an
10439 interface implementation, improve the test: If we are not public
10440 (use new test here: use the computed MethodAttributes directly,
10441 instead of the parsed modifier flags) check if the `implementing'
10442 method comes from an interface or not.
10444 * pending.cs (VerifyPendingMethods): Slightly better error
10447 * makefile: add test target that does the mcs bootstrap.
10449 2003-07-16 Ravi Pratap <ravi@ximian.com>
10451 * interface.cs (Define): Do nothing here since there are no
10452 members to populate etc. Move the attribute emission out of here
10453 since this was just totally the wrong place to put it. Attribute
10454 application happens during the 'Emit' phase, not in the 'Define'
10457 (Emit): Add this method and move the attribute emission here
10459 * rootcontext.cs (EmitCode): Call the Emit method on interface
10462 2003-07-14 Ravi Pratap M <ravi@ximian.com>
10464 * expression.cs (OverloadResolve): Report error only if Location
10465 is not 'Null' which means that there was a probe going on.
10467 2003-07-14 Martin Baulig <martin@ximian.com>
10469 * expression.cs (ConditionalLogicalOperator): New public class to
10470 implement user defined conditional logical operators.
10471 This is section 14.11.2 in the spec and bug #40505.
10473 2003-07-14 Martin Baulig <martin@ximian.com>
10475 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10477 2003-07-14 Martin Baulig <martin@ximian.com>
10479 * codegen.cs (EmitContext.InFixedInitializer): New public field.
10481 * ecore.cs (IVariable.VerifyFixed): New interface method.
10483 * expression.cs (Unary.ResolveOperator): When resolving the `&'
10484 operator, check whether the variable is actually fixed. Fixes bug
10485 #36055. Set a variable definitely assigned when taking its
10486 address as required by the spec.
10488 * statement.cs (LocalInfo.IsFixed): New field.
10489 (LocalInfo.MakePinned): Set `IsFixed' to true.
10491 2003-07-14 Ravi Pratap M <ravi@ximian.com>
10493 * attribute.cs (Attribute.Resolve): While doing a Member lookup
10494 for .ctors, ensure that we only ask for members declared in the
10495 attribute type (BindingFlags.DeclaredOnly).
10499 * expression.cs (Error_WrongNumArguments): Report error 1501
10500 correctly the way CSC does.
10502 2003-07-13 Martin Baulig <martin@ximian.com>
10504 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10505 lookup on the fully qualified name, to make things like "X.X" work
10506 where "X.X" is a fully qualified type name, but we also have a
10507 namespace "X" in the using list. Fixes #41975.
10509 2003-07-13 Martin Baulig <martin@ximian.com>
10511 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10512 function. If we're a CompoundAssign, we need to create an embedded
10513 CompoundAssign, not an embedded Assign.
10514 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10517 2003-07-13 Martin Baulig <martin@ximian.com>
10519 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10520 work to fix bug #46088.
10522 2003-07-13 Ravi Pratap <ravi@ximian.com>
10524 * class.cs (Operator.Emit): Do not emit attributes here - it is
10525 taken care of by the Method class that we delegate too. This takes
10526 care of bug #45876.
10528 2003-07-10 Martin Baulig <martin@ximian.com>
10530 * expression.cs (TypeOfVoid): New class.
10531 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
10533 2003-07-10 Martin Baulig <martin@ximian.com>
10535 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10538 2003-07-10 Martin Baulig <martin@ximian.com>
10540 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10541 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10543 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10545 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10547 2003-07-10 Martin Baulig <martin@ximian.com>
10549 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10550 of decimal. Fixes #42850.
10552 NOTE: I also fixed the created byte blob, but this doesn't work on
10553 the MS runtime and csc never produces any byte blobs for decimal
10556 2003-07-10 Martin Baulig <martin@ximian.com>
10558 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10559 structs; fixes #32068.
10560 (Block.AddChildVariableNames): Fixed #44302.
10562 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10564 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10566 2003-07-07 Miguel de Icaza <miguel@ximian.com>
10568 * attribute.cs: And this test is onger needed.
10570 2003-07-08 Martin Baulig <martin@ximian.com>
10572 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10573 inaccessible types. Fixes #36313.
10575 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10577 * namespace.cs (NamespaceEntry): Create implicit entries for all
10578 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10579 implicit entries for N1.N2 and N1.
10581 2003-07-08 Martin Baulig <martin@ximian.com>
10583 Rewrote the handling of namespaces to fix a lot of the issues
10584 wrt. `using' aliases etc.
10586 * namespace.cs (Namespace): Splitted this class into a
10587 per-assembly `Namespace' and a per-file `NamespaceEntry'.
10589 * typemanager.cs (TypeManager.IsNamespace): Removed.
10590 (TypeManager.ComputeNamespaces): Only compute namespaces from
10591 loaded assemblies here, not the namespaces from the assembly we're
10592 currently compiling.
10594 2003-07-08 Martin Baulig <martin@ximian.com>
10596 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10598 2003-07-07 Miguel de Icaza <miguel@ximian.com>
10600 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10603 I thought about the memory savings here, but LookupTypeReflection
10604 is used under already very constrained scenarios. Compiling
10605 corlib or mcs only exposes one hit, so it would not really reduce
10606 any memory consumption.
10608 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10610 * typemanager.cs: fixes bug #45889 by only adding public types from
10611 other assemblies to the list of known types.
10613 2003-07-07 Miguel de Icaza <miguel@ximian.com>
10615 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10616 on the type we resolved.
10618 2003-07-05 Martin Baulig <martin@ximian.com>
10620 * pending.cs (PendingImplementation.ParentImplements): Don't
10621 create the proxy if the parent is abstract.
10623 * class.cs (TypeContainer.DefineIndexers): Process explicit
10624 interface implementations first. Fixes #37714.
10626 2003-07-04 Miguel de Icaza <miguel@ximian.com>
10628 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10629 defined recursively; but since we modify the input parameters
10630 (left is set to `this' temporarily), we reset this value if the
10631 left_is_explicit is false, which gives the original semantics to
10634 * literal.cs (NullPointer): new class used to represent a null
10635 literal in a pointer context.
10637 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10638 type is a pointer, use a NullPointer object instead of a
10639 NullLiteral. Closes 43687
10641 (ExplicitConversion): Convert pointer values using
10642 the conv opcode to the proper type.
10644 * ecore.cs (New): change ValueTypeVariable property into a method,
10645 that returns whether the valuetype is suitable for being used.
10647 * expression.cs (Binary.DoNumericPromotions): Only return if we
10648 the int constant was a valid uint, and we can return both left and
10649 right as uints. If not, we continue processing, to trigger the
10650 type conversion. This fixes 39018.
10652 * statement.cs (Block.EmitMeta): During constant resolution, set
10653 the CurrentBlock property on the emitcontext, so that we resolve
10654 constants propertly.
10656 2003-07-02 Martin Baulig <martin@ximian.com>
10658 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10659 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10661 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10662 than emitting it here.
10664 * statement.cs: Fixed some more flow analysis bugs.
10666 2003-07-02 Martin Baulig <martin@ximian.com>
10668 * class.cs (MethodData.Define): When implementing interface
10669 methods, set Final unless we're Virtual.
10671 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10672 check work for interface methods.
10674 2003-07-01 Martin Baulig <martin@ximian.com>
10676 * ecore.cs (EmitContext.This): Replaced this property with a
10677 GetThis() method which takes a Location argument. This ensures
10678 that we get the correct error location for a CS0188.
10680 2003-07-01 Miguel de Icaza <miguel@ximian.com>
10682 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10683 ImplicitStandardConversion.
10685 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10687 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
10689 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10692 2003-06-30 Miguel de Icaza <miguel@ximian.com>
10694 * class.cs (Constructor.Define): Turn off initlocals for unsafe
10697 (MethodData.Define): Turn off initlocals for unsafe methods.
10699 2003-06-29 Miguel de Icaza <miguel@ximian.com>
10701 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10702 complete; Fixes #37521.
10704 * delegate.cs: Use Modifiers.TypeAttr to compute the
10705 TypeAttributes, instead of rolling our own. This makes the flags
10706 correct for the delegates.
10708 2003-06-28 Miguel de Icaza <miguel@ximian.com>
10710 * class.cs (Constructor.Define): Set the private flag for static
10711 constructors as well.
10713 * cs-parser.jay (statement_expression): Set the return value to
10714 null, to avoid a crash when we catch an error.
10716 2003-06-24 Miguel de Icaza <miguel@ximian.com>
10718 * cs-parser.jay: Applied patch from Jackson that adds support for
10719 extern and unsafe modifiers to destructor declarations.
10721 * expression.cs: Report error 21 if the user is trying to index a
10724 * driver.cs: Add an error message, suggested by the bug report.
10726 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10727 if we do not have a ": this ()" constructor initializer. Fixes 45149
10729 2003-06-14 Miguel de Icaza <miguel@ximian.com>
10731 * namespace.cs: Add some information to reduce FAQs.
10733 2003-06-13 Miguel de Icaza <miguel@ximian.com>
10735 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10736 underlying enumeration types. Fixes #43915.
10738 * expression.cs: Treat ushort/short as legal values to be used in
10739 bitwise operations.
10741 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10743 * delegate.cs: transfer custom attributes for paramenters from
10744 the delegate declaration to Invoke and BeginInvoke.
10746 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10748 * attribute.cs: handle custom marshalers and emit marshal info
10751 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
10753 * makefile.gnu: Added anonymous.cs to the compiler sources.
10755 2003-05-28 Miguel de Icaza <miguel@ximian.com>
10757 * iterators.cs: Change the name of the proxy class to include two
10760 * cs-parser.jay: Update grammar to include anonymous methods.
10762 * anonymous.cs: new file.
10764 2003-05-27 Miguel de Icaza <miguel@ximian.com>
10766 * class.cs (Field.Define): Add missing test for pointers and
10769 2003-05-27 Ravi Pratap <ravi@ximian.com>
10771 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10772 we use the stobj opcode.
10774 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10775 since it wasn't the correct fix.
10777 It still is puzzling that we are required to use stobj for IntPtr
10778 which seems to be a ValueType.
10780 2003-05-26 Miguel de Icaza <miguel@ximian.com>
10782 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10783 during regular simple name resolution. Now, the trick is that
10784 instead of returning for processing the simplename, we do a
10785 TypeManager.LookupType (ie, a rooted lookup as opposed to a
10786 contextual lookup type). If a match is found, return that, if
10787 not, return for further composition.
10789 This fixes long-standing 30485.
10791 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10792 using the address to initialize an object, do an Stobj instead of
10793 using the regular Stelem.
10795 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10796 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10797 Because if we are a BaseIndexerAccess that value will be true.
10800 * statement.cs (GotoCase.Resolve): Return after reporting an
10801 error, do not attempt to continue.
10803 * expression.cs (PointerArithmetic.Emit): If our operand is a
10804 long, convert our constants to match the operand before
10805 multiplying. Convert to I type before adding. Fixes 43670.
10807 2003-05-14 Ravi Pratap <ravi@ximian.com>
10809 * enum.cs (ImplicitConversionExists) : Rename to
10810 ImplicitEnumConversionExists to remove ambiguity.
10812 * ecore.cs (NullCast): New type of cast expression class which
10813 basically is very similar to EmptyCast with the difference being
10814 it still is a constant since it is used only to cast a null to
10816 (eg. (string) null)
10818 * convert.cs (ImplicitReferenceConversion): When casting a null
10819 literal, we return a NullCast.
10821 * literal.cs (NullLiteralTyped): Remove - I don't see why this
10822 should be around anymore.
10824 The renaming (reported was slightly wrong). Corrections:
10826 ConvertImplicitStandard -> ImplicitConversionStandard
10827 ConvertExplicitStandard -> ExplicitConversionStandard
10829 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10830 before passing them in !
10832 * convert.cs (ImplicitConversionStandard): When comparing for
10833 equal expr and target types, ensure that expr is not a
10836 In general, we must not be checking (expr_type ==
10837 target_type) in the top level conversion methods
10838 (ImplicitConversion, ExplicitConversion etc). This checking is
10839 done in the methods that they delegate to.
10841 2003-05-20 Miguel de Icaza <miguel@ximian.com>
10843 * convert.cs: Move Error_CannotConvertType,
10844 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10845 ImplicitNumericConversion, ImplicitConversionExists,
10846 ImplicitUserConversionExists, StandardConversionExists,
10847 FindMostEncompassedType, FindMostSpecificSource,
10848 FindMostSpecificTarget, ImplicitUserConversion,
10849 ExplicitUserConversion, GetConversionOperators,
10850 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10851 TryImplicitIntConversion, Error_CannotConvertImplicit,
10852 ConvertImplicitRequired, ConvertNumericExplicit,
10853 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10854 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10857 Perform the following renames:
10859 StandardConversionExists -> ImplicitStandardConversionExists
10860 ConvertImplicit -> ImplicitConversion
10861 ConvertImplicitStandard -> ImplicitStandardConversion
10862 TryImplicitIntConversion -> ImplicitIntConversion
10863 ConvertImplicitRequired -> ImplicitConversionRequired
10864 ConvertNumericExplicit -> ExplicitNumericConversion
10865 ConvertReferenceExplicit -> ExplicitReferenceConversion
10866 ConvertExplicit -> ExplicitConversion
10867 ConvertExplicitStandard -> ExplicitStandardConversion
10869 2003-05-19 Martin Baulig <martin@ximian.com>
10871 * statement.cs (TypeInfo.StructInfo): Made this type protected.
10872 (TypeInfo): Added support for structs having structs as fields.
10874 * ecore.cs (FieldExpr): Implement IVariable.
10875 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10876 VariableInfo for the field.
10878 2003-05-18 Martin Baulig <martin@ximian.com>
10880 * expression.cs (This.DoResolve): Report a CS0027 if we're
10881 emitting a field initializer.
10883 2003-05-18 Martin Baulig <martin@ximian.com>
10885 * expression.cs (This.ResolveBase): New public function.
10886 (This.DoResolve): Check for CS0188.
10888 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10891 * ecore.cs (MethodGroupExpr.DoResolve): Set the
10892 `instance_expression' to null if we don't have any non-static
10895 2003-05-18 Martin Baulig <martin@ximian.com>
10897 Reworked the way how local variables and parameters are handled by
10898 the flow analysis code.
10900 * statement.cs (TypeInfo, VariableMap): New public classes.
10901 (VariableInfo): New public class. This is now responsible for
10902 checking whether a variable has been assigned. It is used for
10903 parameters and local variables.
10904 (Block.EmitMeta): Take the InternalParameters as argument; compute
10905 the layout of the flow vectors here.
10906 (Block.LocalMap, Block.ParameterMap): New public properties.
10907 (FlowBranching): The .ctor doesn't get the InternalParameters
10908 anymore since Block.EmitMeta() now computes the layout of the flow
10910 (MyStructInfo): This class is now known as `StructInfo' and nested
10911 in `TypeInfo'; we don't access this directly anymore.
10913 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10914 property and removed IsAssigned(), IsFieldAssigned(),
10915 SetAssigned() and SetFieldAssigned(); we now call them on the
10916 VariableInfo so we don't need to duplicate this code everywhere.
10918 * expression.cs (ParameterReference): Added `Block block' argument
10920 (LocalVariableReference, ParameterReference, This): The new
10921 VariableInfo class is now responsible for all the definite
10924 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10925 IsParameterAssigned, SetParameterAssigned): Removed.
10927 2003-05-18 Martin Baulig <martin@ximian.com>
10929 * typemanager.cs (InitCoreTypes): Try calling
10930 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10931 the 3-args-version. Corlib now also needs our `void_type'.
10932 (GetMethod): Added overloaded version which takes an optional
10933 `bool report_errors' to allow lookups of optional methods.
10935 2003-05-12 Martin Baulig <martin@ximian.com>
10937 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10938 only used for locals and not for parameters.
10940 2003-05-12 Miguel de Icaza <miguel@ximian.com>
10942 * support.cs (InternalParameters.ParameterType): Return the
10943 ExternalType of the parameter.
10945 * parameter.cs (Parameter.ExternalType): drop the two arguments,
10948 2003-05-11 Miguel de Icaza <miguel@ximian.com>
10950 * class.cs (MethodData.Define): Do not set the `newslot' on
10951 interface members, if they are also flagged as "override".
10953 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10954 better code for ++i and i++. This only works for static fields
10955 and local variables.
10957 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10958 want to pull the DeclSpace out of the builder_to_declspace instead
10959 of the TypeBuilder (like in TypeContainer.FindMembers).
10961 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10962 instead of LookupTypeContainer. Fixes the crash on .NET for
10963 looking up interface members.
10965 * const.cs: Create our own emit context during the Definition
10966 stage, so that constants are evaluated in the proper context, when
10967 a recursive definition happens.
10969 2003-05-11 Martin Baulig <martin@ximian.com>
10971 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
10972 new block for a switch section.
10973 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10974 the adding/lookup in the switch block. Fixes #39828.
10976 2003-05-09 Miguel de Icaza <miguel@ximian.com>
10978 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10979 functionality: I needed to convert the data after I had performed
10980 the add/sub operation into the operands type size.
10982 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10983 pass the type for the box operation, otherwise the resulting
10984 object would have been of type object.
10986 (BoxedCast): Add constructor to specify the type to box as.
10988 2003-05-07 Miguel de Icaza <miguel@ximian.com>
10990 * iterators.cs: I was reusing the `count' variable inadvertently,
10991 take steps to not allow this to happen.
10993 2003-05-06 Miguel de Icaza <miguel@ximian.com>
10995 * attribute.cs (Attribute.Resolve): Params attributes are encoded
10996 by creating an array at the point where the params starts and
10997 putting all those arguments there, then adjusting the size of the
11000 2003-05-05 Miguel de Icaza <miguel@ximian.com>
11002 * expression.cs (New.AddressOf): Implement interface
11003 IMemoryLocation. This is used when the `new' operator is used in
11004 the context of an invocation to a method on a value type.
11006 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11009 * namespace.cs: Also check the using aliases here.
11011 * driver.cs: Move the test for using validity after the types have
11012 been entered, so we do a single pass that also includes the using
11015 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11016 in the regular case. CreateSiblingForFinally is doing extra
11019 * attribute.cs (GetAttributeArgumentExpression): Store the result
11020 on an out value, and use the return value to indicate failure
11021 instead of using null (which is a valid return for Constant.GetValue).
11023 * statement.cs: Perform the analysis flow for the increment
11024 portion after the statement, because this will be the real flow of
11025 execution. Fixes #42385
11027 * codegen.cs (EmitContext.EmitArgument,
11028 EmitContext.EmitStoreArgument): New helper functions when the
11029 RemapToProxy flag is set.
11031 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11034 Add support for remapping parameters.
11036 * iterators.cs: Propagate parameter values; Store parameter
11037 values in the proxy classes.
11039 2003-05-04 Miguel de Icaza <miguel@ximian.com>
11041 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
11042 need a proxy reference; I do not know what I was thinking
11044 * cs-parser.jay (constructor_initializer): catch another error,
11045 and display nice message.
11047 (field_declaration): catch void field declaration
11048 to flag a better error.
11050 * class.cs (MemberBase.CheckBase): Report an error instead of a
11051 warning if a new protected member is declared in a struct.
11052 (Field.Define): catch the error of readonly/volatile.
11054 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11056 (FieldExpr.AddressOf): ditto. Catch error where the address of a
11057 volatile variable is taken
11059 2003-05-02 Miguel de Icaza <miguel@ximian.com>
11061 * statement.cs (Fixed.Resolve): Report an error if we are not in
11064 2003-05-01 Miguel de Icaza <miguel@ximian.com>
11066 * typemanager.cs: reuse the code that handles type clashes for
11067 delegates and enumerations.
11069 * class.cs (Report28): Always report.
11071 * expression.cs (EncodeAsAttribute): Allow nulls here.
11073 2003-04-28 Miguel de Icaza <miguel@ximian.com>
11075 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11076 the functionality for testing whether an expression is valid for
11077 an attribute here. Also handle the case of arrays of elements
11080 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11081 encoding a linear array into an array of objects that are suitable
11082 to be passed to an CustomAttributeBuilder.
11084 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11086 * ecore.cs: (FieldExpr): Handle field remapping here.
11088 * iteratators.cs: Pass the instance variable (if the method is an
11089 instance method) to the constructors, so we can access the field
11090 variables on the class.
11092 TODO: Test this with structs. I think the THIS variable on
11093 structs might have to be a pointer, and not a refenrece
11095 2003-04-27 Miguel de Icaza <miguel@ximian.com>
11097 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11098 local variables to fields in a proxy class.
11100 * iterators.cs (PopulateProxy): Rename our internal fields to
11102 Create a <THIS> field if we are an instance method, so we can
11103 reference our parent container variables.
11104 (MapVariable): Called back from the EmitContext code to enter a
11105 new variable to field mapping into the proxy class (we just create
11109 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11110 for using the remapped locals to fields.
11112 I placed the code here, because that gives the same semantics to
11113 local variables, and only changes the Emit code.
11115 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11116 statements inside iterators.
11117 (VariableInfo): Add a FieldBuilder for the cases when we are
11118 remapping local variables to fields in a proxy class
11120 * ecore.cs (SimpleNameResolve): Avoid testing two times for
11121 current_block != null.
11123 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
11124 not cope with strings, as it has been moved to the
11125 TableSwitchEmit. Fixed bug in switch generation.
11127 * expression.cs (New.DoResolve): Provide more context for the user
11128 when reporting an error.
11130 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
11133 * expression.cs (MemberAccess.DoResolve): When we get a type back,
11134 check the permissions for it. Note than in a type-resolution
11135 context the check was already present in DeclSpace.ResolveType,
11136 but was missing from the MemberAccess.
11138 (ArrayCreation.CheckIndices): warn if the user has
11139 more nested levels of expressions, but there are no more
11140 dimensions specified. Avoids crash on bug 41906.
11142 2003-04-26 Miguel de Icaza <miguel@ximian.com>
11144 * statement.cs (Block): replace Implicit bool, for a generic
11146 New flag: `Unchecked'. This is used during the EmitMeta phase
11147 (which is out-of-line with the regular Resolve/Emit process for a
11148 statement, as this is done ahead of time, but still gets a chance
11149 to call constant resolve).
11151 (Block.Flags): new enum for adding a new flag.
11153 (Block.EmitMeta): track the state of unchecked.
11155 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
11156 to enable constant resolution to work there as well.
11158 2003-04-22 Miguel de Icaza <miguel@ximian.com>
11160 * typemanager.cs (ienumerable_type): Also look up
11161 System.Collections.IEnumerable.
11163 2003-04-21 Miguel de Icaza <miguel@ximian.com>
11165 TODO: Test more than one conditional per method.
11167 * class.cs (Indexer.Define): Report the location where the user is
11168 referencing the unsupported feature.
11170 (MethodData): Overload the use of `conditionals' to
11171 minimize the creation of needless ArrayLists. This saves roughly
11172 212kb on my machine.
11174 (Method): Implement the new IIteratorContainer interface.
11175 (Method.SetYields): Implement the method by setting the ModFlags
11176 to contain METHOD_YIELDS.
11178 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
11179 which just got set to null.
11181 * iterators.cs: New file.
11183 (Yield, YieldBreak): New statements.
11185 * statement.cs (Return.Resolve): Flag an error if we are used in
11186 an iterator method.
11188 * codegen.cs (InIterator): New flag set if the code is being
11189 compiled in an iterator method.
11191 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
11192 internal modifier, and we just use it to avoid adding extra
11193 fields, as this is seldom used.
11195 * cs-parser.jay: Add yield_statement (yield and yield break).
11197 * driver.cs: New flag -v2 to turn on version 2 features.
11199 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
11200 hashtable when v2 is enabled.
11202 2003-04-20 Miguel de Icaza <miguel@ximian.com>
11204 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
11205 there is already a namespace defined with this name.
11207 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
11208 people upgraded their corlibs.
11210 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
11211 always use fully qualified types, no need to use the compiler
11214 (TypeManager.IsNamespace): Use binarysearch.
11216 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
11217 AddDelegate): I did not quite use the new IsValid API properly: I
11218 have to pass the short-name and the fullname. I was passing only
11219 the basename instead of the fullname sometimes.
11221 (TypeContainer.DefineType): call NamespaceClash.
11223 * interface.cs (Interface.DefineType): use NamespaceClash before
11226 * delegate.cs (Delegate.DefineType): use NamespaceClash before
11229 * enum.cs: (Enum.DefineType): use NamespaceClash before
11232 * typemanager.cs (: 3-line patch that gives us some tasty 11%
11233 speed increase. First, use the negative_hits cache when we get a
11234 negative. Second, add the type with its full original name
11235 instead of the new . and + encoded name (reflection uses + to
11236 separate type from a nested type). Use LookupTypeReflection
11237 directly which bypasses the type->name hashtable (that we already
11238 know does not contain the type.
11240 * decl.cs (DeclSpace.ResolveTypeExpr): track the
11241 location/container type.
11243 * driver.cs: When passing utf8, use directly the UTF8Encoding.
11245 2003-04-19 Miguel de Icaza <miguel@ximian.com>
11247 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11249 * delegate.cs (NewDelegate.Resolve): Test whether an instance
11250 method is being referenced in the method group from a static
11251 context, and report error 120 if so.
11253 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11256 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11257 is created, we create the A namespace).
11259 * cs-parser.jay: A namespace also introduces a DeclarationFound.
11262 2003-04-18 Miguel de Icaza <miguel@ximian.com>
11264 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11265 invocation to ModuleBuilder.GetType with the same values will
11266 return a new type instance, so we need to cache its return
11269 * expression.cs (Binary.ResolveOperator): Only allow the compare
11270 operators on enums if they are of the same type.
11272 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11273 types of ValueType on their own case. Before we were giving them
11274 the same treatment as objects.
11276 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11277 fullname. Short name is used to compare against container name.
11278 Fullname is used to check against defined namespace names.
11280 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11281 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11283 (Method.CheckBase): Call parent.
11284 (MemberBase.CheckBase): Check for protected members on sealed
11286 (PropertyBase.CheckBase): Call parent.
11287 (Field.Define): Call parent.
11289 * report.cs: Negative error codes are now mapped to 8000 - code,
11290 so that the display is render more nicely.
11292 * typemanager.cs: Do not use try/catch, instead report a regular
11295 (GetPointerType, GetReferenceType): These methods provide
11296 mechanisms to obtain the T* and T& from a T. We had the code
11297 previously scattered around the code base, and it also used
11298 TypeManager.LookupType that would go through plenty of caches.
11299 This one goes directly to the type source.
11301 In some places we did the Type.GetType followed by
11302 ModuleBuilder.GetType, but not in others, so this unifies the
11303 processing as well.
11305 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11306 statements now that we have namespace information.
11308 * typemanager.cs (IsNamespace): New method, returns whether the
11309 string presented is a namespace or not.
11311 (ComputeNamespaces): New public entry point, computes the list of
11312 available namespaces, using the GetNamespaces API call in Mono, or
11313 the slower version in MS.NET.
11315 Now before we start the semantic analysis phase, we have a
11316 complete list of namespaces including everything that the user has
11319 Deleted old code to cache namespaces in .nsc files.
11321 2003-04-17 Miguel de Icaza <miguel@ximian.com>
11323 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11324 class/struct location definition Location for the implicit
11325 constructor location.
11327 (Operator.Define): Use the location of the operator for the
11328 implicit Method definition.
11330 (Constructor.Emit): use the constructor location for the implicit
11331 base initializer constructor.
11333 * ecore.cs: Remove ITypeExpression. This interface is now gone,
11334 and the Expression class now contains two new methods:
11336 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
11337 isolate type lookup from the rest of the resolution process.
11339 Since we use Expressions to hold type definitions due to the way
11340 we parse the input we have historically overloaded Resolve to
11341 perform the Type lookups if a special flag is passed. Now this is
11342 eliminated and two methods take their place.
11344 The differences in the two methods between xStep and xTerminal is
11345 that xStep is involved in our current lookup system that uses
11346 SimpleNames to compose a name, while xTerminal is used just to
11347 catch the case where the simplename lookup failed.
11349 2003-04-16 Miguel de Icaza <miguel@ximian.com>
11351 * expression.cs (ResolveMemberAccess): Remove redundant code.
11352 TypeExpr expressions are always born fully resolved.
11354 * interface.cs (PopulateMethod): Do not lookup the types twice.
11355 We were doing it once during SemanticAnalysis and once during
11358 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11359 in local variable type definitions, were being returned as a
11360 SimpleName (we decomposed everything into a string), that is
11361 because primary_expression was being used instead of a type in the
11362 grammar (reduce/reduce conflicts).
11364 The part that was wrong is that we converted the expression into a
11365 string (an oversimplification in one hand, compounded with primary
11366 expressions doing string concatenation).
11372 Would return "A.B.C[]" as a SimpleName. This stopped things like
11373 using clauses from working on this particular context. And a type
11374 was being matched directly against "A.B.C[]".
11376 We now use the correct approach, and allow for ComposedCast to be
11377 part of the unary expression. So the "A.B.C []" become a composed
11378 cast of "A.B.C" (as a nested group of MemberAccess with a
11379 SimpleName at the end) plus the rank composition "[]".
11383 2003-04-10 Miguel de Icaza <miguel@ximian.com>
11385 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11386 for the access level checking.
11388 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
11389 `TypeContainer container', because I kept getting confused when I
11390 was debugging this code.
11392 * expression.cs (Indexers): Instead of tracking getters/setters,
11393 we now track them in parallel. We create one arraylist less, but
11394 most importantly it is possible now for the LValue code to find a
11395 matching get for a set.
11397 (IndexerAccess.DoResolveLValue): Update the code.
11398 GetIndexersForType has been modified already to extract all the
11399 indexers from a type. The code assumed it did not.
11401 Also make the code set the correct return type for the indexer.
11402 This was fixed a long time ago for properties, but was missing for
11403 indexers. It used to be void_type.
11405 (Binary.Emit): Test first for doubles instead of
11406 floats, as they are more common.
11408 (Binary.EmitBranchable): Use the .un version of the branch opcodes
11409 when dealing with floats and the <=, >= operators. This fixes bug
11412 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11413 to load the array value by emitting a load on the foreach variable
11414 type. This was incorrect.
11416 We now emit the code to load an element using the the array
11417 variable type, and then we emit the conversion operator.
11421 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
11423 * attribute.cs: Avoid allocation of ArrayLists in the common case.
11425 2003-04-09 Miguel de Icaza <miguel@ximian.com>
11427 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11428 test for protection before we test for signatures.
11430 (MethodSignature.ToString): implement.
11432 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11433 to the case where we reduced into a LongConstant.
11435 * decl.cs (CheckAccessLevel): If the type is an array, we can not
11436 depend on whether the information is acurrate, because the
11437 Microsoft runtime will always claim that the array type is public,
11438 regardless of the real state.
11440 If the type is a pointer, another problem happens: the type is
11441 reported as non-public in Microsoft.
11443 In both cases we have to call CheckAccessLevel recursively with
11444 the underlying type as the argument to be tested.
11446 2003-04-08 Miguel de Icaza <miguel@ximian.com>
11448 * assign.cs (Assign.Emit): If we are dealing with a compound
11449 assignment expression, we should use the code path that stores the
11450 intermediate result in a temporary value. This fixes #40903.
11452 *expression.cs (Indirection.ToString): Provide ToString method for
11455 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
11457 * class.cs: Null out fields holding references to Block objects so
11458 they can be garbage collected.
11460 * expression.cs (OverloadResolve): Remove unused local.
11462 2003-04-07 Martin Baulig <martin@ximian.com>
11464 * codegen.cs (EmitContext.CurrentFile): New public field.
11465 (EmitContext.Mark): Use the CurrentFile to check whether the
11466 location is in the correct file.
11467 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11469 2003-04-07 Martin Baulig <martin@ximian.com>
11471 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11473 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11474 location. [FIXME: The location argument which gets passed to this
11475 method is sometimes wrong!]
11477 2003-04-07 Nick Drochak <ndrochak@gol.com>
11479 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11481 2003-04-07 Miguel de Icaza <miguel@ximian.com>
11483 * expression.cs (Indirection.EmitAssign): We were using the
11484 temporary, but returning immediately instead of continuing the
11487 2003-04-06 Martin Baulig <martin@ximian.com>
11489 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11490 if it's a nested child, but also deriving from the outer class.
11493 * typemanager.cs (IsNestedChildOf): Make this work if it's a
11494 nested child, but also deriving from the outer class. See
11496 (FilterWithClosure): We may access private members of the outer
11497 class if we're a nested child and deriving from the outer class.
11498 (RealMemberLookup): Only set `closure_private_ok' if the
11499 `original_bf' contained BindingFlags.NonPublic.
11501 2003-04-05 Martin Baulig <martin@ximian.com>
11503 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
11504 probe if its a type parameter, and if so, flag an error.
11506 * decl.cs: Move here the SetParameterInfo code from class.cs.
11507 Handle IsGeneric here.
11509 Handle a variety of errors in the parameter info definition.
11511 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
11512 type parameters here.
11514 * cs-parser.jay (class_declaration): report errors for parameters
11517 2003-01-21 Miguel de Icaza <miguel@ximian.com>
11519 * generic.cs: New file, contains support code for generics.
11521 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
11522 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
11524 Update parser for the above removals.
11526 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
11527 now taken care of in the parser.
11529 2003-04-02 Miguel de Icaza <miguel@ximian.com>
11531 * class.cs (Event.Define): Do not allow abstract events to have
11534 2003-04-01 Miguel de Icaza <miguel@ximian.com>
11536 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11537 block in event declarations.
11539 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11540 value type, get its address.
11542 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11543 leaving a class on the stack instead of a boolean value (int
11544 0/1). Change the code so we compare against null, and then the
11545 result against zero.
11547 * class.cs (TypeContainer.GetClassBases): We were checking for the
11548 parent class being sealed too late.
11550 * expression.cs (Binary.Emit): For <= and >= when dealing with
11551 floating point values, use cgt.un and clt.un instead of cgt and
11554 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
11556 * statement.cs: Apply the same optimization as MS: skip the
11557 GetEnumerator returning an IEnumerator, and use the one returning a
11558 CharEnumerator instead. This allows us to avoid the try-finally block
11561 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
11563 * cs-parser.jay: Attributes cannot be applied to
11564 namespaces. Fixes #40473
11566 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11569 (Add*): check if the name is valid using the full name for constants,
11570 fields, properties and events.
11572 2003-03-28 Miguel de Icaza <miguel@ximian.com>
11574 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11575 char constants to be part of the enumeration.
11577 * expression.cs (Conditional.DoResolve): Add support for operator
11578 true. Implements the missing functionality from 14.12
11580 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11581 operator true/false as required by the spec.
11583 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11584 implicit conversion to boolean.
11586 * statement.cs (Statement.ResolveBoolean): A boolean expression is
11587 also one where the type implements `operator true'.
11589 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11590 get an expression that will invoke operator true based on an
11593 (GetConversionOperators): Removed the hack that called op_True
11596 (Expression.ResolveBoolean): Move this from Statement.
11598 2003-03-17 Miguel de Icaza <miguel@ximian.com>
11600 * ecore.cs (FieldExpr): do not allow initialization of initonly
11601 fields on derived classes
11603 2003-03-13 Martin Baulig <martin@ximian.com>
11605 * statement.cs (Block.Emit): Call ig.BeginScope() and
11606 ig.EndScope() when compiling with debugging info; call
11607 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11609 2003-03-08 Miguel de Icaza <miguel@ximian.com>
11611 * expression.cs (Indexers): Do not construct immediately, allow
11612 for new members to be appended as we go. Fixes 38143
11614 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11616 * expression.cs: save/restore context when resolving an unchecked
11619 2003-03-05 Miguel de Icaza <miguel@ximian.com>
11621 * cfold.cs: Catch division by zero in modulus operator during
11624 2003-03-03 Miguel de Icaza <miguel@ximian.com>
11626 * interface.cs (Interface.DefineMembers): Avoid defining members
11629 2003-02-27 Miguel de Icaza <miguel@ximian.com>
11631 * driver.cs: handle the +/- options for -noconfig
11633 * statement.cs (Unckeched.Resolve): Also track the state of
11634 unchecked in the Resolve phase.
11636 2003-02-27 Martin Baulig <martin@ximian.com>
11638 * ecore.cs (Expression.MemberLookup): Don't create a
11639 MethodGroupExpr for something which is not a method. Fixes #38291.
11641 2003-02-25 Miguel de Icaza <miguel@ximian.com>
11643 * class.cs (MemberBase.CheckParameters): Also check that the type
11644 is unmanaged if it is a pointer.
11646 * expression.cs (SizeOf.Resolve): Add location information.
11648 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11649 a managed type is declared.
11651 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11652 parameter modifiers as well. Fixes bug 38606
11654 * class.cs: Very sad. Am backing out the speed up changes
11655 introduced by the ArrayList -> Array in the TypeContainer, as they
11656 were not actually that much faster, and introduced a bug (no error
11657 reports on duplicated methods).
11659 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11660 source first, this will guarantee that we have a valid expression
11661 before calling in lower levels functions that will require a
11662 resolved object. Then use this original_source in the
11663 target.ResolveLValue instead of the original source that was
11666 Another change. Use target.Resolve instead of LValueResolve.
11667 Although we are resolving for LValues, we will let the Assign code
11668 take care of that (it will be called again from Resolve). This
11669 basically allows code like this:
11671 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11672 class Y { void A (X x) { x [0] += o; }
11674 The problem was that the indexer was trying to resolve for
11675 set_Item (idx, object o) and never finding one. The real set_Item
11676 was set_Item (idx, X). By delaying the process we get the right
11681 2003-02-23 Martin Baulig <martin@ximian.com>
11683 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11684 while calling DoEmit ().
11686 * codegen.cs (EmitContext.Mark): Don't mark locations in other
11687 source files; if you use the #line directive inside a method, the
11688 compiler stops emitting line numbers for the debugger until it
11689 reaches the end of the method or another #line directive which
11690 restores the original file.
11692 2003-02-23 Martin Baulig <martin@ximian.com>
11694 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11696 2003-02-23 Martin Baulig <martin@ximian.com>
11698 * statement.cs (Block.AddChildVariableNames): We need to call this
11699 recursively, not just for our immediate children.
11701 2003-02-23 Martin Baulig <martin@ximian.com>
11703 * class.cs (Event.Define): Always make the field private, like csc does.
11705 * typemanager.cs (TypeManager.RealMemberLookup): Make events
11706 actually work, fixes bug #37521.
11708 2003-02-23 Miguel de Icaza <miguel@ximian.com>
11710 * delegate.cs: When creating the various temporary "Parameters"
11711 classes, make sure that we call the ComputeAndDefineParameterTypes
11712 on those new parameters (just like we do with the formal ones), to
11713 allow them to be resolved in the context of the DeclSpace.
11715 This fixes the bug that Dick observed in Bugzilla #38530.
11717 2003-02-22 Miguel de Icaza <miguel@ximian.com>
11719 * expression.cs (ResolveMemberAccess): When resolving a constant,
11720 do not attempt to pull a constant if the value was not able to
11721 generate a valid constant.
11723 * const.cs (LookupConstantValue): Do not report more errors than required.
11725 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11727 * expression.cs: fixes bug #38328.
11729 2003-02-18 Miguel de Icaza <miguel@ximian.com>
11731 * class.cs: Changed all the various members that can be part of a
11732 class from being an ArrayList to be an Array of the right type.
11733 During the DefineType type_list, interface_list, delegate_list and
11734 enum_list are turned into types, interfaces, delegates and enums
11737 And during the member population, indexer_list, event_list,
11738 constant_list, field_list, instance_constructor_list, method_list,
11739 operator_list and property_list are turned into their real arrays.
11741 Although we could probably perform this operation earlier, for
11742 good error reporting we need to keep the lists and remove the
11743 lists for longer than required.
11745 This optimization was triggered by Paolo profiling the compiler
11746 speed on the output of `gen-sample-program.pl' perl script.
11748 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11749 not crash in methods like MemberLookupFailed that use this field.
11751 This problem arises when the compiler fails to resolve a type
11752 during interface type definition for example.
11754 2003-02-18 Miguel de Icaza <miguel@ximian.com>
11756 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11757 inherit from System.Object, so we have to stop at null, not only
11758 when reaching System.Object.
11760 2003-02-17 Miguel de Icaza <miguel@ximian.com>
11762 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11763 DeclaredOnly because the parent indexer might have had a different
11764 name, but did not loop until the top of the hierarchy was reached.
11766 The problem this one fixes is 35492: when a class implemented an
11767 indexer from an interface, we were getting the interface method
11768 (which was abstract) and we were flagging an error (can not invoke
11771 This also keeps bug 33089 functioning, and test-148 functioning.
11773 * typemanager.cs (IsSpecialMethod): The correct way of figuring
11774 out if a method is special is to see if it is declared in a
11775 property or event, or whether it is one of the predefined operator
11776 names. This should fix correctly #36804.
11778 2003-02-15 Miguel de Icaza <miguel@ximian.com>
11780 The goal here is to remove the dependency on EmptyCast.Peel ().
11781 Killing it completely.
11783 The problem is that currently in a number of places where
11784 constants are expected, we have to "probe" for an EmptyCast, and
11785 Peel, which is not the correct thing to do, as this will be
11786 repetitive and will likely lead to errors.
11788 The idea is to remove any EmptyCasts that are used in casts that
11789 can be reduced to constants, so we only have to cope with
11792 This bug hunt was triggered by Bug 37363 and the desire to remove
11793 the duplicate pattern where we were "peeling" emptycasts to check
11794 whether they were constants. Now constants will always be
11797 * ecore.cs: Use an enumconstant here instead of wrapping with
11800 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11801 throwing me off. By handling this we can get rid of a few hacks.
11803 * statement.cs (Switch): Removed Peel() code.
11805 2003-02-14 Miguel de Icaza <miguel@ximian.com>
11807 * class.cs: Location information for error 508
11809 * expression.cs (New.DoResolve): Add a guard against double
11810 resolution of an expression.
11812 The New DoResolve might be called twice when initializing field
11813 expressions (see EmitFieldInitializers, the call to
11814 GetInitializerExpression will perform a resolve on the expression,
11815 and later the assign will trigger another resolution
11817 This leads to bugs (#37014)
11819 * delegate.cs: The signature for EndInvoke should contain any ref
11820 or out parameters as well. We were not doing this in the past.
11822 * class.cs (Field.Define): Do not overwrite the type definition
11823 inside the `volatile' group. Turns out that volatile enumerations
11824 were changing the type here to perform a validity test, which
11827 2003-02-12 Miguel de Icaza <miguel@ximian.com>
11829 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11830 and structs, we do not want to load the instance variable
11832 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11833 enum_type has to be handled like an object reference (implicit
11834 conversions exists from this to object), but the regular IsClass
11835 and IsValueType tests will never return true for this one.
11837 Also we use TypeManager.IsValueType instead of type.IsValueType,
11838 just for consistency with the rest of the code (this is only
11839 needed if we ever use the construct exposed by test-180.cs inside
11840 corlib, which we dont today).
11842 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
11844 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11847 2003-02-09 Martin Baulig <martin@ximian.com>
11849 * namespace.cs (Namespace..ctor): Added SourceFile argument.
11850 (Namespace.DefineNamespaces): New static public method; this is
11851 called when we're compiling with debugging to add all namespaces
11852 to the symbol file.
11854 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11855 pass it to the Namespace's .ctor.
11857 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11858 and MethodBase arguments; pass the namespace ID to the symwriter;
11859 pass the MethodBase instead of the token to the symwriter.
11860 (SymbolWriter.DefineNamespace): New method to add a namespace to
11863 2003-02-09 Martin Baulig <martin@ximian.com>
11865 * symbolwriter.cs: New file. This is a wrapper around
11866 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
11867 methods here in near future.
11869 2003-02-09 Martin Baulig <martin@ximian.com>
11871 * codegen.cs (EmitContext.Mark): Just pass the arguments to
11872 ILGenerator.MarkSequencePoint() which are actually used by the
11875 2003-02-09 Martin Baulig <martin@ximian.com>
11877 * location.cs (SourceFile): New public sealed class. This
11878 contains the name and an index which is used in the location's token.
11879 (Location): Reserve an appropriate number of bits in the token for
11880 the source file instead of walking over that list, this gives us a
11881 really huge performance improvement when compiling with debugging.
11883 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11884 `SourceFile' argument instead of a string.
11885 (Driver.ProcessFile): Add all the files via Location.AddFile(),
11886 but don't parse/tokenize here, we need to generate the list of all
11887 source files before we do that.
11888 (Driver.ProcessFiles): New static function. Parses/tokenizes all
11891 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11892 instead of a string.
11894 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11897 2003-02-09 Martin Baulig <martin@ximian.com>
11899 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11900 filename on `#line default'.
11902 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11904 * statement.cs: don't clear the pinned var when the fixed statement
11905 returns from the method (fixes bug#37752).
11907 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11909 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
11912 2003-02-07 Martin Baulig <martin@ximian.com>
11914 * driver.cs: Removed the `--debug-args' command line argument.
11916 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11917 automatically by the AsssemblyBuilder.
11918 (CodeGen.InitializeSymbolWriter): We don't need to call any
11919 initialization function on the symbol writer anymore. This method
11920 doesn't take any arguments.
11922 2003-02-03 Miguel de Icaza <miguel@ximian.com>
11924 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11925 from referenced assemblies as well.
11927 2003-02-02 Martin Baulig <martin@ximian.com>
11929 * class.cs (MethodData.Emit): Generate debugging info for external methods.
11931 2003-02-02 Martin Baulig <martin@ximian.com>
11933 * class.cs (Constructor.Emit): Open the symbol writer before
11934 emitting the constructor initializer.
11935 (ConstructorInitializer.Emit): Call ec.Mark() to allow
11936 single-stepping through constructor initializers.
11938 2003-01-30 Miguel de Icaza <miguel@ximian.com>
11940 * class.cs: Handle error 549: do not allow virtual methods in
11943 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11945 * decl.cs: Check access levels when resolving types
11947 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11949 * statement.cs: Add parameters and locals set in catch blocks that might
11950 return to set vector
11952 2003-01-29 Miguel de Icaza <miguel@ximian.com>
11954 * class.cs (Operator): Set the SpecialName flags for operators.
11956 * expression.cs (Invocation.DoResolve): Only block calls to
11957 accessors and operators on SpecialName methods.
11959 (Cast.TryReduce): Handle conversions from char constants.
11962 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11964 * statement.cs: small memory and time optimization in FlowBranching.
11966 2003-01-28 Pedro Mart <yoros@wanadoo.es>
11968 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11969 problem that the last fix but in the other sid (Set).
11971 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11972 access when there is no indexer in the hierarchy.
11974 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11976 * class.cs: Combine some if statements.
11978 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11980 * driver.cs: fixed bug #37187.
11982 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
11984 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11985 any indexer, it's needed to build a list with all the indexers in the
11986 hierarchy (AllGetters), else we have problems. Fixes #35653.
11988 2003-01-23 Miguel de Icaza <miguel@ximian.com>
11990 * class.cs (MethodData.Define): It is wrong for an interface
11991 implementation to be static in both cases: explicit and implicit.
11992 We were only handling this in one case.
11994 Improve the if situation there to not have negations.
11996 * class.cs (Field.Define): Turns out that we do not need to check
11997 the unsafe bit on field definition, only on usage. Remove the test.
11999 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12001 * driver.cs: use assembly.Location instead of Codebase (the latest
12002 patch made mcs fail when using MS assemblies).
12004 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
12006 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12007 get the path to *corlib.dll.
12009 2003-01-21 Nick Drochak <ndrochak@gol.com>
12013 * typemanager.cs: Remove compiler warnings
12015 2003-01-20 Duncan Mak <duncan@ximian.com>
12017 * AssemblyInfo.cs: Bump the version number to 0.19.
12019 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12021 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12023 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
12025 * class.cs (Constructor::Emit): Emit debugging info for constructors.
12027 2003-01-17 Miguel de Icaza <miguel@ximian.com>
12029 * cs-parser.jay: Small fix: we were not comparing the constructor
12030 name correctly. Thanks to Zoltan for the initial pointer.
12032 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12034 * cs-tokenizer.cs: Set file name when specified with #line
12036 2003-01-15 Miguel de Icaza <miguel@ximian.com>
12038 * cs-parser.jay: Only perform the constructor checks here if we
12039 are named like the class; This will help provider a better
12040 error. The constructor path is taken when a type definition is
12041 not found, but most likely the user forgot to add the type, so
12042 report that rather than the constructor error.
12044 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12046 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12049 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12051 * cs-parser.jay: Add cleanup call.
12053 2003-01-13 Duncan Mak <duncan@ximian.com>
12055 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12056 consistent with other methods.
12058 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12060 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12062 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12064 * attribute.cs: only set GuidAttr to true when we have a
12067 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12071 * typemanager.cs: fixes to allow mcs compile corlib with the new
12072 Type.IsSubclassOf fix.
12074 2003-01-08 Miguel de Icaza <miguel@ximian.com>
12076 * expression.cs (LocalVariableReference.DoResolve): Classify a
12077 constant as a value, not as a variable. Also, set the type for
12080 * cs-parser.jay (fixed_statement): take a type instead of a
12081 pointer_type, so we can produce a better error message later.
12083 * statement.cs (Fixed.Resolve): Flag types that are not pointers
12086 (For.DoEmit): Make inifinite loops have a
12087 non-conditional branch back.
12089 (Fixed.DoEmit): First populate the pinned variables, then emit the
12090 statement, then clear the variables. Before I was emitting the
12091 code once for each fixed piece.
12094 2003-01-08 Martin Baulig <martin@ximian.com>
12096 * statement.cs (FlowBranching.MergeChild): A break in a
12097 SWITCH_SECTION does not leave a loop. Fixes #36155.
12099 2003-01-08 Martin Baulig <martin@ximian.com>
12101 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12102 lives in the same number space than `param_map'. Fixes #36154.
12104 2003-01-07 Miguel de Icaza <miguel@ximian.com>
12106 * cs-parser.jay (constructor_declaration): Set the
12107 Constructor.ModFlags before probing for it. This makes the
12108 compiler report 514, 515 and 132 (the code was there, but got
12111 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12112 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12113 (GotoCase.Resolve): Set `Returns' to ALWAYS.
12115 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12117 * enum.cs: create the enum static fields using the enum type.
12119 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12121 * class.cs: don't try to create the ParamBuilder for the return
12122 type if it's not needed (and handle it breaking for the ms runtime
12125 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12127 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12129 2002-12-29 Miguel de Icaza <miguel@ximian.com>
12131 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12132 the command. This showed up while compiling the JANET source
12133 code, which used \r as its only newline separator.
12135 2002-12-28 Miguel de Icaza <miguel@ximian.com>
12137 * class.cs (Method.Define): If we are an operator (because it
12138 reuses our code), then set the SpecialName and HideBySig. #36128
12140 2002-12-22 Miguel de Icaza <miguel@ximian.com>
12142 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12143 exception, report error 120 `object reference required'.
12145 * driver.cs: Add --pause option, used during to measure the size
12146 of the process as it goes with --timestamp.
12148 * expression.cs (Invocation.DoResolve): Do not allow methods with
12149 SpecialName to be invoked.
12151 2002-12-21 Miguel de Icaza <miguel@ximian.com>
12153 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
12154 number before adding it.
12156 2002-12-21 Ravi Pratap <ravi@ximian.com>
12158 * ecore.cs (StandardImplicitConversion): When in an unsafe
12159 context, we allow conversion between void * to any other pointer
12160 type. This fixes bug #35973.
12162 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
12164 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
12165 is not thrown when extensionless outputs are used
12167 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12169 * rootcontext.cs: fixed compilation of corlib.
12171 2002-12-19 Miguel de Icaza <miguel@ximian.com>
12173 * attribute.cs (Attributes.Contains): Add new method.
12175 * class.cs (MethodCore.LabelParameters): if the parameter is an
12176 `out' parameter, check that no attribute `[In]' has been passed.
12178 * enum.cs: Handle the `value__' name in an enumeration.
12180 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
12182 * decl.cs: Added special case to allow overrides on "protected
12185 2002-12-18 Ravi Pratap <ravi@ximian.com>
12187 * attribute.cs (Attributes.AddAttributeSection): Rename to this
12188 since it makes much more sense.
12190 (Attributes.ctor): Don't require a Location parameter.
12192 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
12194 * attribute.cs (ApplyAttributes): Remove extra Location parameters
12195 since we already have that information per attribute.
12197 * everywhere : make appropriate changes.
12199 * class.cs (LabelParameters): Write the code which actually
12200 applies attributes to the return type. We can't do this on the MS
12201 .NET runtime so we flag a warning in the case an exception is
12204 2002-12-18 Miguel de Icaza <miguel@ximian.com>
12206 * const.cs: Handle implicit null conversions here too.
12208 2002-12-17 Ravi Pratap <ravi@ximian.com>
12210 * class.cs (MethodCore.LabelParameters): Remove the extra
12211 Type [] parameter since it is completely unnecessary. Instead
12212 pass in the method's attributes so that we can extract
12213 the "return" attribute.
12215 2002-12-17 Miguel de Icaza <miguel@ximian.com>
12217 * cs-parser.jay (parse): Use Report.Error to flag errors instead
12218 of ignoring it and letting the compile continue.
12220 * typemanager.cs (ChangeType): use an extra argument to return an
12221 error condition instead of throwing an exception.
12223 2002-12-15 Miguel de Icaza <miguel@ximian.com>
12225 * expression.cs (Unary.TryReduce): mimic the code for the regular
12226 code path. Perform an implicit cast in the cases where we can
12227 implicitly convert to one of the integral types, and then reduce
12228 based on that constant. This fixes bug #35483.
12230 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12232 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
12234 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12236 * namespace.cs: fixed bug #35489.
12238 2002-12-12 Miguel de Icaza <miguel@ximian.com>
12240 * class.cs: Remove some dead code.
12242 * cs-parser.jay: Estimate the number of methods needed
12243 (RootContext.MethodCount);
12245 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12246 numbers instead of StringBuilders.
12248 * support.cs (PtrHashtable): Add constructor with initial size;
12249 We can now reduce reallocations of the method table.
12251 2002-12-10 Ravi Pratap <ravi@ximian.com>
12253 * attribute.cs (ApplyAttributes): Keep track of the emitted
12254 attributes on a per-target basis. This fixes bug #35413.
12256 2002-12-10 Miguel de Icaza <miguel@ximian.com>
12258 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12259 default to the Windows 1252 encoding.
12261 (UnixParseOption): Support version, thanks to Alp for the missing
12264 * AssemblyInfo.cs: Add nice assembly information.
12266 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12269 * cs-parser.jay: Allow a trailing comma before the close bracked
12270 in the attribute_section production.
12272 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12273 address of the instance was being taken, I will take this out,
12274 because we take the address of the object immediately here.
12276 2002-12-09 Ravi Pratap <ravi@ximian.com>
12278 * typemanager.cs (AreMultipleAllowed): Take care of the most
12279 obvious case where attribute type is not in the current assembly -
12282 2002-12-08 Miguel de Icaza <miguel@ximian.com>
12284 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12285 definitions, instead of doing that afterwards.
12287 Also we use a nice little hack, depending on the constructor, we
12288 know if we are a "composed" name or a simple name. Hence, we
12289 avoid the IndexOf test, and we avoid
12291 * codegen.cs: Add code to assist in a bug reporter to track down
12292 the source of a compiler crash.
12294 2002-12-07 Ravi Pratap <ravi@ximian.com>
12296 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12297 types have been emitted for a given element and flag an error
12298 if something which does not have AllowMultiple set is used more
12301 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12302 attribute types and their corresponding AllowMultiple properties
12304 (AreMultipleAllowed): Check the property for a given type.
12306 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12307 property in the case we have a TypeContainer.
12309 (Attributes.AddAttribute): Detect duplicates and just skip on
12310 adding them. This trivial fix catches a pretty gross error in our
12311 attribute emission - global attributes were being emitted twice!
12313 Bugzilla bug #33187 is now fixed.
12315 2002-12-06 Miguel de Icaza <miguel@ximian.com>
12317 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12318 instead of pp_and).
12320 * expression.cs (Binary.ResolveOperator): I can only use the
12321 Concat (string, string, string) and Concat (string, string,
12322 string, string) if the child is actually a concatenation of
12325 2002-12-04 Miguel de Icaza <miguel@ximian.com>
12327 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12328 context where we need a 2-character lookahead.
12330 * pending.cs (PendingImplementation): Rework so we can keep track
12331 of interface types all the time, and flag those which were
12332 implemented by parents as optional.
12334 2002-12-03 Miguel de Icaza <miguel@ximian.com>
12336 * expression.cs (Binary.ResolveOperator): Use
12337 String.Concat(string,string,string) or
12338 String.Concat(string,string,string,string) when possible.
12340 * typemanager: More helper methods.
12343 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12345 * pending.cs: remove the bogus return from GetMissingInterfaces()
12346 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12348 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12350 * namespace.cs: avoid duplicated 'using xxx' being added to
12351 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12352 when we get more than one 'using' statement for the same namespace.
12353 Report a CS0105 warning for it.
12355 2002-11-30 Miguel de Icaza <miguel@ximian.com>
12357 * cs-tokenizer.cs (consume_identifier): use read directly, instead
12358 of calling getChar/putback, uses internal knowledge of it.
12360 (xtoken): Reorder tokenizer so most common patterns are checked
12361 first. This reduces the compilation time in another 5% (from 8.11s
12362 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12364 The parsing time is 22% of the compilation in mcs, and from that
12365 64% is spent on the tokenization process.
12367 I tried using a binary search for keywords, but this is slower
12368 than the hashtable. Another option would be to do a couple of
12371 * Not use a StringBuilder, instead use an array of chars,
12372 with a set value. Notice that this way we could catch
12373 the 645 error without having to do it *afterwards*.
12375 * We could write a hand-parser to avoid the hashtable
12376 compares altogether.
12378 The identifier consumption process takes 37% of the tokenization
12379 time. Another 15% is spent on is_number. 56% of the time spent
12380 on is_number is spent on Int64.Parse:
12382 * We could probably choose based on the string length to
12383 use Int32.Parse or Int64.Parse and avoid all the 64-bit
12386 Another 3% is spend on wrapping `xtoken' in the `token' function.
12388 Handle 0xa0 as whitespace (#34752)
12390 2002-11-26 Miguel de Icaza <miguel@ximian.com>
12392 * typemanager.cs (IsCLRType): New routine to tell whether a type
12393 is one of the builtin types.
12395 Maybe it needs to use TypeCodes to be faster. Maybe we could use
12396 typecode in more places instead of doing pointer comparissions.
12397 We could leverage some knowledge about the way the typecodes are
12400 New code to cache namespaces in assemblies, it is currently not
12401 invoked, to be used soon.
12403 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12405 * expression.cs (Binary.ResolveOperator): specially handle
12406 strings, and do not perform user-defined operator overloading for
12409 2002-11-24 Miguel de Icaza <miguel@ximian.com>
12411 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12412 internalcall as it is a pretty simple operation; Avoid whenever
12413 possible to call Char.IsLetter.
12415 (consume_identifier): Cut by half the number of
12416 hashtable calls by merging the is_keyword and GetKeyword behavior.
12418 Do not short-circuit, because if we do, we
12419 report errors (ie, #if false && true would produce an invalid
12423 2002-11-24 Martin Baulig <martin@ximian.com>
12425 * expression.cs (Cast.TryReduce): If we're in checked syntax,
12426 check constant ranges and report a CS0221. Fixes #33186.
12428 2002-11-24 Martin Baulig <martin@ximian.com>
12430 * cs-parser.jay: Make this work for uninitialized variable
12431 declarations in the `for' initializer. Fixes #32416.
12433 2002-11-24 Martin Baulig <martin@ximian.com>
12435 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12436 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
12438 2002-11-24 Martin Baulig <martin@ximian.com>
12440 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12441 argument; if true, we also check for user-defined conversions.
12442 This is only needed if both arguments are of a user-defined type.
12443 Fixes #30443, added test-175.cs.
12444 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12446 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12448 2002-11-24 Martin Baulig <martin@ximian.com>
12450 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12451 function to get the store opcode.
12452 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12453 only emit the Ldelema if the store opcode is Stobj. You must run
12454 both test-34 and test-167 to test this. Fixes #34529.
12456 2002-11-23 Martin Baulig <martin@ximian.com>
12458 * ecore.cs (Expression.MemberLookup): Added additional
12459 `qualifier_type' argument which is used when we're being called
12460 from MemberAccess.DoResolve() and null if we're called from a
12462 (Expression.MemberLookupFailed): New method to report errors; this
12463 does the CS1540 check and reports the correct error message.
12465 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12466 argument for the CS1540 check and redone the way how we're dealing
12467 with private members. See the comment in the source code for details.
12468 (FilterWithClosure): Reverted this back to revision 1.197; renamed
12469 `closure_start_type' to `closure_qualifier_type' and check whether
12470 it's not null. It was not this filter being broken, it was just
12471 being called with the wrong arguments.
12473 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12474 and pass it the correct `qualifier_type'; this also does the error
12477 2002-11-22 Miguel de Icaza <miguel@ximian.com>
12479 * expression.cs (Invocation.EmitParams): If the we are dealing
12480 with a non-built-in value type, load its address as well.
12482 (ArrayCreation): Use a a pretty constant instead
12483 of the hardcoded value 2. Use 6 instead of 2 for the number of
12484 static initializers.
12486 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12487 because they are not really value types, just glorified integers.
12489 * driver.cs: Do not append .exe, the CSC compiler does not do it.
12491 * ecore.cs: Remove redundant code for enumerations, make them use
12492 the same code path as everything else, fixes the casting issue
12493 with enumerations in Windows.Forms.
12495 * attribute.cs: Do only cast to string if it is a string, the
12496 validation happens later.
12498 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12499 people upgrade their corlibs.
12501 * ecore.cs: Oops, enumerations were not following the entire code path
12503 2002-11-21 Miguel de Icaza <miguel@ximian.com>
12505 * typemanager.cs (FilterWithClosure): Commented out the test for
12506 1540 in typemanager.cs, as it has problems when accessing
12507 protected methods from a parent class (see test-174.cs).
12509 * attribute.cs (Attribute.ValidateGuid): new method.
12510 (Attribute.Resolve): Use above.
12512 2002-11-19 Miguel de Icaza <miguel@ximian.com>
12514 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12516 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12517 handling for enumerations, as we only needed the TypeContainer
12518 functionality to begin with (this is required for the fix below to
12519 work for enums that reference constants in a container class for
12522 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12524 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12525 a valid TypeBuilder to perform lookups on.o
12527 * class.cs (InheritableMemberSignatureCompare): Use true in the
12528 call to GetGetMethod and GetSetMethod, because we are comparing
12529 the signature, and we need to get the methods *even* if they are
12532 (PropertyBase.CheckBase): ditto.
12534 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12535 GotoCase.Resolve): Use Peel on EmpytCasts.
12537 * ecore.cs (EmptyCast): drop child, add Peel method.
12539 2002-11-17 Martin Baulig <martin@ximian.com>
12541 * ecore.cs (EmptyCast.Child): New public property.
12543 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12544 label resolved to an EmptyCast. Fixes #34162.
12545 (GotoCase.Resolve): Likewise.
12546 (Block.EmitMeta): Likewise.
12548 2002-11-17 Martin Baulig <martin@ximian.com>
12550 * expression.cs (Invocation.BetterConversion): Prefer int over
12551 uint; short over ushort; long over ulong for integer literals.
12552 Use ImplicitConversionExists instead of StandardConversionExists
12553 since we also need to check for user-defined implicit conversions.
12554 Fixes #34165. Added test-173.cs.
12556 2002-11-16 Martin Baulig <martin@ximian.com>
12558 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12559 with the `true' and `false' literals. Fixes #33151.
12561 2002-11-16 Martin Baulig <martin@ximian.com>
12563 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12564 October 22nd; don't do the cs1540 check for static members.
12566 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12567 now using our own filter here and doing the cs1540 check again.
12569 2002-11-16 Martin Baulig <martin@ximian.com>
12571 * support.cs (InternalParameters): Don't crash if we don't have
12572 any fixed parameters. Fixes #33532.
12574 2002-11-16 Martin Baulig <martin@ximian.com>
12576 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12577 when looking up static methods to make this work on Windows.
12580 2002-11-16 Martin Baulig <martin@ximian.com>
12582 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12583 a setter rather than using PropertyInfo.CanWrite.
12585 2002-11-15 Nick Drochak <ndrochak@gol.com>
12587 * class.cs: Allow acces to block member by subclasses. Fixes build
12590 2002-11-14 Martin Baulig <martin@ximian.com>
12592 * class.cs (Constructor.Emit): Added the extern/block check.
12595 2002-11-14 Martin Baulig <martin@ximian.com>
12597 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12598 iteration while looking for indexers, this is needed because the
12599 indexer may have a different name in our base classes. Fixed the
12600 error reporting (no indexers at all, not get accessor, no
12601 overloaded match). Fixes bug #33089.
12602 (IndexerAccess.DoResolveLValue): Likewise.
12604 2002-11-14 Martin Baulig <martin@ximian.com>
12606 * class.cs (PropertyBase.CheckBase): Make this work for multiple
12607 indexers. Fixes the first part of bug #33089.
12608 (MethodSignature.InheritableMemberSignatureCompare): Added support
12611 2002-11-13 Ravi Pratap <ravi@ximian.com>
12613 * attribute.cs (Attribute.Resolve): Catch the
12614 NullReferenceException and report it since it isn't supposed to
12617 2002-11-12 Miguel de Icaza <miguel@ximian.com>
12619 * expression.cs (Binary.EmitBranchable): Also handle the cases for
12620 LogicalOr and LogicalAnd that can benefit from recursively
12621 handling EmitBranchable. The code now should be nice for Paolo.
12623 2002-11-08 Miguel de Icaza <miguel@ximian.com>
12625 * typemanager.cs (LookupType): Added a negative-hit hashtable for
12626 the Type lookups, as we perform quite a number of lookups on
12627 non-Types. This can be removed once we can deterministically tell
12628 whether we have a type or a namespace in advance.
12630 But this might require special hacks from our corlib.
12634 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12635 and double which avoids a conversion from an integer to a double.
12637 * expression.cs: tiny optimization, avoid calling IsConstant,
12638 because it effectively performs the lookup twice.
12640 2002-11-06 Miguel de Icaza <miguel@ximian.com>
12642 But a bogus return here to keep the semantics of the old code
12643 until the Mono runtime is fixed.
12645 * pending.cs (GetMissingInterfaces): New method used to remove all
12646 the interfaces that are already implemented by our parent
12647 classes from the list of pending methods.
12649 * interface.cs: Add checks for calls after ResolveTypeExpr.
12651 2002-11-05 Miguel de Icaza <miguel@ximian.com>
12653 * class.cs (Class.Emit): Report warning 67: event not used if the
12654 warning level is beyond 3.
12656 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12657 being a NullLiteral.
12659 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12662 * class.cs (TypeContainer.GetClassBases): Cover a missing code
12663 path that might fail if a type can not be resolved.
12665 * expression.cs (Binary.Emit): Emit unsigned versions of the
12668 * driver.cs: use error 5.
12670 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12672 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12674 2002-11-01 Miguel de Icaza <miguel@ximian.com>
12676 * cs-parser.jay (switch_section): A beautiful patch from Martin
12677 Baulig that fixed 33094.
12679 2002-10-31 Miguel de Icaza <miguel@ximian.com>
12681 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12682 Check whether the base is abstract and report an error if so.
12684 * expression.cs (IndexerAccess.DoResolveLValue,
12685 IndexerAccess.DoResolve): ditto.
12687 (Invocation.DoResolve): ditto.
12689 (Invocation.FullMethodDesc): Improve the report string.
12691 * statement.cs (Block): Eliminate IsVariableDefined as it is
12692 basically just a wrapper for GetVariableInfo.
12694 * ecore.cs (SimpleName): Use new
12696 * support.cs (ReflectionParamter.ParameterType): We unwrap the
12697 type, as we return the actual parameter ref/unref state on a
12700 2002-10-30 Miguel de Icaza <miguel@ximian.com>
12702 * support.cs: Return proper flags REF/OUT fixing the previous
12705 * expression.cs: Reverted last patch, that was wrong. Is_ref is
12706 not used to mean `ref' but `ref or out' in ParameterReference
12708 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12709 full type signature instead of calling TypeManger.CSharpName
12712 * support.cs (InternalParameters.ParameterDesc): Do not compare
12713 directly to the modflags, because REF/OUT will actually be bitsets
12716 * delegate.cs (VerifyMethod): Check also the modifiers.
12718 * cs-tokenizer.cs: Fix bug where floating point values with an
12719 exponent where a sign was missing was ignored.
12721 * driver.cs: Allow multiple assemblies to be specified in a single
12724 2002-10-28 Miguel de Icaza <miguel@ximian.com>
12726 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
12727 because identifiers after a parenthesis would end up in this kind
12728 of production, and we needed to desamiguate it for having casts
12731 (UserDefinedType *) xxx
12733 2002-10-24 Miguel de Icaza <miguel@ximian.com>
12735 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12736 we should set on the Bindingflags.NonPublic, but not turn on
12737 private_ok. private_ok controls whether a Private member is
12738 returned (this is chekced on the filter routine), while the
12739 BindingFlags.NonPublic just controls whether private/protected
12740 will be allowed. This fixes the problem part of the problem of
12741 private properties being allowed to be used in derived classes.
12743 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12744 so we can call the children DoResolveLValue method (this will
12745 properly signal errors on lvalue assignments to base properties)
12747 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12748 getter are null, and we have a property info, we know that this
12749 happened because the lookup failed, so we report an error 122 for
12750 protection level violation.
12752 We also silently return if setter and getter are null in the
12753 resolve functions, this condition only happens if we have flagged
12754 the error before. This is the other half of the problem.
12756 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12757 not have accessibility information, that is why we were returning
12758 true in the filter function in typemanager.cs.
12760 To properly report 122 (property is inaccessible because of its
12761 protection level) correctly, we report this error in ResolveAccess
12762 by failing if both the setter and the getter are lacking (ie, the
12765 DoResolve and DoLResolve have been modified to check for both
12766 setter/getter being null and returning silently, the reason being
12767 that I did not want to put the knowledge about this error in upper
12770 int old = Report.Errors;
12771 x = new PropertyExpr (...);
12772 if (old != Report.Errors)
12777 So the property expr is returned, but it is invalid, so the error
12778 will be flagged during the resolve process.
12780 * class.cs: Remove InheritablePropertySignatureCompare from the
12781 class, as we no longer depend on the property signature to compute
12782 whether it is possible to implement a method or not.
12784 The reason is that calling PropertyInfo.GetGetMethod will return
12785 null (in .NET, in Mono it works, and we should change this), in
12786 cases where the Get Method does not exist in that particular
12791 class X { public virtual int A { get { return 1; } } }
12793 class Z : Y { public override int A { get { return 2; } } }
12795 Would fail in Z because the parent (Y) would not have the property
12796 defined. So we avoid this completely now (because the alternative
12797 fix was ugly and slow), and we now depend exclusively on the
12800 (PropertyBase.CheckBase): Use a method-base mechanism to find our
12801 reference method, instead of using the property.
12803 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12804 routines are gone now.
12806 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12807 names, they were incorrectly named.
12809 * cs-tokenizer.cs: Return are more gentle token on failure.
12811 * pending.cs (PendingImplementation.InterfaceMethod): This routine
12812 had an out-of-sync index variable, which caused it to remove from
12813 the list of pending methods the wrong method sometimes.
12815 2002-10-22 Miguel de Icaza <miguel@ximian.com>
12817 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12818 CanWrite, because those refer to this particular instance of the
12819 property, and do not take into account the fact that we can
12820 override single members of a property.
12822 Constructor requires an EmitContext. The resolution process does
12823 not happen here, but we need to compute the accessors before,
12824 because the resolution does not always happen for properties.
12826 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12827 subclass, before we did not update this flag, but we did update
12830 (GetAccessors): Drop this routine, as it did not work in the
12831 presence of partially overwritten set/get methods.
12833 Notice that this broke the cs1540 detection, but that will require
12836 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12840 * driver.cs: issue a warning instead of an error if we don't support
12841 debugging for the platform. Also ignore a couple of errors that may
12842 arise when trying to write the symbols. Undo my previous patch.
12844 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12846 * driver.cs: ignore /debug switch except for Unix platforms.
12848 2002-10-23 Nick Drochak <ndrochak@gol.com>
12850 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12852 2002-10-21 Miguel de Icaza <miguel@ximian.com>
12854 * driver.cs: Do not make mcs-debug conditional, so we do not break
12855 builds that use it.
12857 * statement.cs (UsageVector.MergeChildren): I would like Martin to
12858 review this patch. But basically after all the children variables
12859 have been merged, the value of "Breaks" was not being set to
12860 new_breaks for Switch blocks. I think that it should be set after
12861 it has executed. Currently I set this to the value of new_breaks,
12862 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12863 conservative, but I do not understand this code very well.
12865 I did not break anything in the build, so that is good ;-)
12867 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12869 2002-10-20 Mark Crichton <crichton@gimp.org>
12871 * cfold.cs: Fixed compile blocker. Really fixed it this time.
12873 2002-10-20 Nick Drochak <ndrochak@gol.com>
12875 * cfold.cs: Fixed compile blocker.
12877 2002-10-20 Miguel de Icaza <miguel@ximian.com>
12879 * driver.cs: I was chekcing the key, not the file.
12881 2002-10-19 Ravi Pratap <ravi@ximian.com>
12883 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12884 message that we were generating - we just need to silently return
12887 2002-10-19 Miguel de Icaza <miguel@ximian.com>
12889 * class.cs (Event.Define): Change my previous commit, as this
12890 breaks the debugger. This is a temporary hack, as it seems like
12891 the compiler is generating events incorrectly to begin with.
12893 * expression.cs (Binary.ResolveOperator): Added support for
12894 "U operator - (E x, E y)"
12896 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12899 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12900 init-only variables, but this path did not take into account that
12901 there might be also instance readonly variables. Correct this
12904 This fixes bug 32253
12906 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12909 * driver.cs: Change the extension for modules to `netmodule'
12911 * cs-parser.jay: Improved slightly the location tracking for
12912 the debugger symbols.
12914 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12915 modifiers that were specified instead of the hardcoded value
12916 (FamAndAssem). This was basically ignoring the static modifier,
12917 and others. Fixes 32429.
12919 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12920 fixed a bug in the process (32476)
12922 * expression.cs (ArrayAccess.EmitAssign): Patch from
12923 hwang_rob@yahoo.ca that fixes bug 31834.3
12925 2002-10-18 Miguel de Icaza <miguel@ximian.com>
12927 * driver.cs: Make the module extension .netmodule.
12929 2002-10-16 Miguel de Icaza <miguel@ximian.com>
12931 * driver.cs: Report an error if the resource file is not found
12932 instead of crashing.
12934 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12935 false, like Emit does.
12937 2002-10-16 Nick Drochak <ndrochak@gol.com>
12939 * typemanager.cs: Remove unused private member. Also reported mcs
12940 bug to report this as a warning like csc.
12942 2002-10-15 Martin Baulig <martin@gnome.org>
12944 * statement.cs (Statement.Emit): Made this a virtual method; emits
12945 the line number info and calls DoEmit().
12946 (Statement.DoEmit): New protected abstract method, formerly knows
12947 as Statement.Emit().
12949 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12951 2002-10-11 Miguel de Icaza <miguel@ximian.com>
12953 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12954 have fixed a remaining problem: not every AddXXXX was adding a
12955 fully qualified name.
12957 Now everyone registers a fully qualified name in the DeclSpace as
12958 being defined instead of the partial name.
12960 Downsides: we are slower than we need to be due to the excess
12961 copies and the names being registered this way.
12963 The reason for this is that we currently depend (on the corlib
12964 bootstrap for instance) that types are fully qualified, because
12965 we dump all the types in the namespace, and we should really have
12966 types inserted into the proper namespace, so we can only store the
12967 basenames in the defined_names array.
12969 2002-10-10 Martin Baulig <martin@gnome.org>
12971 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12972 from bug #31834, see the bug report for a testcase which is
12975 2002-10-10 Martin Baulig <martin@gnome.org>
12977 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12978 flow analysis code for this.
12980 * statement.cs (Do, While, For): Tell the flow analysis code about
12982 (FlowBranching.UsageVector): Added support for infinite loops.
12983 (Block.Resolve): Moved the dead code elimination here and use flow
12986 2002-10-09 Miguel de Icaza <miguel@ximian.com>
12988 * class.cs (Field.Define): Catch cycles on struct type
12991 * typemanager.cs (IsUnmanagedtype): Do not recursively check
12992 fields if the fields are static. We only need to check instance
12995 * expression.cs (As.DoResolve): Test for reference type.
12997 * statement.cs (Using.ResolveExpression): Use
12998 ConvertImplicitRequired, not ConvertImplicit which reports an
13000 (Using.ResolveLocalVariableDecls): ditto.
13002 * expression.cs (Binary.ResolveOperator): Report errors in a few
13003 places where we had to.
13005 * typemanager.cs (IsUnmanagedtype): Finish implementation.
13007 2002-10-08 Miguel de Icaza <miguel@ximian.com>
13009 * expression.cs: Use StoreFromPtr instead of extracting the type
13010 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
13012 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13013 an enumeration value to a System.Enum, but System.Enum is not a
13014 value type, but an class type, so we need to box.
13016 (Expression.ConvertExplicit): One codepath could return
13017 errors but not flag them. Fix this. Fixes #31853
13019 * parameter.cs (Resolve): Do not allow void as a parameter type.
13021 2002-10-06 Martin Baulig <martin@gnome.org>
13023 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13024 if it's a class type and not a struct. Fixes #31815.
13026 2002-10-06 Martin Baulig <martin@gnome.org>
13028 * statement.cs: Reworked the flow analysis code a bit to make it
13029 usable for dead code elimination.
13031 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13033 * cs-parser.jay: allow empty source files. Fixes bug #31781.
13035 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13037 * expression.cs (ComposedCast.DoResolveType): A quick workaround
13038 to fix the test 165, will investigate deeper.
13040 2002-10-04 Martin Baulig <martin@gnome.org>
13042 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13043 finally blocks actually work.
13044 (Try.Resolve): We don't need to create a sibling for `finally' if
13045 there is no finally block.
13047 2002-10-04 Martin Baulig <martin@gnome.org>
13049 * class.cs (Constructor.Define): The default accessibility for a
13050 non-default constructor is private, not public.
13052 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13054 * class.cs (Constructor): Make AllowedModifiers public, add
13057 * cs-parser.jay: Perform the modifiers test here, as the
13058 constructor for the Constructor class usually receives a zero
13059 because of the way we create it (first we create, later we
13060 customize, and we were never checking the modifiers).
13062 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13063 is a version of LookupTypeReflection that includes the type-name
13064 cache. This can be used as a fast path for functions that know
13065 the fully qualified name and are only calling into *.GetType() to
13066 obtain a composed type.
13068 This is also used by TypeManager.LookupType during its type
13071 (LookupType): We now also track the real type name, as sometimes
13072 we can get a quey for the real type name from things like
13073 ComposedCast. This fixes bug 31422.
13075 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13076 complete type fullname, it does not have to go through the type
13077 resolution system to obtain the composed version of the type (for
13078 obtaining arrays or pointers).
13080 (Conditional.Emit): Use the EmitBoolExpression to
13081 generate nicer code, as requested by Paolo.
13083 (ArrayCreation.CheckIndices): Use the patch from
13084 hwang_rob@yahoo.ca to validate the array initializers.
13086 2002-10-03 Miguel de Icaza <miguel@ximian.com>
13088 * class.cs (ConstructorInitializer.Emit): simplify code by using
13089 Invocation.EmitCall, and at the same time, fix the bugs in calling
13090 parent constructors that took variable arguments.
13092 * ecore.cs (Expression.ConvertNumericExplicit,
13093 Expression.ImplicitNumericConversion): Remove the code that
13094 manually wrapped decimal (InternalTypeConstructor call is now gone
13097 * expression.cs (Cast.TryReduce): Also handle decimal types when
13098 trying to perform a constant fold on the type.
13100 * typemanager.cs (IsUnmanagedtype): Partially implemented.
13102 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13103 that only turned off an error report, and did nothing else.
13105 2002-10-02 Miguel de Icaza <miguel@ximian.com>
13107 * driver.cs: Handle and ignore /fullpaths
13109 2002-10-01 Miguel de Icaza <miguel@ximian.com>
13111 * expression.cs (Binary.ResolveOperator): Catch the case where
13112 DoNumericPromotions returns true,
13114 (Binary.DoNumericPromotions): Simplify the code, and the tests.
13116 2002-09-27 Miguel de Icaza <miguel@ximian.com>
13118 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13121 2002-09-26 Miguel de Icaza <miguel@ximian.com>
13123 * ecore.cs (ConvertNumericExplicit): It is not enough that the
13124 conversion exists, but it is also required that the conversion be
13125 performed. This manifested in "(Type64Enum) 2".
13127 * class.cs (TypeManager.AddMethod): The fix is not to change
13128 AddEnum, because that one was using a fully qualified name (every
13129 DeclSpace derivative does), but to change the AddMethod routine
13130 that was using an un-namespaced name. This now correctly reports
13131 the duplicated name.
13133 Revert patch until I can properly fix it. The issue
13134 is that we have a shared Type space across all namespaces
13135 currently, which is wrong.
13137 Options include making the Namespace a DeclSpace, and merge
13138 current_namespace/current_container in the parser.
13140 2002-09-25 Miguel de Icaza <miguel@ximian.com>
13142 * cs-parser.jay: Improve error reporting when we get a different
13143 kind of expression in local_variable_type and
13144 local_variable_pointer_type.
13146 Propagate this to avoid missleading errors being reported.
13148 * ecore.cs (ImplicitReferenceConversion): treat
13149 TypeManager.value_type as a target just like object_type. As
13154 Is valid, and needs to result in the int 1 being boxed before it
13155 is assigned to the value type v.
13157 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
13158 to validate the enumeration name.
13160 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
13161 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
13162 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
13164 * ecore.cs (TryImplicitIntConversion): When doing an
13165 implicit-enumeration-conversion, check if the type is 64-bits and
13166 perform a conversion before passing to EnumConstant.
13168 2002-09-23 Miguel de Icaza <miguel@ximian.com>
13170 * decl.cs (Error_AmbiguousTypeReference); New routine used to
13171 report ambiguous type references. Unlike the MS version, we
13172 report what the ambiguity is. Innovation at work ;-)
13174 (DeclSpace.FindType): Require a location argument to
13175 display when we display an ambiguous error.
13177 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
13179 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
13181 * expression.cs (EmitDynamicInitializers): Apply patch from
13182 hwang_rob@yahoo.ca that fixes the order in which we emit our
13185 2002-09-21 Martin Baulig <martin@gnome.org>
13187 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
13188 delegate takes no arguments.
13190 2002-09-20 Miguel de Icaza <miguel@ximian.com>
13192 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
13195 * expression.cs: Extract the underlying type.
13197 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
13199 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
13201 2002-09-19 Miguel de Icaza <miguel@ximian.com>
13203 * class.cs (TypeContainer.DefineType): We can not use the nice
13204 PackingSize with the size set to 1 DefineType method, because it
13205 will not allow us to define the interfaces that the struct
13208 This completes the fixing of bug 27287
13210 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
13211 means also structs. This fixes part of the problem.
13212 (Expresion.ImplicitReferenceConversionExists): ditto.
13214 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
13215 error if there were no errors reported during the type lookup
13216 process, to avoid duplicates or redundant errors. Without this
13217 you would get an ambiguous errors plus a type not found. We have
13218 beaten the user enough with the first error.
13220 (DeclSparce.FindType): Emit a warning if we have an ambiguous
13223 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
13224 during the resolution process, stop the lookup, this avoids
13225 repeated error reports (same error twice).
13227 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
13229 * typemanager.cs (LookupType): Redo the type lookup code to match
13230 the needs of System.Reflection.
13232 The issue is that System.Reflection requires references to nested
13233 types to begin with a "+" sign instead of a dot. So toplevel
13234 types look like: "NameSpace.TopLevelClass", and nested ones look
13235 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
13238 2002-09-19 Martin Baulig <martin@gnome.org>
13240 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
13241 says that a method always returns or always throws an exception,
13242 don't report the CS0161.
13244 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13245 set `Returns = new_returns'.
13247 2002-09-19 Martin Baulig <martin@gnome.org>
13249 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13250 to an enum constant, check for a CS0176.
13252 2002-09-18 Miguel de Icaza <miguel@ximian.com>
13254 * class.cs (TypeContainer.CheckPairedOperators): Now we check
13255 for operators that must be in pairs and report errors.
13257 * ecore.cs (SimpleName.DoResolveType): During the initial type
13258 resolution process, when we define types recursively, we must
13259 check first for types in our current scope before we perform
13260 lookups in the enclosing scopes.
13262 * expression.cs (MakeByteBlob): Handle Decimal blobs.
13264 (Invocation.VerifyArgumentsCompat): Call
13265 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13266 I thought we were supposed to always call this, but there are a
13267 few places in the code where we dont do it.
13269 2002-09-17 Miguel de Icaza <miguel@ximian.com>
13271 * driver.cs: Add support in -linkres and -resource to specify the
13272 name of the identifier.
13274 2002-09-16 Miguel de Icaza <miguel@ximian.com>
13276 * ecore.cs (StandardConversionExists): Sync with the conversion
13277 code: allow anything-* to void* conversions.
13279 (FindMostSpecificSource): Use an Expression argument
13280 instead of a Type, because we might be handed over a Literal which
13281 gets a few more implicit conversions that plain types do not. So
13282 this information was being lost.
13284 Also, we drop the temporary type-holder expression when not
13287 2002-09-17 Martin Baulig <martin@gnome.org>
13289 * class.cs (PropertyBase.CheckBase): Don't check the base class if
13290 this is an explicit interface implementation.
13292 2002-09-17 Martin Baulig <martin@gnome.org>
13294 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13295 different `IndexerName' attributes.
13297 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13298 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13299 virtual CommonResolve().
13301 2002-09-16 Miguel de Icaza <miguel@ximian.com>
13303 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13304 and convert that to the UnderlyingType.
13306 * statement.cs (Foreach.Resolve): Indexers are just like variables
13307 or PropertyAccesses.
13309 * cs-tokenizer.cs (consume_string): Track line numbers and columns
13310 inside quoted strings, we were not doing this before.
13312 2002-09-16 Martin Baulig <martin@gnome.org>
13314 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13315 resolve it. This is needed for the definite assignment check of the
13316 instance expression, fixes bug #29846.
13317 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13319 2002-09-16 Nick Drochak <ndrochak@gol.com>
13321 * parameter.cs: Fix compile error. Cannot reference static member
13322 from an instance object. Is this an mcs bug?
13324 2002-09-14 Martin Baulig <martin@gnome.org>
13326 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13327 multiple times. Fixes bug #30295, added test-166.cs.
13329 2002-09-14 Martin Baulig <martin@gnome.org>
13331 * statement.cs (Block.Emit): Don't emit unreachable code.
13332 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13333 `break' statements.
13334 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13336 2002-09-14 Martin Baulig <martin@gnome.org>
13338 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13341 2002-09-14 Martin Baulig <martin@gnome.org>
13343 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13344 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13345 be false on the ms runtime.
13347 2002-09-13 Martin Baulig <martin@gnome.org>
13349 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13350 the CS0038 error message.
13352 2002-09-12 Miguel de Icaza <miguel@ximian.com>
13354 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13355 constant inside, return it.
13357 2002-09-12 Martin Baulig <martin@gnome.org>
13359 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13360 implicit conversion can be done between enum types.
13362 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13363 check whether an implicit conversion to the current enum's UnderlyingType
13364 exists and report an error if not.
13366 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13367 without debugging support.
13369 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13370 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
13372 2002-09-12 Martin Baulig <martin@gnome.org>
13374 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13376 * ecore.cs (IMemberExpr.DeclaringType): New property.
13377 (SimpleName.SimpleNameResolve): Check whether we're accessing a
13378 nonstatic member of an outer type (CS0038).
13380 2002-09-11 Miguel de Icaza <miguel@ximian.com>
13382 * driver.cs: Activate the using-error detector at warning level
13383 4 (at least for MS-compatible APIs).
13385 * namespace.cs (VerifyUsing): Small buglett fix.
13387 * pending.cs (PendingImplementation): pass the container pointer.
13389 * interface.cs (GetMethods): Allow for recursive definition. Long
13390 term, I would like to move every type to support recursive
13391 definitions, not the current ordering mechanism that we have right
13394 The situation is this: Attributes are handled before interfaces,
13395 so we can apply attributes to interfaces. But some attributes
13396 implement interfaces, we will now handle the simple cases
13397 (recursive definitions will just get an error).
13399 * parameter.cs: Only invalidate types at the end if we fail to
13402 2002-09-09 Martin Baulig <martin@gnome.org>
13404 * ecore.cs (PropertyExpr.Emit): Also check for
13405 TypeManager.system_int_array_get_length so this'll also work when
13406 compiling corlib. Fixes #30003.
13408 2002-09-09 Martin Baulig <martin@gnome.org>
13410 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13411 and throw an exception if we can't get the type's size. Fixed #30040,
13414 2002-09-09 Martin Baulig <martin@gnome.org>
13416 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13418 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13419 context. Fixes bug #30027.
13421 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13422 virtual functions. Fixes bug #30043, added test-164.cs.
13424 2002-09-08 Ravi Pratap <ravi@ximian.com>
13426 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13428 2002-09-08 Nick Drochak <ndrochak@gol.com>
13430 * driver.cs: Use an object to get the windows codepage since it's not a
13433 2002-09-08 Miguel de Icaza <miguel@ximian.com>
13435 * statement.cs (For.Emit): for infinite loops (test == null)
13436 return whether there is a break inside, not always "true".
13438 * namespace.cs (UsingEntry): New struct to hold the name of the
13439 using definition, the location where it is defined, and whether it
13440 has been used in a successful type lookup.
13442 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13447 2002-09-06 Ravi Pratap <ravi@ximian.com>
13449 * attribute.cs : Fix incorrect code which relied on catching
13450 a NullReferenceException to detect a null being passed in
13451 where an object was expected.
13453 2002-09-06 Miguel de Icaza <miguel@ximian.com>
13455 * statement.cs (Try): flag the catch variable as assigned
13457 * expression.cs (Cast): Simplified by using ResolveType instead of
13458 manually resolving.
13460 * statement.cs (Catch): Fix bug by using ResolveType.
13462 2002-09-06 Ravi Pratap <ravi@ximian.com>
13464 * expression.cs (BetterConversion): Special case for when we have
13465 a NullLiteral as the argument and we have to choose between string
13466 and object types - we choose string the way csc does.
13468 * attribute.cs (Attribute.Resolve): Catch the
13469 NullReferenceException and report error #182 since the Mono
13470 runtime no more has the bug and having this exception raised means
13471 we tried to select a constructor which takes an object and is
13474 2002-09-05 Ravi Pratap <ravi@ximian.com>
13476 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13477 message (1502, 1503) when we can't locate a method after overload
13478 resolution. This is much more informative and closes the bug
13481 * interface.cs (PopulateMethod): Return if there are no argument
13482 types. Fixes a NullReferenceException bug.
13484 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13485 expressions too. Previously we were checking only in one place for
13486 positional arguments leaving out named arguments.
13488 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13489 type to the enum type is not allowed. Remove code corresponding to
13492 (ConvertNumericExplicit): Allow explicit conversions from
13493 the underlying type to enum type. This precisely follows the spec
13494 and closes a bug filed by Gonzalo.
13496 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13499 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13501 2002-09-03 Miguel de Icaza <miguel@ximian.com>
13503 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13504 it was important that we stored the right value after the
13505 reduction in `converted'.
13507 2002-09-04 Martin Baulig <martin@gnome.org>
13509 * location.cs (Location.SymbolDocument): Use full pathnames for the
13512 2002-08-30 Miguel de Icaza <miguel@ximian.com>
13514 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13515 of the expression resolve mechanism, because that will catch the
13516 SimpleName error failures.
13518 (Conditional): If we can not resolve the
13519 expression, return, do not crash.
13521 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13524 (location): display token name instead of its number.
13526 2002-08-28 Martin Baulig <martin@gnome.org>
13528 * expression.cs (Binary.ResolveOperator): Don't silently return
13529 but return an error if an operator cannot be applied between two
13532 2002-08-28 Martin Baulig <martin@gnome.org>
13534 * class.cs (Constructor.Define): Set the permission attributes
13535 correctly instead of making all constructors public.
13537 2002-08-28 Martin Baulig <martin@gnome.org>
13539 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13540 for private members before reporting a CS0103; if we find anything,
13543 2002-08-28 Martin Baulig <martin@gnome.org>
13545 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13546 to check whether `closure_start_type == closure_invocation_type',
13547 we also need to check whether `m.DeclaringType == closure_invocation_type'
13548 before bypassing the permission checks. We might be accessing
13549 protected/private members from the base class.
13550 (TypeManager.RealMemberLookup): Only set private_ok if private
13551 members were requested via BindingFlags.NonPublic.
13553 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13555 * expression.cs (MemberAccess.ResolveMemberAccess): Set
13556 MethodGroupExpr.IsExplicitImpl if appropriate.
13557 (Invocation.DoResolve): Don't report the CS0120 for explicit
13558 interface implementations.
13560 2002-08-27 Martin Baulig <martin@gnome.org>
13562 * expression.cs (Invocation.DoResolve): If this is a static
13563 method and we don't have an InstanceExpression, we must report
13566 2002-08-25 Martin Baulig <martin@gnome.org>
13568 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13569 `==' between a valuetype and an object.
13571 2002-08-25 Miguel de Icaza <miguel@ximian.com>
13573 * ecore.cs (TypeExpr): Provide a ToString method.
13575 2002-08-24 Martin Baulig <martin@gnome.org>
13577 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13578 now called proggie.dbg and it's a binary file.
13580 2002-08-23 Martin Baulig <martin@gnome.org>
13582 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13584 2002-08-23 Martin Baulig <martin@gnome.org>
13586 * struct.cs (MyStructInfo.ctor): Make this work with empty
13587 structs; it's not allowed to use foreach() on null.
13589 2002-08-23 Martin Baulig <martin@gnome.org>
13591 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13592 writer the full pathname of the generated assembly.
13594 2002-08-23 Martin Baulig <martin@gnome.org>
13596 * statements.cs (FlowBranching.UsageVector.MergeChildren):
13597 A `finally' block never returns or breaks; improved handling of
13600 2002-08-23 Martin Baulig <martin@gnome.org>
13602 * statement.cs (Throw.Resolve): Allow `throw null'.
13604 2002-08-23 Martin Baulig <martin@gnome.org>
13606 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13607 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13608 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
13609 MemberLookup would return a wrong event if this is an explicit
13610 interface implementation and the class has an event with the same
13613 2002-08-23 Martin Baulig <martin@gnome.org>
13615 * statement.cs (Block.AddChildVariableNames): New public method.
13616 (Block.AddChildVariableName): Likewise.
13617 (Block.IsVariableNameUsedInChildBlock): Likewise.
13618 (Block.AddVariable): Check whether a variable name has already
13619 been used in a child block.
13621 * cs-parser.jay (declare_local_variables): Mark all variable names
13622 from the current block as being used in a child block in the
13625 2002-08-23 Martin Baulig <martin@gnome.org>
13627 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13628 find the symbol writer.
13630 * driver.cs: csc also allows the arguments to /define being
13631 separated by commas, not only by semicolons.
13633 2002-08-23 Martin Baulig <martin@gnome.org>
13635 * interface.cs (Interface.GetMembers): Added static check for events.
13637 2002-08-15 Martin Baulig <martin@gnome.org>
13639 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13640 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13642 * ecore.cs (Expression.MemberLookup): Added documentation and explained
13643 why the MethodData.EmitDestructor() change was necessary.
13645 2002-08-20 Martin Baulig <martin@gnome.org>
13647 * class.cs (TypeContainer.FindMembers): Added static check for events.
13649 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13651 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13652 use Type.GetEvents(), not Type.FindMembers().
13654 2002-08-20 Martin Baulig <martin@gnome.org>
13656 * decl.cs (MemberCache): Added a special method cache which will
13657 be used for method-only searched. This ensures that a method
13658 search will return a MethodInfo with the correct ReflectedType for
13661 2002-08-20 Martin Baulig <martin@gnome.org>
13663 * decl.cs (DeclSpace.FindMembers): Made this public.
13665 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13667 * delegate.cs: fixed build on windows.
13668 [FIXME: Filed as bug #29150: MCS must report these errors.]
13670 2002-08-19 Ravi Pratap <ravi@ximian.com>
13672 * ecore.cs (StandardConversionExists): Return a false
13673 if we are trying to convert the void type to anything else
13674 since that is not allowed.
13676 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13677 we flag error 70 in the event an event is trying to be accessed
13678 directly from outside the declaring type.
13680 2002-08-20 Martin Baulig <martin@gnome.org>
13682 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13683 MemberCache from typemanager.cs to decl.cs.
13685 2002-08-19 Martin Baulig <martin@gnome.org>
13687 * class.cs (TypeContainer): Implement IMemberContainer.
13688 (TypeContainer.DefineMembers): Create the MemberCache.
13689 (TypeContainer.FindMembers): Do better BindingFlags checking; only
13690 return public members if BindingFlags.Public was given, check
13691 whether members are static.
13693 2002-08-16 Martin Baulig <martin@gnome.org>
13695 * decl.cs (DeclSpace.Define): Splitted this in Define and
13696 DefineMembers. DefineMembers is called first and initializes the
13699 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
13700 DefineMembers() on all our DeclSpaces.
13702 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13703 but call DefineMembers() on all nested interfaces. We call their
13704 Define() in our new Define() function.
13706 * interface.cs (Interface): Implement IMemberContainer.
13707 (Interface.Define): Moved all code except the attribute stuf to
13709 (Interface.DefineMembers): Initialize the member cache.
13711 * typemanager.cs (IMemberFinder): Removed this interface, we don't
13712 need this anymore since we can use MemberCache.FindMembers directly.
13714 2002-08-19 Martin Baulig <martin@gnome.org>
13716 * typemanager.cs (MemberCache): When creating the cache for an
13717 interface type, add all inherited members.
13718 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13719 to `out bool used_cache' and documented it.
13720 (TypeManager.MemberLookup): If we already used the cache in the first
13721 iteration, we don't need to do the interfaces check.
13723 2002-08-19 Martin Baulig <martin@gnome.org>
13725 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
13726 here from IMemberFinder and don't implement this interface anymore.
13727 (DeclSpace.MemberCache): Moved here from IMemberFinder.
13729 * typemanager.cs (IMemberFinder): This interface is now only used by
13730 classes which actually support the member cache.
13731 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13732 since we only put DeclSpaces into this Hashtable.
13733 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13734 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13736 2002-08-16 Martin Baulig <martin@gnome.org>
13738 * typemanager.cs (ICachingMemberFinder): Removed.
13739 (IMemberFinder.MemberCache): New property.
13740 (TypeManager.FindMembers): Merged this with RealFindMembers().
13741 This function will never be called from TypeManager.MemberLookup()
13742 so we can't use the cache here, just the IMemberFinder.
13743 (TypeManager.MemberLookup_FindMembers): Check whether the
13744 IMemberFinder has a MemberCache and call the cache's FindMembers
13746 (MemberCache): Rewrote larger parts of this yet another time and
13747 cleaned it up a bit.
13749 2002-08-15 Miguel de Icaza <miguel@ximian.com>
13751 * driver.cs (LoadArgs): Support quoting.
13753 (Usage): Show the CSC-like command line arguments.
13755 Improved a few error messages.
13757 2002-08-15 Martin Baulig <martin@gnome.org>
13759 * typemanager.cs (IMemberContainer.Type): New property.
13760 (IMemberContainer.IsInterface): New property.
13762 The following changes are conditional to BROKEN_RUNTIME, which is
13763 defined at the top of the file.
13765 * typemanager.cs (MemberCache.MemberCache): Don't add the base
13766 class'es members, but add all members from TypeHandle.ObjectType
13767 if we're an interface.
13768 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13769 is the current type.
13770 (MemberCache.CacheEntry.Container): Removed this field.
13771 (TypeHandle.GetMembers): Include inherited members.
13773 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13775 * typemanager.cs: fixed compilation and added a comment on a field that
13778 2002-08-15 Martin Baulig <martin@gnome.org>
13780 * class.cs (ConstructorInitializer.Resolve): In the
13781 Expression.MemberLookup call, use the queried_type as
13784 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13785 declared' attribute, it's always true.
13786 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13787 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13788 temporary wrapper for FindMembers which tells MemberLookup whether
13789 members from the base classes are included in the return value.
13790 This will go away soon.
13791 (TypeManager.MemberLookup): Use this temporary hack here; once the
13792 new MemberCache is completed, we don't need to do the DeclaredOnly
13793 looping here anymore since the MemberCache will take care of this.
13794 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13795 (MemberCache): When creating the MemberCache for a class, get
13796 members from the current class and all its base classes.
13797 (MemberCache.CacheEntry.Container): New field. This is a
13798 temporary hack until the Mono runtime is fixed to distinguish
13799 between ReflectedType and DeclaringType. It allows us to use MCS
13800 with both the MS runtime and the unfixed Mono runtime without
13801 problems and without accecting performance.
13802 (MemberCache.SearchMembers): The DeclaredOnly looping from
13803 TypeManager.MemberLookup is now done here.
13805 2002-08-14 Martin Baulig <martin@gnome.org>
13807 * statement.cs (MyStructInfo.MyStructInfo): Don't call
13808 Type.GetFields on dynamic types but get the fields from the
13809 corresponding TypeContainer.
13810 (MyStructInfo.GetStructInfo): Added check for enum types.
13812 * typemanager.cs (MemberList.IsSynchronized): Implemented.
13813 (MemberList.SyncRoot): Implemented.
13814 (TypeManager.FilterWithClosure): No need to check permissions if
13815 closure_start_type == closure_invocation_type, don't crash if
13816 closure_invocation_type is null.
13818 2002-08-13 Martin Baulig <martin@gnome.org>
13820 Rewrote TypeContainer.FindMembers to use a member cache. This
13821 gives us a speed increase of about 35% for the self-hosting MCS
13822 build and of about 15-20% for the class libs (both on GNU/Linux).
13824 * report.cs (Timer): New class to get enhanced profiling. This
13825 whole class is "TIMER" conditional since it remarkably slows down
13828 * class.cs (MemberList): New class. This is an IList wrapper
13829 which we're now using instead of passing MemberInfo[]'s around to
13830 avoid copying this array unnecessarily.
13831 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13832 (ICachingMemberFinder, IMemberContainer): New interface.
13833 (TypeManager.FilterWithClosure): If `criteria' is null, the name
13834 has already been checked, otherwise use it for the name comparision.
13835 (TypeManager.FindMembers): Renamed to RealMemberFinder and
13836 provided wrapper which tries to use ICachingMemberFinder.FindMembers
13837 if possible. Returns a MemberList, not a MemberInfo [].
13838 (TypeHandle): New class, implements IMemberContainer. We create
13839 one instance of this class per type, it contains a MemberCache
13840 which is used to do the member lookups.
13841 (MemberCache): New class. Each instance of this class contains
13842 all members of a type and a name-based hash table.
13843 (MemberCache.FindMembers): This is our new member lookup
13844 function. First, it looks up all members of the requested name in
13845 the hash table. Then, it walks this list and sorts out all
13846 applicable members and returns them.
13848 2002-08-13 Martin Baulig <martin@gnome.org>
13850 In addition to a nice code cleanup, this gives us a performance
13851 increase of about 1.4% on GNU/Linux - not much, but it's already
13852 half a second for the self-hosting MCS compilation.
13854 * typemanager.cs (IMemberFinder): New interface. It is used by
13855 TypeManager.FindMembers to call FindMembers on a TypeContainer,
13856 Enum, Delegate or Interface.
13857 (TypeManager.finder_to_member_finder): New PtrHashtable.
13858 (TypeManager.finder_to_container): Removed.
13859 (TypeManager.finder_to_delegate): Removed.
13860 (TypeManager.finder_to_interface): Removed.
13861 (TypeManager.finder_to_enum): Removed.
13863 * interface.cs (Interface): Implement IMemberFinder.
13865 * delegate.cs (Delegate): Implement IMemberFinder.
13867 * enum.cs (Enum): Implement IMemberFinder.
13869 * class.cs (TypeContainer): Implement IMemberFinder.
13871 2002-08-12 Martin Baulig <martin@gnome.org>
13873 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13875 2002-08-12 Martin Baulig <martin@gnome.org>
13877 * ecore.cs (ITypeExpression): New interface for expressions which
13879 (TypeExpression): Renamed to TypeLookupExpression.
13880 (Expression.DoResolve): If we're doing a types-only lookup, the
13881 expression must implement the ITypeExpression interface and we
13882 call DoResolveType() on it.
13883 (SimpleName): Implement the new ITypeExpression interface.
13884 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13885 hack, the situation that we're only looking up types can't happen
13886 anymore when this method is called. Moved the type lookup code to
13887 DoResolveType() and call it.
13888 (SimpleName.DoResolveType): This ITypeExpression interface method
13889 is now doing the types-only lookup.
13890 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13891 (ResolveFlags): Added MaskExprClass.
13893 * expression.cs (MemberAccess): Implement the ITypeExpression
13895 (MemberAccess.DoResolve): Added support for a types-only lookup
13896 when we're called via ITypeExpression.DoResolveType().
13897 (ComposedCast): Implement the ITypeExpression interface.
13899 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
13900 Expression.Resolve() with ResolveFlags.Type instead.
13902 2002-08-12 Martin Baulig <martin@gnome.org>
13904 * interface.cs (Interface.Define): Apply attributes.
13906 * attribute.cs (Attribute.ApplyAttributes): Added support for
13907 interface attributes.
13909 2002-08-11 Martin Baulig <martin@gnome.org>
13911 * statement.cs (Block.Emit): Only check the "this" variable if we
13912 do not always throw an exception.
13914 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13915 whether the property has a set accessor.
13917 2002-08-11 Martin Baulig <martin@gnome.org>
13919 Added control flow analysis support for structs.
13921 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13922 with control flow analysis turned off.
13923 (IVariable): New interface.
13924 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13925 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13926 (FieldExpr.DoResolve): Resolve the instance expression with flow
13927 analysis turned off and do the definite assignment check after the
13928 resolving when we know what the expression will resolve to.
13930 * expression.cs (LocalVariableReference, ParameterReference):
13931 Implement the new IVariable interface, only call the flow analysis
13932 code if ec.DoFlowAnalysis is true.
13933 (This): Added constructor which takes a Block argument. Implement
13934 the new IVariable interface.
13935 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13936 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13937 This does the definite assignment checks for struct members.
13939 * class.cs (Constructor.Emit): If this is a non-static `struct'
13940 constructor which doesn't have any initializer, call
13941 Block.AddThisVariable() to tell the flow analysis code that all
13942 struct elements must be initialized before control returns from
13945 * statement.cs (MyStructInfo): New public class.
13946 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13947 argument to this indexer. If non-zero, check an individual struct
13948 member, not the whole struct.
13949 (FlowBranching.CheckOutParameters): Check struct members.
13950 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13951 overloaded versions of these methods which take an additional
13952 `int field_idx' argument to check struct members.
13953 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13954 overloaded versions of these methods which take an additional
13955 `string field_name' argument to check struct member.s
13956 (VariableInfo): Implement the IVariable interface.
13957 (VariableInfo.StructInfo): New public property. Returns the
13958 MyStructInfo instance of the variable if it's a struct or null.
13959 (Block.AddThisVariable): New public method. This is called from
13960 Constructor.Emit() for non-static `struct' constructor which do
13961 not have any initializer. It creates a special variable for the
13962 "this" instance variable which will be checked by the flow
13963 analysis code to ensure that all of the struct's fields are
13964 initialized before control returns from the constructor.
13965 (UsageVector): Added support for struct members. If a
13966 variable/parameter is a struct with N members, we reserve a slot
13967 in the usage vector for each member. A struct is considered fully
13968 initialized if either the struct itself (slot 0) or all its
13969 members are initialized.
13971 2002-08-08 Martin Baulig <martin@gnome.org>
13973 * driver.cs (Driver.MainDriver): Only report an error CS5001
13974 if there were no compilation errors.
13976 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13977 `UnsafeContext' property to determine whether the parent is in
13978 unsafe context rather than checking the parent's ModFlags:
13979 classes nested in an unsafe class are unsafe as well.
13981 2002-08-08 Martin Baulig <martin@gnome.org>
13983 * statement.cs (UsageVector.MergeChildren): Distinguish between
13984 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13985 we return. Added test17() and test18() to test-154.cs.
13987 2002-08-08 Martin Baulig <martin@gnome.org>
13989 * typemanager.cs (TypeManager.FilterWithClosure): If we have
13990 Family access, make sure the invoking type isn't a subclass of the
13991 queried type (that'd be a CS1540).
13993 * ecore.cs (Expression.MemberLookup): Added overloaded version of
13994 this method which takes an additional `Type invocation_type'.
13996 * expression.cs (BaseAccess.DoResolve): Use the base type as
13997 invocation and query type.
13998 (MemberAccess.DoResolve): If the lookup failed and we're about to
13999 report a CS0122, try a lookup with the ec.ContainerType - if this
14000 succeeds, we must report a CS1540.
14002 2002-08-08 Martin Baulig <martin@gnome.org>
14004 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14005 (MethodGroupExpr): Implement the IMemberExpr interface.
14007 * expression (MemberAccess.ResolveMemberAccess): No need to have
14008 any special code for MethodGroupExprs anymore, they're now
14011 2002-08-08 Martin Baulig <martin@gnome.org>
14013 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14014 Family, FamANDAssem and FamORAssem permissions.
14015 (TypeManager.IsSubclassOrNestedChildOf): New public method.
14017 2002-08-08 Martin Baulig <martin@gnome.org>
14019 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14020 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14023 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14025 * driver.cs: implemented /resource option to embed managed resources.
14027 2002-08-07 Martin Baulig <martin@gnome.org>
14029 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14030 (FieldBase.HasFieldInitializer): New public property.
14031 (FieldBase.GetInitializerExpression): New public method. Resolves and
14032 returns the field initializer and makes sure it is only resolved once.
14033 (TypeContainer.EmitFieldInitializers): Call
14034 FieldBase.GetInitializerExpression to get the initializer, this ensures
14035 that it isn't resolved multiple times.
14037 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
14038 the resolving process (SimpleName/MemberLookup) that we're currently
14039 emitting a field initializer (which must not access any instance members,
14040 this is an error CS0236).
14042 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14043 argument, if the `IsFieldInitializer' flag is set, we must report and
14044 error CS0236 and not an error CS0120.
14046 2002-08-07 Martin Baulig <martin@gnome.org>
14048 * ecore.cs (IMemberExpr): New public interface.
14049 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14050 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14051 if the expression is an IMemberExpr.
14053 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14054 to be null, implicitly default to `this' if we're non-static in
14055 this case. Simplified the code a lot by using the new IMemberExpr
14056 interface. Also fixed bug #28176 here.
14058 2002-08-06 Martin Baulig <martin@gnome.org>
14060 * cs-parser.jay (SimpleLookup): Removed. We need to create
14061 ParameterReferences during semantic analysis so that we can do a
14062 type-only search when resolving Cast, TypeOf and SizeOf.
14063 (block): Pass the `current_local_parameters' to the Block's
14066 * class.cs (ConstructorInitializer): Added `Parameters parameters'
14067 argument to the constructor.
14068 (ConstructorInitializer.Resolve): Create a temporary implicit
14069 block with the parameters.
14071 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14072 references here if we aren't doing a type-only search.
14074 * statement.cs (Block): Added constructor which takes a
14075 `Parameters parameters' argument.
14076 (Block.Parameters): New public property.
14078 * support.cs (InternalParameters.Parameters): Renamed `parameters'
14079 to `Parameters' and made it public readonly.
14081 2002-08-06 Martin Baulig <martin@gnome.org>
14083 * ecore.cs (Expression.Warning): Made this public as well.
14085 * report.cs (Report.Debug): Print the contents of collections.
14087 2002-08-06 Martin Baulig <martin@gnome.org>
14089 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
14090 used to tell Resolve() which kinds of expressions it may return.
14091 (Expression.Resolve): Added overloaded version of this method which
14092 takes a `ResolveFlags flags' argument. This can be used to tell
14093 Resolve() which kinds of expressions it may return. Reports a
14095 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14096 ResolveFlags.SimpleName.
14097 (Expression.Error118): Added overloaded version of this method which
14098 takes a `ResolveFlags flags' argument. It uses the flags to determine
14099 which kinds of expressions are allowed.
14101 * expression.cs (Argument.ResolveMethodGroup): New public method.
14102 Resolves an argument, but allows a MethodGroup to be returned.
14103 This is used when invoking a delegate.
14105 * TODO: Updated a bit.
14107 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14109 Fixed compilation with csc.
14111 * ecore.cs: Expression.Error made public. Is this correct? Should
14112 Warning be made public too?
14114 * expression.cs: use ea.Location instead of ea.loc.
14115 [FIXME: Filed as bug #28607: MCS must report these errors.]
14117 2002-08-06 Martin Baulig <martin@gnome.org>
14119 * ecore.cs (Expression.loc): Moved the location here instead of
14120 duplicating it in all derived classes.
14121 (Expression.Location): New public property.
14122 (Expression.Error, Expression.Warning): Made them non-static and
14123 removed the location argument.
14124 (Expression.Warning): Added overloaded version which takes an
14125 `int level' argument.
14126 (Expression.Error118): Make this non-static and removed the
14127 expression and location arguments.
14128 (TypeExpr): Added location argument to the constructor.
14130 * expression.cs (StaticCallExpr): Added location argument to
14132 (Indirection, PointerArithmetic): Likewise.
14133 (CheckedExpr, UnCheckedExpr): Likewise.
14134 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14135 (StringPtr): Likewise.
14138 2002-08-05 Martin Baulig <martin@gnome.org>
14140 * expression.cs (BaseAccess.DoResolve): Actually report errors.
14142 * assign.cs (Assign.DoResolve): Check whether the source
14143 expression is a value or variable.
14145 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14146 while resolving the corresponding blocks.
14148 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
14149 an error, don't silently return null.
14151 * statement.cs (Block.AddVariable): Do the error reporting here
14152 and distinguish between CS0128 and CS0136.
14153 (Block.DoResolve): Report all unused labels (warning CS0164).
14154 (LabeledStatement): Pass the location to the constructor.
14155 (LabeledStatement.HasBeenReferenced): New property.
14156 (LabeledStatement.Resolve): Set it to true here.
14158 * statement.cs (Return.Emit): Return success even after reporting
14159 a type mismatch error (CS0126 or CS0127), this is what csc does and
14160 it avoids confusing the users with any consecutive errors.
14162 2002-08-05 Martin Baulig <martin@gnome.org>
14164 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
14166 * const.cs (Const.LookupConstantValue): Catch circular definitions.
14168 * expression.cs (MemberAccess.DoResolve): Silently return if an
14169 error has already been reported.
14171 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
14172 error has already been reported.
14174 2002-08-05 Martin Baulig <martin@gnome.org>
14176 * statement.cs (UsageVector): Only initialize the `parameters'
14177 vector if we actually have any "out" parameters.
14179 2002-08-05 Martin Baulig <martin@gnome.org>
14181 * expression.cs (Binary.ResolveOperator): When combining delegates,
14182 they must have the same type.
14184 2002-08-05 Martin Baulig <martin@gnome.org>
14186 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
14187 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
14188 work with the ms runtime and we also don't need it: if we're a
14189 PropertyBuilder and not in the `indexer_arguments' hash, then we
14190 are a property and not an indexer.
14192 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
14193 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
14194 since the latter one doesn't work with the ms runtime.
14196 2002-08-03 Martin Baulig <martin@gnome.org>
14198 Fixed bugs #27998 and #22735.
14200 * class.cs (Method.IsOperator): New public field.
14201 (Method.CheckBase): Report CS0111 if there's already a method
14202 with the same parameters in the current class. Report CS0508 when
14203 attempting to change the return type of an inherited method.
14204 (MethodData.Emit): Report CS0179 if a method doesn't have a body
14205 and it's not marked abstract or extern.
14206 (PropertyBase): New abstract base class for Property and Indexer.
14207 (PropertyBase.CheckBase): Moved here from Property and made it work
14209 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
14210 the same so we can reuse it there.
14211 (Property, Indexer): Derive from PropertyBase.
14212 (MethodSignature.inheritable_property_signature_filter): New delegate
14213 to find properties and indexers.
14215 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
14216 argument and improved error reporting.
14218 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
14219 EmptyReadOnlyParameters and made it a property.
14221 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
14222 version of this method which takes a `PropertyInfo indexer'.
14223 (TypeManager.RegisterIndexer): New method.
14225 * class.cs: Added myself as author of this file :-)
14227 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14229 * class.cs: fixed compilation on windoze.
14231 2002-08-03 Martin Baulig <martin@gnome.org>
14233 * interface.cs (Interface.GetInterfaceBases): Check whether all
14234 base interfaces are at least as accessible than the current one.
14236 * class.cs (TypeContainer.GetClassBases): Check whether base types
14237 are at least as accessible than the current type.
14238 (TypeContainer.AsAccessible): Implemented and made non-static.
14239 (MemberBase.CheckParameters): Report errors if the accessibility
14242 * delegate.cs (Delegate.Delegate): The default visibility is
14243 internal for top-level types and private for nested types.
14244 (Delegate.Define): Report errors if the accessibility checks fail.
14246 * enum.cs (Enum.Enum): The default visibility is internal for
14247 top-level types and private for nested types.
14248 (Enum.DefineType): Compute the correct visibility.
14250 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14251 function which takes a `bool is_toplevel' instead of a TypeContainer.
14253 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14256 2002-08-02 Martin Baulig <martin@gnome.org>
14258 * expression.cs (LocalVariableReferenc): Added constructor which
14259 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14260 (LocalVariableReference.IsReadOnly): New property.
14261 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14262 variable is readonly, use our own readonly flag to do this; you can
14263 use the new constructor to get a writable reference to a read-only
14266 * cs-parser.jay (foreach_statement, using_statement): Get a writable
14267 reference to the local variable.
14269 2002-08-01 Miguel de Icaza <miguel@ximian.com>
14271 * rootcontext.cs (ResolveCore): Also include System.Exception
14273 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14274 we reach an EmptyStatement.
14276 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14279 * expression.cs (Binary.ResolveOperator): Check error result in
14282 use brtrue/brfalse directly and avoid compares to null.
14284 2002-08-02 Martin Baulig <martin@gnome.org>
14286 * class.cs (TypeContainer.Define): Define all nested interfaces here.
14287 Fixes bug #28407, added test-155.cs.
14289 2002-08-01 Martin Baulig <martin@gnome.org>
14291 * class.cs (Event.EmitDefaultMethod): Make this work with static
14292 events. Fixes #28311, added verify-3.cs.
14294 2002-08-01 Martin Baulig <martin@gnome.org>
14296 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14297 `is_disposable' fields.
14298 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14299 `hm.is_disposable' if we're using the collection pattern.
14300 (Foreach.EmitCollectionForeach): Use the correct type for the
14301 enumerator's local variable, only emit the try/finally block if
14302 necessary (fixes #27713).
14304 2002-08-01 Martin Baulig <martin@gnome.org>
14306 * ecore.cs (Expression.report118): Renamed to Error118 and made
14309 * statement.cs (Throw.Resolve): Check whether the expression is of
14310 the correct type (CS0118) and whether the type derives from
14311 System.Exception (CS0155).
14312 (Catch.Resolve): New method. Do the type lookup here and check
14313 whether it derives from System.Exception (CS0155).
14314 (Catch.CatchType, Catch.IsGeneral): New public properties.
14316 * typemanager.cs (TypeManager.exception_type): Added.
14318 2002-07-31 Miguel de Icaza <miguel@ximian.com>
14320 * driver.cs: Updated About function.
14322 2002-07-31 Martin Baulig <martin@gnome.org>
14324 Implemented Control Flow Analysis.
14326 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14327 (EmitContext.CurrentBranching): Added.
14328 (EmitContext.StartFlowBranching): Added.
14329 (EmitContext.EndFlowBranching): Added.
14330 (EmitContext.KillFlowBranching): Added.
14331 (EmitContext.IsVariableAssigned): Added.
14332 (EmitContext.SetVariableAssigned): Added.
14333 (EmitContext.IsParameterAssigned): Added.
14334 (EmitContext.SetParameterAssigned): Added.
14335 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14336 Added control flow analysis stuff here.
14338 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14339 resolve the expression as lvalue.
14340 (LocalVariableReference.DoResolve): Check whether the variable has
14341 already been assigned.
14342 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14343 the parameter as assigned here.
14344 (ParameterReference.DoResolve): Check whether the parameter has already
14346 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14347 expression as lvalue.
14349 * statement.cs (FlowBranching): New class for the flow analysis code.
14350 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14351 (LabeledStatement.IsDefined): New public property.
14352 (LabeledStatement.AddUsageVector): New public method to tell flow
14353 analyis that the label may be reached via a forward jump.
14354 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14356 (VariableInfo.Number): New public field. This is used by flow analysis
14357 to number all locals of a block.
14358 (Block.CountVariables): New public property. This is the number of
14359 local variables in this block (including the locals from all parent
14361 (Block.EmitMeta): Number all the variables.
14363 * statement.cs: Added flow analysis support to all classes.
14365 2002-07-31 Martin Baulig <martin@gnome.org>
14367 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14368 To get debugging messages, compile mcs with /define:MCS_DEBUG and
14369 then use this argument.
14371 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14373 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14374 use this to specify /define options.
14376 2002-07-29 Martin Baulig <martin@gnome.org>
14378 * statement.cs (Fixed): Moved all code that does variable lookups
14379 and resolvings from Emit to Resolve.
14381 * statement.cs (For): Moved all code that does variable lookups
14382 and resolvings from Emit to Resolve.
14384 * statement.cs (Using): Moved all code that does variable lookups
14385 and resolvings from Emit to Resolve.
14387 2002-07-29 Martin Baulig <martin@gnome.org>
14389 * attribute.cs (Attribute.Resolve): Explicitly catch a
14390 System.NullReferenceException when creating the
14391 CustromAttributeBuilder and report a different warning message.
14393 2002-07-29 Martin Baulig <martin@gnome.org>
14395 * support.cs (ParameterData.ParameterName): Added method to
14396 get the name of a parameter.
14398 * typemanager.cs (TypeManager.IsValueType): New public method.
14400 2002-07-29 Martin Baulig <martin@gnome.org>
14402 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
14403 is a flag which specifies that it's either ref or out.
14404 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14405 the out parameter to `out Parameter.Modifier mod', also set the
14406 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14408 * support.cs (InternalParameters.ParameterModifier): Distinguish
14409 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14410 Parameter.Modifier.ISBYREF flag if it's either ref or out.
14412 * expression.cs (Argument.GetParameterModifier): Distinguish
14413 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14414 Parameter.Modifier.ISBYREF flag if it's either ref or out.
14416 2002-07-29 Martin Baulig <martin@gnome.org>
14418 * expression.cs (ParameterReference.ParameterReference): Added
14419 `Location loc' argument to the constructor.
14421 * cs-parser.jay: Pass location to ParameterReference.
14423 2002-07-28 Miguel de Icaza <miguel@ximian.com>
14425 * statement.cs (Try): Initialize the location.
14427 * cs-parser.jay: pass location to Try.
14429 * expression.cs (Unary.Reduce): Change the prototype to return
14430 whether a constant fold could be performed or not. The result is
14431 returned in an out parameters. In the case of Indirection and
14432 AddressOf, we want to perform the full tests.
14434 2002-07-26 Miguel de Icaza <miguel@ximian.com>
14436 * statement.cs (Statement.Emit): Flag dead code.
14438 2002-07-27 Andrew Birkett <andy@nobugs.org>
14440 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14442 2002-07-27 Martin Baulig <martin@gnome.org>
14444 * class.cs (MethodData.Define): Put back call to
14445 TypeManager.AddMethod(), accidentally commented this out.
14447 * report.cs (Debug): New public method to print debugging information,
14448 this is `[Conditional ("DEBUG")]'.
14450 2002-07-26 Martin Baulig <martin@gnome.org>
14452 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14453 (switch_statement): Push the current_block to the switch_stack and
14454 pop it again when we're done with the switch.
14455 (switch_section): The new block is a child of the current_block.
14456 Fixes bug #24007, added test-152.cs.
14458 2002-07-27 Martin Baulig <martin@gnome.org>
14460 * expression.cs (Invocation.EmitArguments): When calling a varargs
14461 function with only its fixed arguments, we need to pass an empty
14464 2002-07-27 Martin Baulig <martin@gnome.org>
14466 Mono 0.13 has been released.
14468 2002-07-25 Miguel de Icaza <miguel@ximian.com>
14470 * driver.cs: Rename --resource to --linkres, because that is what
14471 we do currently, we dont support --resource yet.
14473 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14475 2002-07-25 Martin Baulig <martin@gnome.org>
14477 * class.cs (MethodData): New public class. This is a `method builder'
14478 class for a method or one accessor of a Property/Indexer/Event.
14479 (MethodData.GetMethodFlags): Moved here from MemberBase.
14480 (MethodData.ApplyAttributes): Likewise.
14481 (MethodData.ApplyObsoleteAttribute): Likewise.
14482 (MethodData.ApplyConditionalAttribute): Likewise.
14483 (MethodData.ApplyDllImportAttribute): Likewise.
14484 (MethodData.CheckAbstractAndExternal): Likewise.
14485 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14486 (MethodData.Emit): Formerly known as Method.Emit().
14487 (MemberBase): Moved everything which was specific to a single
14488 accessor/method to MethodData.
14489 (Method): Create a new MethodData and call Define() and Emit() on it.
14490 (Property, Indexer, Event): Create a new MethodData objects for each
14491 accessor and call Define() and Emit() on them.
14493 2002-07-25 Martin Baulig <martin@gnome.org>
14495 Made MethodCore derive from MemberBase to reuse the code from there.
14496 MemberBase now also checks for attributes.
14498 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14499 (MemberBase.GetMethodFlags): Moved here from class Method and marked
14501 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14502 `CallingConventions cc' and `Attributes opt_attrs' arguments.
14503 (MemberBase.ApplyAttributes): New virtual method; applies the
14504 attributes to a method or accessor.
14505 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14506 (MemberBase.ApplyConditionalAttribute): Likewise.
14507 (MemberBase.ApplyDllImportAttribute): Likewise.
14508 (MemberBase.CheckAbstractAndExternal): Likewise.
14509 (MethodCore.ParameterTypes): This is now a property instead of a
14510 method, it's initialized from DoDefineParameters().
14511 (MethodCore.ParameterInfo): Removed the set accessor.
14512 (MethodCore.DoDefineParameters): New protected virtual method to
14513 initialize ParameterTypes and ParameterInfo.
14514 (Method.GetReturnType): We can now simply return the MemberType.
14515 (Method.GetMethodFlags): Override the MemberBase version and add
14516 the conditional flags.
14517 (Method.CheckBase): Moved some code from Define() here, call
14518 DoDefineParameters() here.
14519 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14520 here to avoid some larger code duplication.
14521 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14522 ensure that abstract and external accessors don't declare a body.
14524 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14525 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14526 lookup in the attribute's parent classes, so we need to abort as soon
14527 as we found the first match.
14528 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14529 the attribute has no arguments.
14531 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14534 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14536 * cs-parser.jay: reverted previous patch.
14538 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14540 * cs-parser.jay: fixed bug #22119.
14542 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14544 * attribute.cs: fixed compilation. The error was:
14545 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
14546 be assigned to before control leaves the current method."
14547 [FIXME: Filed as bug #28186: MCS must report this error.]
14549 2002-07-25 Martin Baulig <martin@gnome.org>
14551 * attribute.cs (Attribute.Conditional_GetConditionName): New static
14552 method to pull the condition name ouf of a Conditional attribute.
14553 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14554 the obsolete message and error flag out of an Obsolete attribute.
14556 * class.cs (Method.GetMethodFlags): New public method to get the
14557 TypeManager.MethodFlags for this method.
14558 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14560 (Method.Define): Get and apply the Obsolete and Conditional attributes;
14561 if we're overriding a virtual function, set the new private variable
14562 `parent_method'; call the new TypeManager.AddMethod().
14564 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
14565 the MethodBuilder and the Method in a PtrHashtable.
14566 (TypeManager.builder_to_method): Added for this purpose.
14567 (TypeManager.MethodFlags): Added IsObsoleteError.
14568 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
14569 Obsolete and Conditional arguments in MethodBuilders. If we discover
14570 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14571 the message from the attribute.
14573 2002-07-24 Martin Baulig <martin@gnome.org>
14575 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14576 preprocessor directives, ensure that the argument to #define/#undef is
14577 exactly one identifier and that it's actually an identifier.
14579 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14582 2002-07-24 Martin Baulig <martin@gnome.org>
14584 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14585 initialize it to TypeManager.object_type in the constructor.
14586 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14587 of the `hm.get_current' method if we're using the collection pattern.
14588 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14589 for the explicit conversion to make it work when we're using the collection
14590 pattern and the `Current' property has a different return type than `object'.
14593 2002-07-24 Martin Baulig <martin@gnome.org>
14595 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14596 does not match, but don't report any errors. This method is called in
14597 order for all methods in a MethodGroupExpr until a matching method is
14598 found, so we don't want to bail out if the first method doesn't match.
14599 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14600 matches, report the 123. Fixes #28070.
14602 2002-07-24 Martin Baulig <martin@gnome.org>
14604 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14605 TypeManager.TypeToCoreType() to the top of the method so the
14606 following equality checks will work. Fixes #28107.
14608 2002-07-24 Martin Baulig <martin@gnome.org>
14610 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14611 operand is of type uint, and the other operand is of type sbyte,
14612 short or int, the operands are converted to type long." -
14613 Actually do what this comment already told us. Fixes bug #28106,
14616 2002-07-24 Martin Baulig <martin@gnome.org>
14618 * class.cs (MethodBase): New abstract class. This is now a base
14619 class for Property, Indexer and Event to avoid some code duplication
14620 in their Define() and DefineMethods() methods.
14621 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14622 generic methods for Define() and DefineMethods().
14623 (FieldBase): Derive from MemberBase, not MemberCore.
14624 (Property): Derive from MemberBase, not MemberCore.
14625 (Property.DefineMethod): Moved all the code from this method to the
14626 new MethodBase.DefineAccessor(), just call it with appropriate
14628 (Property.Define): Call the new Property.DoDefine(), this does some
14629 sanity checks and we don't need to duplicate the code everywhere.
14630 (Event): Derive from MemberBase, not MemberCore.
14631 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14632 accessors, this will also make them work with interface events.
14633 (Indexer): Derive from MemberBase, not MemberCore.
14634 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14635 (Indexer.Define): Use the new MethodBase functions.
14637 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14638 argument to the constructor.
14639 (Interface.FindMembers): Added support for interface events.
14640 (Interface.PopluateEvent): Implemented.
14642 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
14644 2002-07-22 Miguel de Icaza <miguel@ximian.com>
14646 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14647 but this is required to check for a method name being the same as
14648 the containing class.
14652 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14654 * interface.cs: initialize variable.
14656 2002-07-23 Martin Baulig <martin@gnome.org>
14658 Implemented the IndexerName attribute in interfaces.
14660 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14661 name if this is an explicit interface implementation.
14662 (Indexer.InterfaceIndexerName): New public variable. If we're
14663 implementing an interface indexer, this is the IndexerName in that
14664 interface. Otherwise, it's the IndexerName.
14665 (Indexer.DefineMethod): If we're implementing interface indexer,
14666 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
14667 and Pending.ImplementIndexer methods.
14668 (Indexer.Define): Also define the PropertyBuilder if we're
14669 implementing an interface indexer and this is neither an explicit
14670 interface implementation nor do the IndexerName match the one in
14673 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14674 If a method is defined here, then we always need to create a proxy
14675 for it. This is used when implementing interface indexers.
14676 (Pending.IsInterfaceIndexer): New public method.
14677 (Pending.ImplementIndexer): New public method.
14678 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14679 This is used when implementing interface indexers to define a proxy
14681 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14682 define a proxy if necessary.
14684 * interface.cs (Interface.IndexerName): New public variable.
14685 (Interface.PopulateIndexer): Set the IndexerName.
14686 (Interface.DefineIndexers): New private method. Populate all the
14687 indexers and make sure their IndexerNames match.
14689 * typemanager.cs (IndexerPropertyName): Added support for interface
14692 2002-07-22 Martin Baulig <martin@gnome.org>
14694 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14695 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14696 ret if HasReturnLabel.
14697 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14700 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14701 and set the ec.LoopBeginTryCatchLevel.
14702 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14703 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14704 the current ec.TryCatchLevel, the branch goes out of an exception
14705 block. In this case, we need to use Leave and not Br.
14707 2002-07-22 Martin Baulig <martin@gnome.org>
14709 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14710 block unless the block does not always return or it is contained in
14711 another try { ... } catch { ... } block. Fixes bug #26506.
14712 Added verify-1.cs to the test suite.
14714 2002-07-22 Martin Baulig <martin@gnome.org>
14716 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14717 then we do not always return. Fixes bug #24985.
14719 2002-07-22 Martin Baulig <martin@gnome.org>
14721 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14722 lookup on a per-class level; ie. walk up the class hierarchy until we
14723 found at least one applicable method, then choose the best among them.
14724 Fixes bug #24463 and test-29.cs.
14726 2002-07-22 Martin Baulig <martin@gnome.org>
14728 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14729 return types of the methods. The return type is not part of the
14730 signature and we must not check it to make the `new' modifier work.
14731 Fixes bug #27999, also added test-147.cs.
14732 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14734 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14735 on the method's return type.
14737 2002-07-21 Martin Baulig <martin@gnome.org>
14739 * assign.cs: Make this work if the rightmost source is a constant and
14740 we need to do an implicit type conversion. Also adding a few more tests
14741 to test-38.cs which should have caught this.
14743 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14744 target in the makefile for this. The makefile.gnu is primarily intended
14745 for end-users who don't want to debug the compiler.
14747 2002-07-21 Martin Baulig <martin@gnome.org>
14749 * assign.cs: Improved the Assign class so it can now handle embedded
14750 assignments (X = Y = Z = something). As a side-effect this'll now also
14751 consume less local variables. test-38.cs now passes with MCS, added
14752 a few new test cases to that test.
14754 2002-07-20 Martin Baulig <martin@gnome.org>
14756 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14757 instructions. Fixes bug #27977, also added test-146.cs.
14759 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14761 * cs-tokenizer.cs: fixed getHex ().
14763 2002-07-19 Martin Baulig <martin@gnome.org>
14765 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14766 not Type.GetType() to lookup the array type. This is needed when
14767 we're constructing an array of a user-defined type.
14768 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14769 single-dimensional arrays, but also for single-dimensial arrays of
14772 2002-07-19 Martin Baulig <martin@gnome.org>
14774 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14775 this function is called, it's not allowed to share LocalBuilders
14776 among ILGenerators.
14778 2002-07-19 Martin Baulig <martin@gnome.org>
14780 * expression.cs (Argument.Resolve): Report an error 118 when trying
14781 to pass a type as argument.
14783 2002-07-18 Martin Baulig <martin@gnome.org>
14785 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14786 Conv_R_Un for the signed `long' type.
14788 2002-07-15 Miguel de Icaza <miguel@ximian.com>
14790 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14791 `expr' for the temporary result, as that will fail if we do
14792 multiple resolves on the same expression.
14794 2002-07-05 Miguel de Icaza <miguel@ximian.com>
14796 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14797 ec.TypeContainer for looking up aliases.
14799 * class.cs (TypeContainer): Remove LookupAlias from here.
14801 * decl.cs (DeclSpace); Move here.
14803 2002-07-01 Miguel de Icaza <miguel@ximian.com>
14805 * class.cs (FindMembers): Only call filter if the constructor
14806 bulider is not null.
14808 Also handle delegates in `NestedTypes' now. Now we will perform
14809 type lookups using the standard resolution process. This also
14812 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14813 This uses Expressions (the limited kind that can be parsed by the
14814 tree) instead of strings.
14816 * expression.cs (ComposedCast.ToString): Implement, used to flag
14817 errors since now we have to render expressions.
14819 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
14822 * ecore.cs (SimpleName.ToString): ditto.
14824 * cs-parser.jay: Instead of using strings to assemble types, use
14825 Expressions to assemble the type (using SimpleName, ComposedCast,
14826 MemberAccess). This should fix the type lookups in declarations,
14827 because we were using a different code path for this.
14829 * statement.cs (Block.Resolve): Continue processing statements
14830 even when there is an error.
14832 2002-07-17 Miguel de Icaza <miguel@ximian.com>
14834 * class.cs (Event.Define): Also remove the `remove' method from
14835 the list of pending items.
14837 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14838 generate more compact code.
14840 2002-07-17 Martin Baulig <martin@gnome.org>
14842 * const.cs (Const.LookupConstantValue): Add support for constant
14843 `unchecked' and `checked' expressions.
14844 Also adding test case test-140.cs for this.
14846 2002-07-17 Martin Baulig <martin@gnome.org>
14848 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14849 check whether mi.ReturnType implements the IEnumerator interface; the
14850 `==' and the IsAssignableFrom() will fail in this situation.
14852 2002-07-16 Ravi Pratap <ravi@ximian.com>
14854 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
14857 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14859 * expression.cs: fixed bug #27811.
14861 2002-07-14 Miguel de Icaza <miguel@ximian.com>
14863 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14864 Molaro: when we are a ref, the value already contains a pointer
14865 value, do not take the address of it.
14867 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14868 * removed mb-parser.jay and mb-tokenizer.cs
14870 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14872 * expression.cs: check against the building corlib void type.
14874 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14876 * ecore.cs: fix for valuetype static readonly fields: when
14877 initializing them, we need their address, not the address of a copy.
14879 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14881 * typemanager.cs: register also enum_type in corlib.
14883 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14885 * class.cs: allow calling this (but not base) initializers in structs.
14887 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14889 * ecore.cs: make sure we compare against the building base types
14892 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14894 * typemanager.cs: fix TypeToCoreType() to handle void and object
14895 (corlib gets no more typerefs after this change).
14897 2002-07-12 Miguel de Icaza <miguel@ximian.com>
14899 * expression.cs (ArrayCreation.EmitArrayArguments): use
14900 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14902 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14903 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
14904 array indexes, the runtime actually forbids them.
14906 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14907 for array arguments here.
14909 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14910 instead of the default for ValueTypes.
14912 (New.DoEmit): Use IsValueType instead of
14913 IsSubclassOf (value_type)
14914 (New.DoResolve): ditto.
14915 (Invocation.EmitCall): ditto.
14917 * assign.cs (Assign): ditto.
14919 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14920 Statements *are* currently doing part of their resolution during
14923 Expressions do always resolve during resolve, but statements are
14924 only required to propagate resolution to their children.
14926 2002-07-11 Miguel de Icaza <miguel@ximian.com>
14928 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14930 (LoadAssembly): Do not add the dll if it is already specified
14932 (MainDriver): Add the System directory to the link path at the end,
14933 after all the other -L arguments.
14935 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14936 wrong opcode for loading bytes and bools (ldelem.i1 instead of
14937 ldelem.u1) and using the opposite for sbytes.
14939 This fixes Digger, and we can finally run it.
14941 * driver.cs (UnixParseOption): Move the option parsing here.
14942 (CSCParseOption): Implement CSC-like parsing of options.
14944 We now support both modes of operation, the old Unix way, and the
14945 new CSC-like way. This should help those who wanted to make cross
14946 platform makefiles.
14948 The only thing broken is that /r:, /reference: and /lib: are not
14949 implemented, because I want to make those have the same semantics
14950 as the CSC compiler has, and kill once and for all the confussion
14951 around this. Will be doing this tomorrow.
14953 * statement.cs (Unsafe.Resolve): The state is checked during
14954 resolve, not emit, so we have to set the flags for IsUnsfe here.
14956 2002-07-10 Miguel de Icaza <miguel@ximian.com>
14958 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14959 not catch the Error_ObjectRefRequired in SimpleName (as it is
14960 possible to have a class/instance variable name that later gets
14961 deambiguated), we have to check this here.
14963 2002-07-10 Ravi Pratap <ravi@ximian.com>
14965 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14966 make static and put into Expression.
14968 (Event.Define): Register the private field of the event with the
14969 TypeManager so that GetFieldFromEvent can get at it.
14971 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14972 keep track of the private field associated with an event which
14975 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14978 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14980 2002-07-10 Miguel de Icaza <miguel@ximian.com>
14982 * expression.cs (Binary.EmitBranchable): this routine emits the
14983 Binary expression in a branchable context. This basically means:
14984 we need to branch somewhere, not just get the value on the stack.
14986 This works together with Statement.EmitBoolExpression.
14988 * statement.cs (Statement.EmitBoolExpression): Use
14991 2002-07-09 Miguel de Icaza <miguel@ximian.com>
14993 * statement.cs (For): Reduce the number of jumps in loops.
14995 (For): Implement loop inversion for the For statement.
14997 (Break): We can be breaking out of a Try/Catch controlled section
14998 (foreach might have an implicit try/catch clause), so we need to
14999 use Leave instead of Br.
15001 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15002 now). If the instace expression supports IMemoryLocation, we use
15003 the AddressOf method from the IMemoryLocation to extract the
15004 address instead of emitting the instance.
15006 This showed up with `This', as we were emitting the instance
15007 always (Emit) instead of the Address of This. Particularly
15008 interesting when This is a value type, as we dont want the Emit
15009 effect (which was to load the object).
15011 2002-07-08 Miguel de Icaza <miguel@ximian.com>
15013 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15015 * statement.cs (Checked): Set the CheckedState during the resolve
15016 process too, as the ConvCast operations track the checked state on
15017 the resolve process, and not emit.
15019 * cs-parser.jay (namespace_member_declaration): Flag that we have
15020 found a declaration when we do. This is used to flag error 1529
15022 * driver.cs: Report ok when we display the help only.
15024 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
15026 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15028 2002-07-04 Miguel de Icaza <miguel@ximian.com>
15030 * cs-tokenizer.cs (define): We also have to track locally the
15031 defines. AllDefines is just used for the Conditional Attribute,
15032 but we also need the local defines for the current source code.
15034 2002-07-03 Miguel de Icaza <miguel@ximian.com>
15036 * statement.cs (While, For, Do): These loops can exit through a
15037 Break statement, use this information to tell whether the
15038 statement is the last piece of code.
15040 (Break): Flag that we break.
15042 * codegen.cs (EmitContexts): New `Breaks' state variable.
15044 2002-07-03 Martin Baulig <martin@gnome.org>
15046 * class.cs (TypeContainer.MethodModifiersValid): Allow override
15047 modifiers in method declarations in structs. Otherwise, you won't
15048 be able to override things like Object.Equals().
15050 2002-07-02 Miguel de Icaza <miguel@ximian.com>
15052 * class.cs (Method, Property, Indexer): Do not allow the public
15053 modifier to be used in explicit interface implementations.
15055 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15056 override modifiers in method declarations in structs
15058 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
15060 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15061 integer or real overflow, report an error
15063 2002-07-02 Martin Baulig <martin@gnome.org>
15065 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15066 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15067 to tell the runtime about our newly created System.Object and
15068 System.ValueType types.
15070 2002-07-02 Miguel de Icaza <miguel@ximian.com>
15072 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15073 struct instead of Ldarg/Starg.
15075 2002-07-02 Martin Baulig <martin@gnome.org>
15077 * expression.cs (Indirection.Indirection): Call
15078 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15080 2002-07-02 Martin Baulig <martin@gnome.org>
15082 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15083 ValueType, call TypeManager.TypeToCoreType() on it.
15084 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15085 the OpCodes.Newarr argument.
15087 2002-07-02 Martin Baulig <martin@gnome.org>
15089 * expression.cs (Invocation.EmitCall): When compiling corlib,
15090 replace all calls to the system's System.Array type to calls to
15091 the newly created one.
15093 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15094 System.Array methods.
15095 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15096 from the system's System.Array type which must be replaced.
15098 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15100 * typemanager.cs: load unverifiable_code_ctor so we can build
15101 corlib using the correct type. Avoid using GetTypeCode() with
15103 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15104 TypeManager.object_type to allow building corlib.
15106 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15108 * ecore.cs: handle System.Enum separately in LoadFromPtr().
15110 2002-07-01 Martin Baulig <martin@gnome.org>
15112 * class.cs: Make the last change actually work, we need to check
15113 whether `ifaces != null' to avoid a crash.
15115 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15117 * class.cs: when we build structs without fields that implement
15118 interfaces, we need to add the interfaces separately, since there is
15119 no API to both set the size and add the interfaces at type creation
15122 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15124 * expression.cs: the dimension arguments to the array constructors
15125 need to be converted if they are a long.
15127 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15129 * class.cs: don't emit ldarg.0 if there is no parent constructor
15130 (fixes showstopper for corlib).
15132 2002-06-29 Martin Baulig <martin@gnome.org>
15134 MCS now compiles corlib on GNU/Linux :-)
15136 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15137 ie. check for MethodImplOptions.InternalCall.
15139 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15140 and TypeManager.attribute_type are null, so we must explicitly check
15141 whether parent is not null to find out whether it's an attribute type.
15142 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15143 and SetBuilder, not only if the property is neither abstract nor external.
15144 This is necessary to set the MethodImplOptions on the accessor methods.
15145 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15146 SetBuilder, see Property.Emit().
15148 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
15149 populate "System.Object", "System.ValueType" and "System.Attribute" since
15150 they've already been populated from BootCorlib_PopulateCoreTypes().
15152 2002-06-29 Martin Baulig <martin@gnome.org>
15154 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
15155 is the NullLiteral, we also need to make sure that target_type is not
15158 2002-06-29 Martin Baulig <martin@gnome.org>
15160 * rootcontext.cs (RootContext.ResolveCore): We must initialize
15161 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
15162 before calling BootstrapCorlib_ResolveDelegate ().
15164 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15166 * statement.cs: fixed build-breaker. All tests passed ok.
15168 2002-06-27 Martin Baulig <martin@gnome.org>
15170 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
15171 for System.Decimal when compiling corlib.
15173 2002-06-27 Martin Baulig <martin@gnome.org>
15175 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
15176 switch blocks which contain nothing but a default clause.
15178 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
15180 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
15182 2002-06-27 Martin Baulig <martin@gnome.org>
15184 * ecore.cs (PropertyExpr.PropertyExpr): Call
15185 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
15187 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
15188 is already a TypeBuilder.
15190 2002-06-27 Martin Baulig <martin@gnome.org>
15192 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
15193 `target_type == TypeManager.array_type', not IsAssignableFrom() in
15194 the "from an array-type to System.Array" case. This makes it work
15195 when compiling corlib.
15197 2002-06-27 Martin Baulig <martin@gnome.org>
15199 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
15200 non-static PropertyExpr, set its InstanceExpression. This makes
15201 the `ICollection.Count' property work in System/Array.cs.
15203 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
15205 * driver.cs: Made error handling more consistent. Errors now
15206 tracked by Report class, so many methods which used to return int
15207 now return void. Main() now prints success/failure and
15208 errors/warnings message.
15210 Renamed '--probe' compiler argument to '--expect-error'. Removed
15211 the magic number return values (123 and 124). Now, if the
15212 expected error occurs, the compiler exits with success (exit value
15213 0). If the compilation completes without seeing that particular
15214 error, the compiler exits with failure (exit value 1). The
15215 makefile in mcs/errors has been changed to handle the new behaviour.
15217 * report.cs: Made 'expected error' number a property and renamed
15218 it from 'Probe' to 'ExpectedError'.
15220 * genericparser.cs: Removed error handling support, since it is
15221 now all done by Report class.
15223 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
15224 class, so parse() no longer returns an int.
15226 * namespace.cs: Use Report.Error instead of GenericParser.error
15228 2002-06-22 Miguel de Icaza <miguel@ximian.com>
15230 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
15231 TypeContainer.AddOperator): At the front of the list put the
15232 explicit implementations, so they get resolved/defined first.
15234 2002-06-21 Miguel de Icaza <miguel@ximian.com>
15236 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
15237 interface type is implemented by this TypeContainer. Used during
15238 explicit interface implementation.
15240 (Property.Define, Indexer.Define, Method.Define): Validate that
15241 the given interface in the explicit implementation is one of the
15242 base classes for the containing type.
15244 Also if we are explicitly implementing an interface, but there is
15245 no match in the pending implementation table, report an error.
15247 (Property.Define): Only define the property if we are
15248 not explicitly implementing a property from an interface. Use the
15249 correct name also for those properties (the same CSC uses,
15250 although that is really not needed).
15252 (Property.Emit): Do not emit attributes for explicitly implemented
15253 properties, as there is no TypeBuilder.
15255 (Indexer.Emit): ditto.
15257 Hiding then means that we do not really *implement* a pending
15258 implementation, which makes code fail.
15260 2002-06-22 Martin Baulig <martin@gnome.org>
15262 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15263 the return value of Object.GetType(). [FIXME: we need to do this whenever
15264 we get a type back from the reflection library].
15266 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15268 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15270 2002-06-20 Miguel de Icaza <miguel@ximian.com>
15272 * attribute.cs: Return null if we can not look up the type.
15274 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15275 the interface types found.
15277 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15278 interface types found.
15280 * typemanager.cs (GetInterfaces): Make this routine returns alll
15281 the interfaces and work around the lame differences between
15282 System.Type and System.Reflection.Emit.TypeBuilder in the results
15283 result for GetInterfaces.
15285 (ExpandInterfaces): Given an array of interface types, expand and
15286 eliminate repeated ocurrences of an interface. This expands in
15287 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15290 2002-06-21 Martin Baulig <martin@gnome.org>
15292 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15295 2002-06-21 Martin Baulig <martin@gnome.org>
15297 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
15298 and called with one of the core types, return the corresponding typebuilder for
15301 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15304 2002-06-21 Martin Baulig <martin@gnome.org>
15306 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15307 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15308 (Expression.ConvertReferenceExplicit): Likewise.
15310 * expression.cs (ElementAccess.DoResolve): Likewise.
15311 (ElementAccess.DoResolveLValue): Likewise.
15313 2002-06-10 Martin Baulig <martin@gnome.org>
15315 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15316 add the "value" parameter to the parameter list.
15318 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15321 2002-06-19 Miguel de Icaza <miguel@ximian.com>
15323 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15324 the argument to an int, uint, long or ulong, per the spec. Also
15325 catch negative constants in array creation.
15327 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15329 * class.cs: do not allow the same interface to appear twice in
15330 the definition list.
15332 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15334 * ecore.cs: don't use ldlen with System.Array.
15336 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15338 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15340 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15342 * modifiers.cs: produce correct field attributes for protected
15343 internal. Easy fix so miguel can work on ther harder stuff:-)
15345 2002-06-18 Miguel de Icaza <miguel@ximian.com>
15347 * pending.cs: New file. Move the code from class.cs here.
15348 Support clearning the pending flag for all methods (when not doing
15349 explicit interface implementation).
15351 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15353 * rootcontext.cs: added a couple more types needed to bootstrap.
15355 2002-06-17 Miguel de Icaza <miguel@ximian.com>
15357 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15358 constructor in the type, instead of any constructor in the type
15359 hierarchy. Thanks to Paolo for finding this bug (it showed up as
15360 a bug in the Mono runtime when applying the params attribute).
15362 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15363 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15365 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
15367 * expression.cs (Unary.ResolveOperator): Use TypeManager
15368 to resolve the type.
15370 2002-06-13 Ravi Pratap <ravi@ximian.com>
15372 * cs-parser.jay (enum_member_declaration): Pass in the attributes
15375 * enum.cs (AddEnumMember): Add support to store the attributes associated
15376 with each member too.
15378 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15379 field builders too - this takes care of the enum member case.
15381 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
15383 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15384 address-of operator on both value types and pointers.
15386 2002-06-10 Martin Baulig <martin@gnome.org>
15388 * interface.cs (Interface.PopulateIndexer): Add the indexer's
15389 PropertyBuilder to the `property_builders' list.
15391 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15392 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15393 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
15394 find any indexers which are inherited from an interface.
15396 2002-06-09 Martin Baulig <martin@gnome.org>
15398 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15399 the same type as the constant if necessary. There's also a test-130.cs
15402 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15404 * typemanager.cs (TypeManager.ChangeType): Previously known as
15405 Enum.ChangeEnumType().
15407 2002-06-09 Martin Baulig <martin@gnome.org>
15409 * expression.cs (Cast.TryReduce): Added support for consts.
15411 2002-06-08 Ravi Pratap <ravi@ximian.com>
15413 * class.cs (Accessor): Hold attributes information so we can pass
15416 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15417 Modify to pass in attributes attached to the methods.
15419 (add_accessor_declaration, remove_accessor_declaration): Ditto.
15421 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15422 to handle the Accessor kind :-)
15424 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15426 2002-06-08 Martin Baulig <martin@gnome.org>
15428 * expression.cs (Unary.TryReduceNegative): Added support for
15431 2002-06-08 Martin Baulig <martin@gnome.org>
15433 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15434 name can't be found in the `defined_names' - the caller will do a
15435 MemberLookup in this case and thus find methods in System.Enum
15436 such as Enum.IsDefined().
15438 2002-06-08 Martin Baulig <martin@gnome.org>
15440 * enum.cs (Enum.ChangeEnumType): This is a custom version of
15441 Convert.ChangeType() which works with TypeBuilder created types.
15442 (Enum.LookupEnumValue, Enum.Define): Use it here.
15444 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15445 `TypeBuilder.BaseType != null' check.
15446 (TypeContainer.FindMembers): Only lookup parent members if we
15447 actually have a parent.
15448 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15449 (ConstructorInitializer.Resolve): Likewise.
15451 * interface.cs (Interface.FindMembers): Added
15452 `TypeBuilder.BaseType != null' check.
15454 * rootcontext.cs (RootContext.ResolveCore): Added
15455 "System.Runtime.CompilerServices.IndexerNameAttribute" to
15456 classes_second_stage.
15458 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15459 debug_type and trace_type when compiling with --nostdlib.
15461 2002-06-07 Martin Baulig <martin@gnome.org>
15463 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15464 (AddField): Set it to true when adding a non-static field.
15465 (DefineType): Use `have_nonstatic_fields' to find out whether we
15466 have non-static fields, not `Fields != null'.
15468 2002-06-02 Miguel de Icaza <miguel@ximian.com>
15470 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15471 dereferencing a null on the static-field code path)
15473 2002-05-30 Martin Baulig <martin@gnome.org>
15475 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15476 to take command line arguments. Use reflection to call the new
15477 custom `Initialize' function on the symbol writer and pass it the
15478 command line arguments.
15480 * driver.cs (--debug-args): New command line argument to pass command
15481 line arguments to the symbol writer.
15483 2002-05-28 Miguel de Icaza <miguel@ximian.com>
15485 * assign.cs (DoResolve): Forgot to do the implicit conversion to
15486 the target type for indexers and properties. Thanks to Joe for
15489 2002-05-27 Miguel de Icaza <miguel@ximian.com>
15491 * typemanager.cs (MethodFlags): returns the method flags
15492 (Obsolete/ShouldIgnore) that control warning emission and whether
15493 the invocation should be made, or ignored.
15495 * expression.cs (Invocation.Emit): Remove previous hack, we should
15496 not do this on matching a base type, we should do this based on an attribute
15498 Only emit calls to System.Diagnostics.Debug and
15499 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15500 on the command line.
15502 * rootcontext.cs: Global settings for tracing and debugging.
15504 * cs-tokenizer.cs (define): New utility function to track
15505 defines. Set the global settings for TRACE and DEBUG if found.
15507 2002-05-25 Ravi Pratap <ravi@ximian.com>
15509 * interface.cs (Populate*): Pass in the TypeContainer as well as
15510 the DeclSpace as parameters so that we can create EmitContexts and
15511 then use that to apply attributes etc.
15513 (PopulateMethod, PopulateEvent, PopulateProperty)
15514 (PopulateIndexer): Apply attributes everywhere.
15516 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15519 (ApplyAttributes): Update accordingly.
15521 We now apply interface attributes for all members too.
15523 2002-05-26 Miguel de Icaza <miguel@ximian.com>
15525 * class.cs (Indexer.Define); Correctly check if we are explicit
15526 implementation (instead of checking the Name for a ".", we
15527 directly look up if the InterfaceType was specified).
15529 Delay the creation of the PropertyBuilder.
15531 Only create the PropertyBuilder if we are not an explicit
15532 interface implementation. This means that explicit interface
15533 implementation members do not participate in regular function
15534 lookups, and hence fixes another major ambiguity problem in
15535 overload resolution (that was the visible effect).
15537 (DefineMethod): Return whether we are doing an interface
15540 * typemanager.cs: Temporary hack until we get attributes in
15541 interfaces (Ravi is working on that) and we get IndexerName
15542 support in interfaces.
15544 * interface.cs: Register the indexers as properties.
15546 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15547 warning, I have verified that this is a bug in the .NET runtime
15548 (JavaScript suffers of the same problem).
15550 * typemanager.cs (MemberLookup): When looking up members for
15551 interfaces, the parent of an interface is the implicit
15552 System.Object (so we succeed in searches of Object methods in an
15553 interface method invocation. Example: IEnumerable x; x.ToString
15556 2002-05-25 Miguel de Icaza <miguel@ximian.com>
15558 * class.cs (Event): Events should also register if they do
15559 implement the methods that an interface requires.
15561 * typemanager.cs (MemberLookup); use the new GetInterfaces
15564 (GetInterfaces): The code used to lookup interfaces for a type is
15565 used in more than one place, factor it here.
15567 * driver.cs: Track the errors at the bottom of the file, we kept
15570 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15571 instance if the method we are calling is static!
15573 2002-05-24 Miguel de Icaza <miguel@ximian.com>
15575 * attribute.cs (ApplyAttributes): Make this function filter out
15576 the IndexerName attribute (as that attribute in reality is never
15577 applied) and return the string constant for the IndexerName
15580 * class.cs (TypeContainer.Emit): Validate that all the indexers
15581 have the same IndexerName attribute, and if so, set the
15582 DefaultName attribute on the class.
15584 * typemanager.cs: The return value might contain other stuff (not
15585 only methods). For instance, consider a method with an "Item"
15586 property and an Item method.
15588 * class.cs: If there is a problem with the parameter types,
15591 2002-05-24 Ravi Pratap <ravi@ximian.com>
15593 * ecore.cs (ImplicitConversionExists): Wrapper function which also
15594 looks at user defined conversion after making a call to
15595 StandardConversionExists - we need this for overload resolution.
15597 * expression.cs : Update accordingly the various method calls.
15599 This fixes 2 bugs filed against implicit user defined conversions
15601 2002-05-22 Miguel de Icaza <miguel@ximian.com>
15603 * statement.cs: Track the result of the assignment.
15605 2002-05-21 Miguel de Icaza <miguel@ximian.com>
15607 * expression.cs (MemberAccess): Improved error reporting for
15608 inaccessible members.
15610 2002-05-22 Martin Baulig <martin@gnome.org>
15612 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
15613 itself with debugging support.
15615 2002-05-22 Martin Baulig <martin@gnome.org>
15617 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15618 Removed, this isn't needed anymore.
15620 2002-05-20 Martin Baulig <martin@gnome.org>
15622 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15623 be underlying type for an enum.
15625 2002-05-20 Miguel de Icaza <miguel@ximian.com>
15627 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15628 that splits out the loading of just the core types.
15630 * rootcontext.cs (ResolveCore): Split the struct resolution in
15631 two, so we can load the enumeration underlying types before any
15634 * expression.cs (Is): Bandaid until we fix properly Switch (see
15635 bug #24985 for details).
15637 * typemanager.cs (ImplementsInterface): The hashtable will contain
15638 a null if there are no interfaces implemented.
15640 2002-05-18 Miguel de Icaza <miguel@ximian.com>
15642 * cs-parser.jay (indexer_declarator): It is fine to have array
15645 2002-05-17 Miguel de Icaza <miguel@ximian.com>
15647 * typemanager.cs: (RegisterBuilder): New function used to register
15648 TypeBuilders that implement interfaces. Since
15649 TypeBuilder.GetInterfaces (as usual) does not work with lame
15651 (AddUserType): register interfaces.
15653 (ImplementsInterface): Use the builder_to_ifaces hash if we are
15654 dealing with TypeBuilder. Also, arrays are showing up as
15655 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15656 methods can not be invoked on them!
15658 * ecore.cs (ExplicitReferenceConversionExists): Made public.
15659 (ImplicitReferenceConversionExists): Split out from
15660 StandardConversionExists.
15662 * expression.cs (As): We were only implementing one of the three
15663 cases for the as operator. We now implement them all.
15664 (Is): Implement the various other cases for Is as well.
15666 * typemanager.cs (CACHE): New define used to control if we want or
15667 not the FindMembers cache. Seems to have a negative impact on
15668 performance currently
15670 (MemberLookup): Nested types have full acess to
15671 enclosing type members
15673 Remove code that coped with instance/static returns for events, we
15674 now catch this in RealFindMembers.
15676 (RealFindMembers): only perform static lookup if the instance
15677 lookup did not return a type or an event.
15679 2002-05-17 Miguel de Icaza <miguel@ximian.com>
15681 * assign.cs (CompoundAssign): We pass more semantic information
15682 now to Compound Assignments than we did before: now we have all
15683 the information at hand, and now we resolve the target *before* we
15684 do the expression expansion, which allows the "CacheValue" method
15685 to have the effect we intended (before, a [x] += 1 would generate
15686 two differen ArrayAccess expressions from the ElementAccess,
15687 during the resolution process).
15689 (CompoundAssign.DoResolve): Resolve target and original_source here.
15691 2002-05-16 Miguel de Icaza <miguel@ximian.com>
15693 * expression.cs (ArrayAccess): dropped debugging information.
15695 * typemanager.cs: Small bug fix: I was always returning i_members,
15696 instead of one of i_members or s_members (depending on which had
15699 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
15700 method is invoked before any code generation takes place, and it
15701 is a mechanism to inform that the expression will be invoked more
15702 than once, and that the method should use temporary values to
15703 avoid having side effects
15705 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15707 * ecore.cs (Expression.CacheTemporaries): Provide empty default
15710 * expression.cs (Indirection, ArrayAccess): Add support for
15711 CacheTemporaries in these two bad boys.
15713 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15714 ldobj or ldind_ref.
15715 (StoreFromPtr): Handle stobj as well.
15717 * expression.cs (UnaryMutator): Share more code.
15719 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15720 down: I was not tracking the Filter function as well, which
15721 was affecting the results of the cache.
15723 2002-05-15 Miguel de Icaza <miguel@ximian.com>
15725 * attribute.cs: Remove the hack to handle the CharSet property on
15728 2002-05-14 Miguel de Icaza <miguel@ximian.com>
15730 * attribute.cs (DoResolve): More uglyness, we now only try to
15731 resolve the attribute partially, to extract the CharSet
15732 information (only if we are a StructLayout attribute). Otherwise
15734 (GetExtraTypeInfo): Add some code to conditionally kill in the
15735 future this. I am more and more convinced that the .NET
15736 framework has special code to handle the attribute setting on
15739 * expression.cs (IsParamsMethodApplicable): Revert my previous
15740 foreach change here, it was wrong.
15742 2002-05-13 Miguel de Icaza <miguel@ximian.com>
15744 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15745 (pp_expr): do not abort on unknown input, just return.
15746 (eval): abort if there are pending chars.
15748 * attribute.cs (Attribute.Resolve): Positional parameters are
15749 optional. Deal with that case.
15751 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15752 the Ansi/Unicode/Auto information for the type.
15754 (TypeContainer.DefineType): instantiate the EmitContext here, as
15755 we will be using it during the type definition (to resolve
15756 attributes) and during the emit phase.
15758 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15759 to pull type information out of the attributes
15761 (Attribute.Resolve): track the constructor builder, and allow for
15762 multiple invocations (structs and classes will use this).
15764 * ecore.cs (MemberLookupFinal): new version with all the
15765 parameters customizable.
15767 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15768 constructors. Return if the result value is null (as the error
15769 would have been flagged already by MemberLookupFinal)
15771 Do not allow instances of abstract classes or interfaces to be
15774 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15775 We have to compare the assembly property here when dealing with
15776 FamANDAssem and Assembly access modifiers, because we might be
15777 creating an assembly from *modules* (that means that we are not
15778 getting TypeBuilders for types defined in other modules that are
15779 part of this assembly).
15781 (Method.Emit): If the method is marked abstract and has a body,
15784 (TypeContainer.DefineMembers): If both the defined member and the
15785 parent name match are methods, then do not emit any warnings: let
15786 the Method.Define routine take care of flagging warnings. But if
15787 there is a mismatch (method overrides something else, or method is
15788 overriwritten by something, then emit warning).
15790 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15791 set to null, this means `do not check for the return type on the
15794 (Method.Define): set the return type for the method signature to
15795 null, so that we get methods with the same name and parameters and
15796 different return types. This is used to flag warning 114 (you are
15797 hiding a method, and you probably want to use the new/override
15800 * typemanager.cs (MemberLookup): Implemented proper access
15801 control, closing a long standing set of bug reports. The problem
15802 was that the Framework only has two bits: Public and NonPublic,
15803 and NonPublic includes private and protected methods, but we need
15804 to enforce the FamANDAssem, FamOrAssem and Family.
15806 2002-05-11 Miguel de Icaza <miguel@ximian.com>
15808 * statement.cs (GotoCase): Return true: Ammounts to giving up
15809 knowledge on whether we return or not, and letting the other case
15810 be responsible for it.
15812 2002-05-10 Miguel de Icaza <miguel@ximian.com>
15814 * driver.cs: Do not load directories for each file processed, only
15815 do it if there is a pattern.
15817 * ecore.cs: Report readonly assigns here as well, as we might have
15818 been resolved only by MemberAccess.
15820 (SimpleName.SimpleNameResolve): Also be useful for LValue
15821 resolution. We need this to propagate assign to local readonly variables
15823 * typemanager.cs: Use a ptrhashtable for the criteria, because we
15824 do not want to reuse potential criteria memory.
15826 * class.cs (MyEventBuilder): Set reflected_type;
15828 * ecore.cs (Constantify): Added support for constifying bools.
15830 (RootContext.LookupType): Added a cache for values looked up in
15831 the declaration space.
15833 * typemanager.cs (FindMembers): Now is a front-end to
15834 RealFindMembers, and provides a two-level hashtable-based cache to
15837 15% performance improvement: from 22.5 to 19.2 seconds.
15839 * expression.cs (IsParamsMethodApplicable): use foreach.
15840 (Invocation.DoResolve): ditto.
15841 (New.DoResolve): ditto.
15842 (ArrayCreation.DoResolve): ditto.
15844 * ecore.cs (FindMostEncompassingType): use foreach.
15846 * delegate.cs (NewDelegate.DoResolve): Use foreach
15848 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15849 (RemoveMethods): use foreach.
15851 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15852 nested foreach statements instead of for, and also break out of
15853 the inner loop once a match is found.
15855 (Invocation.OverloadResolve): Use foreach, simplify the code.
15857 2002-05-08 Miguel de Icaza <miguel@ximian.com>
15859 * cfold.cs (BinaryFold): During an enumeration evaluation context,
15860 we actually unwrap the expression to allow for extra information
15863 * expression.cs: Use Shr_Un on unsigned operations.
15865 2002-05-08 Ravi Pratap <ravi@ximian.com>
15867 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
15868 applicable operators was not being considered correctly. This closes
15869 the bug Miguel reported.
15871 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15873 * attribute.cs: check that the type derives from System.Attribute
15874 and report the correct error in that case (moved the duplicate code to
15875 its own method, too).
15877 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15879 * attribute.cs: lookup attribute type name as the spec says: first the
15880 bare attribute name and then name + "Attribute" (nant compiles with
15881 mcs after this fix).
15883 2002-05-07 Miguel de Icaza <miguel@ximian.com>
15885 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
15886 Because of the way we parse things, we should try to see if a
15887 UIntConstant can fit in an integer.
15889 2002-05-07 Ravi Pratap <ravi@ximian.com>
15891 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15892 when we are in an explicit context.
15894 (ConvertReferenceExplicit): When converting from Iface type S to Class
15895 T make sure the rules are implemented as an OR.
15897 * parameter.cs (ParameterType): Make it a property for now although the
15898 purpose really isn't anything immediate.
15900 * expression.cs (Is*Applicable): Do better checking on the parameter type
15901 of a ref/out parameter. The ones from the system assemblies are already
15902 marked with the correct type so we don't need to do any correction.
15904 * ecore.cs (StandardConversionExists): Conversion from Interface types to
15905 the object type is standard too so include that.
15907 2002-05-06 Miguel de Icaza <miguel@ximian.com>
15909 * ecore.cs (StandardConversionExists): Augment with missing code:
15910 deal with IntConstant, LongConstants and Enumerations.
15912 * assign.cs: Report the error, instead of failing silently
15914 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15915 typecontainer that they are declared, because the
15916 typecontainer/namespace will have the list of using clauses that
15917 need to be applied.
15919 Assembly Attributes were escaping the normal registration
15922 (EmitCode): Apply attributes within an EmitContext that represents
15923 the container they were declared on.
15925 * cs-parser.jay: Track bases for structs. How did I get this wrong?
15927 2002-05-06 Ravi Pratap <ravi@ximian.com>
15929 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15930 Revamp completely - make much cleaner as we now operate only
15933 (FindMostSpecificSource, FindMostSpecificTarget): New methods
15934 to implement the logic detailed in the spec more correctly.
15936 (UserDefinedConversion): Update accordingly.
15938 2002-05-06 Miguel de Icaza <miguel@ximian.com>
15940 * statement.cs: Return flow analysis information up.
15942 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15945 (token): Do not consume an extra character before calling
15948 2002-05-06 Piers Haken <piersh@friskit.com>
15950 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15952 2002-05-06 Miguel de Icaza <miguel@ximian.com>
15954 * class.cs (Constructor.Emit): Set the IsStatic flag in the
15955 EmitContext during the instance constructor initializer
15956 resolution, to stop access to instance variables.
15958 This is mandated by the spec, last paragraph of the `constructor
15959 initializers' section.
15961 2002-05-05 Miguel de Icaza <miguel@ximian.com>
15963 * cs-parser.jay, class.cs (Accessor): new class used to represent
15964 an accessor (get or set). In the past we used `null' to represent
15965 a missing accessor. But this is ambiguous because there was no
15966 way to tell in abstract indexers/properties if one of them was
15969 Now there is a way of addressing that.
15971 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15972 instead of FindMembers.
15974 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15975 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15977 * attribute.cs: Treat indexers and properties as the same in terms
15978 of applying attributes
15980 * ecore.cs (FindMostEncompassedType): Use statically initialized
15981 EmptyExpressions()s like we do elsewhere to avoid creating useless
15982 objects (and we take this out of the tight loop).
15984 (GetConversionOperators): Move the code to extract the actual
15985 operators to a separate routine to clean things up.
15987 2002-05-04 Miguel de Icaza <miguel@ximian.com>
15989 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15990 events are always registered FieldBuilders.
15992 * class.cs (FieldBase): New class shared by Fields
15994 * delegate.cs: If we are a toplevel delegate, use our full name.
15995 If we are a nested delegate, then only use our tail name.
15997 2002-05-02 Ravi Pratap <ravi@ximian.com>
15999 * expression.cs (IsApplicable): Ensure that we add the "&" to
16000 ref/out types before comparing it with the type of the argument.
16002 (IsParamsMethodApplicable): Ditto.
16004 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
16007 * delegate.cs : Handle the case when we have more than one applicable
16008 method. Flag an error only when we finish checking all.
16010 2002-05-02 Miguel de Icaza <miguel@ximian.com>
16012 * expression.cs: Add support for boolean static initializers.
16014 2002-05-01 Miguel de Icaza <miguel@ximian.com>
16016 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16018 * parameter.cs (ComputeParameterTypes,
16019 ComputeAndDefineParameterTypes): Better error handling: now we
16020 clear the `types' cache if we fail during any of the type lookups.
16021 We also return the status code correctly to our caller
16023 * delegate.cs: If we fail to define a delegate, abort the extra
16026 * expression.cs (Binary.ResolveOperator): for
16027 operator==(object,object) and operator !=(object, object) we also
16028 have to verify that there is an implicit conversion from one to
16031 (ArrayAccess.DoResolve): Array Access can operate on
16034 2002-04-30 Miguel de Icaza <miguel@ximian.com>
16036 * assign.cs (CompoundAssign): A new class used as a "flag" that
16037 the assignment actually is happening as part of a compound
16038 assignment operator.
16040 During compound assignment, a few new rules exist to enable things
16047 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16048 to the type of x) if y is implicitly convertible to the type of x,
16049 and the operator is a builtin operator and the return type of the
16050 operator is explicitly convertible to the type of x.
16052 * rootcontext.cs: Reset warning level to 2. 4 catches various
16053 "interesting" features in mcs, we must clean this up at some
16054 point, but currently am trying to kill other bugs ;-)
16056 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16057 in container classes as well.
16059 * expression.cs (Binary.ResolveOperator): Handle string case
16060 before anything else (as operator overloading does emit an error
16061 before doing anything else).
16063 This code could go away when we move to a table driven model, but
16064 i could not come up with a good plan last night.
16066 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
16068 * typemanager.cs (CSharpName): reimplementation using regex.
16069 * class.cs: added null check for fields in Emit
16070 * rootcontext.cs: set warninglevel to 4
16072 2002-04-29 Miguel de Icaza <miguel@ximian.com>
16074 * typemanager.cs (CSharpName): reimplemented with Lupus
16077 2002-04-28 Miguel de Icaza <miguel@ximian.com>
16079 * statement.cs (If): correclty implement Resolve, because we were
16080 not catching sem errors in there. The same process is needed
16082 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16085 (Statement.Warning_DeadCodeFound): Factorize code.
16086 (While): Report dead code here too.
16088 (Statement): Added Resolve virtual method to allow
16089 for resolution split from the emit code.
16091 2002-04-26 Miguel de Icaza <miguel@ximian.com>
16093 * statement.cs (EmitBoolExpression): No longer try to resolve the
16095 (MakeBoolean): New utility function that resolve, implicitly
16096 converts to boolean and tags the expression.
16099 (If, Do): Implement dead code elimination.
16100 (While): Implement loop inversion
16102 (Do, While, For, If): Resolve the expression prior to calling our
16105 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
16108 - added method Report28 (warning: program has more than one entry point)
16109 - added method IsEntryPoint, implements paragraph 10.1 of the spec
16110 - modified method Method.Define, the part at the end of the method
16112 * rootcontext.cs: added static public Location EntryPointLocation;
16114 * ../errors/cs0028.cs : Add test case for the above warning.
16117 - modified method CSharpName to allow arrays of primitive type to
16118 be printed nicely (e.g. instead of System.Int32[][] it now prints
16120 - added method CSharpSignature: returns the signature of a method
16121 in string format to be used in reporting errors, warnings, etc.
16123 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16126 2002-04-26 Ravi Pratap <ravi@ximian.com>
16128 * delegate.cs (Define): Fix extremely silly bug where I was
16129 setting the type of the 'object' parameter of the BeginInvoke
16130 method to System.IAsyncResult instead of System.Object ;-)
16132 2002-04-26 Miguel de Icaza <miguel@ximian.com>
16134 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16137 (Constructor.Emit): return if we fail to initialize the
16138 constructor. Another door closed!
16140 * expression.cs (New.DoResolve): Improve error message (from -6 to
16141 1501). Use DeclaredOnly lookup to find the exact constructor.
16143 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16144 loop. This is useful.
16146 * cs-parser.jay: Adjust the default parameters so that destructors
16147 have the proper signature.
16149 2002-04-26 Martin Baulig <martin@gnome.org>
16151 * driver.cs (LoadAssembly): If `assembly' contains any characters
16152 which are only valid in path names and not in assembly names
16153 (currently slash, backslash and point), use Assembly.LoadFrom ()
16154 instead of Assembly.Load () on the `assembly' (before iteration
16155 over the link_paths).
16157 2002-04-26 Martin Baulig <martin@gnome.org>
16159 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
16161 2002-04-25 Miguel de Icaza <miguel@ximian.com>
16163 * class.cs (Property): use the new typemanager.MemberLookup
16165 (TypeContainer.MemberLookup): Implement using the
16166 TypeManager.MemberLookup now.
16168 * typemanager.cs: Make MemberLookup a function of the TypeManager,
16169 and return MemberInfos, so that these can be used without an
16170 EmitContext (what we had before).
16172 2002-04-24 Miguel de Icaza <miguel@ximian.com>
16174 * expression.cs: Fix the case where the argument to params if the
16175 type of the params. I omitted handling this before. Fixed
16177 2002-04-22 Miguel de Icaza <miguel@ximian.com>
16179 * driver.cs: Call BootCorlib_PopulateCoreType
16181 * class.cs (Property.CheckBase): Check for properties only, not
16184 * interface.cs: Temporary hack: try/catch around the
16185 CustomAttributeBuilder, because I am getting an exception that I
16188 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
16189 types whose definitions are required to be there (attributes are
16190 defined before standard types).
16192 Compute definitions as we boot the various types, as they are used
16193 immediately (value_type class will need object_type, but if we do
16194 not initialize object_type, we will pass a null, which will let
16195 the runtime pick the System.Object from the existing corlib, which
16196 is not what we want).
16198 2002-04-22 Patrik Torstensson <totte@labs2.com>
16200 * cs-tokenizer.cs: fixed a number of trim() issues.
16202 2002-04-22 Ravi Pratap <ravi@ximian.com>
16204 * expression.cs (Argument.Type): Ensure that we return the correct
16205 type when we have out or ref parameters [in which case we
16208 2002-04-22 Miguel de Icaza <miguel@ximian.com>
16210 * class.cs (Property, Indexer): Allow extern modifier in there.
16212 * typemanager.cs (InitBaseTypes): Initializes object_type and
16213 value_type, since those will be used early on during the bootstrap
16214 process to compile corlib.
16216 (InitCoreTypes): Move code from here to InitBaseTypes.
16218 2002-04-21 Miguel de Icaza <miguel@ximian.com>
16220 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
16221 single-dimension arrays as using the ldlen opcode.
16223 Daniel Lewis discovered this optimization.
16225 * typemanager.cs: Add signature for System.Array::get_Length
16227 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16229 * statement.cs: report the error when the foreach does not apply to an
16230 array nor a collection.
16232 2002-04-19 Miguel de Icaza <miguel@ximian.com>
16234 * expression.cs: Add implicit conversions to the operator ~.
16236 * constant.cs (DecimalConstant.Emit): Emit decimal value.
16238 * typemanager.cs: Locate the decimal constructor.
16240 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16242 * attribute.cs: use the new property of TypeOf.
16243 * expression.cs: added 'get' property around typearg.
16245 These changes fix a build breaker reported by NickD. Is this the
16246 correct way to fix? If not, please, revert my changes and make it
16249 2002-04-17 Miguel de Icaza <miguel@ximian.com>
16251 * attribute.cs: Add support for typeof in attribute invocations.
16252 I am not sure that this is right though.
16254 2002-04-14 Duncan Mak <duncan@ximian.com>
16256 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16257 Binary.Operator.Division case.
16259 2002-04-13 Ravi Pratap <ravi@ximian.com>
16261 * class.cs (DefineType): Ensure that we do a proper check on
16262 attribute types and also register it with the TypeManager.
16264 (TypeContainer.Targets): The default for attribute types is
16265 AttributeTargets.All.
16267 * attribute.cs (ApplyAttributes): Registering the attribute type
16268 is done elsewhere, not when we discover we have a Usage attribute.
16270 2002-04-12 Ravi Pratap <ravi@ximian.com>
16272 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16273 and get rid of is_delegate parameter.
16275 * everywhere : update.
16277 2002-04-12 Ravi Pratap <ravi@ximian.com>
16279 * cs-parser.jay (compilation_unit): Revamp completely to use
16280 some new ideas that I got from Rhys' grammar to solve the problems
16281 with assembly level attributes.
16283 (outer_declaration): New grammar production.
16285 (attribute_sections): Add.
16287 (opt_attributes): Base on attribute_sections
16289 (namespace_declaration): Allow opt_attributes to tackle the case
16290 when we have assembly level attributes - we are clever in this
16293 * attribute.cs (ApplyAttributes): Do not worry about assembly
16294 attributes in the non-global context.
16296 * rootcontext.cs (AddGlobalAttributes): Go back to using this
16297 instead of SetGlobalAttributes.
16299 * class.cs, rootcontext.cs : Ensure we define and generate
16300 attribute types before anything else.
16302 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16303 and flag the new error -20 for the case when the attribute type
16304 does not have valid targets specified. csc does not catch this.
16306 * ../errors/errors.txt : update for error # -20
16308 2002-04-11 Ravi Pratap <ravi@ximian.com>
16310 * support.cs (InternalParameters.ParameterModifier): Do some null
16311 checking and return sane values.
16313 * class.cs (Method.Define): If we are a PInvoke method, ensure
16314 that we are static and extern. Report error # 601
16316 * ../errors/cs0601.cs : Add test case for the above error.
16318 2002-04-07 Ravi Pratap <ravi@ximian.com>
16320 * rootcontext.cs (attribute_types): We need to keep type of
16321 all attribute types separately and emit code for them first.
16323 (RegisterAttribute) : Implement.
16325 * class.cs (DefineType): Check if the current Type is a custom
16326 attribute type and register it accordingly.
16328 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16329 adding the first attribute twice and rename to
16331 (SetGlobalAttributes): this.
16333 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16336 * attribute.cs (ApplyAttributes): Take an additional argument telling us
16337 if we are processing global arguments. Hmm, I am unsure of this.
16339 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16341 * expression.cs: added static array of strings to avoid calling
16342 Enum.ToString () for Operator in Binary. Significant recover of
16345 2002-04-10 Miguel de Icaza <miguel@ximian.com>
16347 * class.cs (FindMembers): Allow the Builders of the various
16348 members to be null. If they are skip them. This only happens
16349 during the PInvoke declaration.
16351 2002-04-09 Miguel de Icaza <miguel@ximian.com>
16353 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16354 failure, so we do not keep going afterwards.
16356 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16357 wanted to pass `false' as the `is_delegate' argument. If this is
16358 the case, why not use delegate_type == null to mean `is_delegate =
16359 false' and anything else as is_delegate = true.
16361 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
16363 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16364 code for the section, not the beginning of the tests.
16366 2002-04-08 Miguel de Icaza <miguel@ximian.com>
16368 * cfold.cs: Handle operator + (Enum x, Underlying x)
16370 * expression.cs (Binary): same. Warn about errors where we have
16371 Enum/Enum in operator + as well.
16373 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
16376 - added support for switch(bool)
16377 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16378 - add TableSwitchEmit() to handle table-based switch statements
16380 2002-04-05 Ravi Pratap <ravi@ximian.com>
16382 * expression.cs (Invocation.OverloadResolve): Factor out code which
16383 does parameter compatibility checking with arguments so that we can
16384 re-use the code even from Delegate.VerifyApplicability
16386 (VerifyArgumentsCompat): Move above code here.
16388 * delegate.cs (VerifyApplicability): Get rid of duplicate code
16389 and instead make a call to the above method.
16391 2002-03-31 Ravi Pratap <ravi@ximian.com>
16393 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16394 We use it to keep track of classes which are attribute types.
16396 2002-04-02 Miguel de Icaza <miguel@ximian.com>
16398 * delegate.cs (Delegate.Define): Correctly define the types in the
16399 presence of fixed and array parameters.
16401 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16404 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16405 include NonPublic after the first iteration.
16407 * class.cs (Indexer.CheckBase): Only check if both parents are
16410 * cs-parser.jay (accessor_body): If empty, set to null.
16412 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16413 same code path here to resolve constants names that we did have in
16414 MemberAccess.DoResolve. There is too much code duplicated here.
16416 2002-04-01 Miguel de Icaza <miguel@ximian.com>
16418 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16420 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16423 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16424 tokens, numbers and strings.
16426 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16429 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16430 asyncronous parameters and the regular parameters.
16432 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16433 specify the target directory.
16435 * expression.cs: (This.DoResolve): Simplify
16436 (As.Emit): Optimize, do not generate IsInst if the expression is
16437 always of the given type.
16439 (Is.DoResolve): Bug fix, we were reporting both always/never for
16442 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16443 creating too many unnecessary arrays.
16445 2002-03-31 Miguel de Icaza <miguel@ximian.com>
16447 * class.cs (EmitFieldInitializer): Use Assign expression to assign
16448 fields instead of rolling our own initializer. Takes care of all
16449 implicit conversions, and drops unnecessary static checks/argument.
16451 2002-03-31 Dick Porter <dick@ximian.com>
16453 * driver.cs: use the GetDirectories() return values properly, and
16454 use "/" as path separator.
16456 2002-03-30 Miguel de Icaza <miguel@ximian.com>
16458 * expression.cs (Unary): Optimize - - expr into expr.
16459 (Binary): Optimize a + (-b) into a -b.
16461 * codegen.cs (CodeGen): Made all methods static.
16463 2002-03-29 Miguel de Icaza <miguel@ximian.com>
16467 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16468 TypeBuilder property.
16470 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16473 * tree.cs: Removed the various RecordXXXX, and replaced with a
16474 single RecordDecl. Removed all the accessor methods, and just
16475 left a single access point Type
16477 * enum.cs: Rename DefineEnum to DefineType.
16479 * decl.cs: New abstract method `DefineType' used to unify the
16480 Defines for Enumerations, Interfaces, TypeContainers and
16483 (FindType): Moved LookupInterfaceOrClass here. Moved the
16484 LookupBaseClasses method that used to live in class.cs and
16485 interface.cs here, and renamed to FindType.
16487 * delegate.cs: Implement DefineType. Take advantage of the
16488 refactored pattern for locating the parent builder without taking
16489 the parent_builder argument (which we know does not work if we are
16490 nested, and triggering a toplevel definition).
16492 2002-03-28 Miguel de Icaza <miguel@ximian.com>
16494 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16495 accessibility of a member has changed during override and report
16498 * class.cs (Method.Define, Property.Define): Only complain on
16499 overrides if the method is private, any other accessibility is
16500 fine (and since we just checked the permission is the same, we are
16503 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16504 and elif are processed always. The other pre-processing
16505 directives are only processed if we are "taking" the path
16507 2002-03-29 Martin Baulig <martin@gnome.org>
16509 * class.cs (Method.Emit): Only emit symbolic debugging info if the
16510 current location is not Null.
16512 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16513 a separate method so we can profile it.
16515 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16516 `span.Seconds' are just seconds, but no minutes or hours.
16517 (MainDriver): Profile the CodeGen.SaveSymbols calls.
16519 2002-03-28 Miguel de Icaza <miguel@ximian.com>
16521 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16522 Remove the gratuitous set of Final:
16524 // If an interface implementation, then we can set Final.
16525 if (((flags & MethodAttributes.Abstract) == 0) &&
16526 implementing.DeclaringType.IsInterface)
16527 flags |= MethodAttributes.Final;
16529 I do not know what I was smoking when I used that.
16532 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16533 step into fixing the name resolution issues for delegates and
16534 unifying the toplevel name resolution.
16536 2002-03-28 Martin Baulig <martin@gnome.org>
16538 * class.cs (Method.Emit): If we have a symbol writer, call its
16539 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16540 tell it about the current method.
16542 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16543 writer that we're going to emit the first byte of IL code for a new
16544 statement (a new source line).
16545 (EmitContext.EmitTopBlock): If we have a symbol writer, call
16546 EmitContext.Mark() before emitting any code.
16548 * location.cs (SymbolDocument): Return null when we're Null.
16550 * statement.cs (Statement): Moved the `Location loc' variable here.
16551 (Statement.EmitBoolExpression): If we have a symbol writer, call
16552 ec.Mark() before emitting any code to tell it that we're at the
16553 beginning of a new statement.
16554 (StatementExpression): Added `Location' argument to the constructor.
16555 (Block): Added public readonly variable `StartLocation' and public
16556 variable `EndLocation'. The latter is to be set using SetEndLocation().
16557 (Block): Added constructor which takes a start and end location.
16558 (Block.SetEndLocation): New method. This sets the end location.
16559 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16560 local variables we create.
16561 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16562 each statement and do also mark the begin and end of the block.
16564 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16565 tell it the current lexer.Location, use Location.Null for the end of the
16567 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16568 current block, set its end location using SetEndLocation().
16569 (statement_expression): StatementExpression constructor now takes the
16570 lexer.Location as additional argument.
16571 (for_statement, declare_local_variables): Likewise.
16572 (declare_local_variables): When creating a new implicit block, use the
16573 new Block constructor and pass it the lexer.Location.
16575 2002-03-28 Miguel de Icaza <miguel@ximian.com>
16577 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16578 members also on the parent interfaces recursively.
16580 2002-03-27 Miguel de Icaza <miguel@ximian.com>
16582 * report.cs: Use new formats, since Gonzalo finished the missing
16585 * expression.cs (Binary.ResolveOperator): added missing operator|
16586 operator& and operator^ for bool/bool.
16588 * cs-parser.jay: CheckDef now takes a Location argument that is
16589 used to report errors more precisly (instead of reporting the end
16590 of a definition, we try to track something which is a lot closer
16591 to the source of the problem).
16593 * cs-tokenizer.cs: Track global token use, so we can properly flag
16594 the use of #define/#undef after the first token has been seen.
16596 Also, rename the reportXXXX to Error_DescriptiveName
16598 * decl.cs (DeclSpace.IsTopLevel): Move property here from
16599 TypeContainer, so that Enum and Interface can use this too.
16601 * class.cs (TypeContainer.LookupInterfaceOrClass,
16602 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16603 `builder' argument. Typically this was used to pass the parent
16604 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16607 The problem is that a nested class could trigger the definition of
16608 a toplevel class, and the builder would be obviously wrong in that
16611 So we drop this argument, and we compute dynamically the
16612 TypeBuilder/ModuleBuilder (the correct information was available
16613 to us anyways from DeclSpace.Parent)
16615 * interface.cs (Interface.DefineInterface): Drop builder
16616 parameter cleanup like class.cs
16618 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
16621 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16624 (Try.Emit): Propagate the returns value from the statement.
16626 (Return.Emit): Even if we are leavning
16628 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16630 * modifiers.cs: Fix the computation of MethodAttributes flags.
16632 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16634 * driver.cs: allow compilation of files that start with '/'.
16635 Add a default case when checking the argument of --target.
16637 2002-03-25 Miguel de Icaza <miguel@ximian.com>
16639 * interface.cs: Implement the same search algorithm for types in
16640 the interface code.
16642 * delegate.cs: Do not allow multiple definition.
16644 * Recovered ChangeLog that got accidentally amputated
16646 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16648 * rootcontext.cs: Load manually enum to allow core classes to
16649 contain enumerations.
16651 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16652 Update to new static methods in TypeManager.
16654 * typemanager.cs (GetMethod, GetConstructor): Use our
16655 implementation of FindMembers to find the members, since during
16656 corlib compilation, the types are TypeBuilders and GetMethod and
16657 GetConstructor do not work.
16659 Make all methods in TypeManager static.
16661 (InitCodeHelpers): Split the functionality from
16662 the InitCodeTypes function.
16664 * driver.cs: Call InitCodeHelpers after we have populated the
16667 * cs-parser.jay (delegate_declaration): we did not used to compute
16668 the delegate name correctly for void delegates.
16670 2002-03-24 Miguel de Icaza <miguel@ximian.com>
16672 * rootcontext.cs (RootContext): Init the interface_resolve_order
16673 and type_container_resolve_order always.
16675 (ResolveCore, BootstrapCorlib_ResolveClass,
16676 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16677 compiler when compiling with --nostdlib
16679 * class.cs (TypeContainer.DefineType): Check that our parent is
16680 not null. This test is most important when we are bootstraping
16683 * codegen.cs: Split out the symbol writing code.
16685 2002-03-25 Martin Baulig <martin@gnome.org>
16687 * driver.cs (-g): Made -g an alias for --debug.
16689 2002-03-24 Martin Baulig <martin@gnome.org>
16691 * codegen.cs (SymbolWriter): New public variable. Returns the
16692 current symbol writer.
16693 (CodeGen): Added `bool want_debugging_support' argument to the
16694 constructor. If true, tell the ModuleBuild that we want debugging
16695 support and ask it for the ISymbolWriter.
16696 (Save): If we have a symbol writer, call it's Close() method after
16697 saving the assembly.
16699 * driver.c (--debug): New command line argument to create a
16700 debugger information file.
16702 * location.cs (SymbolDocument): New public property. Returns an
16703 ISymbolDocumentWriter object for the current source file or null
16704 if we don't have a symbol writer.
16706 2002-03-21 Miguel de Icaza <miguel@ximian.com>
16708 * driver.cs (LoadAssembly): Correctly return when all the paths
16709 have been tried and not before.
16711 * statement.cs (Switch.Emit): return the actual coverage for this
16712 statement (returns/not-returns)
16714 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16715 switch of the statement if we are the last switch section. That
16716 kills two problems: try/catch problems (we used to emit an empty
16717 nop at the end) and switch statements where all branches would
16720 2002-03-19 Miguel de Icaza <miguel@ximian.com>
16722 * driver.cs: Add default assemblies (the equivalent to the
16723 Microsoft CSC.RSP file)
16725 * cs-tokenizer.cs: When updating `cols and setting it to zero,
16726 also update tokens_seen and set it to false.
16728 * driver.cs: Implement --recurse for Mike.
16730 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16731 correctly splitting out the paths.
16733 2002-03-18 Miguel de Icaza <miguel@ximian.com>
16735 * interface.cs (Interface.PopulateProperty): Instead of using
16736 `parent' as the declaration space for the set parameters, use
16739 * support.cs (InternalParameters): InternalParameters constructor
16740 takes a DeclSpace instead of a TypeContainer.
16742 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16743 types are being initialized, load the address of it before calling
16746 (New): Provide a mechanism to disable the generation of local
16747 value type temporaries when the caller will be providing us with
16748 an address to store it.
16750 (ArrayCreation.EmitDynamicInitializers): Use it.
16752 2002-03-17 Miguel de Icaza <miguel@ximian.com>
16754 * expression.cs (Invocation.EmitArguments): Only probe for array
16755 property if there is more than one argument. Sorry about that.
16757 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16758 empty param arrays.
16760 * class.cs (Method.LabelParameters): Fix incorrect code path that
16761 prevented the `ParamArrayAttribute' from being applied to the
16764 2002-03-16 Miguel de Icaza <miguel@ximian.com>
16766 * support.cs (ReflectionParameters): Correctly compute whether the
16767 last argument is a params array. Fixes the problem with
16770 * typemanager.cs: Make the assemblies array always be non-null
16771 (empty, but non-null)
16773 * tree.cs (RecordDecl): New function that abstracts the recording
16774 of names. This reports error 101, and provides a pointer to the
16775 previous declaration. Fixes a crash in the compiler.
16777 * cs-parser.jay (constructor_declaration): Update to new grammar,
16778 and provide a constructor_body that can be empty.
16780 2002-03-15 Miguel de Icaza <miguel@ximian.com>
16782 * driver.cs: Add support for --resources.
16784 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16785 Make all types for the various array helper methods be integer.
16787 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16788 CheckState to ConvCast.
16790 (ConvCast): Now it takes a `checked' state argument, to avoid
16791 depending on the emit context for the conversion, and just using
16792 the resolve time setting.
16794 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16795 instead of Invocation.EmitArguments. We do not emit the original
16796 arguments, instead we emit those which have been converted to
16797 unsigned int expressions.
16799 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16801 * codegen.cs: ditto.
16803 * expression.cs (LocalVariableReference): Drop the use of the
16804 Store function that depended on the variable index.
16806 * statement.cs (VariableInfo): Drop the `Idx' property from this
16807 class, as this is not taking into account the indexes for
16808 temporaries tat we generate during the execution, getting the
16811 * class.cs: First emit class initializers, then call the parent
16814 * expression.cs (Binary): Fix opcode emision.
16815 (UnaryMutator.EmitCode): Support checked code generation
16817 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16818 matches for events for both the Static and Instance scans,
16819 pointing to the same element. Fix that.
16821 2002-03-14 Miguel de Icaza <miguel@ximian.com>
16823 * rootcontext.cs (ResolveTree): Always set the
16824 interface_resolve_order, because nested interfaces will be calling
16827 * class.cs (GetInterfaceOrClass): Track the same resolution
16828 process used by TypeManager.LookupType. This fixes the nested
16829 type lookups in class declarations (separate path from
16832 (TypeContainer.DefineType): Also define nested interfaces.
16833 (TypeContainer.RegisterOrder): New public function used to
16834 register the order in which child interfaces need to be closed.
16836 Nested interfaces need to be closed after their parents have been
16839 * interface.cs (InterfaceAttr): Put all the logic for computing
16840 the interface attribute here.
16842 (DefineInterface): Register our interface order with the
16843 RootContext or with the TypeContainer depending on the case.
16845 2002-03-12 Miguel de Icaza <miguel@ximian.com>
16847 * cs-parser.jay: rework foreach statement to work with the new
16848 changes to the policy on SimpleNames.
16850 * report.cs: support Stacktrace on warnings as well.
16852 * makefile: drop --unsafe and /unsafe from the compile.
16854 2002-03-13 Ravi Pratap <ravi@ximian.com>
16856 * ecore.cs (StandardConversionExists): Modify to take an Expression
16857 as the first parameter. Ensure we do null -> reference type conversion
16860 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16861 temporary Expression objects.
16863 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16865 * interface.cs: workaround bug in method overloading resolution
16866 (there is already a bugzilla bug for it).
16868 2002-03-12 Miguel de Icaza <miguel@ximian.com>
16870 We could also solve this problem by having a separate path for
16871 performing type lookups, instead of DoResolve, we could have a
16872 ResolveType entry point, and only participating pieces of the
16873 production (simplename, deref, array) would implement this.
16875 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16876 signal SimpleName to only resolve type names and not attempt to
16877 resolve anything else.
16879 * expression.cs (Cast): Set the flag.
16881 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16883 * class.cs: Only report 108 if there is no `new' modifier.
16885 * cs-parser.jay: rework foreach statement to work with the new
16886 changes to the policy on SimpleNames.
16888 * report.cs: support Stacktrace on warnings as well.
16890 * makefile: drop --unsafe and /unsafe from the compile.
16892 2002-03-11 Miguel de Icaza <miguel@ximian.com>
16894 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16895 lookups here, instead of doing that at parse time. This means
16896 that our grammar will not introduce `LocalVariableReferences' as
16897 expressions at this point. That solves the problem of code like
16901 static void Main ()
16905 This is only half the fix. The full fix requires parameters to
16906 also be handled in this way.
16908 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16909 makes the use more obvious of the DeclSpace. The
16910 ec.TypeContainer.TypeBuilder is now only used to pull the
16911 TypeBuilder for it.
16913 My theory is that I can get rid of the TypeBuilder completely from
16914 the EmitContext, and have typecasts where it is used (from
16915 DeclSpace to where it matters).
16917 The only pending problem is that the code that implements Aliases
16918 is on TypeContainer, and probably should go in DeclSpace.
16920 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16921 lookups here, instead of doing that at parse time. This means
16922 that our grammar will not introduce `LocalVariableReferences' as
16923 expressions at this point. That solves the problem of code like
16927 static void Main ()
16931 This is only half the fix. The full fix requires parameters to
16932 also be handled in this way.
16934 * class.cs (Property.DefineMethod): When implementing an interface
16935 method, set newslot, when implementing an abstract method, do not
16936 set the flag (before we tried never setting it, or always setting
16937 it, which is the difference).
16938 (Indexer.DefineMethod): same.
16939 (Method.DefineMethod): same.
16941 * ecore.cs: Only set the status used flag if we get back a Field.
16943 * attribute.cs: Temporary hack, so Paolo can keep working.
16945 2002-03-08 Ravi Pratap <ravi@ximian.com>
16947 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16948 the unmanaged type in the case we have a MarshalAs attribute.
16950 (Resolve): Handle the case when we are parsing the special MarshalAs
16951 attribute [we need to store the unmanaged type to use later]
16953 * typemanager.cs (marshal_as_attr_type): Built in type for the
16954 MarshalAs Attribute.
16956 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
16957 on parameters and accordingly set the marshalling info.
16959 2002-03-09 Miguel de Icaza <miguel@ximian.com>
16961 * class.cs: Optimizing slightly by removing redundant code after
16962 we switched to the `NoTypes' return value.
16963 (Property.DefineMethod): use NoTypes here too.
16965 This fixes the bug I introduced in my last batch of changes.
16967 2002-03-05 Ravi Pratap <ravi@ximian.com>
16969 * tree.cs (RecordEnum): Add. We now keep track of enums too.
16971 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16972 Enums since those are types too.
16974 * cs-parser.jay (enum_declaration): Record enums as we parse them.
16976 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
16977 thanks to a call during the lookup process.
16979 2002-03-07 Miguel de Icaza <miguel@ximian.com>
16981 * statement.cs (Foreach): Lots of work to accomodate a particular
16982 kind of foreach statement that I had not kept in mind. It is
16983 possible to have foreachs on classes that provide a GetEnumerator
16984 method that return objects that implement the "pattern" for using
16985 a foreach, there is no need to support GetEnumerator
16988 This is needed to compile nant.
16990 * decl.cs: Only report 114 if the member is not `Finalize' and if
16991 the warning level is at least 2.
16993 * class.cs: Moved the compare function from Method to
16996 (MethodSignature.InheritableMemberSignatureCompare): Add new
16997 filter function that is used to extract inheritable methods from a
17000 (Method.Define): Use the new `inheritable_method_signature_filter'
17003 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17006 2002-03-06 Miguel de Icaza <miguel@ximian.com>
17008 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17010 * cs-parser.jay: Add opt_semicolon to the interface declaration.
17012 * expression.cs: Pass location information to
17013 ConvertImplicitStandard.
17015 * class.cs: Added debugging code to track return values from
17018 2002-03-05 Miguel de Icaza <miguel@ximian.com>
17020 * expression.cs (Is.DoResolve): If either side of the `is' is an
17021 interface, do not flag the warning.
17023 * ecore.cs (ImplicitReferenceConversion): We need a separate test
17026 * report.cs: Allow for --fatal to be used with --probe.
17028 * typemanager.cs (NoTypes): Move the definition for the empty Type
17031 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17033 (TypeContainer.DefineProxy): New function used to proxy to parent
17034 implementations when implementing interfaces.
17035 (TypeContainer.ParentImplements): used to lookup if our parent
17036 implements a public function that is required by an interface.
17037 (TypeContainer.VerifyPendingMethods): Hook this up.
17039 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17040 `modules' and `assemblies' arraylists into arrays. We only grow
17041 these are the very early start up of the program, so this improves
17042 the speedof LookupType (nicely measured).
17044 * expression.cs (MakeByteBlob): Replaced unsafe code with
17045 BitConverter, as suggested by Paolo.
17047 * cfold.cs (ConstantFold.Binary): Special case: perform constant
17048 folding of string concatenation, but if either side is a string,
17049 and the other is not, then return null, and let the runtime use
17050 the concatenation on the string plus the object (using
17051 `Object.ToString').
17053 2002-03-04 Miguel de Icaza <miguel@ximian.com>
17055 Constant Folding has been implemented now.
17057 * expression.cs (Unary.Reduce): Do not throw an exception, catch
17058 the error instead on types that are not supported in one's
17061 * constant.cs (Constant and all children): New set of functions to
17062 perform implict and explicit conversions.
17064 * ecore.cs (EnumConstant): Implement the new functions to perform
17065 conversion by proxying to the child expression.
17067 * codegen.cs: (ConstantCheckState): Constant evaluation has its
17068 own separate setting that can not be turned off from the command
17069 line using --unchecked or --checked and is only controlled using
17070 the checked/unchecked statements and expressions. This setting is
17071 used by the constant folder to flag errors.
17073 * expression.cs (CheckedExpr, UncheckedExpr): Set the
17074 ConstantCheckState as well.
17076 During Resolve, they also have to flag the state, because the
17077 constant folder runs completely in the Resolve phase.
17079 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17082 2002-03-01 Miguel de Icaza <miguel@ximian.com>
17084 * cfold.cs: New file, this file contains the constant folder.
17086 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17087 argument to track whether we are using the resulting address to
17088 load or store a value and provide better error messages.
17090 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17091 new AddressOf arguments.
17093 * statement.cs (Foreach.EmitCollectionForeach): Update
17095 * expression.cs (Argument.Emit): Call AddressOf with proper
17096 arguments to track usage.
17098 (New.DoEmit): Call AddressOf with new arguments.
17100 (Unary.Emit): Adjust AddressOf call.
17102 2002-03-01 Ravi Pratap <ravi@ximian.com>
17104 * cs-parser.jay (member_access): Change the case for pre-defined types
17105 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
17108 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17111 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17112 essentially like methods and apply attributes like MethodImplOptions to them too.
17114 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17117 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17118 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17121 * Update code everywhere accordingly.
17123 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17125 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17127 2002-02-28 Ravi Pratap <ravi@ximian.com>
17129 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17130 try performing lookups against those instead of jumping straight into using
17131 the 'using' clauses.
17133 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17135 (LookupType): Perform lookups in implicit parents too.
17137 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17138 sequence as RootContext.LookupType.
17140 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
17141 the various cases of namespace lookups into this method.
17143 2002-03-01 Miguel de Icaza <miguel@ximian.com>
17145 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17146 in positional arguments)
17148 * class.cs (Operator): Update the AllowedModifiers to contain
17151 * cs-parser.jay: Update operator declaration to allow for the
17152 operator body to be empty.
17154 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
17157 2002-02-27 Miguel de Icaza <miguel@ximian.com>
17159 * class.cs (Method.Emit): Label parameters.
17161 * driver.cs: Return 1 or 0 as the program exit code.
17163 2002-02-26 Miguel de Icaza <miguel@ximian.com>
17165 * expression.cs: Special case the `null' object when trying to
17166 auto-compute the type, as anything can be explicitly converted to
17169 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
17170 spotting this Paolo.
17172 (Expression.ImplicitNumericConversion): Perform comparissions of
17173 the type using the underlying type in the case of an enumeration
17174 rather than using the enumeration type for the compare.
17176 Cope with the underlying == type case, which is not possible to
17179 (Expression.ConvertNumericExplicit): Perform comparissions of
17180 the type using the underlying type in the case of an enumeration
17181 rather than using the enumeration type for the compare.
17183 * driver.cs: If the user does not supply an extension, assume .exe
17185 * cs-parser.jay (if_statement): Rewrote so that we can track the
17186 location for the if statement.
17188 * expression.cs (Binary.ConstantFold): Only concat strings when
17189 the operation is "+", not everything ;-)
17191 * statement.cs (Statement.EmitBoolExpression): Take a location
17193 (If, While, Do): Track location.
17195 * expression.cs (Binary.ResolveOperator): In the object + string
17196 case, I was missing a call to ConvertImplicit
17198 2002-02-25 Ravi Pratap <ravi@ximian.com>
17200 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
17201 Location arguments. Ensure we use RootContext.LookupType to do our work
17202 and not try to do a direct Type.GetType and ModuleBuilder.GetType
17204 * interface.cs (PopulateMethod): Handle the type of the parameter being
17207 * expression.cs (Invocation.BetterFunction): Handle the case when we
17208 have a params method with no fixed arguments and a call is made with no
17211 2002-02-25 Miguel de Icaza <miguel@ximian.com>
17213 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
17214 the verbatim-string-literal
17216 * support.cs (InternalParameters.ParameterModifier): handle null
17218 (InternalParameters.ParameterType): ditto.
17220 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
17221 duplicating the name of the variable parameter.
17222 (GetParameterByName): Fix bug where we were not looking up array
17223 paramters if they were the only present (thanks Paolo!).
17224 (GetParameterInfo): We only have an empty set of types if both
17225 fixed and array are set to null.
17226 (GetParameterInfo-idx): Handle FixedParameter == null
17228 * cs-parser.jay: Handle the case where there is no catch
17229 statements (missing null test).
17231 2002-02-22 Miguel de Icaza <miguel@ximian.com>
17233 * driver.cs (MainDriver): Be conservative on our command line
17236 Catch DirectoryNotFoundException when calling GetFiles.
17238 (SplitPathAndPattern): Used to split the input specification into
17239 a path and a pattern that we can feed to Directory.GetFiles.
17241 2002-02-21 Miguel de Icaza <miguel@ximian.com>
17243 * statement.cs (Fixed): Implement the last case of the Fixed
17244 statement (string handling).
17246 * expression.cs (StringPtr): New class used to return a char * to
17247 a string; Used by the Fixed statement.
17249 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
17251 * expression.cs (Binary.ResolveOperator): Remove redundant
17252 MemberLookup pn parent type.
17253 Optimize union call, we do not need a union if the types are the same.
17254 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17257 Specialize the use of MemberLookup everywhere, instead of using
17258 the default settings.
17260 (StackAlloc): Implement stackalloc keyword.
17262 * cs-parser.jay: Add rule to parse stackalloc.
17264 * driver.cs: Handle /h, /help, /?
17266 * expression.cs (MakeByteBlob): Removed the hacks we had in place
17267 before we supported unsafe code.
17269 * makefile: add --unsafe to the self compilation of mcs.
17271 2002-02-20 Miguel de Icaza <miguel@ximian.com>
17273 * expression.cs (PointerArithmetic): New class that is used to
17274 perform pointer arithmetic.
17275 (Binary.Resolve): Handle pointer arithmetic
17276 Handle pointer comparission.
17277 (ArrayPtr): Utility expression class that is used to take the
17278 address of an array.
17280 (ElementAccess): Implement array access for pointers
17282 * statement.cs (Fixed): Implement fixed statement for arrays, we
17283 are missing one more case before we are done.
17285 * expression.cs (Indirection): Implement EmitAssign and set the
17286 ExprClass to Variable. This allows pointer dereferences to be
17287 treated as variables, and to have values assigned to them.
17289 * ecore.cs (Expression.StoreFromPtr): New utility function to
17290 store values dereferencing.
17292 2002-02-20 Ravi Pratap <ravi@ximian.com>
17294 * expression.cs (Binary.ResolveOperator): Ensure that we are
17295 not trying to operate on a void type - this fixes the reported
17298 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17299 the parent implementation is sealed.
17301 * ../errors/cs0239.cs : Add.
17303 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17305 * typemanager.cs (unverifiable_code_type): Corresponds to
17306 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17307 which have unsafe code in them.
17309 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
17312 2002-02-19 Miguel de Icaza <miguel@ximian.com>
17314 * cs-tokenizer.cs: Add support for @"litreal strings"
17316 Make tokenizer accept pre-processor directives
17317 on any column (remove the old C-like limitation).
17319 * rootcontext.cs (EmitCode): Emit any global attributes.
17320 (AddGlobalAttributes): Used to keep track of assembly attributes.
17322 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17324 * cs-parser.jay: Add support for global attributes.
17326 2002-02-17 Miguel de Icaza <miguel@ximian.com>
17328 * expression.cs (Indirection): New helper class. Unary will
17329 create Indirection classes to be able to implement the
17330 IMemoryLocation interface on it.
17332 2002-02-16 Miguel de Icaza <miguel@ximian.com>
17334 * cs-parser.jay (fixed_statement): reference the right statement.
17336 * statement.cs (Fixed.Emit): Finish implementing the fixed
17337 statement for the &x case.
17339 2002-02-14 Miguel de Icaza <miguel@ximian.com>
17341 * class.cs (Property.Define, Method.Define): Remove newslot when
17344 * modifiers.cs: My use of NewSlot when `Abstract' was set was
17345 wrong. NewSlot should only be used if the `new' keyword is present.
17347 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17348 locating our system dir. Sorry about this.
17350 2002-02-13 Miguel de Icaza <miguel@ximian.com>
17352 * driver.cs (GetSystemDir): Compute correctly the location of our
17353 system assemblies. I was using the compiler directory instead of
17354 the library directory.
17356 2002-02-13 Ravi Pratap <ravi@ximian.com>
17358 * expression.cs (BetterFunction): Put back in what Miguel commented out
17359 since it is the correct fix. The problem is elsewhere ;-)
17361 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17362 parameters of the parms method are themselves compatible or not !
17364 (StandardConversionExists): Fix very dangerous bug where we were forgetting
17365 to check that a class implements an interface before saying that an implicit
17366 conversion was allowed. Use ImplementsInterface to do the checking.
17368 2002-02-13 Miguel de Icaza <miguel@ximian.com>
17370 * class.cs (Method.Define): Track whether we are an explicit
17371 implementation or not. And only call DefineMethodOverride if we
17372 are an explicit implementation.
17374 (Property.DefineMethod): Ditto.
17376 2002-02-11 Ravi Pratap <ravi@ximian.com>
17378 * expression.cs (BetterFunction): Catch hideous bug which was
17379 preventing us from detecting ambiguous calls due to implicit casts i.e
17382 2002-01-29 Miguel de Icaza <miguel@ximian.com>
17384 * support.cs (Pair): Remove un-needed method. I figured why I was
17385 getting the error in cs-parser.jay, the variable in a foreach loop
17386 is readonly, and the compiler does not really treat this as a variable.
17388 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
17389 instead of EQUALS in grammar.
17391 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17393 * expression.cs (Unary.DoResolve): Check whether the argument is
17396 2002-01-28 Miguel de Icaza <miguel@ximian.com>
17398 * support.cs: Api for Pair to set a value. Despite the fact that
17399 the variables are public the MS C# compiler refuses to compile
17400 code that accesses the field if the variable is part of a foreach
17403 * statement.cs (Fixed): Begin implementation of the fixed
17406 (Block.AddVariable): Return the VariableInfo on success and null
17407 on failure instead of true/false.
17409 * cs-parser.jay (foreach): Catch errors on variables already
17410 defined (we were ignoring this value before) and properly unwind
17411 the block hierarchy
17413 (fixed_statement): grammar for the fixed statement.
17415 2002-01-25 Miguel de Icaza <miguel@ximian.com>
17417 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17418 pointer types to be incretemented.
17420 (SizeOf): Implement.
17422 * cs-parser.jay (pointer_member_access): Implement
17423 expr->IDENTIFIER production.
17425 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17426 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17429 (Unary): Implement indirection.
17431 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17432 use in non-unsafe context).
17434 (SimpleName.DoResolve): Check for pointers in field access on safe
17437 (Expression.LoadFromPtr): Factor the load-indirect code in this
17438 function. This was duplicated in UnboxCast and ParameterReference
17440 2002-01-24 Miguel de Icaza <miguel@ximian.com>
17442 * expression.cs (ComposedCast): report an error if a pointer cast
17443 is used in a safe region.
17445 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17446 pointer type casts in unsafe context.
17448 * codegen.cs (EmitContext): Set up IsUnsafe.
17450 * cs-parser.jay (non_expression_type): Add productions for pointer
17453 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17454 code. We should not use force into static mode if the method is
17455 not virtual. Fixes bug in MIS
17457 * statement.cs (Do.Emit, While.Emit, For.Emit,
17458 Statement.EmitBoolExpression): Add support to Do and While to
17459 propagate infinite loop as `I do return' semantics.
17461 Improve the For case to also test for boolean constants.
17463 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17464 to the list of attributes we can add.
17466 Remove `EmitContext' argument.
17468 * class.cs (Method.Define): Apply parameter attributes.
17469 (Constructor.Define): Apply parameter attributes.
17470 (MethodCore.LabelParameters): Move here the core of labeling
17473 * support.cs (ReflectionParameters.ParameterModifier,
17474 InternalParameters.ParameterModifier): Use IsByRef on the type and
17475 only return the OUT bit for these parameters instead of in/out/ref
17478 This is because I miss-understood things. The ParameterInfo.IsIn
17479 and IsOut represent whether the parameter has the [In] and [Out]
17482 2002-01-22 Miguel de Icaza <miguel@ximian.com>
17484 * ecore.cs (FieldExpr.Emit): Release temporaries.
17486 * assign.cs (LocalTemporary.Release): new function.
17488 * codegen.cs (EmitContext.GetTemporaryStorage,
17489 EmitContext.FreeTemporaryStorage): Rework the way we deal with
17490 temporary storage. Now we can "put back" localbuilders when we
17493 2002-01-21 Miguel de Icaza <miguel@ximian.com>
17495 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17496 need to make a copy of the variable to generate verifiable code.
17498 2002-01-19 Miguel de Icaza <miguel@ximian.com>
17500 * driver.cs: Compute dynamically the system directory.
17502 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17503 Slower, but more generally useful. Used by the abstract
17504 registering implementation.
17506 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17507 the rules for the special rule on Type/instances. First check if
17508 we have the same name, and if so, try that special static path
17509 rather than the instance path.
17511 2002-01-18 Miguel de Icaza <miguel@ximian.com>
17513 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17516 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17517 Enum, ValueType, Delegate or Array for non-corlib compiles.
17519 * cs-tokenizer.cs: Catch long identifiers (645)
17521 * typemanager.cs (IndexerPropetyName): Ravi never tested this
17524 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17525 fix, we were returning too early, so we were not registering
17526 pending methods from abstract classes.
17528 Do not register pending methods if the class is abstract.
17530 * expression.cs (Conditional.DoResolve): Report circular implicit
17531 conversions when we neecd to compute it for conditional
17534 (Is.DoResolve): If the expression is always of the provided type,
17535 flag warning 183. If the expression can not ever be of the
17536 provided type flag warning 184.
17538 * class.cs: Catch 169 as well.
17540 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17543 2002-01-18 Nick Drochak <ndrochak@gol.com>
17545 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
17547 2002-01-17 Miguel de Icaza <miguel@ximian.com>
17549 * interface.cs: (PopulateMethod): Check for pointers being defined
17550 only if the unsafe context is active.
17551 (PopulateProperty): ditto.
17552 (PopulateIndexer): ditto.
17554 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17555 specified. If pointers are present, make sure that they are
17556 present in an unsafe context.
17557 (Constructor, Constructor.Define): ditto.
17558 (Field, Field.Define): ditto.
17559 (Property, Property.Define): ditto.
17560 (Event, Event.Define): ditto.
17562 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17563 hashtable if there are classes or structs defined.
17565 * expression.cs (LocalVariableReference.DoResolve): Simplify this
17566 code, as the constant resolution moved.
17568 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17569 the metadata, so we can flag error 133.
17571 * decl.cs (MemberCore.UnsafeOK): New function to test that a
17572 pointer is being declared in an unsafe context.
17574 2002-01-16 Miguel de Icaza <miguel@ximian.com>
17576 * modifiers.cs (Modifiers.Check): Require a Location argument.
17577 Report error 227 for Unsafe use.
17579 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17581 * statement.cs (For.Emit): If the test is null, then report that
17582 we do `return', as we wont reach anything afterwards.
17584 (Switch.SwitchGoverningType): Track the expression that matched
17587 * driver.cs: Allow negative numbers as an error code to flag.
17589 * cs-parser.jay: Handle 1551.
17591 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17593 2002-01-15 Miguel de Icaza <miguel@ximian.com>
17595 * cs-parser.jay: Report 1518 (type declaration can only contain
17596 class, struct, interface, enum or delegate)
17598 (switch_label): Report 1523 (keywords `case' or `default' must
17601 (opt_switch_sections): Report 1522 (empty switch)
17603 * driver.cs: Report 1515 (response file specified multiple times)
17604 Report 1516 (Source file specified multiple times).
17606 * expression.cs (Argument.Resolve): Signal 1510
17608 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17609 access not allowed in static code)
17611 2002-01-11 Ravi Pratap <ravi@ximian.com>
17613 * typemanager.cs (IsPointerType): Utility method which we are going
17616 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17617 the object type, so we take care of that.
17619 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17621 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17622 added to non-params parameters :-)
17624 * typemanager.cs (CSharpName): Include 'void' type too.
17626 (void_ptr_type): Include in the set of core types.
17628 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
17631 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
17634 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
17635 completely forgotten about it.
17637 2002-01-10 Ravi Pratap <ravi@ximian.com>
17639 * cs-parser.jay (pointer_type): Add. This begins our implementation
17640 of parsing rules for unsafe code.
17642 (unsafe_statement): Implement.
17644 (embedded_statement): Modify to include the above.
17646 * statement.cs (Unsafe): Implement new class for unsafe blocks.
17648 * codegen.cs (EmitContext.InUnsafe): Add. This determines
17649 if the current context is an unsafe one.
17651 * cs-parser.jay (local_variable_pointer_type): Since local variable types
17652 are handled differently, we need separate rules for them.
17654 (local_variable_declaration): Update to use local_variable_pointer_type
17655 to allow variable declarations of unmanaged pointer types.
17657 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17658 in unsafe contexts.
17660 * ../errors/cs0214.cs : Add.
17662 2002-01-16 Nick Drochak <ndrochak@gol.com>
17664 * makefile: remove 'response' file when cleaning.
17666 2002-01-15 Miguel de Icaza <miguel@ximian.com>
17668 * cs-parser.jay: Report 1524.
17670 2002-01-14 Miguel de Icaza <miguel@ximian.com>
17672 * typemanager.cs (RegisterMethod): drop checking if we have
17673 registered this from here
17675 2002-01-12 Miguel de Icaza <miguel@ximian.com>
17677 * class.cs (Method.EmitDestructor): Implement calling our base
17680 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17681 value of InFinally.
17683 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17684 this routine and will wrap the call in a try/catch block. Deal
17687 2002-01-11 Miguel de Icaza <miguel@ximian.com>
17689 * ecore.cs (Expression.MemberLookup): instead of taking a
17690 parameter `same_type' that was used to tell whether we could
17691 access private members we compute our containing type from the
17694 (FieldExpr): Added partial support for volatile fields. This does
17695 not work for volatile fields exposed from assemblies, as I can not
17696 figure out how to extract the modreq from it.
17698 Updated all the source files to use this.
17700 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17701 because it is referenced by MemberLookup very often.
17703 2002-01-09 Ravi Pratap <ravi@ximian.com>
17705 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17706 TypeBuilder.GetCustomAttributes to retrieve what we need.
17708 Get rid of redundant default_member_attr_type as this is the same as
17709 default_member_type which already exists.
17711 * interface.cs, attribute.cs : Update accordingly.
17713 2002-01-08 Miguel de Icaza <miguel@ximian.com>
17715 * typemanager.cs: Enable IndexerPropertyName again. It does not
17716 work for TYpeBuilders though. Ravi, can you please fix this?
17718 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17720 * expression.cs (Argument.Emit): Handle the case of ref objects
17721 being passed to ref functions;
17723 (ParameterReference.EmitLoad): Loads the content of the pointer
17724 without dereferencing.
17726 2002-01-07 Miguel de Icaza <miguel@ximian.com>
17728 * cs-tokenizer.cs: Implemented the pre-processing expressions.
17730 2002-01-08 Ravi Pratap <ravi@ximian.com>
17732 * class.cs (Indexer.DefineMethod): Incorporate the interface
17733 type in the name of the method if we are doing explicit interface
17736 * expression.cs (ConversionExists): Remove as it is completely obsolete.
17738 (BetterConversion): Fix extremely trivial bug where we were referring to
17739 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17742 * ../errors/bug16.cs : Add although we have fixed it.
17744 2002-01-07 Miguel de Icaza <miguel@ximian.com>
17746 * expression.cs (BaseIndexer): Begin implementation.
17748 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17750 * cs-parser.jay (indexer_declarator): Use qualified_identifier
17751 production directly to remove a shift/reduce, and implement
17752 explicit interface implementation.
17754 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17755 after a floating point suffix.
17757 * expression.cs (DoNumericPromotions): Improved the conversion for
17758 uint/uint. If we have a constant, we avoid doing a typecast to a
17761 * class.cs (Indexer): Implement explicit interface implementation
17764 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17766 * class.cs: make the default instance constructor public and hidebysig.
17768 2001-01-03 Ravi Pratap <ravi@ximian.com>
17770 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17771 so we can call it from elsewhere.
17773 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17774 we emit it internally if the class has a defined indexer; otherwise the user
17775 emits it by decorating the class definition with the DefaultMemberAttribute.
17777 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17778 attribute is not used on a type which defines an indexer.
17780 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17781 character when we skip whitespace.
17783 * ../errors/cs0646.cs : Add.
17785 2002-01-03 Miguel de Icaza <miguel@ximian.com>
17787 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17790 * makefile: Add practical target `mcs3.exe' which builds the third
17791 generation compiler.
17793 * expression.cs (New): Fix structures constructor calling.
17795 * class.cs (Property, Method, Indexer): Emit Final flag on the
17796 method if we are an interface implementation and we are not
17799 * ecore.cs (PropertyExpr): New public field `IsBase', tells
17800 whether this property is referencing a `base' method.
17802 * expression.cs (Invocation.EmitCall): take an extra argument:
17803 is_base, this is used to determine whether the `call' or
17804 `callvirt' opcode should be used.
17807 * delegate.cs: update EmitCall.
17809 * class.cs (Method.Define): Set NewSlot for the cases where we are
17810 not implementing an interface method.
17812 (Property.Define): ditto.
17814 2002-01-02 Miguel de Icaza <miguel@ximian.com>
17816 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17817 'r'. Allows mcs to parse itself fully.
17819 2002-01-02 Ravi Pratap <ravi@ximian.com>
17821 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17822 of the number of initializers that require the InitializeArray method.
17824 (CheckIndices): Store the Expression in all cases - not the plain value. Also
17825 update the above field where necessary.
17827 (MakeByteBlob): Update accordingly.
17829 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
17832 (EmitDynamicInitializers): Update in accordance with the new optimization.
17834 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17835 same OpCode applies.
17837 * cs-parser.jay : Fix some glaring errors I introduced.
17839 2002-01-01 Ravi Pratap <ravi@ximian.com>
17841 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17842 so that we can check for name clashes there too.
17844 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17845 for interface indexers.
17847 * interfaces.cs (Define): Emit the default member attribute.
17849 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17850 variable was being referred to while setting the value ;-)
17852 2002-01-01 Miguel de Icaza <miguel@ximian.com>
17854 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17855 byte-by-byte information when we know the data is zero.
17857 Make the block always a multiple of 4, because
17858 DefineInitializedData has a bug.
17860 * assign.cs: Fix, we should assign from the temporary, not from
17863 * expression.cs (MakeByteBlob): Fix my incorrect code.
17865 2001-12-31 Miguel de Icaza <miguel@ximian.com>
17867 * typemanager.cs (EnumToUnderlying): This function is used to get
17868 the underlying type from an enumeration, because it does not
17871 * constant.cs: Use the I4_S form for values between -128 and 127.
17873 * statement.cs (Block.LookupLabel): Looks up a label.
17874 (Block): Drop support for labeled blocks.
17876 (LabeledStatement): New kind of statement that represents a label
17879 (Goto): Finally implement this bad boy.
17881 * cs-parser.jay: Update to reflect new mechanism to implement
17884 2001-12-30 Miguel de Icaza <miguel@ximian.com>
17886 * codegen.cs (EmitContext.This): a codegen property that keeps the
17887 a single instance of this instead of creating many different this
17890 * delegate.cs (Delegate.DoResolve): Update to use the property;
17892 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17894 * expression.cs (BaseAccess.DoResolve): Ditto.
17896 2001-12-29 Ravi Pratap <ravi@ximian.com>
17898 * typemanager.cs (methodimpl_attr_type): Add to hold the type
17899 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17901 (InitCoreTypes): Update accordingly.
17903 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17904 so we can quickly store the state.
17906 (ApplyAttributes): Set the correct implementation flags
17907 for InternalCall methods.
17909 2001-12-29 Miguel de Icaza <miguel@ximian.com>
17911 * expression.cs (EmitCall): if a method is not virtual, then do
17912 not use callvirt on it.
17914 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17915 user defined stuff) requires the use of stobj, which takes an
17916 address on the stack instead of an array and an index. So emit
17917 the Ldelema operation for it.
17919 (EmitStoreOpcode): Use stobj for valuetypes.
17921 (UnaryMutator.EmitCode): Use the right 1 value depending on
17922 whether we are dealing with int64/uint64, float or doubles.
17924 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17925 constructors that I implemented last night.
17927 (Constructor.IsDefault): Fix to work properly for static
17930 * cs-parser.jay (CheckDef): report method signature errors.
17931 Update error number 103 to be 132.
17933 * decl.cs: New AdditionResult enumeration value: MethodExists.
17934 Although we do this check for methods later on in the semantic
17935 analysis, catching repeated default constructors is so easy that
17936 we catch these here.
17938 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17941 (ParameterReference.EmitAssign, Emit): handle
17944 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17945 (ArrayAccess.EmitStoreOpcode): ditto.
17947 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17949 * expression.cs (MakeByteBlob): Complete all the missing types
17950 (uint, short, ushort, byte, sbyte)
17952 * class.cs: Only init instance field initializers on instance
17955 Rename `constructors' to instance_constructors.
17957 (TypeContainer.AddConstructor): Only add constructors to the list
17958 if it is not static.
17960 Make sure that we handle default_static_constructor independently
17961 everywhere where we handle instance_constructors
17963 2001-12-28 Miguel de Icaza <miguel@ximian.com>
17965 * class.cs: Do not lookup or create a base initializer for a
17966 static constructor.
17968 (ConstructorInitializer.Resolve): use the proper type to lookup
17971 * cs-parser.jay: Report error 1585 (modifiers between type and name).
17973 * enum.cs, interface.cs: Remove CloseType, this is taken care by
17976 * decl.cs: CloseType is now an virtual method, the default
17977 implementation just closes this type.
17979 2001-12-28 Ravi Pratap <ravi@ximian.com>
17981 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17982 to PreserveSig by default. Also emit HideBySig on such methods.
17984 Basically, set the defaults to standard values.
17986 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17987 argument, if candidate is better, it can't be worse than the best !
17989 (Invocation): Re-write bits to differentiate between methods being
17990 applicable in their expanded form and their normal form - for params
17993 Get rid of use_standard everywhere as only standard conversions are allowed
17994 in overload resolution.
17996 More spec conformance.
17998 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18000 * driver.cs: Add --timestamp, to see where the compiler spends
18003 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18004 `this' in static code.
18006 (SimpleName.DoResolve): Implement in terms of a helper function
18007 that allows static-references to be passed upstream to
18010 (Expression.ResolveWithSimpleName): Resolve specially simple
18011 names when called by MemberAccess to implement the special
18014 (Expression.ImplicitReferenceConversion): Handle conversions from
18015 Null to reference types before others, as Null's type is
18018 * expression.cs (Invocation.EmitCall): Handle the special case of
18019 calling methods declared on a reference type from a ValueType
18020 (Base classes System.Object and System.Enum)
18022 (MemberAccess.Resolve): Only perform lookups on Enumerations if
18023 the left hand side is a TypeExpr, not on every enumeration.
18025 (Binary.Resolve): If types are reference types, then do a cast to
18026 object on operators != and == of both arguments.
18028 * typemanager.cs (FindMembers): Extract instance and static
18029 members if requested.
18031 * interface.cs (PopulateProperty): Use void_type instead of null
18032 as the return type for the setter method.
18034 (PopulateIndexer): ditto.
18036 2001-12-27 Ravi Pratap <ravi@ximian.com>
18038 * support.cs (ReflectionParameters): Fix minor bug where we
18039 were examining the wrong parameter for the ParamArray attribute.
18041 Cope with requests for the type of the parameter at position
18042 greater than the params parameter's. We now return the element
18043 type of the params array as that makes more sense.
18045 * expression.cs (Invocation.IsParamsMethodApplicable): Update
18046 accordingly as we no longer have to extract the element type
18049 (Invocation.OverloadResolve): Update.
18051 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18053 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18054 against IEnumerator, test whether the return value is a descendant
18055 of the IEnumerator interface.
18057 * class.cs (Indexer.Define): Use an auxiliary method to implement
18058 the other bits of the method definition. Begin support for
18059 explicit interface implementation.
18061 (Property.DefineMethod): Use TypeManager.void_type instead of null
18062 for an empty return value.
18064 2001-12-26 Miguel de Icaza <miguel@ximian.com>
18066 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18067 dealing with a FieldExpr which is composed of a FieldBuilder, in
18068 the code path we did extract the constant, but we should have
18069 obtained the underlying value to be able to cast it (otherwise we
18070 end up in an infinite loop, this is what Ravi was running into).
18072 (ArrayCreation.UpdateIndices): Arrays might be empty.
18074 (MemberAccess.ResolveMemberAccess): Add support for section
18075 14.5.4.1 that deals with the special case of E.I when E is a type
18076 and something else, that I can be a reference to a static member.
18078 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18079 handle a particular array type to create byte blobs, it is just
18080 something we dont generate byteblobs for.
18082 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18085 * location.cs (Push): remove the key from the hashtable that we
18086 are about to add. This happens for empty files.
18088 * driver.cs: Dispose files after we have parsed them.
18090 (tokenize): new function that only runs the tokenizer on its
18091 input, for speed testing.
18093 2001-12-26 Ravi Pratap <ravi@ximian.com>
18095 * class.cs (Event.Define): Define the private field only if there
18096 are no accessors defined.
18098 * expression.cs (ResolveMemberAccess): If there is no associated
18099 field with the event, that means we have an event defined with its
18100 own accessors and we should flag error cs0070 since transforming
18101 ourselves into a field is not valid in that case.
18103 * ecore.cs (SimpleName.DoResolve): Same as above.
18105 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18106 and charset to sane values.
18108 2001-12-25 Ravi Pratap <ravi@ximian.com>
18110 * assign.cs (DoResolve): Perform check on events only if they
18111 are being accessed outside the declaring type.
18113 * cs-parser.jay (event_declarations): Update rules to correctly
18114 set the type of the implicit parameter etc.
18116 (add_accessor, remove_accessor): Set current local parameters.
18118 * expression.cs (Binary): For delegate addition and subtraction,
18119 cast the return value from the method into the appropriate delegate
18122 2001-12-24 Ravi Pratap <ravi@ximian.com>
18124 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18125 of these as the workaround is unnecessary.
18127 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18128 delegate data - none of that is needed at all.
18130 Re-write bits to extract the instance expression and the delegate method
18133 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
18136 * attribute.cs (ApplyAttributes): New method to take care of common tasks
18137 of attaching attributes instead of duplicating code everywhere.
18139 * everywhere : Update code to do attribute emission using the above method.
18141 2001-12-23 Miguel de Icaza <miguel@ximian.com>
18143 * expression.cs (IsParamsMethodApplicable): if there are not
18144 parameters, return immediately.
18146 * ecore.cs: The 0 literal can be implicity converted to an enum
18149 (SimpleName.DoResolve): First lookup the type, then lookup the
18152 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
18153 want to get its address. If the InstanceExpression is not
18154 addressable, store the result in a temporary variable, then get
18157 * codegen.cs: Only display 219 errors on warning level or above.
18159 * expression.cs (ArrayAccess): Make it implement the
18160 IMemoryLocation interface.
18162 (Binary.DoResolve): handle the operator == (object a, object b)
18163 and operator != (object a, object b) without incurring into a
18164 BoxedCast (because 5 != o should never be performed).
18166 Handle binary enumerator operators.
18168 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
18169 value type, otherwise use Ldelem_ref.
18171 Use precomputed names;
18173 (AddressOf): Implement address of
18175 * cs-parser.jay (labeled_statement): Fix recursive block
18176 addition by reworking the production.
18178 * expression.cs (New.DoEmit): New has a special case:
18180 If we are dealing with a ValueType, we have a few
18181 situations to deal with:
18183 * The target of New is a ValueType variable, that is
18184 easy, we just pass this as the variable reference
18186 * The target of New is being passed as an argument,
18187 to a boxing operation or a function that takes a
18190 In this case, we need to create a temporary variable
18191 that is the argument of New.
18194 2001-12-23 Ravi Pratap <ravi@ximian.com>
18196 * rootcontext.cs (LookupType): Check that current_type is not null before
18197 going about looking at nested types.
18199 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
18200 not implement the IAssignMethod interface any more.
18202 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
18203 where we tranform them into FieldExprs if they are being resolved from within
18204 the declaring type.
18206 * ecore.cs (SimpleName.DoResolve): Do the same here.
18208 * assign.cs (DoResolve, Emit): Clean up code considerably.
18210 * ../errors/bug10.cs : Add.
18212 * ../errors/cs0070.cs : Add.
18214 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
18216 * assign.cs : Get rid of EventIsLocal everywhere.
18218 2001-12-23 Miguel de Icaza <miguel@ximian.com>
18220 * ecore.cs (ConvertIntLiteral): finished the implementation.
18222 * statement.cs (SwitchLabel): Convert the value we are using as a
18223 key before looking up the table.
18225 2001-12-22 Miguel de Icaza <miguel@ximian.com>
18227 * codegen.cs (EmitTopBlock): Require a Location argument now.
18229 * cs-parser.jay (constructor_declarator): We need to setup
18230 current_local_parameters before we parse the
18231 opt_constructor_initializer, to allow the variables to be bound
18232 to the constructor arguments.
18234 * rootcontext.cs (LookupType): First lookup nested classes in our
18235 class and our parents before we go looking outside our class.
18237 * expression.cs (ConstantFold): Extract/debox the values at the
18240 * rootcontext.cs (EmitCode): Resolve the constants first before we
18241 resolve the types. This is not really needed, but it helps debugging.
18243 * statement.cs: report location.
18245 * cs-parser.jay: pass location to throw statement.
18247 * driver.cs: Small bug fix.
18249 * report.cs: Updated format to be 4-zero filled digits.
18251 2001-12-22 Ravi Pratap <ravi@ximian.com>
18253 * expression.cs (CheckIndices): Fix minor bug where the wrong
18254 variable was being referred to ;-)
18256 (DoEmit): Do not call EmitStaticInitializers when the
18257 underlying type is System.Object.
18259 2001-12-21 Ravi Pratap <ravi@ximian.com>
18261 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18262 and do the usual workaround for SRE.
18264 * class.cs (MyEventBuilder.EventType): New member to get at the type
18265 of the event, quickly.
18267 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18269 * assign.cs (Assign.DoResolve): Handle the case when the target
18270 is an EventExpr and perform the necessary checks.
18272 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18275 (SimpleName.MemberStaticCheck): Include check for EventExpr.
18277 (EventExpr): Set the type in the constructor itself since we
18278 are meant to be born fully resolved.
18280 (EventExpr.Define): Revert code I wrote earlier.
18282 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18283 instance expression is null. The instance expression is a This in that case
18284 or a null, depending on whether it is a static method or not.
18286 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18287 refers to more than one method.
18289 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18290 and accordingly flag errors.
18292 2001-12-21 Miguel de Icaza <miguel@ximian.com>
18294 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18296 2001-12-22 Miguel de Icaza <miguel@ximian.com>
18298 * location.cs (ToString): Provide useful rutine.
18300 2001-12-21 Miguel de Icaza <miguel@ximian.com>
18302 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18303 objects, return the actual integral boxed.
18305 * statement.cs (SwitchLabel): define an ILLabel for each
18308 (Switch.CheckSwitch): If the value is a Literal, extract
18309 the underlying literal.
18311 Also in the unused hashtable we had, add the SwitchLabel so we can
18312 quickly look this value up.
18314 * constant.cs: Implement a bunch of new constants. Rewrite
18315 Literal based on this. Made changes everywhere to adapt to this.
18317 * expression.cs (Expression.MakeByteBlob): Optimize routine by
18318 dereferencing array only once, and also copes with enumrations.
18320 bytes are two bytes wide, not one.
18322 (Cast): Perform constant conversions.
18324 * ecore.cs (TryImplicitIntConversion): Return literals instead of
18325 wrappers to the literals here.
18327 * expression.cs (DoNumericPromotions): long literals can converted
18328 to ulong implicity (this is taken care of elsewhere, but I was
18329 missing this spot).
18331 * ecore.cs (Expression.Literalize): Make the return type Literal,
18332 to improve type checking.
18334 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18336 2001-12-20 Miguel de Icaza <miguel@ximian.com>
18338 * literal.cs: Revert code from ravi that checked the bounds. The
18339 bounds are sane by the definition of the type itself.
18341 * typemanager.cs: Fix implementation of ImplementsInterface. We
18342 need to actually look up in our parent hierarchy for interfaces
18345 * const.cs: Use the underlying type for enumerations
18347 * delegate.cs: Compute the basename for the delegate creation,
18348 that should fix the delegate test case, and restore the correct
18349 Type Lookup semantics in rootcontext
18351 * rootcontext.cs: Revert Ravi's last patch. The correct way of
18352 referencing a nested type with the Reflection API is using the "+"
18355 * cs-parser.jay: Do not require EOF token at the end.
18357 2001-12-20 Ravi Pratap <ravi@ximian.com>
18359 * rootcontext.cs (LookupType): Concatenate type names with
18360 a '.' instead of a '+' The test suite passes again.
18362 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18363 field of the enumeration.
18365 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18366 the case when the member is an EventExpr.
18368 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18369 static has an associated instance expression.
18371 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18373 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18375 * class.cs (Event.Define): Register event and perform appropriate checks
18378 We define the Add and Remove methods even if the use provides none because
18379 in that case, we provide default implementations ourselves.
18381 Define a private field of the type of the event. This is done by the CSC compiler
18382 and we should be doing it too ;-)
18384 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18385 More methods we use in code we generate.
18387 (multicast_delegate_type, delegate_type): Two separate types since the distinction
18390 (InitCoreTypes): Update accordingly for the above.
18392 * class.cs (Event.Emit): Generate code for default accessors that we provide
18394 (EmitDefaultMethod): Do the job in the above.
18396 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
18399 2001-12-20 Miguel de Icaza <miguel@ximian.com>
18401 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18402 builders even if we were missing one.
18404 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18405 pass the Basename as our class name instead of the Name. The
18406 basename will be correctly composed for us.
18408 * parameter.cs (Paramters): Now takes a Location argument.
18410 * decl.cs (DeclSpace.LookupType): Removed convenience function and
18411 make all the code call directly LookupType in RootContext and take
18412 this chance to pass the Location information everywhere.
18414 * Everywhere: pass Location information.
18416 2001-12-19 Miguel de Icaza <miguel@ximian.com>
18418 * class.cs (Constructor.Define): Updated way of detecting the
18419 length of the parameters.
18421 (TypeContainer.DefineType): Use basename as the type name for
18424 (TypeContainer.Define): Do not recursively define types here, as
18425 definition is taken care in order by the RootContext.
18427 * tree.cs: Keep track of namespaces in a per-file basis.
18429 * parameter.cs (Parameter.ComputeSignature): Update to use
18432 (Parameters.GetSignature): ditto.
18434 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18435 instead of a TypeContainer.
18437 (Interface.SemanticAnalysis): Use `this' instead of our parent to
18438 resolve names. Because we need to be resolve in our context, not
18441 * driver.cs: Implement response files.
18443 * class.cs (TypeContainer.DefineType): If we are defined, do not
18444 redefine ourselves.
18446 (Event.Emit): Emit the code for add/remove handlers.
18447 (Event.Define): Save the MethodBuilders for add/remove.
18449 * typemanager.cs: Use pair here too.
18451 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18452 DictionaryEntry requires the first argument to be non-null.
18454 (enum_declaration): Compute full name for registering the
18457 (delegate_declaration): Instead of using
18458 formal_parameter_list, use opt_formal_parameter_list as the list
18461 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18462 (EventParsing): New property that controls whether `add' and
18463 `remove' are returned as tokens or identifiers (for events);
18465 2001-12-19 Ravi Pratap <ravi@ximian.com>
18467 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18468 use MyEventBuilder only and let it wrap the real builder for us.
18470 (MyEventBuilder): Revamp constructor etc.
18472 Implement all operations that we perform on EventBuilder in precisely the same
18475 (FindMembers): Update to use the EventBuilder member.
18477 (Event.Emit): Update accordingly.
18479 2001-12-18 Ravi Pratap <ravi@ximian.com>
18481 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18482 by calling the appropriate methods.
18484 (GetCustomAttributes): Make stubs as they cannot possibly do anything
18487 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18489 2001-12-17 Ravi Pratap <ravi@ximian.com>
18491 * delegate.cs (Delegate.Populate): Check that the return type
18492 and various parameters types are indeed accessible.
18494 * class.cs (Constructor.Define): Same here.
18496 (Field.Define): Ditto.
18498 (Event.Define): Ditto.
18500 (Operator.Define): Check that the underlying Method defined itself
18501 correctly - so it's MethodBuilder should not be null.
18503 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18504 expression happens to be null.
18506 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18507 members but as of now we don't seem to be able to do anything really useful with it.
18509 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18510 not the EventBuilder.
18512 2001-12-18 Miguel de Icaza <miguel@ximian.com>
18514 * cs-tokenizer.cs: Add support for defines.
18515 Add support for #if, #elif, #else, #endif
18517 (eval_var): evaluates a variable.
18518 (eval): stubbed for evaluating functions.
18520 * cs-parser.jay: Pass the defines information
18522 * driver.cs: Add --define command line option.
18524 * decl.cs: Move MemberCore here.
18526 Make it the base class for DeclSpace. This allows us to catch and
18527 report 108 and 109 for everything now.
18529 * class.cs (TypeContainer.Define): Extract all the members
18530 before populating and emit the warning 108 (new keyword required
18531 to override) instead of having each member implement this.
18533 (MemberCore.Define): New abstract method, we will be using this in
18534 the warning reporting engine in Populate.
18536 (Operator.Define): Adjust to new MemberCore protocol.
18538 * const.cs (Const): This does not derive from Expression, it is a
18539 temporary object we use to create fields, it is a MemberCore.
18541 * class.cs (Method.Define): Allow the entry point to be in a
18544 * driver.cs: Rewrite the argument handler to clean it up a bit.
18546 * rootcontext.cs: Made it just an auxiliary namespace feature by
18547 making everything static.
18549 * driver.cs: Adapt code to use RootContext type name instead of
18552 * delegate.cs: Remove RootContext argument.
18554 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18557 * class.cs (Event.Define): The lookup can fail.
18559 * cs-tokenizer.cs: Begin implementation of pre-procesor.
18561 * expression.cs: Resolve the this instance before invoking the code.
18563 2001-12-17 Miguel de Icaza <miguel@ximian.com>
18565 * cs-parser.jay: Add a production in element_access that allows
18566 the thing to become a "type" reference. This way we can parse
18567 things like "(string [])" as a type.
18569 Note that this still does not handle the more complex rules of
18573 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
18575 * ecore.cs: (CopyNewMethods): new utility function used to
18576 assemble the list of methods from running FindMembers.
18578 (MemberLookup): Rework FindMembers so that
18580 2001-12-16 Miguel de Icaza <miguel@ximian.com>
18582 * class.cs (TypeContainer): Remove Delegates who fail to be
18585 * delegate.cs (Populate): Verify that we dont get null return
18586 values. TODO: Check for AsAccessible.
18588 * cs-parser.jay: Use basename to emit error 574 (destructor should
18589 have the same name as container class), not the full name.
18591 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18592 possible representation.
18594 Also implements integer type suffixes U and L.
18596 2001-12-15 Miguel de Icaza <miguel@ximian.com>
18598 * expression.cs (ArrayCreation.DoResolve): We need to do the
18599 argument resolution *always*.
18601 * decl.cs: Make this hold the namespace. Hold the root context as
18603 (LookupType): Move here.
18605 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18607 * location.cs (Row, Name): Fixed the code, it was always returning
18608 references to the first file.
18610 * interface.cs: Register properties defined through interfaces.
18612 * driver.cs: Add support for globbing on the command line
18614 * class.cs (Field): Make it derive from MemberCore as well.
18617 2001-12-15 Ravi Pratap <ravi@ximian.com>
18619 * class.cs (Event::Define): Check that the type of the event is a delegate
18620 type else flag error #66.
18622 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18625 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18626 values of EntryPoint, CharSet etc etc.
18628 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18630 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18631 be null and we should ignore this. I am not sure if this is really clean. Apparently,
18632 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18633 which needs this to do its work.
18635 * ../errors/cs0066.cs : Add.
18637 2001-12-14 Miguel de Icaza <miguel@ximian.com>
18639 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18642 * class.cs: (MethodSignature.MethodSignature): Removed hack that
18643 clears out the parameters field.
18644 (MemberSignatureCompare): Cleanup
18646 (MemberCore): New base class used to share code between MethodCore
18649 (RegisterRequiredImplementations) BindingFlags.Public requires
18650 either BindingFlags.Instace or Static. Use instance here.
18652 (Property): Refactored code to cope better with the full spec.
18654 * parameter.cs (GetParameterInfo): Return an empty array instead
18657 * class.cs (Property): Abstract or extern properties have no bodies.
18659 * parameter.cs (GetParameterInfo): return a zero-sized array.
18661 * class.cs (TypeContainer.MethodModifiersValid): Move all the
18662 method modifier validation to the typecontainer so we can reuse
18663 this on properties.
18665 (MethodCore.ParameterTypes): return an empty sized array of types.
18667 (Property.Define): Test property modifier validity.
18669 Add tests for sealed/override too.
18671 (Method.Emit): abstract or extern methods have no bodies.
18673 2001-12-14 Ravi Pratap <ravi@ximian.com>
18675 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18678 (Method::Define, ::Emit): Modify accordingly.
18680 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18682 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18684 * makefile: Pass in /unsafe.
18686 2001-12-13 Miguel de Icaza <miguel@ximian.com>
18688 * class.cs (MakeKey): Kill routine.
18690 * class.cs (TypeContainer.Define): Correctly define explicit
18691 method implementations (they require the full interface name plus
18694 * typemanager.cs: Deply the PtrHashtable here and stop using the
18695 lame keys. Things work so much better.
18697 This of course broke everyone who depended on `RegisterMethod' to
18698 do the `test for existance' test. This has to be done elsewhere.
18700 * support.cs (PtrHashtable): A hashtable that avoid comparing with
18701 the object stupid Equals method (because, that like fails all over
18702 the place). We still do not use it.
18704 * class.cs (TypeContainer.SetRequiredInterface,
18705 TypeContainer.RequireMethods): Killed these two routines and moved
18706 all the functionality to RegisterRequiredImplementations.
18708 (TypeContainer.RegisterRequiredImplementations): This routine now
18709 registers all the implementations required in an array for the
18710 interfaces and abstract methods. We use an array of structures
18711 which can be computed ahead of time to reduce memory usage and we
18712 also assume that lookups are cheap as most classes will not
18713 implement too many interfaces.
18715 We also avoid creating too many MethodSignatures.
18717 (TypeContainer.IsInterfaceMethod): Update and optionally does not
18718 clear the "pending" bit if we find that there are problems with
18721 (TypeContainer.VerifyPendingMethods): Update to report errors of
18722 methods that look like implementations but are not.
18724 (TypeContainer.Define): Add support for explicit interface method
18727 2001-12-12 Miguel de Icaza <miguel@ximian.com>
18729 * typemanager.cs: Keep track of the parameters here instead of
18730 being a feature of the TypeContainer.
18732 * class.cs: Drop the registration of parameters here, as
18733 InterfaceMethods are also interface declarations.
18735 * delegate.cs: Register methods with the TypeManager not only with
18736 the TypeContainer. This code was buggy.
18738 * interface.cs: Full registation here.
18740 2001-12-11 Miguel de Icaza <miguel@ximian.com>
18742 * expression.cs: Remove reducer for binary expressions, it can not
18745 * const.cs: Put here the code that used to go into constant.cs
18747 * constant.cs: Put here the code for constants, this is a new base
18748 class for Literals.
18750 * literal.cs: Make Literal derive from Constant.
18752 2001-12-09 Miguel de Icaza <miguel@ximian.com>
18754 * statement.cs (Return.Emit): Report error 157 if the user
18755 attempts to return from a finally block.
18757 (Return.Emit): Instead of emitting a return, jump to the end of
18760 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18761 LocalBuilder to store the result of the function. ReturnLabel is
18762 the target where we jump.
18765 2001-12-09 Radek Doulik <rodo@ximian.com>
18767 * cs-parser.jay: remember alias in current namespace
18769 * ecore.cs (SimpleName::DoResolve): use aliases for types or
18772 * class.cs (LookupAlias): lookup alias in my_namespace
18774 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18776 (LookupAlias): lookup alias in this and if needed in parent
18779 2001-12-08 Miguel de Icaza <miguel@ximian.com>
18783 * rootcontext.cs: (ModuleBuilder) Made static, first step into
18784 making things static. I need this to avoid passing the
18785 TypeContainer when calling ParameterType.
18787 * support.cs (InternalParameters.ParameterType): Remove ugly hack
18788 that did string manipulation to compute the type and then call
18789 GetType. Use Parameter.ParameterType instead.
18791 * cs-tokenizer.cs: Consume the suffix for floating values.
18793 * expression.cs (ParameterReference): figure out whether this is a
18794 reference parameter or not. Kill an extra variable by computing
18795 the arg_idx during emission.
18797 * parameter.cs (Parameters.GetParameterInfo): New overloaded
18798 function that returns whether a parameter is an out/ref value or not.
18800 (Parameter.ParameterType): The type of the parameter (base,
18801 without ref/out applied).
18803 (Parameter.Resolve): Perform resolution here.
18804 (Parameter.ExternalType): The full type (with ref/out applied).
18806 * statement.cs (Using.Emit, Using.EmitExpression): Implement
18807 support for expressions on the using statement.
18809 2001-12-07 Miguel de Icaza <miguel@ximian.com>
18811 * statement.cs (Using.EmitLocalVariableDecls): Split the
18812 localvariable handling of the using statement.
18814 (Block.EmitMeta): Keep track of variable count across blocks. We
18815 were reusing slots on separate branches of blocks.
18817 (Try.Emit): Emit the general code block, we were not emitting it.
18819 Check the type of the declaration to be an IDisposable or
18820 something that can be implicity converted to it.
18822 Emit conversions if required.
18824 * ecore.cs (EmptyExpression): New utility class.
18825 (Expression.ImplicitConversionExists): New utility function.
18827 2001-12-06 Miguel de Icaza <miguel@ximian.com>
18829 * statement.cs (Using): Implement.
18831 * expression.cs (LocalVariableReference): Support read only variables.
18833 * statement.cs: Remove the explicit emit for the Leave opcode.
18834 (VariableInfo): Add a readonly field.
18836 2001-12-05 Miguel de Icaza <miguel@ximian.com>
18838 * ecore.cs (ConvCast): new class used to encapsulate the various
18839 explicit integer conversions that works in both checked and
18840 unchecked contexts.
18842 (Expression.ConvertNumericExplicit): Use new ConvCast class to
18843 properly generate the overflow opcodes.
18845 2001-12-04 Miguel de Icaza <miguel@ximian.com>
18847 * statement.cs: The correct type for the EmptyExpression is the
18848 element_type, not the variable type. Ravi pointed this out.
18850 2001-12-04 Ravi Pratap <ravi@ximian.com>
18852 * class.cs (Method::Define): Handle PInvoke methods specially
18853 by using DefinePInvokeMethod instead of the usual one.
18855 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18856 above to do the task of extracting information and defining the method.
18858 2001-12-04 Ravi Pratap <ravi@ximian.com>
18860 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18861 of the condition for string type.
18863 (Emit): Move that here.
18865 (ArrayCreation::CheckIndices): Keep string literals in their expression
18868 (EmitDynamicInitializers): Handle strings appropriately.
18870 2001-12-04 Miguel de Icaza <miguel@ximian.com>
18872 * codegen.cs (EmitContext): Replace multiple variables with a
18873 single pointer to the current Switch statement.
18875 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18878 2001-12-03 Miguel de Icaza <miguel@ximian.com>
18882 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18885 (Foreach.Emit): Foreach on arrays was not setting
18886 up the loop variables (for break/continue).
18888 (GotoCase): Semi-implented.
18890 2001-12-03 Ravi Pratap <ravi@ximian.com>
18892 * attribute.cs (CheckAttribute): Handle system attributes by using
18893 Attribute.GetAttributes to examine information we need.
18895 (GetValidPlaces): Same here.
18897 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18899 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18901 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18903 (Method::Define): Set appropriate flags if we have a DllImport attribute.
18905 (Method::Emit): Handle the case when we are a PInvoke method.
18907 2001-12-03 Miguel de Icaza <miguel@ximian.com>
18909 * expression.cs: Use ResolveWithSimpleName on compound names.
18911 2001-12-02 Ravi Pratap <ravi@ximian.com>
18913 * constant.cs (EmitConstant): Make sure we resolve the associated expression
18914 before trying to reduce it.
18916 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18918 * constant.cs (LookupConstantValue): Implement.
18920 (EmitConstant): Use the above in emitting the constant.
18922 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18923 that are user-defined by doing a LookupConstantValue on them.
18925 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18928 2001-11-29 Miguel de Icaza <miguel@ximian.com>
18930 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18932 (BaseAccess.DoResolve): Implement.
18934 (MemberAccess.DoResolve): Split this routine into a
18935 ResolveMemberAccess routine that can be used independently
18937 2001-11-28 Miguel de Icaza <miguel@ximian.com>
18939 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18940 As that share bits of the implementation. Is returns a boolean,
18941 while As returns the Type that is being probed.
18943 2001-12-01 Ravi Pratap <ravi@ximian.com>
18945 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18946 instead of a Literal - much easier.
18948 (EnumInTransit): Remove - utterly useless :-)
18950 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18952 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18954 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18955 chain when we have no associated expression.
18957 2001-11-30 Ravi Pratap <ravi@ximian.com>
18959 * constant.cs (Define): Use Location while reporting the errror.
18961 Also emit a warning when 'new' is used and there is no inherited
18964 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
18967 (LookupEnumValue): Implement to lookup an enum member's value and define it
18970 (Populate): Re-write accordingly to use the above routine.
18972 2001-11-27 Miguel de Icaza <miguel@ximian.com>
18974 * expression.cs (This): Fix prototype for DoResolveLValue to
18975 override the base class DoResolveLValue.
18977 * cs-parser.cs: Report errors cs574 and cs575 (destructor
18980 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18981 (we need to load the address of the field here). This fixes
18984 (FieldExpr.DoResolveLValue): Call the DoResolve
18985 function to initialize the Instance expression.
18987 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18988 correctly the GetEnumerator operation on a value type.
18990 * cs-parser.jay: Add more simple parsing error catches.
18992 * statement.cs (Switch): Add support for string switches.
18993 Handle null specially.
18995 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
18997 2001-11-28 Ravi Pratap <ravi@ximian.com>
18999 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19001 (declare_local_constant): New helper function.
19003 * statement.cs (AddConstant): Keep a separate record of constants
19005 (IsConstant): Implement to determine if a variable is a constant.
19007 (GetConstantExpression): Implement.
19009 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19011 * statement.cs (IsVariableDefined): Re-write.
19013 2001-11-27 Ravi Pratap <ravi@ximian.com>
19015 * class.cs (TypeContainer::FindMembers): Look for constants
19016 in the case when we are looking for MemberTypes.Field
19018 * expression.cs (MemberAccess::DoResolve): Check that in the
19019 case we are a FieldExpr and a Literal, we are not being accessed
19020 by an instance reference.
19022 * cs-parser.jay (local_constant_declaration): Implement.
19024 (declaration_statement): Implement for constant declarations.
19026 2001-11-26 Miguel de Icaza <miguel@ximian.com>
19028 * statement.cs (Switch): Catch double defaults.
19030 (Switch): More work on the switch() statement
19031 implementation. It works for integral values now, need to finish
19035 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19037 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19038 integer literals into other integer literals. To be used by
19041 2001-11-24 Ravi Pratap <ravi@ximian.com>
19043 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19046 (EmitDynamicInitializers): Cope with the above since we extract data
19047 directly from ArrayData now.
19049 (ExpectInitializers): Keep track of whether initializers are mandatory
19052 (Bounds): Make it a hashtable to prevent the same dimension being
19053 recorded for every element in that dimension.
19055 (EmitDynamicInitializers): Fix bug which prevented the Set array method
19058 Also fix bug which was causing the indices to be emitted in the reverse
19061 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19063 * expression.cs (ArrayCreation): Implement the bits that Ravi left
19064 unfinished. They do not work, because the underlying code is
19067 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19069 * cs-parser.jay: Remove bogus fixme.
19071 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19072 on Switch statement.
19074 2001-11-23 Ravi Pratap <ravi@ximian.com>
19076 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19079 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19080 parameter. Apparently, any expression is allowed.
19082 (ValidateInitializers): Update accordingly.
19084 (CheckIndices): Fix some tricky bugs thanks to recursion.
19086 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
19087 I was being completely brain-dead.
19089 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19090 and re-write acordingly.
19092 (DelegateInvocation): Re-write accordingly.
19094 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19096 (MakeByteBlob): Handle types more correctly.
19098 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19099 initialization from expressions but it is incomplete because I am a complete
19102 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19104 * statement.cs (If.Emit): Fix a bug that generated incorrect code
19105 on If. Basically, we have to return `true' (ie, we do return to
19106 our caller) only if both branches of the if return.
19108 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19109 short-circuit operators, handle them as short circuit operators.
19111 (Cast.DoResolve): Resolve type.
19112 (Cast.Cast): Take an expression as the target type.
19114 * cs-parser.jay (cast_expression): Remove old hack that only
19115 allowed a limited set of types to be handled. Now we take a
19116 unary_expression and we resolve to a type during semantic
19119 Use the grammar productions from Rhys to handle casts (this is
19120 not complete like Rhys syntax yet, we fail to handle that corner
19121 case that C# has regarding (-x), but we will get there.
19123 2001-11-22 Ravi Pratap <ravi@ximian.com>
19125 * class.cs (EmitFieldInitializer): Take care of the case when we have a
19126 field which is an array type.
19128 * cs-parser.jay (declare_local_variables): Support array initialization too.
19130 * typemanager.cs (MakeKey): Implement.
19132 (everywhere): Use the above appropriately.
19134 * cs-parser.jay (for_statement): Update for array initialization while
19135 declaring variables.
19137 * ecore.cs : The error message was correct, it's the variable's names that
19138 were misleading ;-) Make the code more readable.
19140 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19141 the correct type etc.
19143 (ConvertExplicit): Handle Enum types by examining the underlying type.
19145 2001-11-21 Ravi Pratap <ravi@ximian.com>
19147 * parameter.cs (GetCallingConvention): Always return
19148 CallingConventions.Standard for now.
19150 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19152 * expression.cs (Binary.ResolveOperator): Update the values of `l'
19153 and `r' after calling DoNumericPromotions.
19155 * ecore.cs: Fix error message (the types were in the wrong order).
19157 * statement.cs (Foreach.ProbeCollectionType): Need to pass
19158 BindingFlags.Instance as well
19160 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
19161 implicit int literal conversion in an empty cast so that we
19162 propagate the right type upstream.
19164 (UnboxCast): new class used to unbox value types.
19165 (Expression.ConvertExplicit): Add explicit type conversions done
19168 (Expression.ImplicitNumericConversion): Oops, forgot to test for
19169 the target type before applying the implicit LongLiterals to ULong
19172 2001-11-21 Miguel de Icaza <miguel@ximian.com>
19174 * cs-parser.jay (for_statement): Reworked the way For works: now
19175 we declare manually any variables that are introduced in
19176 for_initializer to solve the problem of having out-of-band code
19177 emition (that is what got for broken).
19179 (declaration_statement): Perform the actual variable declaration
19180 that used to be done in local_variable_declaration here.
19182 (local_variable_declaration): Do not declare anything, just pass
19183 the information on a DictionaryEntry
19185 2001-11-20 Ravi Pratap <ravi@ximian.com>
19187 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
19188 re-write of the logic to now make it recursive.
19190 (UpdateIndices): Re-write accordingly.
19192 Store element data in a separate ArrayData list in the above methods.
19194 (MakeByteBlob): Implement to dump the array data into a byte array.
19196 2001-11-19 Ravi Pratap <ravi@ximian.com>
19198 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
19201 * constant.cs (Define): Implement.
19203 (EmitConstant): Re-write fully.
19205 Pass in location info.
19207 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
19210 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
19211 DictionaryEntry since we need location info too.
19213 (constant_declaration): Update accordingly.
19215 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
19216 code into another method : UpdateIndices.
19218 2001-11-18 Ravi Pratap <ravi@ximian.com>
19220 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
19221 some type checking etc.
19223 2001-11-17 Ravi Pratap <ravi@ximian.com>
19225 * expression.cs (ArrayCreation::ValidateInitializers): Implement
19226 bits to provide dimension info if the user skips doing that.
19228 Update second constructor to store the rank correctly.
19230 2001-11-16 Ravi Pratap <ravi@ximian.com>
19232 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
19233 and try to implement.
19235 * ../errors/cs0150.cs : Add.
19237 * ../errors/cs0178.cs : Add.
19239 2001-11-16 Miguel de Icaza <miguel@ximian.com>
19241 * statement.cs: Implement foreach on multi-dimensional arrays.
19243 * parameter.cs (Parameters.GetParameterByName): Also lookup the
19244 name of the params argument.
19246 * expression.cs: Use EmitStoreOpcode to get the right opcode while
19247 initializing the array.
19249 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19250 we can use this elsewhere.
19252 * statement.cs: Finish implementation of foreach for single
19255 * cs-parser.jay: Use an out-of-band stack to pass information
19256 around, I wonder why I need this.
19258 foreach_block: Make the new foreach_block the current_block.
19260 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19261 function used to return a static Parameters structure. Used for
19262 empty parameters, as those are created very frequently.
19264 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19266 2001-11-15 Ravi Pratap <ravi@ximian.com>
19268 * interface.cs : Default modifier is private, not public. The
19269 make verify test passes again.
19271 2001-11-15 Ravi Pratap <ravi@ximian.com>
19273 * support.cs (ReflectionParameters): Fix logic to determine
19274 whether the last parameter is a params one. Test 9 passes again.
19276 * delegate.cs (Populate): Register the builders we define with
19277 RegisterParameterForBuilder. Test 19 passes again.
19279 * cs-parser.jay (property_declaration): Reference $6 instead
19280 of $$ to get at the location.
19282 (indexer_declaration): Similar stuff.
19284 (attribute): Ditto.
19286 * class.cs (Property): Register parameters for the Get and Set methods
19287 if they exist. Test 23 passes again.
19289 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19290 call to EmitArguments as we are sure there aren't any params arguments.
19291 Test 32 passes again.
19293 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19294 IndexOutOfRangeException.
19296 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19297 Test 33 now passes again.
19299 2001-11-15 Miguel de Icaza <miguel@ximian.com>
19301 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19302 broke a bunch of things. Will have to come up with a better way
19303 of tracking locations.
19305 * statement.cs: Implemented foreach for single dimension arrays.
19307 2001-11-09 Miguel de Icaza <miguel@ximian.com>
19309 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19310 an error. This removes the lookup from the critical path.
19312 * cs-parser.jay: Removed use of temporary_loc, which is completely
19315 2001-11-14 Miguel de Icaza <miguel@ximian.com>
19317 * support.cs (ReflectionParameters.ParameterModifier): Report
19318 whether the argument is a PARAMS argument or not.
19320 * class.cs: Set the attribute `ParamArrayAttribute' on the
19321 parameter argument.
19323 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19324 and cons_param_array_attribute (ConstructorInfo for
19325 ParamArrayAttribute).,
19327 * codegen.cs: Emit the return using the `Return' statement, that
19328 way we can report the error correctly for missing return values.
19330 * class.cs (Method.Emit): Clean up.
19332 * expression.cs (Argument.Resolve): Take another argument: the
19333 location where this argument is used. Notice that this is not
19334 part of the "Argument" class as to reduce the size of the
19335 structure (we know the approximate location anyways).
19337 Test if the argument is a variable-reference, if not, then
19338 complain with a 206.
19340 (Argument.Emit): Emit addresses of variables.
19342 (Argument.FullDesc): Simplify.
19344 (Invocation.DoResolve): Update for Argument.Resolve.
19346 (ElementAccess.DoResolve): ditto.
19348 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19349 method should be virtual, as this method is always virtual.
19351 (NewDelegate.DoResolve): Update for Argument.Resolve.
19353 * class.cs (ConstructorInitializer.DoResolve): ditto.
19355 * attribute.cs (Attribute.Resolve): ditto.
19357 2001-11-13 Miguel de Icaza <miguel@ximian.com>
19359 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19361 * expression.cs (ParameterReference): Drop IStackStorage and implement
19362 IAssignMethod instead.
19364 (LocalVariableReference): ditto.
19366 * ecore.cs (FieldExpr): Drop IStackStorage and implement
19367 IAssignMethod instead.
19369 2001-11-13 Miguel de Icaza <miguel@ximian.com>
19371 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19372 enumerations that are used in heavily used structures derive from
19373 byte in a laughable and pathetic attempt to reduce memory usage.
19374 This is the kind of pre-optimzations that you should not do at
19375 home without adult supervision.
19377 * expression.cs (UnaryMutator): New class, used to handle ++ and
19378 -- separatedly from the other unary operators. Cleans up the
19379 code, and kills the ExpressionStatement dependency in Unary.
19381 (Unary): Removed `method' and `Arguments' from this class, making
19382 it smaller, and moving it all to SimpleCall, so I can reuse this
19383 code in other locations and avoid creating a lot of transient data
19384 strucutres when not required.
19386 * cs-parser.jay: Adjust for new changes.
19388 2001-11-11 Miguel de Icaza <miguel@ximian.com>
19390 * enum.cs (Enum.Populate): If there is a failure during
19393 * cs-parser.jay (opt_enum_base): we used to catch type errors
19394 here, but this is really incorrect. The type error should be
19395 catched during semantic analysis.
19397 2001-12-11 Ravi Pratap <ravi@ximian.com>
19399 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19400 current_local_parameters as expected since I, in my stupidity, had forgotten
19403 * attribute.cs (GetValidPlaces): Fix stupid bug.
19405 * class.cs (Method::Emit): Perform check on applicability of attributes.
19407 (Constructor::Emit): Ditto.
19409 (Field::Emit): Ditto.
19411 (Field.Location): Store location information.
19413 (Property, Event, Indexer, Operator): Ditto.
19415 * cs-parser.jay (field_declaration): Pass in location for each field.
19417 * ../errors/cs0592.cs : Add.
19419 2001-11-12 Ravi Pratap <ravi@ximian.com>
19421 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19423 (InitCoreTypes): Update accordingly.
19425 (RegisterAttrType, LookupAttr): Implement.
19427 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19428 info about the same.
19430 (Resolve): Update to populate the above as necessary.
19432 (Error592): Helper.
19434 (GetValidPlaces): Helper to the above.
19436 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19438 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19440 2001-11-12 Ravi Pratap <ravi@ximian.com>
19442 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19444 * ../errors/cs0617.cs : Add.
19446 2001-11-11 Ravi Pratap <ravi@ximian.com>
19448 * enum.cs (Emit): Rename to Populate to be more consistent with what
19449 we expect it to do and when exactly it is called.
19451 * class.cs, rootcontext.cs : Update accordingly.
19453 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19454 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19456 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19458 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19459 of a fieldinfo using the above, when dealing with a FieldBuilder.
19461 2001-11-10 Ravi Pratap <ravi@ximian.com>
19463 * ../errors/cs0031.cs : Add.
19465 * ../errors/cs1008.cs : Add.
19467 * ../errrors/cs0543.cs : Add.
19469 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19472 (FindMembers): Implement.
19474 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19475 enums and delegates too.
19477 (enum_types): Rename to builder_to_enum.
19479 (delegate_types): Rename to builder_to_delegate.
19481 * delegate.cs (FindMembers): Implement.
19483 2001-11-09 Ravi Pratap <ravi@ximian.com>
19485 * typemanager.cs (IsEnumType): Implement.
19487 * enum.cs (Emit): Re-write parts to account for the underlying type
19488 better and perform checking etc.
19490 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19491 of the underlying type.
19493 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19496 * enum.cs (error31): Helper to report error #31.
19498 * cs-parser.jay (enum_declaration): Store location of each member too.
19500 * enum.cs (member_to_location): New hashtable.
19502 (AddEnumMember): Update location hashtable.
19504 (Emit): Use the location of each member while reporting errors.
19506 2001-11-09 Miguel de Icaza <miguel@ximian.com>
19508 * cs-parser.jay: A for_initializer if is a
19509 local_variable_declaration really ammount to have an implicit
19510 block with the variable declaration and no initializer for for.
19512 * statement.cs (For.Emit): Cope with null initializers.
19514 This fixes the infinite loop on for initializers.
19516 2001-11-08 Miguel de Icaza <miguel@ximian.com>
19518 * enum.cs: More cleanup.
19520 * ecore.cs: Remove dead code.
19522 * class.cs (Property.Emit): More simplification.
19523 (Event.Emit): ditto.
19525 Reworked to have less levels of indentation.
19527 2001-11-08 Ravi Pratap <ravi@ximian.com>
19529 * class.cs (Property): Emit attributes.
19539 * enum.cs (Emit): Ditto.
19541 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19544 * class.cs (Field, Event, etc.): Move attribute generation into the
19545 Emit method everywhere.
19547 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19548 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19549 as we had no way of defining nested enums !
19551 * rootcontext.cs : Adjust code accordingly.
19553 * typemanager.cs (AddEnumType): To keep track of enum types separately.
19555 2001-11-07 Ravi Pratap <ravi@ximian.com>
19557 * expression.cs (EvalConstantExpression): Move into ecore.cs
19559 * enum.cs (Enum): Rename some members and make them public and readonly
19560 according to our convention.
19562 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19565 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19567 (Enum::Emit): Write a simple version for now which doesn't try to compute
19568 expressions. I shall modify this to be more robust in just a while.
19570 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19572 (TypeContainer::CloseType): Create the Enum types too.
19574 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19576 * expression.cs (EvalConstantExpression): Get rid of completely.
19578 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19579 user-defined values and other cases.
19581 (IsValidEnumLiteral): Helper function.
19583 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
19584 out there in the case we had a literal FieldExpr.
19586 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19588 (Literalize): Revamp a bit to take two arguments.
19590 (EnumLiteral): New class which derives from Literal to wrap enum literals.
19592 2001-11-06 Ravi Pratap <ravi@ximian.com>
19594 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19596 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19598 (Resolve): Use the above to ensure we have proper initializers.
19600 2001-11-05 Ravi Pratap <ravi@ximian.com>
19602 * expression.cs (Expression::EvalConstantExpression): New method to
19603 evaluate constant expressions.
19605 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19607 2001-11-07 Miguel de Icaza <miguel@ximian.com>
19609 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19612 (Binary.ResolveOperator): Handle operator != (object a, object b)
19613 and operator == (object a, object b);
19615 (Binary.DoNumericPromotions): Indicate whether the numeric
19616 promotion was possible.
19618 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19621 Made the ArrayAccess implement interface IAssignMethod instead of
19622 IStackStore as the order in which arguments are passed reflects
19625 * assign.cs: Instead of using expr.ExprClass to select the way of
19626 assinging, probe for the IStackStore/IAssignMethod interfaces.
19628 * typemanager.cs: Load InitializeArray definition.
19630 * rootcontext.cs (RootContext.MakeStaticData): Used to define
19631 static data that can be used to initialize arrays.
19633 2001-11-05 Miguel de Icaza <miguel@ximian.com>
19635 * expression.cs: Handle operator== and operator!= for booleans.
19637 (Conditioal.Reduce): Implement reducer for the ?: operator.
19639 (Conditional.Resolve): Implement dead code elimination.
19641 (Binary.Resolve): Catch string literals and return a new
19642 concatenated string.
19644 (Unary.Reduce): Implement reduction of unary expressions.
19646 * ecore.cs: Split out the expression core handling here.
19648 (Expression.Reduce): New method used to perform constant folding
19649 and CSE. This is needed to support constant-expressions.
19651 * statement.cs (Statement.EmitBoolExpression): Pass true and false
19652 targets, and optimize for !x.
19654 2001-11-04 Ravi Pratap <ravi@ximian.com>
19656 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19657 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19658 set custom atttributes.
19660 * literal.cs (Literal::GetValue): New abstract method to return the actual
19661 value of the literal, cast as an object.
19663 (*Literal): Implement GetValue method.
19665 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19666 expressions to the arraylist but objects of type Argument.
19668 * class.cs (TypeContainer::Emit): Emit our attributes too.
19670 (Method::Emit, Constructor::Emit): Ditto.
19672 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19673 to be ignoring earlier.
19675 2001-11-03 Ravi Pratap <ravi@ximian.com>
19677 * attribute.cs (AttributeSection::Define): Implement to do the business
19678 of constructing a CustomAttributeBuilder.
19680 (Attribute): New trivial class. Increases readability of code.
19682 * cs-parser.jay : Update accordingly.
19684 (positional_argument_list, named_argument_list, named_argument): New rules
19686 (attribute_arguments): Use the above so that we are more correct.
19688 2001-11-02 Ravi Pratap <ravi@ximian.com>
19690 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19691 to perform all checks for a method with a params parameter.
19693 (Invocation::OverloadResolve): Update to use the above method and therefore
19694 cope correctly with params method invocations.
19696 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
19699 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19700 constructors in our parent too because we can't afford to miss out on
19703 * attribute.cs (AttributeSection): New name for the class Attribute
19705 Other trivial changes to improve readability.
19707 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19708 use the new class names.
19710 2001-11-01 Ravi Pratap <ravi@ximian.com>
19712 * class.cs (Method::Define): Complete definition for params types too
19714 (Indexer::Define): Ditto.
19716 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19717 Cope everywhere with a request for info about the array parameter.
19719 2001-11-01 Ravi Pratap <ravi@ximian.com>
19721 * tree.cs (RecordNamespace): Fix up to check for the correct key.
19723 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
19724 local_variable_type to extract the string corresponding to the type.
19726 (local_variable_type): Fixup the action to use the new helper method.
19728 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
19731 * expression.cs : Clean out code which uses the above.
19733 2001-10-31 Ravi Pratap <ravi@ximian.com>
19735 * typemanager.cs (RegisterMethod): Check if we already have an existing key
19736 and bale out if necessary by returning a false.
19738 (RegisterProperty): Ditto.
19740 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19741 and print out appropriate error messages.
19743 * interface.cs (everywhere): Ditto.
19745 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19746 location to constructor.
19748 * class.cs (Property, Event, Indexer): Update accordingly.
19750 * ../errors/cs111.cs : Added.
19752 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19753 of a method, as laid down by the spec.
19755 (Invocation::OverloadResolve): Use the above method.
19757 2001-10-31 Ravi Pratap <ravi@ximian.com>
19759 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19760 now take a TypeContainer and a Parameters object.
19762 (ParameterData): Modify return type of ParameterModifier method to be
19763 Parameter.Modifier and not a string.
19765 (ReflectionParameters, InternalParameters): Update accordingly.
19767 * expression.cs (Argument::GetParameterModifier): Same here.
19769 * support.cs (InternalParameters::ParameterType): Find a better way of determining
19770 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19771 symbol in it at all so maybe this is only for now.
19773 2001-10-30 Ravi Pratap <ravi@ximian.com>
19775 * support.cs (InternalParameters): Constructor now takes an extra argument
19776 which is the actual Parameters class.
19778 (ParameterDesc): Update to provide info on ref/out modifiers.
19780 * class.cs (everywhere): Update call to InternalParameters to pass in
19781 the second argument too.
19783 * support.cs (ParameterData): Add ParameterModifier, which is a method
19784 to return the modifier info [ref/out etc]
19786 (InternalParameters, ReflectionParameters): Implement the above.
19788 * expression.cs (Argument::ParameterModifier): Similar function to return
19789 info about the argument's modifiers.
19791 (Invocation::OverloadResolve): Update to take into account matching modifiers
19794 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19795 a new SetFormalParameters object which we pass to InternalParameters.
19797 2001-10-30 Ravi Pratap <ravi@ximian.com>
19799 * expression.cs (NewArray): Merge into the ArrayCreation class.
19801 2001-10-29 Ravi Pratap <ravi@ximian.com>
19803 * expression.cs (NewArray): Merge classes NewBuiltinArray and
19804 NewUserdefinedArray into one as there wasn't much of a use in having
19807 * expression.cs (Argument): Change field's name to ArgType from Type.
19809 (Type): New readonly property which returns the proper type, taking into
19810 account ref/out modifiers.
19812 (everywhere): Adjust code accordingly for the above.
19814 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19815 whether we are emitting for a ref or out parameter.
19817 * expression.cs (Argument::Emit): Use the above field to set the state.
19819 (LocalVariableReference::Emit): Update to honour the flag and emit the
19822 * parameter.cs (Attributes): Set the correct flags for ref parameters.
19824 * expression.cs (Argument::FullDesc): New function to provide a full desc.
19826 * support.cs (ParameterData): Add method ParameterDesc to the interface.
19828 (ReflectionParameters, InternalParameters): Implement the above method.
19830 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19833 (Invocation::FullMethodDesc): Ditto.
19835 2001-10-29 Miguel de Icaza <miguel@ximian.com>
19837 * cs-parser.jay: Add extra production for the second form of array
19840 * expression.cs (ArrayCreation): Update to reflect the above
19843 * Small changes to prepare for Array initialization.
19845 2001-10-28 Miguel de Icaza <miguel@ximian.com>
19847 * typemanager.cs (ImplementsInterface): interface might be null;
19848 Deal with this problem;
19850 Also, we do store negative hits on the cache (null values), so use
19851 this instead of calling t.GetInterfaces on the type everytime.
19853 2001-10-28 Ravi Pratap <ravi@ximian.com>
19855 * typemanager.cs (IsBuiltinType): New method to help determine the same.
19857 * expression.cs (New::DoResolve): Get rid of array creation code and instead
19858 split functionality out into different classes.
19860 (New::FormArrayType): Move into NewBuiltinArray.
19862 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19865 (NewBuiltinArray): New class to handle creation of built-in arrays.
19867 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19868 account creation of one-dimensional arrays.
19870 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19872 (NewUserdefinedArray::DoResolve): Implement.
19874 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19876 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19877 we maintain inside the TypeManager. This is necessary to perform lookups on the
19880 (LookupType): Update to perform GetType on the module builders too.
19882 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19884 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19886 2001-10-23 Ravi Pratap <ravi@ximian.com>
19888 * expression.cs (New::DoResolve): Implement guts of array creation.
19890 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19892 2001-10-27 Miguel de Icaza <miguel@ximian.com>
19894 * expression.cs: Fix bug I introduced lsat night that broke
19897 (Expression.Resolve): Report a 246 error (can not resolve name)
19898 if we find a SimpleName in the stream.
19900 (Expression.ResolveLValue): Ditto.
19902 (Expression.ResolveWithSimpleName): This function is a variant of
19903 ResolveName, this one allows SimpleNames to be returned without a
19904 warning. The only consumer of SimpleNames is MemberAccess
19906 2001-10-26 Miguel de Icaza <miguel@ximian.com>
19908 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19909 might arrive here. I have my doubts that this is correct.
19911 * statement.cs (Lock): Implement lock statement.
19913 * cs-parser.jay: Small fixes to support `lock' and `using'
19915 * cs-tokenizer.cs: Remove extra space
19917 * driver.cs: New flag --checked, allows to turn on integer math
19920 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19921 Threading.Monitor.Exit
19923 2001-10-23 Miguel de Icaza <miguel@ximian.com>
19925 * expression.cs (IndexerAccess::DoResolveLValue): Set the
19926 Expression Class to be IndexerAccess.
19928 Notice that Indexer::DoResolve sets the eclass to Value.
19930 2001-10-22 Miguel de Icaza <miguel@ximian.com>
19932 * class.cs (TypeContainer::Emit): Emit code for indexers.
19934 * assign.cs (IAssignMethod): New interface implemented by Indexers
19935 and Properties for handling assignment.
19937 (Assign::Emit): Simplify and reuse code.
19939 * expression.cs (IndexerAccess, PropertyExpr): Implement
19940 IAssignMethod, clean up old code.
19942 2001-10-22 Ravi Pratap <ravi@ximian.com>
19944 * typemanager.cs (ImplementsInterface): New method to determine if a type
19945 implements a given interface. Provides a nice cache too.
19947 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19950 (ConvertReferenceExplicit): Ditto.
19952 * delegate.cs (Delegate::Populate): Update to define the parameters on the
19953 various methods, with correct names etc.
19955 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
19956 Operator.UnaryNegation.
19958 * cs-parser.jay (operator_declarator): Be a little clever in the case where
19959 we have a unary plus or minus operator.
19961 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
19964 * everywhere : update accordingly.
19966 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19969 * class.cs (Method::Define): For the case where we are implementing a method
19970 inherited from an interface, we need to set the MethodAttributes.Final flag too.
19971 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19973 2001-10-21 Ravi Pratap <ravi@ximian.com>
19975 * interface.cs (FindMembers): Implement to work around S.R.E
19978 * typemanager.cs (IsInterfaceType): Implement.
19980 (FindMembers): Update to handle interface types too.
19982 * expression.cs (ImplicitReferenceConversion): Re-write bits which
19983 use IsAssignableFrom as that is not correct - it doesn't work.
19985 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19986 and accordingly override EmitStatement.
19988 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19989 using the correct logic :-)
19991 2001-10-19 Ravi Pratap <ravi@ximian.com>
19993 * ../errors/cs-11.cs : Add to demonstrate error -11
19995 2001-10-17 Miguel de Icaza <miguel@ximian.com>
19997 * assign.cs (Assign::Resolve): Resolve right hand side first, and
19998 then pass this as a hint to ResolveLValue.
20000 * expression.cs (FieldExpr): Add Location information
20002 (FieldExpr::LValueResolve): Report assignment to readonly
20005 (Expression::ExprClassFromMemberInfo): Pass location information.
20007 (Expression::ResolveLValue): Add new method that resolves an
20010 (Expression::DoResolveLValue): Default invocation calls
20013 (Indexers): New class used to keep track of indexers in a given
20016 (IStackStore): Renamed from LValue, as it did not really describe
20017 what this did. Also ResolveLValue is gone from this interface and
20018 now is part of Expression.
20020 (ElementAccess): Depending on the element access type
20022 * typemanager.cs: Add `indexer_name_type' as a Core type
20023 (System.Runtime.CompilerServices.IndexerNameAttribute)
20025 * statement.cs (Goto): Take a location.
20027 2001-10-18 Ravi Pratap <ravi@ximian.com>
20029 * delegate.cs (Delegate::VerifyDelegate): New method to verify
20030 if two delegates are compatible.
20032 (NewDelegate::DoResolve): Update to take care of the case when
20033 we instantiate a delegate from another delegate.
20035 * typemanager.cs (FindMembers): Don't even try to look up members
20036 of Delegate types for now.
20038 2001-10-18 Ravi Pratap <ravi@ximian.com>
20040 * delegate.cs (NewDelegate): New class to take care of delegate
20043 * expression.cs (New): Split the delegate related code out into
20044 the NewDelegate class.
20046 * delegate.cs (DelegateInvocation): New class to handle delegate
20049 * expression.cs (Invocation): Split out delegate related code into
20050 the DelegateInvocation class.
20052 2001-10-17 Ravi Pratap <ravi@ximian.com>
20054 * expression.cs (New::DoResolve): Implement delegate creation fully
20055 and according to the spec.
20057 (New::DoEmit): Update to handle delegates differently.
20059 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20060 because of which we were printing out arguments in reverse order !
20062 * delegate.cs (VerifyMethod): Implement to check if the given method
20063 matches the delegate.
20065 (FullDelegateDesc): Implement.
20067 (VerifyApplicability): Implement.
20069 * expression.cs (Invocation::DoResolve): Update to accordingly handle
20070 delegate invocations too.
20072 (Invocation::Emit): Ditto.
20074 * ../errors/cs1593.cs : Added.
20076 * ../errors/cs1594.cs : Added.
20078 * delegate.cs (InstanceExpression, TargetMethod): New properties.
20080 2001-10-16 Ravi Pratap <ravi@ximian.com>
20082 * typemanager.cs (intptr_type): Core type for System.IntPtr
20084 (InitCoreTypes): Update for the same.
20086 (iasyncresult_type, asynccallback_type): Ditto.
20088 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20091 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20094 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20095 the builders for the 4 members of a delegate type :-)
20097 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20100 * expression.cs (New::DoResolve): Implement guts for delegate creation.
20102 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20104 2001-10-15 Miguel de Icaza <miguel@ximian.com>
20106 * statement.cs (Break::Emit): Implement.
20107 (Continue::Emit): Implement.
20109 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
20110 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
20111 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
20112 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
20115 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20116 properties that track the label for the current loop (begin of the
20117 loop and end of the loop).
20119 2001-10-15 Ravi Pratap <ravi@ximian.com>
20121 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20122 use of emitting anything at all.
20124 * class.cs, rootcontext.cs : Get rid of calls to the same.
20126 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20128 (Populate): Define the constructor correctly and set the implementation
20131 * typemanager.cs (delegate_types): New hashtable to hold delegates that
20134 (AddDelegateType): Implement.
20136 (IsDelegateType): Implement helper method.
20138 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20140 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20141 and accordingly handle it.
20143 * delegate.cs (Populate): Take TypeContainer argument.
20144 Implement bits to define the Invoke method. However, I still haven't figured out
20145 how to take care of the native int bit :-(
20147 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
20148 Qualify the name of the delegate, not its return type !
20150 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
20153 (StandardConversionExists): Checking for array types turns out to be recursive.
20155 (ConvertReferenceExplicit): Implement array conversion.
20157 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
20159 2001-10-12 Ravi Pratap <ravi@ximian.com>
20161 * cs-parser.jay (delegate_declaration): Store the fully qualified
20162 name as it is a type declaration.
20164 * delegate.cs (ReturnType, Name): Rename members to these. Make them
20167 (DefineDelegate): Renamed from Define. Does the same thing essentially,
20168 as TypeContainer::DefineType.
20170 (Populate): Method in which all the definition of the various methods (Invoke)
20173 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
20176 (CloseDelegate): Finally creates the delegate.
20178 * class.cs (TypeContainer::DefineType): Update to define delegates.
20179 (Populate, Emit and CloseType): Do the same thing here too.
20181 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
20182 delegates in all these operations.
20184 2001-10-14 Miguel de Icaza <miguel@ximian.com>
20186 * expression.cs: LocalTemporary: a new expression used to
20187 reference a temporary that has been created.
20189 * assign.cs: Handle PropertyAccess back here, so that we can
20190 provide the proper semantic access to properties.
20192 * expression.cs (Expression::ConvertReferenceExplicit): Implement
20193 a few more explicit conversions.
20195 * modifiers.cs: `NEW' modifier maps to HideBySig.
20197 * expression.cs (PropertyExpr): Make this into an
20198 ExpressionStatement, and support the EmitStatement code path.
20200 Perform get/set error checking, clean up the interface.
20202 * assign.cs: recognize PropertyExprs as targets, and if so, turn
20203 them into toplevel access objects.
20205 2001-10-12 Miguel de Icaza <miguel@ximian.com>
20207 * expression.cs: PropertyExpr::PropertyExpr: use work around the
20210 * typemanager.cs: Keep track here of our PropertyBuilders again to
20211 work around lameness in SRE.
20213 2001-10-11 Miguel de Icaza <miguel@ximian.com>
20215 * expression.cs (LValue::LValueResolve): New method in the
20216 interface, used to perform a second resolution pass for LValues.
20218 (This::DoResolve): Catch the use of this in static methods.
20220 (This::LValueResolve): Implement.
20222 (This::Store): Remove warning, assigning to `this' in structures
20225 (Invocation::Emit): Deal with invocation of
20226 methods on value types. We need to pass the address to structure
20227 methods rather than the object itself. (The equivalent code to
20228 emit "this" for structures leaves the entire structure on the
20229 stack instead of a pointer to it).
20231 (ParameterReference::DoResolve): Compute the real index for the
20232 argument based on whether the method takes or not a `this' pointer
20233 (ie, the method is static).
20235 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
20236 value types returned from functions when we need to invoke a
20237 method on the sturcture.
20240 2001-10-11 Ravi Pratap <ravi@ximian.com>
20242 * class.cs (TypeContainer::DefineType): Method to actually do the business of
20243 defining the type in the Modulebuilder or Typebuilder. This is to take
20244 care of nested types which need to be defined on the TypeBuilder using
20245 DefineNestedMethod.
20247 (TypeContainer::GetClassBases): Implement. Essentially the code from the
20248 methods in RootContext, only ported to be part of TypeContainer.
20250 (TypeContainer::GetInterfaceOrClass): Ditto.
20252 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20254 * interface.cs (Interface::DefineInterface): New method. Does exactly
20255 what RootContext.CreateInterface did earlier, only it takes care of nested types
20258 (Interface::GetInterfaces): Move from RootContext here and port.
20260 (Interface::GetInterfaceByName): Same here.
20262 * rootcontext.cs (ResolveTree): Re-write.
20264 (PopulateTypes): Re-write.
20266 * class.cs (TypeContainer::Populate): Populate nested types too.
20267 (TypeContainer::Emit): Emit nested members too.
20269 * typemanager.cs (AddUserType): Do not make use of the FullName property,
20270 instead just use the name argument passed in as it is already fully
20273 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20274 to TypeContainer mapping to see if a type is user-defined.
20276 * class.cs (TypeContainer::CloseType): Implement.
20278 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20279 the default constructor.
20281 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20284 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20286 * interface.cs (CloseType): Create the type here.
20288 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20291 Remove all the methods which are now in TypeContainer.
20293 2001-10-10 Ravi Pratap <ravi@ximian.com>
20295 * delegate.cs (Define): Re-write bits to define the delegate
20298 2001-10-10 Miguel de Icaza <miguel@ximian.com>
20300 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20302 * expression.cs (ImplicitReferenceConversion): handle null as well
20303 as a source to convert to any reference type.
20305 * statement.cs (Return): Perform any implicit conversions to
20306 expected return type.
20308 Validate use of return statement.
20310 * codegen.cs (EmitContext): Pass the expected return type here.
20312 * class.cs (Method, Constructor, Property): Pass expected return
20313 type to EmitContext.
20315 2001-10-09 Miguel de Icaza <miguel@ximian.com>
20317 * expression.cs: Make DoResolve take an EmitContext instead of a
20320 Replaced `l' and `location' for `loc', for consistency.
20322 (Error, Warning): Remove unneeded Tc argument.
20324 * assign.cs, literal.cs, constant.cs: Update to new calling
20327 * codegen.cs: EmitContext now contains a flag indicating whether
20328 code is being generated in a static method or not.
20330 * cs-parser.jay: DecomposeQI, new function that replaces the old
20331 QualifiedIdentifier. Now we always decompose the assembled
20332 strings from qualified_identifier productions into a group of
20335 2001-10-08 Miguel de Icaza <miguel@ximian.com>
20337 * rootcontext.cs: Deal with field-less struct types correctly now
20338 by passing the size option to Define Type.
20340 * class.cs: Removed hack that created one static field.
20342 2001-10-07 Miguel de Icaza <miguel@ximian.com>
20344 * statement.cs: Moved most of the code generation here.
20346 2001-10-09 Ravi Pratap <ravi@ximian.com>
20348 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20351 (ElementAccess): Remove useless bits for now - keep checks as the spec
20354 2001-10-08 Ravi Pratap <ravi@ximian.com>
20356 * expression.cs (ElementAccess::DoResolve): Remove my crap code
20357 and start performing checks according to the spec.
20359 2001-10-07 Ravi Pratap <ravi@ximian.com>
20361 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20362 rank_specifiers instead.
20364 (rank_specifiers): Change the order in which the rank specifiers are stored
20366 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20368 * expression.cs (ElementAccess): Implement the LValue interface too.
20370 2001-10-06 Ravi Pratap <ravi@ximian.com>
20372 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20373 except that user defined conversions are not included.
20375 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
20376 perform the conversion of the return type, if necessary.
20378 (New::DoResolve): Check whether we are creating an array or an object
20379 and accordingly do the needful.
20381 (New::Emit): Same here.
20383 (New::DoResolve): Implement guts of array creation.
20385 (New::FormLookupType): Helper function.
20387 2001-10-07 Miguel de Icaza <miguel@ximian.com>
20389 * codegen.cs: Removed most of the code generation here, and move the
20390 corresponding code generation bits to the statement classes.
20392 Added support for try/catch/finalize and throw.
20394 * cs-parser.jay: Added support for try/catch/finalize.
20396 * class.cs: Catch static methods having the flags override,
20397 virtual or abstract.
20399 * expression.cs (UserCast): This user cast was not really doing
20400 what it was supposed to do. Which is to be born in fully resolved
20401 state. Parts of the resolution were being performed at Emit time!
20405 2001-10-05 Miguel de Icaza <miguel@ximian.com>
20407 * expression.cs: Implicity convert the result from UserCast.
20409 2001-10-05 Ravi Pratap <ravi@ximian.com>
20411 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20412 prevented it from working correctly.
20414 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20415 merely ConvertImplicit.
20417 2001-10-05 Miguel de Icaza <miguel@ximian.com>
20419 * typemanager.cs: Make the LookupTypeContainer function static,
20420 and not per-instance.
20422 * class.cs: Make static FindMembers (the one that takes a Type
20425 * codegen.cs: Add EmitForeach here.
20427 * cs-parser.jay: Make foreach a toplevel object instead of the
20428 inline expansion, as we need to perform semantic analysis on it.
20430 2001-10-05 Ravi Pratap <ravi@ximian.com>
20432 * expression.cs (Expression::ImplicitUserConversion): Rename to
20433 UserDefinedConversion.
20435 (Expression::UserDefinedConversion): Take an extra argument specifying
20436 whether we look for explicit user conversions too.
20438 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20440 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20442 (ExplicitUserConversion): Make it a call to UserDefinedConversion
20443 with the appropriate arguments.
20445 * cs-parser.jay (cast_expression): Record location too.
20447 * expression.cs (Cast): Record location info.
20449 (Expression::ConvertExplicit): Take location argument.
20451 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20452 to determine if we are doing explicit conversions.
20454 (UserCast::Emit): Update accordingly.
20456 (Expression::ConvertExplicit): Report an error if everything fails.
20458 * ../errors/cs0030.cs : Add.
20460 2001-10-04 Miguel de Icaza <miguel@ximian.com>
20462 * modifiers.cs: If the ABSTRACT keyword is present, also set the
20463 virtual and newslot bits.
20465 * class.cs (TypeContainer::RegisterRequiredImplementations):
20466 Record methods we need.
20468 (TypeContainer::MakeKey): Helper function to make keys for
20469 MethodBases, since the Methodbase key is useless.
20471 (TypeContainer::Populate): Call RegisterRequiredImplementations
20472 before defining the methods.
20474 Create a mapping for method_builders_to_methods ahead of time
20475 instead of inside a tight loop.
20477 (::RequireMethods): Accept an object as the data to set into the
20478 hashtable so we can report interface vs abstract method mismatch.
20480 2001-10-03 Miguel de Icaza <miguel@ximian.com>
20482 * report.cs: Make all of it static.
20484 * rootcontext.cs: Drop object_type and value_type computations, as
20485 we have those in the TypeManager anyways.
20487 Drop report instance variable too, now it is a global.
20489 * driver.cs: Use try/catch on command line handling.
20491 Add --probe option to debug the error reporting system with a test
20494 * report.cs: Add support for exiting program when a probe
20495 condition is reached.
20497 2001-10-03 Ravi Pratap <ravi@ximian.com>
20499 * expression.cs (Binary::DoNumericPromotions): Fix the case when
20500 we do a forcible conversion regardless of type, to check if
20501 ForceConversion returns a null.
20503 (Binary::error19): Use location to report error.
20505 (Unary::error23): Use location here too.
20507 * ../errors/cs0019.cs : Check in.
20509 * ../errors/cs0023.cs : Check in.
20511 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20512 case of a non-null MethodInfo object with a length of 0 !
20514 (Binary::ResolveOperator): Flag error if overload resolution fails to find
20515 an applicable member - according to the spec :-)
20516 Also fix logic to find members in base types.
20518 (Unary::ResolveOperator): Same here.
20520 (Unary::report23): Change name to error23 and make first argument a TypeContainer
20521 as I was getting thoroughly confused between this and error19 :-)
20523 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20524 (::FindMostEncompassedType): Implement.
20525 (::FindMostEncompassingType): Implement.
20526 (::StandardConversionExists): Implement.
20528 (UserImplicitCast): Re-vamp. We now need info about most specific
20529 source and target types so that we can do the necessary conversions.
20531 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20532 mathematical union with no duplicates.
20534 2001-10-03 Miguel de Icaza <miguel@ximian.com>
20536 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20537 in order from base classes to child classes, so that we can in
20538 child classes look up in our parent for method names and
20539 attributes (required for handling abstract, virtual, new, override
20540 constructs: we need to instrospect our base class, and if we dont
20541 populate the classes in order, the introspection might be
20542 incorrect. For example, a method could query its parent before
20543 the parent has any methods and would determine that the parent has
20544 no abstract methods (while it could have had them)).
20546 (RootContext::CreateType): Record the order in which we define the
20549 2001-10-02 Miguel de Icaza <miguel@ximian.com>
20551 * class.cs (TypeContainer::Populate): Also method definitions can
20552 fail now, keep track of this.
20554 (TypeContainer::FindMembers): Implement support for
20555 DeclaredOnly/noDeclaredOnly flag.
20557 (Constructor::Emit) Return the ConstructorBuilder.
20559 (Method::Emit) Return the MethodBuilder.
20560 Check for abstract or virtual methods to be public.
20562 * rootcontext.cs (RootContext::CreateType): Register all the
20563 abstract methods required for the class to be complete and the
20564 interface methods that must be implemented.
20566 * cs-parser.jay: Report error 501 (method requires body if it is
20567 not marked abstract or extern).
20569 * expression.cs (TypeOf::Emit): Implement.
20571 * typemanager.cs: runtime_handle_type, new global type.
20573 * class.cs (Property::Emit): Generate code for properties.
20575 2001-10-02 Ravi Pratap <ravi@ximian.com>
20577 * expression.cs (Unary::ResolveOperator): Find operators on base type
20578 too - we now conform exactly to the spec.
20580 (Binary::ResolveOperator): Same here.
20582 * class.cs (Operator::Define): Fix minor quirk in the tests.
20584 * ../errors/cs0215.cs : Added.
20586 * ../errors/cs0556.cs : Added.
20588 * ../errors/cs0555.cs : Added.
20590 2001-10-01 Miguel de Icaza <miguel@ximian.com>
20592 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20593 single integer which is really efficient
20595 2001-10-01 Ravi Pratap <ravi@ximian.com>
20597 * expression.cs (Expression::ImplicitUserConversion): Use location
20598 even in the case when we are examining True operators.
20600 * class.cs (Operator::Define): Perform extensive checks to conform
20601 with the rules for operator overloading in the spec.
20603 * expression.cs (Expression::ImplicitReferenceConversion): Implement
20604 some of the other conversions mentioned in the spec.
20606 * typemanager.cs (array_type): New static member for the System.Array built-in
20609 (cloneable_interface): For System.ICloneable interface.
20611 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20612 we start resolving the tree and populating types.
20614 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20616 2001-10-01 Miguel de Icaza <miguel@ximian.com>
20618 * expression.cs (Expression::ExprClassFromMemberInfo,
20619 Expression::Literalize): Create literal expressions from
20620 FieldInfos which are literals.
20622 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20623 type casts, because they were wrong. The test suite in tests
20626 (ImplicitNumericConversion): ushort to ulong requires a widening
20629 Int32 constant to long requires widening cast as well.
20631 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20632 for integers because the type on the stack is not i4.
20634 2001-09-30 Miguel de Icaza <miguel@ximian.com>
20636 * expression.cs (report118): require location argument.
20638 * parameter.cs: Do not dereference potential null value.
20640 * class.cs: Catch methods that lack the `new' keyword when
20641 overriding a name. Report warnings when `new' is used without
20642 anything being there to override.
20644 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20646 * class.cs: Only add constructor to hashtable if it is non-null
20647 (as now constructors can fail on define).
20649 (TypeManager, Class, Struct): Take location arguments.
20651 Catch field instance initialization in structs as errors.
20653 accepting_filter: a new filter for FindMembers that is static so
20654 that we dont create an instance per invocation.
20656 (Constructor::Define): Catch errors where a struct constructor is
20659 * cs-parser.jay: Pass location information for various new
20662 * delegate.cs (Delegate): take a location argument.
20664 * driver.cs: Do not call EmitCode if there were problesm in the
20665 Definition of the types, as many Builders wont be there.
20667 * decl.cs (Decl::Decl): Require a location argument.
20669 * cs-tokenizer.cs: Handle properly hex constants that can not fit
20670 into integers, and find the most appropiate integer for it.
20672 * literal.cs: Implement ULongLiteral.
20674 * rootcontext.cs: Provide better information about the location of
20675 failure when CreateType fails.
20677 2001-09-29 Miguel de Icaza <miguel@ximian.com>
20679 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20682 * expression.cs (Binary::CheckShiftArguments): Add missing type
20684 (Binary::ResolveOperator): Add type to the logical and and logical
20685 or, Bitwise And/Or and Exclusive Or code paths, it was missing
20688 (Binary::DoNumericPromotions): In the case where either argument
20689 is ulong (and most signed types combined with ulong cause an
20690 error) perform implicit integer constant conversions as well.
20692 2001-09-28 Miguel de Icaza <miguel@ximian.com>
20694 * expression.cs (UserImplicitCast): Method should always be
20696 (Invocation::BetterConversion): Simplified test for IntLiteral.
20698 (Expression::ImplicitNumericConversion): Split this routine out.
20699 Put the code that performs implicit constant integer conversions
20702 (Expression::Resolve): Become a wrapper around DoResolve so we can
20703 check eclass and type being set after resolve.
20705 (Invocation::Badness): Remove this dead function
20707 (Binary::ResolveOperator): Do not compute the expensive argumnets
20708 unless we have a union for it.
20710 (Probe::Emit): Is needs to do an isinst and then
20711 compare against null.
20713 (::CanConvert): Added Location argument. If the Location argument
20714 is null (Location.Null), then we do not report errors. This is
20715 used by the `probe' mechanism of the Explicit conversion. We do
20716 not want to generate an error for something that the user
20717 explicitly requested to be casted. But the pipeline for an
20718 explicit cast first tests for potential implicit casts.
20720 So for now, if the Location is null, it means `Probe only' to
20721 avoid adding another argument. Might have to revise this
20724 (ClassCast): New class used to type cast objects into arbitrary
20725 classes (used in Explicit Reference Conversions).
20727 Implement `as' as well.
20729 Reverted all the patches from Ravi below: they were broken:
20731 * The use of `level' as a mechanism to stop recursive
20732 invocations is wrong. That was there just to catch the
20733 bug with a strack trace but not as a way of addressing
20736 To fix the problem we have to *understand* what is going
20737 on and the interactions and come up with a plan, not
20738 just get things going.
20740 * The use of the type conversion cache that I proposed
20741 last night had an open topic: How does this work across
20742 protection domains. A user defined conversion might not
20743 be public in the location where we are applying the
20744 conversion, a different conversion might be selected
20745 (ie, private A->B (better) but public B->A (worse),
20746 inside A, A->B applies, but outside it, B->A will
20749 * On top of that (ie, even if the above is solved),
20750 conversions in a cache need to be abstract. Ie, `To
20751 convert from an Int to a Short use an OpcodeCast', not
20752 `To convert from an Int to a Short use the OpcodeCast on
20753 the variable 5' (which is what this patch was doing).
20755 2001-09-28 Ravi Pratap <ravi@ximian.com>
20757 * expression.cs (Invocation::ConversionExists): Re-write to use
20758 the conversion cache
20760 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20761 cache all conversions done, not just user-defined ones.
20763 (Invocation::BetterConversion): The real culprit. Use ConversionExists
20764 to determine if a conversion exists instead of acutually trying to
20765 perform the conversion. It's faster too.
20767 (Expression::ConvertExplicit): Modify to use ConversionExists to check
20768 and only then attempt the implicit conversion.
20770 2001-09-28 Ravi Pratap <ravi@ximian.com>
20772 * expression.cs (ConvertImplicit): Use a cache for conversions
20773 already found. Check level of recursion and bail out if necessary.
20775 2001-09-28 Miguel de Icaza <miguel@ximian.com>
20777 * typemanager.cs (string_concat_string_string, string_concat_object_object):
20778 Export standard methods that we expect for string operations.
20780 * statement.cs (Block::UsageWarning): Track usage of variables and
20781 report the errors for not used variables.
20783 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20786 2001-09-27 Miguel de Icaza <miguel@ximian.com>
20788 * codegen.cs: remove unnneded code
20790 * expression.cs: Removed BuiltinTypeAccess class
20792 Fix the order in which implicit conversions are
20795 The previous fixed dropped support for boxed conversions (adding a
20796 test to the test suite now)
20798 (UserImplicitCast::CanConvert): Remove test for source being null,
20799 that code is broken. We should not feed a null to begin with, if
20800 we do, then we should track the bug where the problem originates
20801 and not try to cover it up here.
20803 Return a resolved expression of type UserImplicitCast on success
20804 rather than true/false. Ravi: this is what I was talking about,
20805 the pattern is to use a static method as a "constructor" for
20808 Also, do not create arguments until the very last minute,
20809 otherwise we always create the arguments even for lookups that
20810 will never be performed.
20812 (UserImplicitCast::Resolve): Eliminate, objects of type
20813 UserImplicitCast are born in a fully resolved state.
20815 * typemanager.cs (InitCoreTypes): Init also value_type
20816 (System.ValueType).
20818 * expression.cs (Cast::Resolve): First resolve the child expression.
20820 (LValue): Add new method AddressOf to be used by
20823 Change the argument of Store to take an EmitContext instead of an
20824 ILGenerator, because things like FieldExpr need to be able to call
20825 their children expression to generate the instance code.
20827 (Expression::Error, Expression::Warning): Sugar functions for
20830 (Expression::MemberLookup): Accept a TypeContainer instead of a
20831 Report as the first argument.
20833 (Expression::ResolvePrimary): Killed. I still want to improve
20834 this as currently the code is just not right.
20836 (Expression::ResolveMemberAccess): Simplify, but it is still
20839 (Unary::Resolve): Catch errors in AddressOf operators.
20841 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20842 index to a byte for the short-version, or the compiler will choose
20843 the wrong Emit call, which generates the wrong data.
20845 (ParameterReference::Emit, ::Store): same.
20847 (FieldExpr::AddressOf): Implement.
20849 * typemanager.cs: TypeManager: made public variable instead of
20852 * driver.cs: document --fatal.
20854 * report.cs (ErrorMessage, WarningMessage): new names for the old
20855 Error and Warning classes.
20857 * cs-parser.jay (member_access): Turn built-in access to types
20858 into a normal simplename
20860 2001-09-27 Ravi Pratap <ravi@ximian.com>
20862 * expression.cs (Invocation::BetterConversion): Fix to cope
20863 with q being null, since this was introducing a bug.
20865 * expression.cs (ConvertImplicit): Do built-in conversions first.
20867 2001-09-27 Ravi Pratap <ravi@ximian.com>
20869 * expression.cs (UserImplicitCast::Resolve): Fix bug.
20871 2001-09-27 Ravi Pratap <ravi@ximian.com>
20873 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20874 I had introduced long ago (what's new ?).
20876 * expression.cs (UserImplicitCast::CanConvert): Static method to do
20877 the work of all the checking.
20878 (ConvertImplicit): Call CanConvert and only then create object if necessary.
20879 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20881 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20882 that is the right way.
20884 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
20885 overloading resolution. Use everywhere instead of cutting and pasting code.
20887 (Binary::ResolveOperator): Use MakeUnionSet.
20889 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
20890 we have to convert to bool types. Not complete yet.
20892 2001-09-27 Miguel de Icaza <miguel@ximian.com>
20894 * typemanager.cs (TypeManager::CSharpName): support ushort.
20896 * expression.cs (Expression::TryImplicitIntConversion): Attempts
20897 to provide an expression that performsn an implicit constant int
20898 conversion (section 6.1.6).
20899 (Expression::ConvertImplicitRequired): Reworked to include
20900 implicit constant expression conversions.
20902 (Expression::ConvertNumericExplicit): Finished.
20904 (Invocation::Emit): If InstanceExpression is null, then it means
20905 that we perform a call on this.
20907 2001-09-26 Miguel de Icaza <miguel@ximian.com>
20909 * expression.cs (Unary::Emit): Remove some dead code.
20910 (Probe): Implement Resolve and Emit for `is'.
20911 (Expression::ConvertImplicitRequired): Attempt to do constant
20912 expression conversions here. Maybe should be moved to
20913 ConvertImplicit, but I am not sure.
20914 (Expression::ImplicitLongConstantConversionPossible,
20915 Expression::ImplicitIntConstantConversionPossible): New functions
20916 that tell whether is it possible to apply an implicit constant
20917 expression conversion.
20919 (ConvertNumericExplicit): Started work on explicit numeric
20922 * cs-parser.jay: Update operator constants.
20924 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20925 (Parameters::GetSignature): Hook up VerifyArgs here.
20926 (Parameters::VerifyArgs): Verifies that no two arguments have the
20929 * class.cs (Operator): Update the operator names to reflect the
20930 ones that the spec expects (as we are just stringizing the
20933 * expression.cs (Unary::ResolveOperator): Fix bug: Use
20934 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20935 previous usage did only work for our methods.
20936 (Expression::ConvertImplicit): Handle decimal implicit numeric
20937 conversions as well.
20938 (Expression::InternalTypeConstructor): Used to invoke constructors
20939 on internal types for default promotions.
20941 (Unary::Emit): Implement special handling for the pre/post
20942 increment/decrement for overloaded operators, as they need to have
20943 the same semantics as the other operators.
20945 (Binary::ResolveOperator): ditto.
20946 (Invocation::ConversionExists): ditto.
20947 (UserImplicitCast::Resolve): ditto.
20949 2001-09-26 Ravi Pratap <ravi@ximian.com>
20951 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20952 operator, return after emitting body. Regression tests pass again !
20954 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20955 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20956 (Invocation::OverloadResolve): Ditto.
20957 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20959 * everywhere : update calls to the above methods accordingly.
20961 2001-09-26 Miguel de Icaza <miguel@ximian.com>
20963 * assign.cs (Assign): Make it inherit from ExpressionStatement.
20965 * expression.cs (ExpressionStatement): New base class used for
20966 expressions that can appear in statements, so that we can provide
20967 an alternate path to generate expression that do not leave a value
20970 (Expression::Emit, and all the derivatives): We no longer return
20971 whether a value is left on the stack or not. Every expression
20972 after being emitted leaves a single value on the stack.
20974 * codegen.cs (EmitContext::EmitStatementExpression): Use the
20975 facilties of ExpressionStatement if possible.
20977 * cs-parser.jay: Update statement_expression.
20979 2001-09-25 Miguel de Icaza <miguel@ximian.com>
20981 * driver.cs: Change the wording of message
20983 2001-09-25 Ravi Pratap <ravi@ximian.com>
20985 * expression.cs (Binary::ResolveOperator): Had forgottten to set
20986 the type of the expression to the return type of the method if
20987 we have an overloaded operator match ! The regression tests pass again !
20988 (Unary::ResolveOperator): Ditto.
20990 * expression.cs (Invocation::ConversionExists): Correct the member lookup
20991 to find "op_Implicit", not "implicit" ;-)
20992 (UserImplicitCast): New class to take care of user-defined implicit conversions.
20993 (ConvertImplicit, ForceConversion): Take TypeContainer argument
20995 * everywhere : Correct calls to the above accordingly.
20997 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20998 (ConvertImplicit): Do user-defined conversion if it exists.
21000 2001-09-24 Miguel de Icaza <miguel@ximian.com>
21002 * assign.cs: track location.
21003 (Resolve): Use implicit conversions on assignment.
21005 * literal.cs: Oops. Not good, Emit of short access values should
21006 pass (Bytes) or the wrong argument will be selected.
21008 * expression.cs (Unary::Emit): Emit code for -expr.
21010 (Unary::ResolveOperator): Handle `Substract' for non-constants
21011 (substract from zero from the non-constants).
21012 Deal with Doubles as well.
21014 (Expression::ConvertImplicitRequired): New routine that reports an
21015 error if no implicit conversion exists.
21017 (Invocation::OverloadResolve): Store the converted implicit
21018 expressions if we make them
21020 2001-09-24 Ravi Pratap <ravi@ximian.com>
21022 * class.cs (ConstructorInitializer): Take a Location argument.
21023 (ConstructorBaseInitializer): Same here.
21024 (ConstructorThisInitializer): Same here.
21026 * cs-parser.jay : Update all calls accordingly.
21028 * expression.cs (Unary, Binary, New): Take location argument.
21029 Update accordingly everywhere.
21031 * cs-parser.jay : Update all calls to the above to take a location
21034 * class.cs : Ditto.
21036 2001-09-24 Ravi Pratap <ravi@ximian.com>
21038 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21039 (Invocation::BetterConversion): Same here
21040 (Invocation::ConversionExists): Ditto.
21042 (Invocation::ConversionExists): Implement.
21044 2001-09-22 Ravi Pratap <ravi@ximian.com>
21046 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21047 Also take an additional TypeContainer argument.
21049 * All over : Pass in TypeContainer as argument to OverloadResolve.
21051 * typemanager.cs (CSharpName): Update to check for the string type and return
21054 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21057 2001-09-21 Ravi Pratap <ravi@ximian.com>
21059 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21060 (Invocation::BetterFunction): Implement.
21061 (Invocation::BetterConversion): Implement.
21062 (Invocation::ConversionExists): Skeleton, no implementation yet.
21064 Okay, things work fine !
21066 2001-09-21 Miguel de Icaza <miguel@ximian.com>
21068 * typemanager.cs: declare and load enum_type, delegate_type and
21071 * expression.cs (Expression::Emit): Now emit returns a value that
21072 tells whether a value is left on the stack or not. This strategy
21073 might be reveted tomorrow with a mechanism that would address
21074 multiple assignments.
21075 (Expression::report118): Utility routine to report mismatches on
21078 (Unary::Report23): Report impossible type/operator combination
21081 (Unary::IsIncrementableNumber): Whether the type can be
21082 incremented or decremented with add.
21083 (Unary::ResolveOperator): Also allow enumerations to be bitwise
21085 (Unary::ResolveOperator): Implement ++, !, ~,
21087 (Invocation::Emit): Deal with new Emit convetion.
21089 * All Expression derivatives: Updated their Emit method to return
21090 whether they leave values on the stack or not.
21092 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21093 stack for expressions that are statements.
21095 2001-09-20 Miguel de Icaza <miguel@ximian.com>
21097 * expression.cs (LValue): New interface. Must be implemented by
21099 (LocalVariableReference, ParameterReference, FieldExpr): Implement
21102 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21103 interface for generating code, simplifies the code.
21105 2001-09-20 Ravi Pratap <ravi@ximian.com>
21107 * expression.cs (everywhere): Comment out return statements in ::Resolve
21108 methods to avoid the warnings.
21110 2001-09-20 Miguel de Icaza <miguel@ximian.com>
21112 * driver.cs (parse): Report error 2001 if we can not open the
21115 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21118 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21121 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21122 otherwise nested blocks end up with the same index.
21124 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21126 * expression.cs: Instead of having FIXMEs in the Resolve
21127 functions, throw exceptions so it is obvious that we are facing a
21130 * cs-parser.jay (invocation_expression): Pass Location information.
21132 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21133 Use a basename for those routines because .NET does not like paths
21136 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21139 2001-09-19 Miguel de Icaza <miguel@ximian.com>
21141 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21142 are loading the correct data types (throws an exception if not).
21143 (TypeManager::InitCoreTypes): Use CoreLookupType
21145 * expression.cs (Unary::ResolveOperator): return the child
21146 expression for expressions which are just +expr.
21147 (Unary::ResolveOperator): Return negative literals for -LITERAL
21148 expressions (otherwise they are Unary {Literal}).
21149 (Invocation::Badness): Take into account `Implicit constant
21150 expression conversions'.
21152 * literal.cs (LongLiteral): Implement long literal class.
21153 (IntLiteral): export the `Value' of the intliteral.
21155 2001-09-19 Ravi Pratap <ravi@ximian.com>
21157 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
21159 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
21160 instead of 'Operator'
21162 * expression.cs (Binary::ResolveOperator): Update accordingly.
21163 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
21166 * cs-parser.jay (unary_expression): Update to use the new names.
21168 * gen-treedump.cs (GetUnary): Same here.
21170 * expression.cs (Unary::Resolve): Implement.
21171 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
21172 operators are found instead of making noise ;-)
21173 (Unary::ResolveOperator): New method to do precisely the same thing which
21174 Binary::ResolveOperator does for Binary expressions.
21175 (Unary.method, .Arguments): Add.
21176 (Unary::OperName): Implement.
21177 (Unary::ForceConversion): Copy and Paste !
21179 * class.cs (Operator::Define): Fix a small bug for the case when we have
21182 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
21183 for the inbuilt operators. Only overloading works for now ;-)
21185 2001-09-18 Miguel de Icaza <miguel@ximian.com>
21187 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
21188 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
21190 * expression.cs (This::Emit): Implement.
21191 (This::Resolve): Implement.
21192 (TypeOf:Resolve): Implement.
21193 (Expression::ResolveSimpleName): Add an implicit this to instance
21195 (MemberAccess::Resolve): Deal with Parameters and Fields.
21196 Bind instance variable to Field expressions.
21197 (FieldExpr::Instance): New field used to track the expression that
21198 represents the object instance.
21199 (FieldExpr::Resolve): Track potential errors from MemberLookup not
21201 (FieldExpr::Emit): Implement.
21203 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
21204 the last instruction contains a return opcode to avoid generating
21205 the last `ret' instruction (this generates correct code, and it is
21206 nice to pass the peverify output).
21208 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
21209 initializer for static and instance variables.
21210 (Constructor::Emit): Allow initializer to be null in the case of
21211 static constructors. Only emit initializer for instance
21214 (TypeContainer::FindMembers): Return a null array if there are no
21217 Also fix the code for the MemberTypes.Method branch, as it was not
21218 scanning that for operators (or tried to access null variables before).
21220 * assign.cs (Assign::Emit): Handle instance and static fields.
21224 * driver.cs: Stop compilation if there are parse errors.
21226 * cs-parser.jay (constructor_declaration): Provide default base
21227 initializer for non-static constructors.
21228 (constructor_declarator): Do not provide a default base
21229 initializers if none was specified.
21230 Catch the fact that constructors should not have parameters.
21232 * class.cs: Do not emit parent class initializers for static
21233 constructors, that should be flagged as an error.
21235 2001-09-18 Ravi Pratap <ravi@ximian.com>
21237 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
21238 Move back code into TypeContainer::Populate.
21240 2001-09-18 Ravi Pratap <ravi@ximian.com>
21242 * class.cs (TypeContainer::AddConstructor): Fix the check to
21243 compare against Name, not Basename.
21244 (Operator::OpType): Change Plus and Minus to Add and Subtract.
21246 * cs-parser.jay : Update accordingly.
21248 * class.cs (TypeContainer::FindMembers): For the case where we are searching
21249 for methods, don't forget to look into the operators too.
21250 (RegisterMethodBuilder): Helper method to take care of this for
21251 methods, constructors and operators.
21252 (Operator::Define): Completely revamp.
21253 (Operator.OperatorMethod, MethodName): New fields.
21254 (TypeContainer::Populate): Move the registering of builders into
21255 RegisterMethodBuilder.
21256 (Operator::Emit): Re-write.
21258 * expression.cs (Binary::Emit): Comment out code path to emit method
21259 invocation stuff for the case when we have a user defined operator. I am
21260 just not able to get it right !
21262 2001-09-17 Miguel de Icaza <miguel@ximian.com>
21264 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21267 (Expression::MemberLookup): Provide a version that allows to
21268 specify the MemberTypes and BindingFlags.
21270 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21271 so it was not fetching variable information from outer blocks.
21273 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21274 Beforefieldinit as it was buggy.
21276 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21277 that Ravi put here.
21279 * class.cs (Constructor::Emit): Only emit if block is not null.
21280 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21281 deal with this by semantically definining it as if the user had
21284 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21285 constructors as we now "emit" them at a higher level.
21287 (TypeContainer::DefineDefaultConstructor): Used to define the
21288 default constructors if none was provided.
21290 (ConstructorInitializer): Add methods Resolve and Emit.
21292 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21294 2001-09-17 Ravi Pratap <ravi@ximian.com>
21296 * class.cs (TypeContainer::EmitDefaultConstructor): Register
21297 the default constructor builder with our hashtable for methodbuilders
21300 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21301 and argument_count is 0 in which case we have a match.
21302 (Binary::ResolveOperator): More null checking and miscellaneous coding
21305 2001-09-17 Ravi Pratap <ravi@ximian.com>
21307 * rootcontext.cs (IsNameSpace): Compare against null.
21309 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21311 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21312 and Unary::Operator.
21314 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21317 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21318 we have overloaded operators.
21319 (Binary::ResolveOperator): Implement the part which does the operator overload
21322 * class.cs (Operator::Emit): Implement.
21323 (TypeContainer::Emit): Emit the operators we have too.
21325 * expression.cs (Binary::Emit): Update to emit the appropriate code for
21326 the case when we have a user-defined operator.
21328 2001-09-17 Miguel de Icaza <miguel@ximian.com>
21330 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21332 2001-09-16 Ravi Pratap <ravi@ximian.com>
21334 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21335 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21336 (Constructor::Emit): Implement.
21337 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21338 if we have no work to do.
21339 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
21342 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21343 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21345 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21348 2001-09-15 Ravi Pratap <ravi@ximian.com>
21350 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21352 (Tree::RecordNamespace): Method to do what the name says ;-)
21353 (Tree::Namespaces): Property to get at the namespaces hashtable.
21355 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
21358 * rootcontext.cs (IsNamespace): Fixed it :-)
21360 2001-09-14 Miguel de Icaza <miguel@ximian.com>
21362 * class.cs (TypeContainer::FindMembers): Add support for
21364 (MethodCore): New class that encapsulates both the shared aspects
21365 of a Constructor and a Method.
21366 (Method, Constructor): Factored pieces into MethodCore.
21368 * driver.cs: Added --fatal which makes errors throw exceptions.
21369 Load System assembly as well as part of the standard library.
21371 * report.cs: Allow throwing exceptions on errors for debugging.
21373 * modifiers.cs: Do not use `parent', instead use the real type
21374 container to evaluate permission settings.
21376 * class.cs: Put Ravi's patch back in. He is right, and we will
21377 have to cope with the
21379 2001-09-14 Ravi Pratap <ravi@ximian.com>
21381 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21382 FamORAssem, not FamANDAssem.
21384 2001-09-14 Miguel de Icaza <miguel@ximian.com>
21386 * driver.cs: Added --parse option that only parses its input files
21389 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
21390 incorrect. IsTopLevel is not used to tell whether an object is
21391 root_types or not (that can be achieved by testing this ==
21392 root_types). But to see if this is a top-level *class* (not
21393 necessarly our "toplevel" container).
21395 2001-09-14 Ravi Pratap <ravi@ximian.com>
21397 * enum.cs (Enum::Define): Modify to call the Lookup method on the
21398 parent instead of a direct call to GetType.
21400 2001-09-14 Ravi Pratap <ravi@ximian.com>
21402 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21403 Modifiers.TypeAttr. This should just be a call to that method.
21405 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21406 object so that we can determine if we are top-level or not.
21408 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
21411 * enum.cs (Enum::Define): Ditto.
21413 * modifiers.cs (FieldAttr): Re-write.
21415 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21416 (TypeContainer::HaveStaticConstructor): New property to provide access
21417 to precisely that info.
21419 * modifiers.cs (MethodAttr): Re-write.
21420 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21422 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21423 of top-level types as claimed.
21425 2001-09-13 Miguel de Icaza <miguel@ximian.com>
21427 * expression.cs (MemberLookup): Fruitless attempt to lookup
21428 constructors. Maybe I need to emit default constructors? That
21429 might be it (currently .NET emits this for me automatically).
21430 (Invocation::OverloadResolve): Cope with Arguments == null.
21431 (Invocation::EmitArguments): new function, shared by the new
21432 constructor and us.
21433 (Invocation::Emit): Handle static and instance methods. Emit
21434 proper call instruction for virtual or non-virtual invocations.
21435 (New::Emit): Implement.
21436 (New::Resolve): Implement.
21437 (MemberAccess:Resolve): Implement.
21438 (MethodGroupExpr::InstanceExpression): used conforming to the spec
21439 to track instances.
21440 (FieldExpr::Resolve): Set type.
21442 * support.cs: Handle empty arguments.
21444 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21445 SimpleLookup): Auxiliary routines to help parse a qualifier
21448 Update qualifier_identifier rule.
21450 * codegen.cs: Removed debugging messages.
21452 * class.cs: Make this a global thing, this acts just as a "key" to
21453 objects that we might have around.
21455 (Populate): Only initialize method_builders_to_methods once.
21457 * expression.cs (PropertyExpr): Initialize type from the
21460 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21461 Resolve pattern. Attempt to implicitly convert value to boolean.
21464 * expression.cs: Set the type for the int32/int32 argument case.
21465 (Binary::ResolveOperator): Set the return type to boolean for
21466 comparission operators
21468 * typemanager.cs: Remove debugging print code.
21470 (Invocation::Resolve): resolve type.
21472 * class.cs: Allocate a MemberInfo of the correct size, as the code
21473 elsewhere depends on the test to reflect the correct contents.
21475 (Method::) Keep track of parameters, due to System.Reflection holes
21477 (TypeContainer::Populate): Keep track of MethodBuilders to Method
21480 (TypeContainer::FindMembers): Use ArrayList and then copy an array
21481 of the exact size and return that.
21483 (Class::LookupMethodByBuilder): New function that maps
21484 MethodBuilders to its methods. Required to locate the information
21485 on methods because System.Reflection bit us again.
21487 * support.cs: New file, contains an interface ParameterData and
21488 two implementations: ReflectionParameters and InternalParameters
21489 used to access Parameter information. We will need to grow this
21492 * expression.cs (Invocation::GetParameterData): implement a cache
21493 and a wrapper around the ParameterData creation for methods.
21494 (Invocation::OverloadResolve): Use new code.
21496 2001-09-13 Ravi Pratap <ravi@ximian.com>
21498 * class.cs (TypeContainer::EmitField): Remove and move into
21499 (Field::Define): here and modify accordingly.
21500 (Field.FieldBuilder): New member.
21501 (TypeContainer::Populate): Update accordingly.
21502 (TypeContainer::FindMembers): Implement.
21504 2001-09-13 Miguel de Icaza <miguel@ximian.com>
21506 * statement.cs: (VariableInfo::VariableType): New field to be
21507 initialized with the full type once it is resolved.
21509 2001-09-12 Miguel de Icaza <miguel@ximian.com>
21511 * parameter.cs (GetParameterInfo): Use a type cache to compute
21512 things only once, and to reuse this information
21514 * expression.cs (LocalVariableReference::Emit): Implement.
21515 (OpcodeCast::Emit): fix.
21517 (ParameterReference::Resolve): Implement.
21518 (ParameterReference::Emit): Implement.
21520 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21521 that are expressions need to stay as Expressions.
21523 * typemanager.cs (CSharpName): Returns the C# name of a type if
21526 * expression.cs (Expression::ConvertImplicit): New function that
21527 implements implicit type conversions.
21529 (Expression::ImplicitReferenceConversion): Implements implicit
21530 reference conversions.
21532 (EmptyCast): New type for transparent casts.
21534 (OpcodeCast): New type for casts of types that are performed with
21535 a sequence of bytecodes.
21537 (BoxedCast): New type used for casting value types into reference
21538 types. Emits a box opcode.
21540 (Binary::DoNumericPromotions): Implements numeric promotions of
21541 and computation of the Binary::Type.
21543 (Binary::EmitBranchable): Optimization.
21545 (Binary::Emit): Implement code emission for expressions.
21547 * typemanager.cs (TypeManager): Added two new core types: sbyte
21550 2001-09-12 Ravi Pratap <ravi@ximian.com>
21552 * class.cs (TypeContainer::FindMembers): Method which does exactly
21553 what Type.FindMembers does, only we don't have to use reflection. No
21554 implementation yet.
21556 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21557 typecontainer objects as we need to get at them.
21558 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21560 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21561 typecontainer object.
21563 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21564 of just a Report object.
21566 2001-09-11 Ravi Pratap <ravi@ximian.com>
21568 * class.cs (Event::Define): Go back to using the prefixes "add_" and
21570 (TypeContainer::Populate): Now define the delegates of the type too.
21571 (TypeContainer.Delegates): Property to access the list of delegates defined
21574 * delegates.cs (Delegate::Define): Implement partially.
21576 * modifiers.cs (TypeAttr): Handle more flags.
21578 2001-09-11 Ravi Pratap <ravi@ximian.com>
21580 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21582 (Operator::Define): Re-write logic to get types by using the LookupType method
21583 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21584 (Indexer::Define): Ditto.
21585 (Event::Define): Ditto.
21586 (Property::Define): Ditto.
21588 2001-09-10 Ravi Pratap <ravi@ximian.com>
21590 * class.cs (TypeContainer::Populate): Now define operators too.
21591 (TypeContainer.Operators): New property to access the list of operators
21593 (Operator.OperatorMethodBuilder): New member to hold the method builder
21594 for the operator we are defining.
21595 (Operator::Define): Implement.
21597 2001-09-10 Ravi Pratap <ravi@ximian.com>
21599 * class.cs (Event::Define): Make the prefixes of the accessor methods
21600 addOn_ and removeOn_
21602 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21603 of the location being passed in too. Ideally, this should go later since all
21604 error reporting should be done through the Report object.
21606 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21607 (Populate): Iterate thru the indexers we have and define them too.
21608 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21609 for the get and set accessors.
21610 (Indexer::Define): Implement.
21612 2001-09-09 Miguel de Icaza <miguel@ximian.com>
21614 * expression.cs (Binary::Resolve): Beginning of it. I scratched
21615 my previous implementation, did not work.
21617 * typemanager.cs: Add a couple of missing types (the longs).
21619 * literal.cs: Use TypeManager.bool_type instead of getting it.
21621 * expression.cs (EventExpr): New kind of expressions.
21622 (Expressio::ExprClassFromMemberInfo): finish
21624 2001-09-08 Miguel de Icaza <miguel@ximian.com>
21626 * assign.cs: Emit stores to static fields differently.
21628 2001-09-08 Ravi Pratap <ravi@ximian.com>
21630 * Merge in changes and adjust code to tackle conflicts. Backed out my
21631 code in Assign::Resolve ;-)
21633 2001-09-08 Ravi Pratap <ravi@ximian.com>
21635 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21636 instead Report.Error and also pass in the location.
21637 (CSharpParser::Lexer): New readonly property to return the reference
21638 to the Tokenizer object.
21639 (declare_local_variables): Use Report.Error with location instead of plain
21643 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21644 (Operator.CheckBinaryOperator): Ditto.
21646 * cs-parser.jay (operator_declarator): Update accordingly.
21648 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21649 (CheckBinaryOperator): Same here.
21651 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21652 on the name without any prefixes of namespace names etc. This is because we
21653 already might have something already fully qualified like
21654 'System.Console.WriteLine'
21656 * assign.cs (Resolve): Begin implementation. Stuck ;-)
21658 2001-09-07 Ravi Pratap <ravi@ximian.com>
21660 * cs-tokenizer.cs (location): Return a string which also contains
21663 * expression.cs (ElementAccess): New class for expressions of the
21664 type 'element access.'
21665 (BaseAccess): New class for expressions of the type 'base access.'
21666 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21669 * cs-parser.jay (element_access): Implement action.
21670 (base_access): Implement actions.
21671 (checked_expression, unchecked_expression): Implement.
21673 * cs-parser.jay (local_variable_type): Correct and implement.
21674 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21676 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21678 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21679 name and the specifiers.
21681 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21683 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
21684 making them all public ;-)
21686 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21689 2001-09-07 Miguel de Icaza <miguel@ximian.com>
21691 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21693 (FieldExpr, PropertyExprs): New resolved expressions.
21694 (SimpleName::MemberStaticCheck): Perform static checks for access
21695 to non-static fields on static methods. Maybe this should be
21696 generalized for MemberAccesses.
21697 (SimpleName::ResolveSimpleName): More work on simple name
21700 * cs-parser.jay (primary_expression/qualified_identifier): track
21701 the parameter index.
21703 * codegen.cs (CodeGen::Save): Catch save exception, report error.
21704 (EmitContext::EmitBoolExpression): Chain to expression generation
21705 instead of temporary hack.
21706 (::EmitStatementExpression): Put generic expression code generation.
21708 * assign.cs (Assign::Emit): Implement variable assignments to
21709 local variables, parameters and fields.
21711 2001-09-06 Miguel de Icaza <miguel@ximian.com>
21713 * statement.cs (Block::GetVariableInfo): New method, returns the
21714 VariableInfo for a variable name in a block.
21715 (Block::GetVariableType): Implement in terms of GetVariableInfo
21717 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21718 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21720 2001-09-06 Ravi Pratap <ravi@ximian.com>
21722 * cs-parser.jay (operator_declaration): Continue on my quest : update
21723 to take attributes argument.
21724 (event_declaration): Ditto.
21725 (enum_declaration): Ditto.
21726 (indexer_declaration): Ditto.
21728 * class.cs (Operator::Operator): Update constructor accordingly.
21729 (Event::Event): Ditto.
21731 * delegate.cs (Delegate::Delegate): Same here.
21733 * enum.cs (Enum::Enum): Same here.
21735 2001-09-05 Ravi Pratap <ravi@ximian.com>
21737 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21739 * ../tests/cs0658.cs : New file to demonstrate error 0658.
21741 * attribute.cs (Attributes): New class to encapsulate all attributes which were
21742 being passed around as an arraylist.
21743 (Attributes::AddAttribute): Method to add attribute sections.
21745 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21746 (struct_declaration): Update accordingly.
21747 (constant_declaration): Update.
21748 (field_declaration): Update.
21749 (method_header): Update.
21750 (fixed_parameter): Update.
21751 (parameter_array): Ditto.
21752 (property_declaration): Ditto.
21753 (destructor_declaration): Ditto.
21755 * class.cs (Struct::Struct): Update constructors accordingly.
21756 (Class::Class): Ditto.
21757 (Field::Field): Ditto.
21758 (Method::Method): Ditto.
21759 (Property::Property): Ditto.
21760 (TypeContainer::OptAttribute): update property's return type.
21762 * interface.cs (Interface.opt_attributes): New member.
21763 (Interface::Interface): Update to take the extra Attributes argument.
21765 * parameter.cs (Parameter::Parameter): Ditto.
21767 * constant.cs (Constant::Constant): Ditto.
21769 * interface.cs (InterfaceMemberBase): New OptAttributes field.
21770 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
21771 the attributes as a parameter.
21772 (InterfaceProperty): Update constructor call.
21773 (InterfaceEvent): Ditto.
21774 (InterfaceMethod): Ditto.
21775 (InterfaceIndexer): Ditto.
21777 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
21778 pass the attributes too.
21779 (interface_event_declaration): Ditto.
21780 (interface_property_declaration): Ditto.
21781 (interface_method_declaration): Ditto.
21782 (interface_declaration): Ditto.
21784 2001-09-05 Miguel de Icaza <miguel@ximian.com>
21786 * class.cs (Method::Define): Track the "static Main" definition to
21787 create an entry point.
21789 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21790 EntryPoint if we find it.
21792 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21793 (EmitContext::ig): Make this variable public.
21795 * driver.cs: Make the default output file be the first file name
21796 with the .exe extension.
21798 Detect empty compilations
21800 Handle various kinds of output targets. Handle --target and
21801 rename -t to --dumper.
21803 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21804 methods inherited from Expression return now an Expression. This
21805 will is used during the tree rewriting as we resolve them during
21808 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21809 the spec. Missing entirely is the information about
21810 accessability of elements of it.
21812 (Expression::ExprClassFromMemberInfo): New constructor for
21813 Expressions that creates a fully initialized Expression based on
21814 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21817 (Invocation::Resolve): Begin implementing resolution of invocations.
21819 * literal.cs (StringLiteral): Implement Emit.
21821 2001-09-05 Ravi Pratap <ravi@ximian.com>
21823 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21826 2001-09-04 Ravi Pratap <ravi@ximian.com>
21828 * cs-parser.jay (attribute_arguments): Implement actions.
21829 (attribute): Fix bug in production. Implement action.
21830 (attribute_list): Implement.
21831 (attribute_target): Implement.
21832 (attribute_target_specifier, opt_target_specifier): Implement
21833 (CheckAttributeTarget): New method to check if the attribute target
21835 (attribute_section): Implement.
21836 (opt_attributes): Implement.
21838 * attribute.cs : New file to handle attributes.
21839 (Attribute): Class to hold attribute info.
21841 * cs-parser.jay (opt_attribute_target_specifier): Remove production
21842 (attribute_section): Modify production to use 2 different rules to
21843 achieve the same thing. 1 s/r conflict down !
21844 Clean out commented, useless, non-reducing dimension_separator rules.
21846 * class.cs (TypeContainer.attributes): New member to hold list
21847 of attributes for a type.
21848 (Struct::Struct): Modify to take one more argument, the attribute list.
21849 (Class::Class): Ditto.
21850 (Field::Field): Ditto.
21851 (Method::Method): Ditto.
21852 (Property::Property): Ditto.
21854 * cs-parser.jay (struct_declaration): Update constructor call to
21855 pass in the attributes too.
21856 (class_declaration): Ditto.
21857 (constant_declaration): Ditto.
21858 (field_declaration): Ditto.
21859 (method_header): Ditto.
21860 (fixed_parameter): Ditto.
21861 (parameter_array): Ditto.
21862 (property_declaration): Ditto.
21864 * constant.cs (Constant::Constant): Update constructor similarly.
21865 Use System.Collections.
21867 * parameter.cs (Parameter::Parameter): Update as above.
21869 2001-09-02 Ravi Pratap <ravi@ximian.com>
21871 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21872 (TypeContainer.delegates): New member to hold list of delegates.
21874 * cs-parser.jay (delegate_declaration): Implement the action correctly
21875 this time as I seem to be on crack ;-)
21877 2001-09-02 Miguel de Icaza <miguel@ximian.com>
21879 * rootcontext.cs (RootContext::IsNamespace): new function, used to
21880 tell whether an identifier represents a namespace.
21882 * expression.cs (NamespaceExpr): A namespace expression, used only
21883 temporarly during expression resolution.
21884 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21885 utility functions to resolve names on expressions.
21887 2001-09-01 Miguel de Icaza <miguel@ximian.com>
21889 * codegen.cs: Add hook for StatementExpressions.
21891 * class.cs: Fix inverted test for static flag in methods.
21893 2001-09-02 Ravi Pratap <ravi@ximian.com>
21895 * class.cs (Operator::CheckUnaryOperator): Correct error number used
21896 to make it coincide with MS' number.
21897 (Operator::CheckBinaryOperator): Ditto.
21899 * ../errors/errors.txt : Remove error numbers added earlier.
21901 * ../errors/cs1019.cs : Test case for error # 1019
21903 * ../errros/cs1020.cs : Test case for error # 1020
21905 * cs-parser.jay : Clean out commented cruft.
21906 (dimension_separators, dimension_separator): Comment out. Ostensibly not
21907 used anywhere - non-reducing rule.
21908 (namespace_declarations): Non-reducing rule - comment out.
21910 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21911 with TypeContainer::AddEnum.
21913 * delegate.cs : New file for delegate handling classes.
21914 (Delegate): Class for declaring delegates.
21916 * makefile : Update.
21918 * cs-parser.jay (delegate_declaration): Implement.
21920 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
21922 * class.cs (Event::Define): Implement.
21923 (Event.EventBuilder): New member.
21925 * class.cs (TypeContainer::Populate): Update to define all enums and events
21927 (Events): New property for the events arraylist we hold. Shouldn't we move to using
21928 readonly fields for all these cases ?
21930 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
21932 * class.cs (Property): Revamp to use the convention of making fields readonly.
21933 Accordingly modify code elsewhere.
21935 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21936 the Define method of the Property class.
21938 * class.cs : Clean up applied patch and update references to variables etc. Fix
21940 (TypeContainer::Populate): Update to define all the properties we have. Also
21941 define all enumerations.
21943 * enum.cs (Define): Implement.
21945 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
21947 * cs-parser.jay (overloadable_operator): The semantic value is an
21948 enum of the Operator class.
21949 (operator_declarator): Implement actions.
21950 (operator_declaration): Implement.
21952 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21953 validity of definitions.
21954 (Operator::CheckBinaryOperator): Static method to check for binary operators
21955 (TypeContainer::AddOperator): New method to add an operator to a type.
21957 * cs-parser.jay (indexer_declaration): Added line to actually call the
21958 AddIndexer method so it gets added ;-)
21960 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
21961 already taken care of by the MS compiler ?
21963 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
21965 * class.cs (Operator): New class for operator declarations.
21966 (Operator::OpType): Enum for the various operators.
21968 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
21970 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21971 ostensibly handle this in semantic analysis.
21973 * cs-parser.jay (general_catch_clause): Comment out
21974 (specific_catch_clauses, specific_catch_clause): Ditto.
21975 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21976 (catch_args, opt_catch_args): New productions.
21977 (catch_clause): Rewrite to use the new productions above
21978 (catch_clauses): Modify accordingly.
21979 (opt_catch_clauses): New production to use in try_statement
21980 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21981 and re-write the code in the actions to extract the specific and
21982 general catch clauses by being a little smart ;-)
21984 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21985 Hooray, try and catch statements parse fine !
21987 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
21989 * statement.cs (Block::GetVariableType): Fix logic to extract the type
21990 string from the hashtable of variables.
21992 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21993 I end up making that mistake ;-)
21994 (catch_clauses): Fixed gross error which made Key and Value of the
21995 DictionaryEntry the same : $1 !!
21997 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
21999 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22001 * cs-parser.jay (event_declaration): Correct to remove the semicolon
22002 when the add and remove accessors are specified.
22004 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22006 * cs-parser.jay (IndexerDeclaration): New helper class to hold
22007 information about indexer_declarator.
22008 (indexer_declarator): Implement actions.
22009 (parsing_indexer): New local boolean used to keep track of whether
22010 we are parsing indexers or properties. This is necessary because
22011 implicit_parameters come into picture even for the get accessor in the
22012 case of an indexer.
22013 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22015 * class.cs (Indexer): New class for indexer declarations.
22016 (TypeContainer::AddIndexer): New method to add an indexer to a type.
22017 (TypeContainer::indexers): New member to hold list of indexers for the
22020 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22022 * cs-parser.jay (add_accessor_declaration): Implement action.
22023 (remove_accessor_declaration): Implement action.
22024 (event_accessors_declaration): Implement
22025 (variable_declarators): swap statements for first rule - trivial.
22027 * class.cs (Event): New class to hold information about event
22029 (TypeContainer::AddEvent): New method to add an event to a type
22030 (TypeContainer::events): New member to hold list of events.
22032 * cs-parser.jay (event_declaration): Implement actions.
22034 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22036 * cs-parser.jay (dim_separators): Implement. Make it a string
22037 concatenating all the commas together, just as they appear.
22038 (opt_dim_separators): Modify accordingly
22039 (rank_specifiers): Update accordingly. Basically do the same
22040 thing - instead, collect the brackets here.
22041 (opt_rank_sepcifiers): Modify accordingly.
22042 (array_type): Modify to actually return the complete type string
22043 instead of ignoring the rank_specifiers.
22044 (expression_list): Implement to collect the expressions
22045 (variable_initializer): Implement. We make it a list of expressions
22046 essentially so that we can handle the array_initializer case neatly too.
22047 (variable_initializer_list): Implement.
22048 (array_initializer): Make it a list of variable_initializers
22049 (opt_array_initializer): Modify accordingly.
22051 * expression.cs (New::NType): Add enumeration to help us
22052 keep track of whether we have an object/delegate creation
22053 or an array creation.
22054 (New:NewType, New::Rank, New::Indices, New::Initializers): New
22055 members to hold data about array creation.
22056 (New:New): Modify to update NewType
22057 (New:New): New Overloaded contructor for the array creation
22060 * cs-parser.jay (array_creation_expression): Implement to call
22061 the overloaded New constructor.
22063 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
22065 * class.cs (TypeContainer::Constructors): Return member
22066 constructors instead of returning null.
22068 2001-08-26 Miguel de Icaza <miguel@ximian.com>
22070 * typemanager.cs (InitCoreTypes): Initialize the various core
22071 types after we have populated the type manager with the user
22072 defined types (this distinction will be important later while
22073 compiling corlib.dll)
22075 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22076 on Expression Classification. Now all expressions have a method
22077 `Resolve' and a method `Emit'.
22079 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22080 generation from working. Also add some temporary debugging
22083 2001-08-24 Miguel de Icaza <miguel@ximian.com>
22085 * codegen.cs: Lots of code generation pieces. This is only the
22086 beginning, will continue tomorrow with more touches of polish. We
22087 handle the fundamentals of if, while, do, for, return. Others are
22088 trickier and I need to start working on invocations soon.
22090 * gen-treedump.cs: Bug fix, use s.Increment here instead of
22093 * codegen.cs (EmitContext): New struct, used during code
22094 emission to keep a context. Most of the code generation will be
22097 * cs-parser.jay: Add embedded blocks to the list of statements of
22098 this block. So code generation proceeds in a top down fashion.
22100 2001-08-23 Miguel de Icaza <miguel@ximian.com>
22102 * statement.cs: Add support for multiple child blocks.
22104 2001-08-22 Miguel de Icaza <miguel@ximian.com>
22106 * codegen.cs (EmitCode): New function, will emit the code for a
22107 Block of code given a TypeContainer and its ILGenerator.
22109 * statement.cs (Block): Standard public readonly optimization.
22110 (Block::Block constructors): Link children.
22111 (Block::Child): Child Linker.
22112 (Block::EmitVariables): Emits IL variable declarations.
22114 * class.cs: Drop support for MethodGroups here, delay until
22116 (Method::): Applied the same simplification that I did before, and
22117 move from Properties to public readonly fields.
22118 (Method::ParameterTypes): Returns the parameter types for the
22119 function, and implements a cache that will be useful later when I
22120 do error checking and the semantic analysis on the methods is
22122 (Constructor::GetCallingConvention): Renamed from CallingConvetion
22123 and made a method, optional argument tells whether this is a class
22124 or a structure to apply the `has-this' bit.
22125 (Method::GetCallingConvention): Implement, returns the calling
22127 (Method::Define): Defines the type, a second pass is performed
22128 later to populate the methods.
22130 (Constructor::ParameterTypes): implement a cache similar to the
22131 one on Method::ParameterTypes, useful later when we do semantic
22134 (TypeContainer::EmitMethod): New method. Emits methods.
22136 * expression.cs: Removed MethodGroup class from here.
22138 * parameter.cs (Parameters::GetCallingConvention): new method.
22140 2001-08-21 Miguel de Icaza <miguel@ximian.com>
22142 * class.cs (TypeContainer::Populate): Drop RootContext from the
22145 (Constructor::CallingConvention): Returns the calling convention.
22146 (Constructor::ParameterTypes): Returns the constructor parameter
22149 (TypeContainer::AddConstructor): Keep track of default constructor
22150 and the default static constructor.
22152 (Constructor::) Another class that starts using `public readonly'
22153 instead of properties.
22155 (Constructor::IsDefault): Whether this is a default constructor.
22157 (Field::) use readonly public fields instead of properties also.
22159 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
22160 track of static constructors; If none is used, turn on
22161 BeforeFieldInit in the TypeAttributes.
22163 * cs-parser.jay (opt_argument_list): now the return can be null
22164 for the cases where there are no arguments.
22166 (constructor_declarator): If there is no implicit `base' or
22167 `this', then invoke the default parent constructor.
22169 * modifiers.cs (MethodAttr): New static function maps a set of
22170 modifiers flags into a MethodAttributes enum
22171 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
22172 MethodAttr, TypeAttr to represent the various mappings where the
22173 modifiers are used.
22174 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
22176 2001-08-19 Miguel de Icaza <miguel@ximian.com>
22178 * parameter.cs (GetParameterInfo): Fix bug where there would be no
22181 * interface.cs (PopulateIndexer): Implemented the code generator
22182 for interface indexers.
22184 2001-08-17 Miguel de Icaza <miguel@ximian.com>
22186 * interface.cs (InterfaceMemberBase): Now we track the new status
22189 (PopulateProperty): Implement property population. Woohoo! Got
22190 Methods and Properties going today.
22192 Removed all the properties for interfaces, and replaced them with
22193 `public readonly' fields.
22195 2001-08-16 Miguel de Icaza <miguel@ximian.com>
22197 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
22198 initialize their hashtables/arraylists only when they are needed
22199 instead of doing this always.
22201 * parameter.cs: Handle refs and out parameters.
22203 * cs-parser.jay: Use an ArrayList to construct the arguments
22204 instead of the ParameterCollection, and then cast that to a
22207 * parameter.cs: Drop the use of ParameterCollection and use
22208 instead arrays of Parameters.
22210 (GetParameterInfo): Use the Type, not the Name when resolving
22213 2001-08-13 Miguel de Icaza <miguel@ximian.com>
22215 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
22216 and instead use public readonly fields.
22218 * class.cs: Put back walking code for type containers.
22220 2001-08-11 Miguel de Icaza <miguel@ximian.com>
22222 * class.cs (MakeConstant): Code to define constants.
22224 * rootcontext.cs (LookupType): New function. Used to locate types
22227 2001-08-08 Miguel de Icaza <miguel@ximian.com>
22229 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
22230 this System.Reflection code is. Kudos to Microsoft
22232 * typemanager.cs: Implement a type cache and avoid loading all
22233 types at boot time. Wrap in LookupType the internals. This made
22234 the compiler so much faster. Wow. I rule!
22236 * driver.cs: Make sure we always load mscorlib first (for
22237 debugging purposes, nothing really important).
22239 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
22240 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
22242 * rootcontext.cs: Lookup types on their namespace; Lookup types
22243 on namespaces that have been imported using the `using' keyword.
22245 * class.cs (TypeContainer::TypeAttr): Virtualize.
22246 (Class::TypeAttr): Return attributes suitable for this bad boy.
22247 (Struct::TypeAttr): ditto.
22248 Handle nested classes.
22249 (TypeContainer::) Remove all the type visiting code, it is now
22250 replaced with the rootcontext.cs code
22252 * rootcontext.cs (GetClassBases): Added support for structs.
22254 2001-08-06 Miguel de Icaza <miguel@ximian.com>
22256 * interface.cs, statement.cs, class.cs, parameter.cs,
22257 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22258 Drop use of TypeRefs, and use strings instead.
22260 2001-08-04 Miguel de Icaza <miguel@ximian.com>
22264 * class.cs (Struct::Struct): set the SEALED flags after
22265 checking the modifiers.
22266 (TypeContainer::TypeAttr): new property, returns the
22267 TypeAttributes for a class.
22269 * cs-parser.jay (type_list): Oops, list production was creating a
22270 new list of base types.
22272 * rootcontext.cs (StdLib): New property.
22273 (GetInterfaceTypeByName): returns an interface by type name, and
22274 encapsulates error handling here.
22275 (GetInterfaces): simplified.
22276 (ResolveTree): Encapsulated all the tree resolution here.
22277 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22280 * driver.cs: Add support for --nostdlib, to avoid loading the
22281 default assemblies.
22282 (Main): Do not put tree resolution here.
22284 * rootcontext.cs: Beginning of the class resolution.
22286 2001-08-03 Miguel de Icaza <miguel@ximian.com>
22288 * rootcontext.cs: Provide better error reporting.
22290 * cs-parser.jay (interface_base): set our $$ to be interfaces.
22292 * rootcontext.cs (CreateInterface): Handle the case where there
22293 are no parent interfaces.
22295 (CloseTypes): Routine to flush types at the end.
22296 (CreateInterface): Track types.
22297 (GetInterfaces): Returns an array of Types from the list of
22298 defined interfaces.
22300 * typemanager.c (AddUserType): Mechanism to track user types (puts
22301 the type on the global type hash, and allows us to close it at the
22304 2001-08-02 Miguel de Icaza <miguel@ximian.com>
22306 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22307 RecordInterface instead.
22309 * cs-parser.jay: Updated to reflect changes above.
22311 * decl.cs (Definition): Keep track of the TypeBuilder type that
22312 represents this type here. Not sure we will use it in the long
22313 run, but wont hurt for now.
22315 * driver.cs: Smaller changes to accomodate the new code.
22317 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22320 * rootcontext.cs (CreateInterface): New method, used to create
22321 the System.TypeBuilder type for interfaces.
22322 (ResolveInterfaces): new entry point to resolve the interface
22324 (CodeGen): Property, used to keep track of the code generator.
22326 2001-07-26 Miguel de Icaza <miguel@ximian.com>
22328 * cs-parser.jay: Add a second production for delegate_declaration
22331 (enum_body): Put an opt_comma here instead of putting it on
22332 enum_body or enum_member_declarations so we can handle trailing
22333 commas on enumeration members. Gets rid of a shift/reduce.
22335 (type_list): Need a COMMA in the middle.
22337 (indexer_declaration): Tell tokenizer to recognize get/set
22339 * Remove old targets.
22341 * Re-add the parser target.
22343 2001-07-13 Simon Cozens <simon@simon-cozens.org>
22345 * cs-parser.jay: Add precendence rules for a number of operators
22346 ot reduce the number of shift/reduce conflicts in the grammar.
22348 2001-07-17 Miguel de Icaza <miguel@ximian.com>
22350 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22353 Get rid of old crufty code.
22355 * rootcontext.cs: Use this to keep track of the parsed
22356 representation and the defined types available to the program.
22358 * gen-treedump.cs: adjust for new convention.
22360 * type.cs: Split out the type manager, and the assembly builder
22363 * typemanager.cs: the type manager will live here now.
22365 * cil-codegen.cs: And the code generator here.
22367 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
22369 * makefile: Fixed up for easy making.
22371 2001-07-13 Simon Cozens <simon@simon-cozens.org>
22373 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22376 (unary_expression): Expand pre_increment_expression and
22377 post_decrement_expression to reduce a shift/reduce.
22379 2001-07-11 Simon Cozens
22381 * cs-tokenizer.cs: Hex numbers should begin with a 0.
22383 Improve allow_keyword_as_indent name.
22385 2001-06-19 Miguel de Icaza <miguel@ximian.com>
22387 * Adjustments for Beta2.
22389 2001-06-13 Miguel de Icaza <miguel@ximian.com>
22391 * decl.cs: Added `Define' abstract method.
22392 (InTransit): new property, used to catch recursive definitions.
22394 * interface.cs: Implement `Define'.
22396 * modifiers.cs: Map Modifiers.constants to
22397 System.Reflection.TypeAttribute flags.
22399 * class.cs: Keep track of types and user-defined types.
22400 (BuilderInit): New method for creating an assembly
22401 (ResolveType): New function to launch the resolution process, only
22402 used by interfaces for now.
22404 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22405 that are inserted into the name space.
22407 2001-06-08 Miguel de Icaza <miguel@ximian.com>
22409 * ARGH. I have screwed up my tree so many times due to the use of
22410 rsync rather than using CVS. Going to fix this at once.
22412 * driver.cs: Objetify driver. Load assemblies, use assemblies to
22415 2001-06-07 Miguel de Icaza <miguel@ximian.com>
22417 * Experiment successful: Use System.Type rather that our own
22420 2001-05-25 Miguel de Icaza <miguel@ximian.com>
22422 * cs-parser.jay: Removed nsAliases from here.
22424 Use new namespaces, handle `using XXX;'
22426 * namespace.cs: Reimplemented namespace handling, use a recursive
22427 definition of the class. Now we can keep track of using clauses
22428 and catch invalid using clauses.
22430 2001-05-24 Miguel de Icaza <miguel@ximian.com>
22432 * gen-treedump.cs: Adapted for all the renaming.
22434 * expression.cs (Expression): this class now has a Type property
22435 which returns an expression Type.
22437 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22438 `Type', as this has a different meaning now in the base
22440 2001-05-22 Miguel de Icaza <miguel@ximian.com>
22442 * interface.cs, class.cs: Removed from all the sources the
22443 references to signature computation, as we can not do method
22444 signature computation during the parsing time, as we are not
22445 trying to solve at that point distinguishing:
22449 void a (NS.Blah x) {}
22452 Which depending on the context might be valid or not, as we do not
22453 know if Blah is the same thing as NS.Blah at that point.
22455 * Redid everything so the code uses TypeRefs now instead of
22456 Types. TypeRefs are just temporary type placeholders, that need
22457 to be resolved. They initially have a pointer to a string and the
22458 current scope in which they are used. This is used later by the
22459 compiler to resolve the reference to an actual Type.
22461 * DeclSpace is no longer a CIR.Type, and neither are
22462 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
22463 are all DeclSpaces, but no Types.
22465 * type.cs (TypeRefManager): This implements the TypeRef manager,
22466 which keeps track of all the types that need to be resolved after
22467 the parsing has finished.
22469 2001-05-13 Miguel de Icaza <miguel@ximian.com>
22471 * ARGH. We are going to have to store `foreach' as a class rather
22472 than resolving it, as we need to verify error 1579 after name
22473 resolution. *OR* we could keep a flag that says `This request to
22474 IEnumerator comes from a foreach statement' which we can then use
22475 to generate the error.
22477 2001-05-10 Miguel de Icaza <miguel@ximian.com>
22479 * class.cs (TypeContainer.AddMethod): we now add methods to the
22480 MethodGroup instead of the method hashtable.
22482 * expression.cs: Add MethodGroup abstraction, which gets us one
22483 step closer to the specification in the way we handle method
22486 * cs-parser.jay (primary_expression): qualified_identifier now
22487 tried to match up an identifier to a local variable reference or
22488 to a parameter reference.
22490 current_local_parameters is now a parser global variable that
22491 points to the current parameters for the block, used during name
22494 (property_declaration): Now creates an implicit `value' argument to
22497 2001-05-09 Miguel de Icaza <miguel@ximian.com>
22499 * parameter.cs: Do not use `param' arguments as part of the
22500 signature, per the spec.
22502 2001-05-08 Miguel de Icaza <miguel@ximian.com>
22504 * decl.cs: Base class for classes, structs and interfaces. This
22505 is the "Declaration Space"
22507 * cs-parser.jay: Use CheckDef for checking declaration errors
22508 instead of having one on each function.
22510 * class.cs: Factor out some code for handling error handling in
22511 accordance to the "Declarations" section in the "Basic Concepts"
22512 chapter in the ECMA C# spec.
22514 * interface.cs: Make all interface member classes derive from
22515 InterfaceMemberBase.
22517 2001-05-07 Miguel de Icaza <miguel@ximian.com>
22519 * Many things: all interfaces are parsed and generated in
22520 gen-treedump. Support for member variables, constructors,
22521 destructors, properties, constants is there.
22523 Beginning of the IL backend, but very little done, just there for
22526 2001-04-29 Miguel de Icaza <miguel@ximian.com>
22528 * cs-parser.jay: Fix labeled statement.
22530 * cs-tokenizer.cs (escape): Escape " and ' always.
22531 ref_line, ref_name: keep track of the line/filename as instructed
22532 by #line by the compiler.
22535 2001-04-27 Miguel de Icaza <miguel@ximian.com>
22537 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22538 to match the values in System.CodeDOM.
22540 Divid renamed to Divide.
22542 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22544 (Statements.set): remove.
22546 * System.CodeDOM/CodeCatchClause.cs: always have a valid
22549 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22550 falseStatements always have valid values.
22552 * cs-parser.jay: Use System.CodeDOM now.