1 2005-08-03 Raja R Harinath <rharinath@novell.com>
3 First cut of the qualified-alias-member feature.
4 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
6 * cs-parser.jay (DOUBLE_COLON): New token.
7 (namespace_or_type_name): Add rule for recognizing
8 qualified-alias-members.
9 (primary_expression): Likewise.
10 (element_access): Allow QualifiedAliasMember as a possible
11 type-bearing expression.
12 (local_variable_type, local_variable_pointer_type): Likewise.
13 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
14 aliases in the current and enclosing namespace declarations.
15 (NamespaceEntry.UsingAlias): Add CS0440 warning.
16 * decl.cs (MemberName.is_double_colon): New.
17 (MemberName.MemberName): Add new constructor for alias-member.
18 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
19 * expression.cs (QualifiedAliasMember): New expression type.
21 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
23 * location.cs : it borked when no argument was specified.
25 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
27 * location.cs : tiny ToString() format fix.
29 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
31 * statement.cs : oops, it was missing.
33 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
35 A set of fixes for precise line/column location.
38 "token" field now holds a file/line "delta", a line number offset
39 from the segment, and a column number. See also:
40 http://lists.ximian.com/pipermail/mono-devel-list/2004-
42 Removed static IsNull. Use instance IsNull property instead.
44 For some tokens it stores Location. For Identifier it stores
45 LocatedToken which is a pair of string name and location.
46 Column numbers are adjusted only at getChar().
48 Use Location.ToString() for reporting (it now contains column).
50 Largely modified to use LocatedToken instead of
51 string (IDENTIFIER), and to acquire Location from some tokens.
52 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
53 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
55 Now MemberName holds Location. DeclSpace.ctor() receives Location
56 as a parameter. Removed extra parameters to all derived classes.
57 Replaced Location.IsNull() with instance property.
58 * assign.cs, expression.cs :
59 Added .ctor() overload that omits Location.
61 Added "nameEscaped" flag that indicates the identifier was escaped
62 in the source file. This fixes bug #57047.
64 2005-09-02 Martin Baulig <martin@ximian.com>
66 * class.cs: Make CS3005 a warning, not an error.
68 2005-08-02 Marek Safar <marek.safar@seznam.cz>
70 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
71 New method, looking for lo-case imported cls type.
73 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
76 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
78 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
80 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
82 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
84 Optimized to save 3.5 MB for SWF compilation.
86 2005-08-01 Marek Safar <marek.safar@seznam.cz>
88 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
89 (PartialContainer.Create): Moved logic AddToContainer.
90 (PartialContainer.MarkForDuplicationCheck): Shares name.
92 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
95 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
97 (Namespace.GetSignatureForError): New method.
99 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
100 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
102 2005-08-01 Raja R Harinath <rharinath@novell.com>
105 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
106 member lookup rather than qualifier_type, since qualifier_type can
109 2005-08-01 Marek Safar <marek.safar@seznam.cz>
111 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
114 2005-07-31 Miguel de Icaza <miguel@novell.com>
116 * statement.cs: Copy the local exception into the exception
117 captured local. Fixes 75674
119 2005-07-31 Raja R Harinath <harinath@gmail.com>
122 * expression.cs (Invocation.OverloadResolve): Don't report error
123 CS1501 if error CS1502 has been reported.
124 (New.DoResolve): Delegate CS1501 reporting to
125 Invocation.OverloadResolve.
128 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
129 invariant-meaning-in-block property in an enclosing block if
132 2005-07-29 Marek Safar <marek.safar@seznam.cz>
134 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
135 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
136 (Switch.CheckSwitch): Just save 50kb for SWF.
138 2005-07-27 Martin Baulig <martin@ximian.com>
140 * anonymous.cs (CaptureContext.AddField): Added
141 `AnonymousContainer am' argument; compute its toplevel scope if
142 it's not already computed. Fixes #75649.
144 2005-07-26 Raja R Harinath <rharinath@novell.com>
147 * class.cs (Constructor.Emit): Reset block to null if the block
150 2005-07-25 Marek Safar <marek.safar@seznam.cz>
152 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
154 2005-07-25 Marek Safar <marek.safar@seznam.cz>
156 * class.cs (MethodData.Define): Check whether accessor implementing
159 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
161 2005-07-22 Marek Safar <marek.safar@seznam.cz>
164 * namespace.cs (LookupType): Moved same type check to...
166 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
169 2005-07-21 Raja R Harinath <rharinath@novell.com>
171 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
172 already found a typebuilder.
173 * class.cs (MethodCore.IsDuplicateImplementation): Compare
174 MemberNames, not strings.
176 * const.cs (Error_ExpressionMustBeConst):
177 Rename from Error_EpressionMustBeConst.
178 * const.cs, class.cs, statement.cd: Update.
180 2005-07-21 Marek Safar <marek.safar@seznam.cz>
184 * const.cs (Const.LookupConstantValue): Report missing contant expression
186 (Error_EpressionMustBeConstant): Only one error method.
188 * class.cs, statement.c: Updated.
190 2005-07-20 Raja R Harinath <rharinath@novell.com>
192 * statement.cs (Block.Flags): Add back HasVarargs.
193 (Block.flags): Make protected.
194 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
196 * typemanager.cs (types, typecontainers, user_types): Remove.
197 (UserTypes, TypeContainers): Likewise.
198 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
199 (CleanUp, Reset): Update.
200 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
201 (GetNestedType): Use Type.GetNestedType.
202 (CoreLookupType): Take two arguments, the namespace and the
203 basename of the type. Update to use the Namespace.Lookup
205 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
206 (RealMemberLookup): Use IsNestedChildOf instead of playing with
207 string concatenation and substring matches.
208 * class.cs, enum.cs, delegate.cs: Update to changes.
210 2005-07-20 Marek Safar <marek.safar@seznam.cz>
212 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
213 Expression and made virtual.
215 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
216 (ImplicitStandardConversionExists): Fixed `byte' typo ?
218 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
220 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
223 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
226 2005-07-18 Marek Safar <marek.safar@seznam.cz>
229 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
230 AssemblyCultureAttribute is not used on executable.
233 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
235 2005-07-16 Raja R Harinath <rharinath@novell.com>
238 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
239 New. Reports CS0252/CS0253.
240 Mostly taken from preliminary patch by Duncak Mak.
241 (Binary.DoResolveOperator): Store results of operator lookup.
242 Use them to detect if we need to warn about unintended reference
245 2005-07-15 Raja R Harinath <rharinath@novell.com>
248 * namespace.cs (Namespace.Lookup): Add back location parameter.
249 (Namespace.LookupType): Add CS0436 report. Add location parameter.
250 * delegate.cs, ecore.cs, expression.cs: Update to changes.
252 * codegen.cs (EmitContext.DeclSpace): Make readonly.
253 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
254 (Namespace.LookupType): ... this.
255 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
257 * typemanager.cs (LookupTypeReflection): Remove buggy code that
258 purported to handle pointers.
259 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
262 2005-07-15 Marek Safar <marek.safar@seznam.cz>
264 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
267 2005-07-15 Raja R Harinath <rharinath@novell.com>
269 * namespace.cs (Namespace.Lookup): Drop location parameter.
270 (NamespaceEntry.LookupAlias): Remove. Merge into ...
271 (NamespaceEntry.Lookup): ... this.
272 (NamespaceEntry.Error_AmbiguousTypeReference):
273 Move here from DeclSpace.
274 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
276 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
277 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
278 Move to NamespaceEntry.
279 * delegate.cs, expression.cs: Update to changes.
281 2005-08-31 Martin Baulig <martin@ximian.com>
283 Committing a patch from Atsushi Enomoto for #75850.
285 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
286 Prefer a generic enumerator over a non-generic one.
288 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
290 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
291 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
293 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
295 * driver.cs : reverting default encoding change as well as mcs.
297 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
299 * driver.cs, support.cs : merged r48826.
301 > could you integrate your mcs changes to gmcs otherwise
302 > gmcs cannot compile some files.
304 2005-08-20 Martin Baulig <martin@ximian.com>
306 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
307 scope if we don't already have it.
309 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
310 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
313 2005-07-31 Miguel de Icaza <miguel@novell.com>
315 * statement.cs: Copy the local exception into the exception
316 captured local. Fixes 75674
318 2005-07-15 Marek Safar <marek.safar@seznam.cz>
320 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
323 2005-08-12 Martin Baulig <martin@ximian.com>
325 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
326 for nested types here to avoid hitting the cache too early.
328 2005-08-09 Miguel de Icaza <miguel@novell.com>
330 * enum.cs: On the new compiler CLS error 3005 is now a warning not
333 2005-08-03 Martin Baulig <martin@ximian.com>
335 Make iterators in generic methods work; see gtest-191.cs.
338 (Constraints.Resolve): Protect against being called twice.
341 (TypeContainer.GetClassBases): Make this `protected virtual'.
343 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
344 (Iterator.GetClassBases): Override this and compute the base
346 (Iterator.DefineNestedTypes): If we're a generic method, all our
347 method type parameters become class type parameters on the proxy
351 (ToplevelBlock.Parameters): Make this a property, not a field.
352 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
354 2005-08-03 Martin Baulig <martin@ximian.com>
356 * typemanager.cs (TypeManager.IsSubclassOf): Use
357 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
358 (TypeManager.GetFullName_recursed): Improved.
360 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
363 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
364 Private accessor case, using TypeManager.IsPrivateAccessible instead of
365 invocation_type == mi.DeclaringType, since the first one also checks
366 other condition used by generic instances.
368 2005-07-27 Martin Baulig <martin@ximian.com>
370 * anonymous.cs (CaptureContext.AddField): Added
371 `AnonymousContainer am' argument; compute its toplevel scope if
372 it's not already computed. Fixes #75649.
374 2005-07-14 Marek Safar <marek.safar@seznam.cz>
376 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
377 CheckAttributeType and refactored.
378 (Attribute.ResolvePossibleAttributeType): Changed to reuse
379 ResolveAsTypeTerminal error handling.
380 (ResolveAsTypeTerminal): Introduced because of global attributes extra
382 (GetSignatureForError): Print errors in same way.
385 * codegen.cs: Reflect attribute GetSignatureForError change.
388 * expression.cs: Add silent parameter to ResolveAsTypeStep.
390 * namespace.cs (UsingEntry): Refactored to make fields private.
393 statement.cs: Error_UnexpectedKind has extra parameter.
395 2005-07-14 Raja R Harinath <rharinath@novell.com>
397 * ecore.cs (IAlias): Remove.
398 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
399 that implement the interface.
400 * namespace.cs (Namespace): Likewise.
401 (Namespace.declspaces): Renamed from 'defined_names'.
402 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
403 DeclSpace instead of an IAlias.
404 * tree.cs (Tree.AddDecl): Update.
406 2005-07-12 Raja R Harinath <rharinath@novell.com>
408 * statement.cs (Block.Flags); Remove HasVarargs.
409 (Block.HasVarargs): Move to ToplevelBlock.
410 (Block.ThisVariable, Block.AddThisVariable): Likewise.
411 (Block.Variables): Make protected. Initialize variable hashtable
413 (Block.AddVariable): Update.
414 (Block.Resolve): Update to changes.
415 (ToplevelBlock.HasVarargs): New boolean.
416 (ToplevelBlock.ThisVariable): Move here from Block.
417 (ToplevelBlock.AddThisVariable): Likewise.
418 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
419 * expression.cs (This.ResolveBase): Update to changes.
420 (ArglistAccess.DoResolve): Likewise.
422 2005-07-11 Marek Safar <marek.safar@seznam.cz>
425 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
427 * class.cs (TypeContainer.VerifyMembers): Distinguish between
428 not used and not used & assigned.
429 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
431 2005-07-11 Marek Safar <marek.safar@seznam.cz>
434 * expression.cs (Is.DoResolve): null is never provided type.
436 2005-07-08 Marek Safar <marek.safar@seznam.cz>
439 * cs-parser.jay: Less strict event error rule to catch more errors.
441 2005-07-11 Martin Baulig <martin@ximian.com>
443 * generic.cs (ConstructedType.CheckConstraints): Improve the check
444 for the constructor constraint: we do not only have to check
445 whether the class has a public constructor, but also ensure that
446 it's parameterless. Fixes #75492.
448 2005-07-11 Martin Baulig <martin@ximian.com>
450 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
451 between type parameters if they either have the reference type
452 constraint or the class constraint.
454 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
456 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
458 2005-07-07 Marek Safar <marek.safar@seznam.cz>
461 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
462 (ExtractSecurityPermissionSet): Cope with self referencing security
465 * driver.cs (SetOutputFile): Made public property OutputFile.
467 2005-07-07 Raja R Harinath <rharinath@novell.com>
470 * class.cs (TypeContainer.first_nonstatic_field): Rename from
471 has_nonstatic_fields. Make into a FieldBase pointer.
472 (TypeContainer.AddField): Add CS0282 check.
473 (TypeContainer.EmitType): Update.
475 2005-07-06 Miguel de Icaza <miguel@novell.com>
477 * cs-tokenizer.cs (consume_identifier): Do not create strings to
478 compare if they start with __.
480 2005-07-06 Raja R Harinath <rharinath@novell.com>
482 * statement.cs (Switch.SwitchGoverningType): Only look at
483 UserCasts that don't need implicit standard conversions to one of
484 the allowed switch types (Fixes test-322.cs).
485 (LocalInfo.Resolve): Re-enable sanity-test.
487 2005-07-06 Marek Safar <marek.safar@seznam.cz>
489 * cs-tokenizer.cs (consume_identifier): Detect double undescores
491 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
493 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
495 2005-07-06 Raja R Harinath <rharinath@novell.com>
498 * ecore.cs (SimpleName.GetSignatureForError): Add.
499 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
500 (MemberAccess.GetSignatureForError): Add.
502 2005-07-05 Marek Safar <marek.safar@seznam.cz>
504 The big error and warning messages review.
534 * typemanager.cs: Updated.
536 * class.cs: (MethodCore.SetYields): Moved here to share.
537 (PropertyMethod.Define): Moved iterator setup here.
539 * iterators.cs: Add orig_method to have full access to parent
542 2005-07-05 Raja R Harinath <rharinath@novell.com>
544 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
545 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
546 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
547 variable of struct type.
548 * expression.cs (Unary.ResolveOperator): Update to change.
549 (Indirection.VerifyFixed): Likewise.
550 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
551 (ParameterReference.VerifyFixed): Value parameters are fixed.
552 (This.VerifyFixed): Treat 'this' as a value parameter.
553 * statement.cs (LocalInfo.IsFixed): Remove.
555 2005-07-01 Martin Baulig <martin@ximian.com>
557 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
558 `ec.EmitThis ()' to get the correct scope.
560 2005-07-01 Martin Baulig <martin@ximian.com>
562 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
563 instance is a ParameterReference; fixes #75299.
565 2005-06-30 Raja R Harinath <rharinath@novell.com>
568 * expression.cs (Indexers.map): Remove.
569 (Indexers.Append): Filter out inaccessible setters and getters.
570 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
573 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
575 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
576 (FieldExpr.Emit, PropertyExpr.Emit): Update.
577 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
578 * expression.cs (Invocation.EmitCall): Add CS0120 check.
580 2005-06-30 Marek Safar <marek.safar@seznam.cz>
583 * class.cs (FieldBase.GetInitializerExpression): One more field
586 2005-06-28 Miguel de Icaza <miguel@novell.com>
588 * pending.cs: Do not define a proxy if the base method is virtual,
589 it will be picked up by the runtime (bug 75270).
591 2005-07-08 Martin Baulig <martin@ximian.com>
593 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
594 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
596 2005-07-07 Martin Baulig <martin@ximian.com>
598 * generic.cs (ConstructedType.CheckConstraint): Use
599 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
600 called recursively; fixes #75329.
602 2005-07-06 Martin Baulig <martin@ximian.com>
604 * generic.cs (TypeManager.InferTypeArguments): Added support for
605 anonymous methods; fixes #75461.
607 2005-07-01 Martin Baulig <martin@ximian.com>
609 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
610 `ec.EmitThis ()' to get the correct scope.
612 2005-07-01 Martin Baulig <martin@ximian.com>
614 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
615 instance is `This'; fixes #75299.
617 2005-06-30 Martin Baulig <martin@ximian.com>
619 * class.cs (Indexer): Implement IIteratorContainer; added support
620 for iterators in indexers.
623 (EmitContext.CurrentIterator): Make this a property, not a field.
625 * anonymous.cs (AnonymousContainer.Iterator): New public property.
627 2005-06-28 Miguel de Icaza <miguel@novell.com>
629 * pending.cs: Do not define a proxy if the base method is virtual,
630 it will be picked up by the runtime (bug 75270).
632 2005-06-28 Martin Baulig <martin@ximian.com>
634 * cs-parser.jay (interface_method_declaration): Avoid a
635 reduce/reduce conflict by moving some of the code into a separate
636 `interface_method_declaration_body' rule; fixes #75368.
638 2005-06-28 Martin Baulig <martin@ximian.com>
640 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
641 array check after the check for TypeBuilder's.
643 2005-06-21 Raja R Harinath <rharinath@novell.com>
645 * convert.cs (FindMostEncompassedType): Add two trivial special
646 cases (number_of_types == 0 || number_of_types == 1).
647 (FindMostEncompasingType): Likewise.
649 2005-06-17 Raja R Harinath <rharinath@novell.com>
651 Some cleanups preparing for the fix of #75283.
652 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
654 (EventExpr.InstanceResolve): Likewise.
655 (EventExpr.DoResolve): Remove redundant checks.
657 2005-06-08 Miguel de Icaza <miguel@novell.com>
659 * class.cs: Small fix.
661 2005-06-08 Raja R Harinath <rharinath@novell.com>
664 * class.cs (GetPartialBases): Fix return value check of
667 2005-06-07 Raja R Harinath <rharinath@novell.com>
669 Ensure that partial classes are registered in their enclosing
670 namespace. Initial part of fix of #75160.
671 * tree.cs (Tree.RecordDecl): Add new namespace argument.
672 Register declspace with namespace here, not in
673 DeclSpace.RecordDecl.
674 * cs-parser.jay: Pass namespace to RecordDecl.
675 * class.cs (PartialContainer.Create): Likewise.
676 (ClassPart.DefineType): New sanity-check. Throws an exception if
678 * decl.cs (Declspace.RecordDecl): Remove.
679 * namespace.cs (NamespaceEntry.DefineName): Remove.
681 2005-06-06 Marek Safar <marek.safar@seznam.cz>
683 * rootcontext.cs: Reset TargetExt as well.
685 2005-06-03 Raja R Harinath <rharinath@novell.com>
687 * ecore.cs (Expression.Resolve): Emit CS0654 error when
690 2005-06-02 Raja R Harinath <rharinath@novell.com>
692 Fix #75080, cs0119.cs.
693 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
695 (Expression.Resolve): ... this. Use it. Remove bogus code
696 allowing ExprClass.Type and ExprClass.Namespace for
697 ResolveFlags.VariableOrValue.
698 (Expression.Resolve) [1-argument variant]: Change default resolve
699 flags based on language version.
700 (Expression.Error_UnexpectedKind): Use a simple string array
701 rather than an ArrayList.
702 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
704 (TypeOfVoid.DoResolve): Likewise.
705 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
706 flags argument -- it always has the same value.
708 2005-05-31 Raja R Harinath <rharinath@novell.com>
711 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
712 Use it in the error message.
713 * assign.cs, expression.cs, statement.cs: Update.
715 2005-05-30 Raja R Harinath <rharinath@novell.com>
718 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
719 the "almostMatchedMember" case too.
720 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
721 that failed the accessibility checks to 'almost_match'.
723 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
725 * attribute.cs: Use internal MethodBuilder methods to set
726 ExactSpelling and SetLastError on PInvoke methods, instead
727 of passing them via charset. Fixes #75060.
729 2005-05-27 Raja R Harinath <rharinath@novell.com>
731 * parameter.cs (Parameter): Remove TODO comment.
732 (Parameter.DefineParameter): Remove Location parameter.
733 (Parameters.LabelParameters): Likewise.
734 * class.cs (Constructor.Emit): Update to change.
735 (MethodData.Emit): Likewise.
736 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
737 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
739 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
742 Removed Parameters.Location and added Parameter.Location instead.
743 Removed Location parameter from Emit() and GetSignature().
750 Modified all related calls.
752 2005-06-21 Martin Baulig <martin@ximian.com>
754 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
755 left-hand side is not a nullable type; fixes #75328.
757 2005-06-21 Martin Baulig <martin@ximian.com>
760 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
761 (TypeManager.GetFullNameSignature): Likewise.
763 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
764 `source.FullName' and `target.FullName' to check whether there are
765 two conflicting definitions.
767 2005-06-21 Martin Baulig <martin@ximian.com>
769 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
770 a BoxedCast - also for reference types - to be compatible with csc.
772 2005-06-21 Martin Baulig <martin@ximian.com>
774 * expression.cs (MemberAccess.DoResolve): Add support for nested
775 types in a generic instance; fixes #75320.
777 2005-06-20 Martin Baulig <martin@ximian.com>
779 * generic.cs (TypeManager.InferType): Also walk the class
780 hierarchy for generic instances; fixes #75261.
782 2005-06-17 Martin Baulig <martin@ximian.com>
784 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
785 to make things work for corlib.
787 2005-06-15 Martin Baulig <martin@ximian.com>
789 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
790 obsolete `SecurityAction' values.
792 2005-06-06 Marek Safar <marek.safar@seznam.cz>
794 * rootcontext.cs: Reset TargetExt as well.
796 2005-06-09 Martin Baulig <martin@ximian.com>
798 * delegate.cs (Delegate.VerifyMethod): Added
799 `MethodGroupExpr old_mg' argument; inherit its
800 `HasTypeParameters'; fix #75085.
802 2005-06-09 Martin Baulig <martin@ximian.com>
804 * expression.cs (Invocation.OverloadResolve): Correctly handle
805 generic methods for the SetMemberIsUsed(); fix #75064.
807 2005-06-09 Martin Baulig <martin@ximian.com>
809 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
812 2005-06-08 Martin Baulig <martin@ximian.com>
814 * cs-parser.jay (nullable_type_or_conditional): If we put the
815 nullable back and our `type' is a `ComposedCast', remove the
816 nullable from it. Fixes #75156.
818 * expression.cs (ComposedCast.RemoveNullable): New public method.
820 2005-06-08 Martin Baulig <martin@ximian.com>
822 The big Iterators rewrite :-)
824 * iterators.cs: Rewrite this to use the anonymous methods framework.
826 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
827 before the TypeContainers; see 2test-21.cs.
830 (TypeContainer.DefineType): Don't create a new EmitContext if we
831 already have one (this only happens if we're an Iterator).
832 (TypeContainer.Define): Also call Define() on all our iterators.
833 (Method.CreateEmitContext): Added support for iterators.
836 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
837 (AnonymousContainer.CreateMethodHost): Moved here from
838 AnonymousMethod and made abstract.
839 (AnonymousContainer.CreateScopeType): New abstract method.
840 (AnonymousContainer.IsIterator): New public property.
841 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
842 get the ScopeTypeBuilder rather than manually defining it here.
843 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
846 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
847 before RootContext.DefineTypes().
849 * codegen.cs (EmitContext.RemapToProxy): Removed.
850 (EmitContext.CurrentAnonymousMethod): Changed type from
851 AnonymousMethod -> AnonymousContainer.
852 (EmitContext.ResolveTopBlock): Protect from being called twice.
853 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
854 (EmitContext.EmitThis): Removed the iterators hacks; use the
855 anonymous methods framework for that.
858 (ToplevelBlock.Container): Make this a property, not a field.
859 (ToplevelBlock.ReParent): New public method; move the
860 ToplevelBlock into a new container.
861 (Foreach.TemporaryVariable): Simplify.
863 2005-06-05 Martin Baulig <martin@ximian.com>
865 * statement.cs (LocalInfo.CompilerGenerated): New flag.
866 (Block.AddTemporaryVariable): New public method; creates a new
867 `LocalInfo' for a temporary variable.
868 (Block.EmitMeta): Create the LocalBuilders for all the temporary
870 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
871 non-iterator variables.
873 2005-06-05 Martin Baulig <martin@ximian.com>
875 * statement.cs (Foreach.TemporaryVariable): Create the
876 LocalBuilder in the Emit phase and not in Resolve since in some
877 situations, we don't have an ILGenerator during Resolve; see
878 2test-19.cs for an example.
880 2005-06-04 Martin Baulig <martin@ximian.com>
882 The big Foreach rewrite - Part II.
884 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
885 with `PropertyInfo ienumerator_getcurrent'.
887 * codegen.cs (VariableStorage): Removed.
890 (Foreach): Derive from Statement, not ExceptionStatement.
891 (Foreach.CollectionForeach): New nested class. Moved all the code
892 dealing with collection foreach here.
893 (Foreach.ForeachHelperMethods): Removed.
894 (Foreach.TemporaryVariable): Implement IMemoryLocation.
896 2005-05-23 Martin Baulig <martin@ximian.com>
898 * statement.cs (Try.DoResolve): Don't create a `finally' if we
899 don't need to. Fix #75014.
901 2005-05-26 Raja R Harinath <rharinath@novell.com>
903 Improve user-defined conversion handling.
904 * convert.cs (GetConversionOperators): Rewrite. Return only the
905 applicable operators.
906 (AddConversionOperators): New. Helper for GetConversionOperators.
907 (FindMostEncompassedType, FindMostEncompassingType): Verify that
908 there is only one most encompassed/encompassing type.
909 (FindMostSpecificSource, FindMostSpecificTarget): Remove
910 "applicable operator" handling.
911 (UserConversion): Move cache here from GetConversionOperators.
912 Directly cache the chosen operator, rather than the whole
914 (ExplicitNumericConversion): Fix buggy implementation of Decimal
915 case. Allow conversion of decimal to sbyte and byte too.
916 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
917 New static methods. Used to avoid allocating EmptyExpressions in
920 2005-05-24 Duncan Mak <duncan@novell.com>
922 * ecore.cs (CastFromDecimal): New class for casting a decimal to
923 another class, used in Convert.ExplicitNumericConversion.
924 (CastToDecimal): New class, similar to above, but casts to
925 System.Decimal, used in Convert.ImplicitNumericConversion and also
926 in explicit convesion from double/float to decimal.
928 * convert.cs (ImplicitNumericConversion): Handle implicit
929 conversions to System.Decimal.
930 (ExplicitNumericConversion): handle explicit conversions to
935 2005-05-20 Miguel de Icaza <miguel@novell.com>
937 * typemanager.cs: Do not throw an exception in the TypeBuilder
938 case, we take care of it on the TypeCode.
940 2005-05-17 Marek Safar <marek.safar@seznam.cz>
942 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
945 * cs-parser.jay: Catch more lexical errors.
947 * report.cs: Add one more Error method.
950 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
952 2005-05-20 Martin Baulig <martin@ximian.com>
954 * class.cs (TypeContainer.CircularDepException): Removed.
955 (TypeContainer.DefineType): Removed the `InTransit' stuff.
956 (TypeContainer.CheckRecursiveDefinition): Check for circular class
957 (CS0146) and interface (CS0529) dependencies here.
959 2005-05-20 Martin Baulig <martin@ximian.com>
961 * expression.cs (New.DoResolve): Move the CS0712 check above the
962 CS0144 check; otherwise it can never be reached.
964 2005-05-20 Martin Baulig <martin@ximian.com>
966 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
968 2005-05-20 Martin Baulig <martin@ximian.com>
970 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
972 * typemanager.cs (TypeManager.IsAttributeType): New public method.
974 2005-05-19 Martin Baulig <martin@ximian.com>
977 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
978 to disable error reporting.
980 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
981 here since we don't want to report an error; see the new test-336.cs.
983 2005-05-19 Raja R Harinath <rharinath@novell.com>
985 * statement.cs (ToplevelBlock.GetParameterReference)
986 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
987 Move here from class Block.
988 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
989 * expression.cs (ParameterReference.DoResolveBase): Likewise.
991 2005-05-18 Martin Baulig <martin@ximian.com>
996 (FlowBranching.Reachability): Add non-static public And() and Or()
998 (FlowBranchingSwitch): New class; do the `break_origins' thing
999 like in FlowBranchingLoop.
1000 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1001 reachability, not just locals and parameters.
1002 (FlowBranching.MergeChild): Remove some of the hacks for loop and
1003 switch; MergeBreakOrigins() now takes care of that.
1005 2005-05-18 Martin Baulig <martin@ximian.com>
1007 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1008 a loop and may leave it, reset the barrier; fixes #74974.
1010 2005-05-16 Raja R Harinath <rharinath@novell.com>
1012 Fix test-382.cs. Emit values of decimal constants.
1013 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1015 (TypeContainer.AddField): ... this.
1016 (TypeContainer.EmitFieldInitializers): Allow the list of fields
1017 with initializers to include 'Const's.
1018 (ClassPart.RegisterFieldForInitialization): Forward to
1020 * const.cs (Const.Const): Pass initializer to base class.
1021 (Const.Define): In case of decimal constants, register them for
1022 initialization in a static constructor.
1024 2005-05-14 Martin Baulig <martin@ximian.com>
1026 * statement.cs (Block.Resolve): Correctly handle unreachable code;
1027 do not call ResolveUnreachable() on unreachable statements in
1028 here, see the comment in the source code.
1030 2005-05-13 Raja R Harinath <rharinath@novell.com>
1033 * expression.cs (BinaryResolveOperator): If one of the operands of
1034 an equality comparison is 'null' and the other is a pointer type,
1035 convert the null to a NullPointer.
1036 * convert.cs (ImplicitReferenceConversion): If the expression is a
1037 NullLiteral and the target type is a pointer type, return a
1038 NullPointer instead.
1039 (ImplicitConversionStandard): Likewise.
1041 2005-05-13 Marek Safar <marek.safar@seznam.cz>
1043 * cs-parser.jay: Set readonly context based on special constructs.
1045 * expression.cs (LocalVariableReference.DoResolveBase): Improved
1046 readonly variable error handling.
1048 * rootcontext.cs (EmitCode): Don't verify members when error
1051 * statement.cs (LocalInfo): Add reaodnly context information.
1052 (SetReadOnlyContext, GetReadOnlyContext): New methods.
1054 2005-05-17 Martin Baulig <martin@ximian.com>
1056 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1059 2005-05-13 Martin Baulig <martin@ximian.com>
1061 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
1062 handle unreachable blocks.
1064 2005-05-13 Martin Baulig <martin@ximian.com>
1067 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1068 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1071 2005-05-13 Martin Baulig <martin@ximian.com>
1073 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1074 instance variable, not a local. Fix #74873.
1075 (Block.ResolveUnreachable): Set it to true here.
1077 2005-05-12 Martin Baulig <martin@ximian.com>
1079 * cs-parser.jay (property_declaration): Pass the `current_class',
1080 not the `current_container' to Property's .ctor. Fixes #74912.
1082 2005-05-11 Martin Baulig <martin@ximian.com>
1084 * typemanager.cs (Closure): Copy this from MCS and merge all the
1085 GMCS-specific changes into it.
1087 2005-05-12 Raja R Harinath <harinath@gmail.com>
1090 * typemanager.cs (unmanaged_enclosing_types): New.
1091 (IsUnmanagedType): Avoid infloops by using
1092 'unmanaged_enclosing_types' to talk with recursive invocations.
1094 2005-05-11 Duncan Mak <duncan@novell.com>
1096 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1097 continuing to process for 'arg'.
1098 (handle_preprocessing_directive): Check the argument of the #endif
1099 directive and report error CS1025 if there are any trailing
1102 According to the C# spec, having even whitespace after the #endif
1103 directive is illegal; however, because we call arg.TrimEnd ()
1104 beforehand, we have the same behavior as csc, allowing whitespace
1105 after the directive.
1109 2005-05-11 Marek Safar <marek.safar@seznam.cz>
1113 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1114 (Constructor.GetObsoleteAttribute): Implemented correctly.
1116 2005-05-10 Martin Baulig <martin@ximian.com>
1118 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1119 resolve the type; fixes #74864.
1120 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1121 in DoResolve(); fixes #74862.
1123 2005-05-10 Martin Baulig <martin@ximian.com>
1125 * support.cs (ReflectionParameters.ParameterModifier): Use
1126 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1127 and `ParameterAttributes.In'. Fixes #74884.
1129 2005-05-10 Martin Baulig <martin@ximian.com>
1131 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1132 the cache if we're just looking for `MemberTypes.NestedType' in a
1135 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1136 constraints if we're still resolving the type tree.
1137 (Expression.MemberLookup): If we're resolving the type tree, only
1138 look for `MemberTypes.NestedType' since we're only interested in
1141 * class.cs (TypeContainer.DefineType): Don't resolve the type
1142 parameters here; do this later in ResolveType() after the type
1143 tree has been resolved.
1144 (TypeContainer.ResolveType): New public method; this is called
1145 after the type tree is resolved and before the types are being
1146 populated. We resolve the generic constraints here.
1147 (TypeContainer.DoDefineMember): Check the constraints on our base
1148 class and interfaces.
1150 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1151 set the `ResolvingTypeTree' flag on the EmitContext.
1153 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1155 2005-05-10 Marek Safar <marek.safar@seznam.cz>
1157 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1159 * expression.cs (Argument.GetParameterModifier): Turned to property.
1160 (Invocation.Error_InvalidArguments): Add more descriptive errors.
1162 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1165 2005-05-09 Raja R Harinath <rharinath@novell.com>
1168 * decl.cs (MemberCache.AddMethods): Register override methods,
1169 rather than non-override methods.
1170 * typemanager.cs (RegisterOverride): New.
1171 (IsOverride): Update.
1173 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1175 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1177 2005-05-06 Martin Baulig <martin@ximian.com>
1180 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1181 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1183 2005-05-09 Marek Safar <marek.safar@seznam.cz>
1187 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1188 recursive declaration.
1190 * statement.cs (Block.ResolveMeta): Report any error in resolving.
1192 2005-05-06 Marek Safar <marek.safar@seznam.cz>
1194 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1196 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1198 2005-05-05 Raja R Harinath <rharinath@novell.com>
1201 * decl.cs (DeclSpace.FamilyAccessible):
1202 Use TypeManager.IsNestedFamilyAccessible.
1204 Fix reopened #64812.
1205 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1208 2005-05-04 Raja R Harinath <rharinath@novell.com>
1209 Abin Thomas <projectmonokochi@rediffmail.com>
1210 Anoob V E <projectmonokochi@rediffmail.com>
1211 Harilal P R <projectmonokochi@rediffmail.com>
1214 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1215 allow access to all static members.
1217 2005-05-04 Martin Baulig <martin@ximian.com>
1219 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1221 2005-05-04 Martin Baulig <martin@ximian.com>
1225 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1226 section at the end; make things work if `default' is not the last
1229 2005-05-04 Martin Baulig <martin@ximian.com>
1233 * statement.cs (Switch): Replaced the `got_default' field with a
1234 `default_section' one.
1235 (Switch.CheckSwitch): Set `default_section' here.
1236 (Switch.Resolve): If we're a constant switch and the constant is
1237 not found, use the default section.
1239 2005-05-03 Martin Baulig <martin@ximian.com>
1241 * expression.cs (ArrayAccess.EmitGetLength): New public method.
1243 * statement.cs (Foreach.ArrayForeach): New nested class.
1244 (Foreach.TemporaryVariable): New nested class.
1245 (Foreach.EmitArrayForeach): Removed; this is now in the new
1248 2005-05-03 Raja R Harinath <rharinath@novell.com>
1250 * pending.cs (BaseImplements): Move the #74773 fix here. This is
1252 (VerifyPendingMethods): Revert change below.
1254 * typemanager.cs (IsOverride, RegisterNonOverride): New.
1255 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1256 that used to trigger warning -28. Remove warning -28.
1257 * expression.cs (Invocation.OverloadResolve): Use
1258 TypeManager.IsOverride to distinguish override methods.
1261 * pending.cs (VerifyPendingMethods): If a base type implements the
1262 requested interface, don't bother checking individual methods of
1263 the base type. As a side-effect, this prevents the creation of
1264 unnecessary proxies.
1266 2005-05-02 Martin Baulig <martin@ximian.com>
1270 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1271 Also `And' the locals if the old vector is null.
1272 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1273 null; in this case we basically reset all the variables.
1275 2005-05-02 Martin Baulig <martin@ximian.com>
1279 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1280 Added `FlowBranching branching' argument; always `and' the
1281 variables instead of `or'ing them unless we're an infinite loop.
1283 * statement.cs (While.Resolve): Create a new sibling unless we're
1286 2005-05-02 Martin Baulig <martin@ximian.com>
1290 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1291 arguments; use it instead of creating a new TopLevelBlock.
1292 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1293 our ConstructorInitializer.
1296 (TopLevelBlock.TopLevelBranching): New public property.
1297 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1298 and create our `TopLevelBranching'.
1300 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1301 anonymous method host, use `block.TopLevelBranching' rather than
1302 creating a new branching.
1304 2005-04-20 Miguel de Icaza <miguel@novell.com>
1306 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1307 a ScopeInfo, if any of the current children is a child of the new
1308 entry, move those children there.
1310 2005-04-30 Martin Baulig <martin@ximian.com>
1312 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1313 at the beginning of a SwitchSection. Fix #73335.
1315 2005-04-27 Marek Safar <marek.safar@seznam.cz>
1318 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1320 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1321 (FieldExpr.DoResolve): Obsolete members are ignored for field
1324 2005-04-26 Marek Safar <marek.safar@seznam.cz>
1326 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1327 of arrays detection.
1329 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1331 (Field.VerifyClsCompliance): Volatile fields are not compliant.
1333 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1336 2005-04-25 Ben Maurer <bmaurer@ximian.com>
1338 * cs-parser.jay: Use the prefered version of -unsafe in error
1341 2005-04-22 Marek Safar <marek.safar@seznam.cz>
1343 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1346 2005-04-20 John Luke <john.luke@gmail.com>
1348 * driver.cs: fix typo in error message, --outout to --output
1350 2005-04-30 Martin Baulig <martin@ximian.com>
1352 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1353 handle the .NET 2.x security attributes.
1355 2005-04-30 Martin Baulig <martin@ximian.com>
1358 (TypeManager.ExpandInterfaces): Don't add things twice.
1361 (TypeContainer.VerifyClsCompliance): Allow generic instances.
1363 2005-04-29 Martin Baulig <martin@ximian.com>
1365 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1367 * anonymous.cs: Added support for anonymous generic methods.
1369 2005-04-29 Martin Baulig <martin@ximian.com>
1371 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1374 2005-04-29 Martin Baulig <martin@ximian.com>
1376 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1378 * expression.cs (New.DoResolve): Fix the CS0304 check.
1380 2005-04-29 Martin Baulig <martin@ximian.com>
1382 * typemanager.cs (TypeManager.GetFullName): Updated to the new
1385 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1386 explicit interface implementation, compare the interface types.
1387 (MethodData.Define): Use the new naming scheme from the latest
1389 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1391 * decl.cs (MemberName.GetMemberName): Removed.
1392 (MemberName.MethodName, FullName): New properties.
1394 2005-04-25 Raja R Harinath <rharinath@novell.com>
1396 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1398 2005-04-22 Martin Baulig <martin@ximian.com>
1400 * generic.cs (GenericMethod): Create the EmitContext in the
1401 `Define()'; in `Define(MethodBuilder)', create the type parameters
1402 before calling `Define()'. Fixes #73933.
1404 2005-04-22 Martin Baulig <martin@ximian.com>
1407 (Constraints.Resolve): Make things work wrt. the new type lookup system.
1408 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
1410 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
1411 ConstructedType, check its constraints.
1413 2005-04-20 Marek Safar <marek.safar@seznam.cz>
1415 * codegen.cs (InRefOutArgumentResolving): New field.
1417 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1418 fields outside contructor.
1420 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1422 2005-04-19 Miguel de Icaza <miguel@novell.com>
1424 * anonymous.cs (CaptureContext.EmitParameterInstance): The
1425 parameter code was not completed ever, so it was not as up-to-date
1426 as local variables. Must finish it.
1428 The bug fix was to compare the Toplevel of the block, not the
1429 current block. Thanks for Ben for pointing this out.
1431 2005-04-19 Raja R Harinath <rharinath@novell.com>
1433 * decl.cs (AddMethods): Use the declaring type of the problem
1434 method to determine if we want to squash a warning.
1436 2005-04-19 Marek Safar <marek.safar@seznam.cz>
1438 * attribute.cs: Removed debug output.
1440 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1442 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1445 2005-04-18 Raja R Harinath <rharinath@novell.com>
1448 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1449 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1450 all null comparisons against reference types.
1452 2005-04-18 Marek Safar <marek.safar@seznam.cz>
1455 * class.cs (TypeContainer.CircularDepException) New nested
1457 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1458 (TypeContainer.DefineType): Removed error, reset InTransit before
1460 (Class.DefineType): Throw exception when is in Transit.
1461 Catch exception and report error.
1462 (Struct.DefineType): Throw exception when is in Transit.
1463 Catch exception and report error.
1464 (Interface.DefineType): Throw exception when is in Transit.
1465 Catch exception and report error.
1467 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1468 handle nested exception handlers.
1470 * flowanalysis.cs (InTryWithCatch): New method, search for try with
1473 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1474 InFinally and InCatch storage.
1476 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1477 (Catch.Resolve): Set and Restore ec.InCatch.
1478 (Try.Resolve): Set and Restore ec.InFinally.
1479 (Try.HasCatch): True when try has catch.
1481 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
1483 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1484 for the same event member, so exclude such cases from warning 419.
1487 2005-04-16 Miguel de Icaza <miguel@novell.com>
1489 * expression.cs (Binary.ResolveOperator): Apply patch from John
1490 Luke to fix bug 59864: operators &, | and ^ on enumerations
1491 require that the same enum type on both sides.
1493 * driver.cs: Add warnings to old flag usage, this is to assist
1494 people who produce Makefiles and hope that the Makefiles will be
1497 * class.cs (TypeContainer.EmitType): Moved the definition of the
1498 special $PRIVATE$ field from the resolve phase to the Emit phase.
1499 During resolve we do not know if we are a struct with
1500 HasExplicitLayout, we know this only after the attributes for the
1503 Set the FieldOffset to zero on the dummy field that we create for
1504 the class. Fixes 74590.
1506 2005-04-16 Raja R Harinath <rharinath@novell.com>
1509 * ecore.cs (PropertyExpr.resolved): New.
1510 (DoResolve): Use it to handle a case of double resolution here.
1511 Handle a case of identical-name-and-type-name.
1512 * expression.cs (ArrayCreation.CheckIndices): Avoid double
1513 resolution by storing the results of expression resolution back
1514 into the "probes" array.
1516 2005-04-15 Raja R Harinath <rharinath@novell.com>
1518 Fix cs0208-7.cs and cs0208-8.cs.
1519 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1520 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
1521 error reporting to point out the reason a struct is not unmanaged.
1523 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
1525 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
1526 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1528 2005-04-13 Raja R Harinath <rharinath@novell.com>
1531 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1532 IdenticalNameAndTypeName here.
1533 (EventExpr.InstanceResolve): Likewise.
1535 2005-04-13 Marek Safar <marek.safar@seznam.cz>
1537 C# 2.0 DefaultCharSetAttribute implementation
1539 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1540 which allows us to set GlobalNamespace for every resolve.
1541 (Attribute.ResolveArguments): Cut from Resolve.
1542 (Attribute.GetCharSetValue): Returns CharSet named argument.
1543 (Attribute.DefinePInvokeMethod): Gets default charset from
1545 (GlobalAttribute.ResolveAsTypeStep): Override.
1546 (GlobalAttribute.ResolveArguments): Override.
1548 * class.cs (TypeAttr): Is protected.
1550 * codegen.cs (ModuleClass.DefaultCharSet): New member.
1551 (ModuleClass.DefaultCharSetType): New memeber.
1552 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1554 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1555 charset from module.
1557 * delegate.cs (TypeAttr): Override.
1558 (Delegate.DefineType): Use this TypeAttr.
1560 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1561 at very early stage (before types are defined) to resolve model
1562 module attributes. It will probably not work with corlib but it
1565 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1566 charset from module.
1568 * typemanager.cs (default_charset_type): New type.
1570 2005-04-13 Raja R Harinath <rharinath@novell.com>
1572 * decl.cs (MemberCache.AddMethods): Don't warn if
1573 System.Object.Finalize has buggy MethodAttributes.
1575 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1578 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
1580 * doc.cs : detect ambiguous reference to overloaded members.
1581 Fixed bug #71603. MS 1.1 csc does not detect it.
1583 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
1585 * doc.cs : delegates must not be referenced with parameters.
1588 2005-04-12 Miguel de Icaza <miguel@novell.com>
1590 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1592 2005-04-10 Miguel de Icaza <miguel@novell.com>
1594 * driver.cs (MainDriver): Stop processing if the CLS stage found
1597 (CompilerCallableEntryPoint.InvokeCompiler): Always
1598 reset after execution; Take a TextWriter argument for the
1601 * report.cs: Use the error stream instead of hardcoding stderr.
1603 2005-04-09 Miguel de Icaza <miguel@novell.com>
1605 * class.cs: Reduce code paths to test, too small of an
1606 optimization to make it worth the extra testing. Always perform
1609 2005-04-08 Raja R Harinath <rharinath@novell.com>
1612 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1613 operators that had errors reported on them.
1615 2005-04-08 Marek Safar <marek.safar@seznam.cz>
1617 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1619 (Attribute.Resolve): Add named argument type checking.
1621 * class.cs (FixedField.Define): Use IsPrimitiveType
1623 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1625 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1626 unsafe parameter types.
1628 * statement.cs (Using.ResolveExpression): Add better error description.
1630 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1632 2005-04-08 Raja R Harinath <rharinath@novell.com>
1635 * attribute.cs (Attribute.GetAttributeUsage): Resolve
1636 AttributeUsageAttribute in the emitcontext of the attribute class,
1637 not in the emitcontext of the attributable entity it was attached to.
1638 * cs-parser.jay: Use 'current_class', not 'current_container',
1639 when creating a GlobalAttribute.
1641 2005-04-08 Alp Toker <alp@atoker.com>
1643 * pending.cs: The fix to #58413 failed to compile methods implementing
1644 interfaces with/without params modifiers and vice versa, even though
1645 params modifiers aren't part of the signature. Make the modifier check
1646 less strict as in csc.
1648 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
1649 Anoob V E <projectmonokochi@rediffmail.com>
1650 Harilal P R <projectmonokochi@rediffmail.com>
1653 * pending.cs (TypeAndMethods.mods): New. Store the parameter
1654 modifiers of pending methods.
1655 (PendingImplementation.PendingImplementation): Initialize it.
1656 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1657 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1658 with ParameterData. Add check for modifiers.
1659 * class.cs (MethodData.Define): Update to changes.
1661 2005-04-07 Raja R Harinath <rharinath@novell.com>
1663 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1665 2005-04-07 Marek Safar <marek.safar@seznam.cz>
1667 * class.cs (PropertyMethod.Define): Check private accessor in abstract
1670 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1673 * typemanager.cs: Registered RequiredAttributeAttribute.
1675 2005-04-06 Marek Safar <marek.safar@seznam.cz>
1677 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1678 Warning CS0169 is back at level 3.
1679 (IMethodData.SetMemberIsUsed): New method.
1681 * decl.cs (IsUsed): New value; moved from FieldBase.Status
1682 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1684 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1686 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1688 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1691 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1694 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1695 to avoid the problems with nested types.
1697 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
1698 Anoob V.E <projectmonokochi@rediffmail.com>
1699 Harilal P.R <projectmonokochi@rediffmail.com>
1700 Raja R Harinath <rharinath@novell.com>
1703 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1705 * typemanager (GetConstructor): Make public.
1707 2005-04-05 John Luke <john.luke@gmail.com>
1708 Raja R Harinath <rharinath@novell.com>
1711 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1712 struct too. Return false quicker in a few cases.
1713 (VerifyUnManaged): Use it.
1715 2005-04-05 Raja R Harinath <rharinath@novell.com>
1718 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1719 not 'unreachable_seen'.
1721 2005-04-04 Marek Safar <marek.safar@seznam.cz>
1723 * attribute.cs (Attribute.GetValue): Removed unused.
1725 * codegen.cs (CodeGen.TrimExt): Removed unused.
1727 * cs-parser.jay (output): Removed unused.
1729 * cs-tokenizer.cs (hex_digits): Removed unused.
1731 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1733 * expression.cs (Indirection.LoadExprValue): Removed unused.
1734 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1736 * iterators.cs (Iterator.param_types): Removed unused.
1738 * statement.cs (Goto.block): Removed unused.
1739 (ToplevelBlock.did): Removed unused.
1740 (Switch.ResolveConstantSwitch): Removed unused.
1742 2005-04-01 Ben Maurer <bmaurer@ximian.com>
1744 * rootcontext.cs: Allow mcs to bootstrap with the compilation
1747 2005-04-19 Martin Baulig <martin@ximian.com>
1749 Merged r42462 from MCS and made it work for GMCS.
1751 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
1753 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
1755 2005-04-01 Raja R Harinath <rharinath@novell.com>
1757 Fix #74232 and cs0208-3.cs.
1758 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1759 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1760 unmanaged type. Don't use FieldBuilders when 't' is a
1761 TypeBuilder. Use ModFlags and MemberType fields.
1762 * class.cs (MemberBase.member_type): Rename from MemberType.
1763 (MemberBase.MemberType): New property. Determines member_type on
1765 (MemberBase.DoDefine): Don't initialize MemberType here.
1766 (FieldMember.Define): Likewise.
1768 2005-04-01 Marek Safar <marek.safar@seznam.cz>
1771 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1772 Attributes are emitted there.
1774 2005-04-01 Raja R Harinath <rharinath@novell.com>
1776 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1777 keyword in 'partial enum' too.
1778 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1780 Report from Kamil Skalski <nazgul@omega.pl>.
1783 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1784 have partial containers too.
1786 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1787 in block' checks to Block.CheckInvariantMeaningInBlock.
1788 * statement.cs (Block.GetKnownVariableInfo): Make private.
1789 (Block.IsVariableUsedInChildBlock): Remove.
1790 (Block.IsVariableUsedInBlock): Likewise.
1791 (Block.CheckInvariantMeaningInBlock): New. Show location of
1792 conflicting declaration.
1793 (Block.AddVariable): Make error messages less long-winded and more
1794 specific. Show location of conflicting declaration.
1795 * parameter.cs (Parameters.Location): New readonly property.
1797 2005-03-31 Raja R Harinath <rharinath@novell.com>
1799 Clean up semantics of invoking ResolveMemberAccess.
1800 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1801 can have an instance, ensure that we pass in a non-TypeExpression
1802 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
1803 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1804 argument. Update to changes and simplify.
1805 (FieldExpr.Emitinstance): Remove CS0120 check.
1806 (PropertyExpr.EmitInstance): Likewise.
1807 * expression.cs (Argument.Resolve): Likewise.
1808 (Invocation.DoResolve): Update to changes in semantics of
1811 2005-03-31 Marek Safar <marek.safar@seznam.cz>
1814 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1817 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1819 2005-03-31 Raja R Harinath <rharinath@novell.com>
1821 Fix difference in behaviour with commandline invocation.
1822 * driver.cs (Driver.Reset): New.
1823 (CompilerCallableEntryPoint): Call it.
1825 * statement.cs (If.Resolve): Avoid spurious "uninitialized
1826 variable" warnings if the boolean expression failed to resolve.
1828 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
1830 * attribute.cs: Fix the union of several permissions when some of them
1831 are unrestricted (so the result isn't an unrestricted permission set).
1834 2005-03-30 Raja R Harinath <rharinath@novell.com>
1836 * ecore.cs (MemberExpr): New class. Convert from interface
1838 (MemberExpr.ResolveMemberAccess): Refactor and move here from
1839 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
1841 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1842 (MethodGroupExpr.IsExplicitImpl): Remove.
1843 (Expression.GetFieldFromEvent): Remove.
1844 (SimpleName.MemberStaticCheck): Remove.
1845 (SimpleName.DoSimpleNameResolve): Update to changes.
1846 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1847 (MemberAccess.IdenticalNameAndTypeName): Remove.
1848 (MemberAccess.error176): Move to MemberExpr.
1849 (MemberAccess.DoResolve): Update to changes.
1850 (BaseAccess.DoResolve): Likewise.
1852 2005-03-30 Marek Safar <marek.safar@seznam.cz>
1854 C# 2.0 Conditional attribute class implementation
1856 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1857 Analyzes class whether it has attribute which has ConditionalAttribute
1858 and its condition is not defined.
1860 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1861 (Class.IsExcluded): New method. Search for at least one defined
1862 condition in ConditionalAttribute of attribute class.
1864 2005-03-30 Raja R Harinath <rharinath@novell.com>
1866 * ecore.cs (PropertyExpr): Derive from Expression, not
1867 ExpressionStatement.
1868 (PropertyExpr.EmitStatement): Remove.
1870 2005-03-29 Raja R Harinath <rharinath@novell.com>
1873 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1874 internal field "value__" of an enum be private. The examples for
1875 "value__" that I found on MSDN all used FieldAttributes.Private.
1877 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1878 Don't mention IL method attribute names.
1880 Fix #47991. Remove a TODO.
1881 * statement.cs (Block.Toplevel): Make into a field.
1882 (Block.Parameters): Move into ToplevelBlock.
1883 (Block.known_variables): Rename from child_variable_names.
1884 (Block.Block): Remove variants that take Parameters. Initialize
1885 'Toplevel' with the immediately surrounding toplevel block.
1886 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
1887 LocalInfo parameter.
1888 (Block.GetKnownVariableInfo): New.
1889 (Block.IsVariableNameUsedInChildBlock): Update.
1890 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
1891 the block, even though it may not be in scope.
1892 (Block.AddVariable): Remove Parameters parameter. Use
1893 Toplevel.Parameters instead.
1894 (Block.AddConstant): Remove Parameters parameter.
1895 (Block.GetParameterReference): Update to use Toplevel.Parameters.
1896 (Block.IsParamaterReference): Likewise.
1897 (Block.IsLocalParameter): Likewise. Simplify a lot.
1898 (ToplevelBlock.Parameters): New. Moved from Block.
1899 (ToplevelBlock.ToplevelBlock): Update to changes. Always
1900 initialize Parameters to a non-null value.
1901 * cs-parser.jay: Update to changes.
1902 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1903 simple names that mean different things in the same block. Use
1904 Block.IsVariableNameUsedInBlock.
1906 2005-03-28 Raja R Harinath <rharinath@novell.com>
1908 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1910 2005-03-26 Raja R Harinath <harinath@acm.org>
1913 * assign.cs (Assign.DoResolve): When the RHS of an assignment
1914 fails to resolve, ensure that the LHS is still resolved as an
1917 2005-03-25 Raja R Harinath <harinath@acm.org>
1919 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1921 (Enum.current_ec): Remove.
1922 (Enum.LookupEnumValue): Remove EmitContext argument.
1923 Just uses the one created during DefineType.
1924 (Enum.FindMembers): Update.
1925 * expression.cs (MemberAccess.DoResolve): Update.
1927 2005-03-22 Marek Safar <marek.safar@seznam.cz>
1929 * assign.cs (Assign.DoResolve): Check for CS1717 when
1930 source and target are same (uses Equals).
1932 * expression.cs (LocalVariableReference, ParameterReference,
1933 This): Implemented Equals, GetHashCode.
1935 * statement.cs (Block.GetParameterReference): Removed useless
1938 2005-03-22 Raja R Harinath <rharinath@novell.com>
1941 * statement.cs (Block.AddVariable): Ensure that we skip implicit
1942 blocks before deciding whether the error is cs0136 or cs0128.
1944 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1945 (using_alias_directive, using_namespace_directive): Pass
1946 MemberName, not an expression to Namespace.UsingAlias and
1948 (MakeName): Use the MemberName of the namespace.
1949 * namespace.cs (Namespace.MemberName): New.
1950 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1951 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1953 * decl.cs (MemberName.Name): Make readonly.
1954 (MemberName.FromDotted): New "constructor".
1955 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1956 (MemberCore.Name): Compute from MemberName on demand.
1957 (MemberCore.SetMemberName): Provide a way to change the
1959 (MemberCore.AddToContainer): Don't take a fullname parameter.
1960 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1961 fully qualified name of the container to the member name.
1962 (TypeContainer.AddToTypeContainer): Use a fully qualified name
1963 only if the type is a member of the root container.
1964 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1965 MemberName.Left rather than searching for an embedded ".".
1966 (PartialContainer.CreatePart): Update to changes in RootContext.
1967 (MemberBase.ShortName): Turn into a property. Use
1968 MemberCore.SetMemberName.
1969 (MemberBase.ExplicitInterfaceName): Remove.
1970 (MemberBase.UpdateMemberName): Remove.
1971 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1972 (PropertyBase.SetMemberName): New override.
1973 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1974 (Tree.GetDecl): New.
1975 (Tree.AllDecls): Rename from Decls.
1976 * attribute.cs, enum.cs, report.cs: Update to changes.
1977 * driver.cs (MainDriver): Use MemberName.FromDotted on
1978 RootContext.MainClass.
1980 2005-03-21 Marek Safar <marek.safar@seznam.cz>
1982 * class.cs (FixedField.Define): Check for CS1664 and more sanity
1985 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1987 2005-03-18 Marek Safar <marek.safar@seznam.cz>
1989 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1990 property accessor modifiers.
1992 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1993 fixed buffer attribute (CS1716).
1994 (PropertyMethod.HasCustomAccessModifier): When property accessor
1995 has custom modifier.
1997 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1999 (PropertyExpr.DoResolveLValue): Add CS0272.
2001 2005-03-17 Miguel de Icaza <miguel@novell.com>
2003 * convert.cs: When converting to a pointer, use the proper Conv.U
2004 or Conv.I depending on the source data type.
2006 * cs-tokenizer.cs: Make the size for large decimal constants,
2009 2005-03-17 Martin Baulig <martin@ximian.com>
2011 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2012 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2014 2005-03-17 Martin Baulig <martin@ximian.com>
2016 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2017 to bool so we can return an error condition.
2018 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2021 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
2023 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2026 2005-03-16 Raja R Harinath <rharinath@novell.com>
2028 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2029 Refactor to avoid traversing the list of assemblies, and to avoid
2030 string concatenation.
2031 * typemanager.cs (guid_attr_type): Remove.
2032 (negative_hits, pointers, references): Remove hashes.
2034 (GetConstructedType): New. Uses type_hash to handle constructed
2035 types (arrays, references, pointers).
2036 (GetReferenceType, GetPointerType): Use it.
2037 (GetNestedType): New. Uses type_hash to handle nested types of
2039 (LookupType, LookupTypeDirect): Remove.
2040 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
2041 'types' hash and LookupTypeReflection directly.
2042 (params_string, params_object): Use GetConstructedType.
2043 * namespace.cs (Namespace.cached_types): New. Cache of reflected
2045 (Namespace.Lookup): Use cached_types.
2046 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2047 provided by old TypeManager.LookupType.
2048 * rootcontext.cs (MakeFQN): Remove.
2049 * decl.cs (DeclSpace.MakeFQN): Likewise.
2050 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2051 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2052 TypeManager.GetConstructedType.
2053 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2055 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
2057 * cs-parser.jay: Fix build.
2059 2005-03-15 Marek Safar <marek.safar@seznam.cz>
2061 * class.cs (TypeContainer.CircularDepException) New nested
2062 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2064 * cs-parser.jay: Reports CS1527 for any namespace element.
2066 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2069 * expression.cs (ParameterReference.IsAssigned): Changed error to
2071 (Error_WrongNumArguments): Moved CS0245 detection here.
2073 * statement.cs (Return.Resolve): Add CS1622 report.
2075 2005-03-11 Marek Safar <marek.safar@seznam.cz>
2077 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2079 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
2081 * attribute.cs expression.cs: Get rid of some allocations.
2083 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
2085 * doc.cs : just eliminate the latest change.
2087 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2089 * doc.cs : commented out the latest change. It breaks xml-030.cs
2091 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2093 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2094 fail. So invoke CreateType() in FindDocumentedType().
2096 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
2098 * cs-tokenizer.cs : added IsKeyword().
2099 * doc.cs : Detect keyword incorrectly used as identifier.
2100 Allow identifiers prefixed by @.
2102 2005-03-10 Marek Safar <marek.safar@seznam.cz>
2104 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2105 It caused exception in namespace resolving (again!).
2107 * class.cs (Class.ctor): Removed exit.
2108 (PropertyMethod.ctor): ditto.
2110 * codegen.cs (Codegen.Reset): Reset static data.
2111 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2113 * cs-tokenizer.cs (Cleanup): Removed.
2115 * driver.cs (GetSystemDir): Rewrote to one line command.
2116 It caused problem with unloaded dynamic modules.
2117 (UnixParseOption): Removed Exit.
2118 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2119 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2120 Now can be mcs used as library.
2122 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2125 * location.cs (Reset): Reset static data.
2127 * namespace.cs (Reset): Reset static data.
2129 * report.cs (Report.Reset): Reset static data.
2131 * rootcontext.cs (RootContext.Reset): Reset static data.
2133 * tree.cs (RootTypes.ctor): Use Location.Null
2135 * typemanager.cs (TypeManager.Reset): Reset static data.
2136 (CoreLookupType): Removed Exit.
2137 (TypeHandle.Reset): Reset static data.
2139 2005-03-10 Raja R Harinath <rharinath@novell.com>
2142 * typemanager.cs (ComputeNamespaces): Import namespaces from
2143 referenced modules too.
2145 2005-03-09 Raja R Harinath <rharinath@novell.com>
2147 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2150 2005-03-09 Raja R Harinath <rharinath@novell.com>
2152 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2153 enclosing DeclSpace. This ensures that a name-lookup populates
2154 more caches and there are fewer 'TypeExpression's. Carve out
2155 nested type lookup into ...
2156 (LookupNestedTypeInHierarchy): ... this.
2158 2005-04-15 Martin Baulig <martin@ximian.com>
2160 Merged r41590 from MCS and make it work in the generics land.
2162 * generic.cs (TypeParameter.UpdateConstraints): Removed the
2165 * class.cs (PartialContainer.UpdateConstraints): Removed.
2166 (PartialContainer.CheckConstraints): Removed.
2167 (PartialContainer.SetParameterInfo): Store the constraints here.
2168 (PartialContainer.DefineTypeParameters): New public method;
2169 resolve the type parameter's constraints here. Note that the
2170 PartialContainer doesn't have an EmitContext anymore, so we must
2171 do this in the ClassPart.
2173 2005-03-09 Raja R Harinath <rharinath@novell.com>
2175 Clean up a few partial-class semantics.
2176 Fixes test-357.cs and cs1618-2.cs.
2177 * cs-parser.jay (struct_declaration): Use 'current_class' as
2178 parent of newly-created struct. Remove call to Register ().
2179 Use 'pop_current_class' to complete handing the current struct.
2180 (interface_declaration): Likewise.
2181 (class_declaration): Likewise.
2182 (enum_declaration): Use 'current_class' as parent of newly created
2184 (delegate_declaration): Likewise.
2185 (pop_current_class): New function. This is used to handle closing
2186 up the 'current_class' and 'current_container', and pointing them
2187 to the enclosing class/container.
2188 (CSharpParser): Initialize 'current_class' too.
2189 * decl.cs (MemberCore): Add check for invariant: a partial
2190 container is not a parsed entity, and thus does not enclose any
2192 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2193 (DeclSpace.BaseTypeExpr): Use it.
2194 (DeclSpace.LookupType): Add check for invariant.
2195 * class.cs (TypeContainer): Add check for invariant: a nested
2196 class should have the same NamespaceEntry as its enclosing class.
2197 (TypeContainer.EmitFieldInitializers): Make virtual.
2198 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2200 (TypeContainer.Register): Remove.
2201 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2202 null. Use TypeResolveEmitContext for resolving base types and
2203 interfaces. Move initialization of Parts.TypeBuilder here from
2205 (TypeContainer.DefineNestedTypes): ... here.
2206 (PartialContainer): Take a Namespace not a NamespaceEntry.
2207 (PartialContainer.Create): Don't use Register. Call the
2208 appropriate Add... function directly.
2209 (ClassPart): Take both the PartialContainer and the enclosing
2210 class as constructor arguments.
2211 (ClassPart.EmitFieldInitializers): Override.
2212 (ClassPart.PartFindNestedTypes): Remove.
2213 (FieldBase.GetInitializerExpression): Resolve the initializer
2214 expression in the emit context of the enclosing class.
2215 * tree.cs (RootTypes): Remove Register ().
2217 2005-03-08 Marek Safar <marek.safar@seznam.cz>
2219 * cs-parser.jay: Removed CS0134.
2221 * driver.cs: Removed CS1901.
2223 * expression.cs (SizeOf.DoResolve): Don't report CS0233
2224 for predefined types.
2226 2005-03-07 Duncan Mak <duncan@novell.com>
2228 * codegen.cs (Save): Catch UnauthorizedAccessException as
2229 well. Fixes bug #73454.
2231 2005-03-07 Marek Safar <marek.safar@seznam.cz>
2233 * cs-tokenizer.cs (xtoken): Add CS1035.
2235 * class.cs (MethodData.Define): Add CS0683.
2236 (FieldMember.ctor): Add CS0681.
2238 2005-03-07 Raja R Harinath <rharinath@novell.com>
2240 * ecore.cs (SimpleName.DoResolve): Rename from
2241 SimpleName.DoResolveAllowStatic.
2242 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2243 Pass 'intermediate' flag to MemberStaticCheck.
2244 (SimpleName.MemberStaticCheck): Skip "static check" only in case
2245 of "intermediate" lookups via MemberAccess.
2246 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
2247 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2249 2005-03-07 Raja R Harinath <rharinath@novell.com>
2252 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2253 slipped in because of variable names that are identical to a
2254 builtin type's BCL equivalent ('string String;', 'int Int32;').
2255 (PropertyExpr.EmitInstance): Likewise.
2257 2005-03-04 Marek Safar <marek.safar@seznam.cz>
2259 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2261 * report.cs (warning_ignore_table): Made public.
2263 2005-03-04 Raja R Harinath <rharinath@novell.com>
2266 * class.cs (MethodData.Emit): Pass 'container' to
2267 container.GetObsoleteAttribute instead of 'container.Parent'.
2269 2005-03-03 Marek Safar <marek.safar@seznam.cz>
2271 * cs-parser.jay: Add 1534 error test.
2273 * iterators.cs (Yield.CheckContext): Add error 1629.
2274 (Iterator.ctor): Save unsafe modifier.
2275 (MoveNextMethod.DoEmit): Restore unsafe context.
2277 * namespace.cs (UsingAlias): Better error message.
2279 2005-03-03 Dan Winship <danw@novell.com>
2281 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2282 the warning message [#73219]
2284 2005-03-03 Raja R Harinath <rharinath@novell.com>
2286 Fix compile with MCS 1.0.0.0.
2287 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2288 w_restore to not depend on string constant folding.
2290 2005-03-03 Raja R Harinath <rharinath@novell.com>
2292 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
2293 CS0246 check to users who passed 'silent = false'.
2294 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2296 (SimpleName.SimpleNameResolve): Update.
2297 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2298 (MemberAccess.IdenticalNameAndTypeName): Update.
2299 * doc.cs (FindDocumentedTypeNonArray): Update.
2301 2005-03-03 Raja R Harinath <rharinath@novell.com>
2303 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2304 * parameters.cs (ComputeAndDefineParameters): Remove.
2305 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2306 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2307 Use GetParameterInfo.
2309 2005-03-02 Marek Safar <marek.safar@seznam.cz>
2311 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2313 2005-03-02 Raja R Harinath <rharinath@novell.com>
2315 Unify DeclSpace.LookupType and DeclSpace.FindType.
2316 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
2317 is in charge of defining nested types on demand.
2318 (DeclSpace.LookupType): Use it when the current_type is a
2319 TypeBuilder. Use LookupTypeDirect for reflected types.
2320 (DeclSpace.FindType): Remove.
2321 (DeclSpace.LookupInterfaceOrClass): Likewise.
2322 (DeclSpace.DefineTypeAndParents): Likewise.
2323 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2324 DeclSpace.LookupType.
2325 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2326 * typemanager.cs (LookupType): Simplify.
2327 (AddUserType): Remove type from negative_hits.
2328 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2329 * class.cs (TypeContainer.FindMembers): Move handling of nested
2331 (TypeContainer.FindMembers_NestedTypes): ... here.
2332 (TypeContainer.FindNestedType): Implement override.
2333 (ClassPart.FindNestedType): Delegate to PartialContainer.
2334 (ClassPart.PartFindNestedType): Looks up the nested types of the
2337 2005-04-14 Martin Baulig <martin@ximian.com>
2339 * generic.cs (ConstructedType): Moved all the type lookup and
2340 nested class logic into SimpleName.
2341 (ConstructedType.ResolveConstructedType): Our underlying type is
2342 already fully resolved; all the type lookup stuff is in
2345 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2346 constructed types here instead of in ConstructedType.
2348 * decl.cs (MemberName.GetTypeExpression): Always create a
2349 SimpleName, not a ConstructedType.
2350 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2352 2005-03-02 Martin Baulig <martin@ximian.com>
2354 * class.cs (TypeContainer.DoDefineMembers): We also need a default
2355 static constructor in static classes.
2357 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
2359 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2360 sizeParamIndex is not specified.
2362 2005-03-01 Marek Safar <marek.safar@seznam.cz>
2365 * report.cs (WarningMessage.IsEnabled): Missing null check.
2367 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2369 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2370 in the fields and not in the properties.
2372 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
2374 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
2377 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2379 * attribute.cs: Small refactoring (improved robustness).
2380 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2381 (ValidateGuid): Removed.
2382 (Resolve): Removed referenced to above mentioned.
2383 (GetAttributeUsage): Made private and changed to work without
2385 (GetIndexerAttributeValue): Don't crash.
2386 (GetConditionalAttributeValue): Ditto.
2387 (GetClsCompliantAttributeValue): Ditto.
2388 (ExtractSecurityPermissionSet): All attributes exceptions are
2390 (GetPropertyValue): New helper.
2391 (GetMethodImplOptions): New method.
2392 (DefinePInvokeMethod): Reuse common code. Implemented handling of
2393 some missing properties.
2395 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2396 (Method.ApplyAttributeBuilder): Updated.
2398 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2401 2005-02-28 Raja R Harinath <rharinath@novell.com>
2404 * report.cs (Report.SymbolRelatedToPreviousError): Handle
2405 non-simple types (array, pointer, reference).
2407 2005-02-28 Marek Safar <marek.safar@seznam.cz>
2409 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2411 * class.cs (MethodCore.IsDuplicateImplementation): Special error
2413 (Method.CheckBase): Catch wrong destructor here.
2414 (MethodData.Define): Add errors 550, 668.
2416 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2418 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2420 * pending.cs (VerifyPendingMethods): Add error 551.
2422 * typemanager.cs (CSharpName): Next error report helper.
2424 2005-02-25 Marek Safar <marek.safar@seznam.cz>
2426 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2427 attributes. Removed useless attribute double check.
2428 It saves almost 2MBs for corlib.
2430 2005-02-25 Raja R Harinath <rharinath@novell.com>
2433 * statement.cs (ExpressionStatement.Resolve): Make robust to being
2434 called twice in case of error.
2436 2005-02-23 Chris Toshok <toshok@ximian.com>
2438 Fix compiler portions of #72827.
2439 * statement.cs (Block.Emit): call Begin/EndScope on the
2440 EmitContext instead of the ILGenerator.
2442 * codegen.cs (EmitContext.BeginScope): new method, call
2443 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2445 (EmitContext.BeginScope): same, but EndScope and CloseScope
2447 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2448 offset and call the superclass's OpenScope(int) with it.
2449 (SymbolWriter.CloseScope): get the current il
2450 offset and call superclass's CloseScope(int) with it.
2452 2005-02-23 Marek Safar <marek.safar@seznam.cz>
2454 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2455 CS1677 for out and ref as well.
2457 * class.cs (Method.Define): Add error CS1599 detection.
2459 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2461 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2463 * delegate.cs (Delegate.Define): Add error CS1599 detection.
2465 * support.cs.cs (ModifierDesc): New helper method.
2467 2005-02-23 Raja R Harinath <rharinath@novell.com>
2468 Abin Thomas <projectmonokochi@rediffmail.com>
2469 Anoob V E <projectmonokochi@rediffmail.com>
2470 Harilal P R <projectmonokochi@rediffmail.com>
2473 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2474 MemberLookup (used for error reporting) actually returns a result.
2475 Fix error report number (122, not 112).
2477 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
2478 Anoob V E <projectmonokochi@rediffmail.com>
2479 Harilal P R <projectmonokochi@rediffmail.com>
2482 * pending.cs (PendingImplementation.GetAbstractMethods):
2483 Find NonPublic members too.
2485 2005-02-22 Marek Safar <marek.safar@seznam.cz>
2487 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2490 * class.cs (MethodCore.CheckMethodAgainstBase):
2491 Add error 239 report.
2493 2005-02-21 Marek Safar <marek.safar@seznam.cz>
2495 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2497 * class.cs (Operator.Define): Add error 217 report.
2499 2005-02-21 Raja R Harinath <rharinath@novell.com>
2502 * expression.cs (Invocation.IsApplicable): Make public.
2503 (Invocation.IsParamsMethodApplicable): Likewise.
2504 * delegate.cs (Delegate.VerifyApplicability): Don't use
2505 Invocation.VerifyArgumentCompat for parameter applicability
2506 testing. Use Invocation.IsApplicable and
2507 Invocation.IsParamsMethodApplicable.
2509 2005-02-21 Marek Safar <marek.safar@seznam.cz>
2511 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2513 * class.cs (Operator.Define): Add error 217 report.
2515 2005-02-21 Raja R Harinath <rharinath@novell.com>
2517 * namespace.cs (UsingEntry.Resolve): Undo change below.
2519 2005-02-21 Raja R Harinath <rharinath@novell.com>
2522 * ecore.cs (Expression.MemberLookupFailed): Add argument to
2523 disable the error message when the extended MemberLookup also
2525 (Expression.MemberLookupFinal): Update.
2526 (SimpleName.DoSimpleNameResolve): Update.
2527 * expression.cs (MemberAccess.ResolveNamespaceOrType):
2528 Don't use MemberLookupFinal.
2529 (New.DoResolve): Update.
2530 (BaseAccess.CommonResolve): Update.
2532 2005-02-21 Raja R Harinath <rharinath@novell.com>
2535 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2536 occured previously, don't resolve again.
2538 2005-02-21 Marek Safar <marek.safar@seznam.cz>
2541 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2542 argument. Call ResolveAttributeUsage for unresolved.
2543 when types doesn't match ctor arguments.
2545 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2546 for nested attribute classes.
2547 (Class.attribute_usage): Removed.
2548 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2549 for attribute class.
2551 * ecore.cs (IsAttribute): Removed.
2553 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2555 * rootcontext.cs (RegisterAttribute): Removed, attributes are
2557 (attribute_types): Removed.
2558 (EmitCode): Global attributes are emited as the latest.
2560 2005-02-18 Marek Safar <marek.safar@seznam.cz>
2562 * class.cs (EmitFieldInitializers): Don't emit field initializer
2563 for default values when optimilization is on.
2565 * constant.cs (Constant.IsDefaultValue): New property.
2567 * driver.cs: Add /optimize handling.
2571 * literal.cs: Implement new IsDefaultValue property.
2573 * rootcontext.cs (Optimize): New field, holds /optimize option.
2575 2005-02-18 Raja R Harinath <rharinath@novell.com>
2577 Fix crasher in re-opened #72347.
2578 * namespace.cs (Namespace.Lookup): Return null if
2579 DeclSpace.DefineType returns null.
2582 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2584 2005-02-18 Raja R Harinath <rharinath@novell.com>
2586 Fix remainder of #63202. Change semantics of DoResolveLValue: it
2587 now returns null if it cannot resolve to an lvalue.
2588 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2589 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2590 returned null. Remove check for SimpleName.
2591 (EventExpr.DoResolveLValue): New.
2592 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2593 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
2595 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
2597 (Unary.ResolveOperator): Move CS0211 check ...
2598 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
2600 (Unary.DoResolveLValue): Simplify.
2601 (AddressOf.DoResolveLValue): New.
2602 (ArrayAccess.DoResolveLValue): New.
2604 2005-02-16 Marek Safar <marek.safar@seznam.cz>
2606 * attribute.cs (Attribute.Resolve): Add arguments casting for
2607 when types doesn't match ctor arguments.
2609 2005-02-16 Raja R Harinath <rharinath@novell.com>
2611 Fix parts of #63202.
2612 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2613 lookup of operator in base type. Ensure that all checks happen
2614 when the operator resolves to an "op_..." method.
2616 2005-02-15 Raja R Harinath <rharinath@novell.com>
2619 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2620 'ignore_cs0104' parameter. Pass it to ...
2621 (NamespaceEntry.Lookup): ... this.
2622 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2623 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2624 (TypeLookupExpression.DoResolveAsTypeStep): Update.
2625 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2626 Update. Request that cs0104 errors be ignored.
2627 (ComposedCast.ResolveAsTypeStep): Update.
2629 2005-02-14 Raja R Harinath <rharinath@novell.com>
2632 * expression.cs (Invocation.BetterFunction): Remove support for
2633 comparing virtual functions and their overrides.
2634 (Invocation.IsOverride): New.
2635 (Invocation.OverloadResolve): Don't consider 'override' functions
2636 during candidate selection. Store them in a lookaside list.
2637 If the selected method is a 'virtual' function, use the list to
2638 find any overrides that are closer to the LHS type.
2640 2005-02-14 Marek Safar <marek.safar@seznam.cz>
2642 * expression.cs (New.DoResolve): Add complex core type reduction.
2643 (New.Constantify): Converts complex core type syntax like 'new int ()'
2646 2005-02-14 Raja R Harinath <rharinath@novell.com>
2648 * decl.cs (EntryType.EntryType): New constructor to create an
2649 updated copy of a cache entry.
2650 (MemberCache.AddMethods): Use it.
2651 (MemberCache.ClearDeclaredOnly): Remove.
2652 (MemberCache.MemberCache): Update.
2654 2005-02-11 Miguel de Icaza <miguel@novell.com>
2656 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2657 variable. This one is represents the actual low-level declaration
2658 of the method, as opposed to the semantic level `IsStatic'.
2660 An anonymous method which is hosted into a static method might be
2661 actually an instance method. IsStatic would reflect the
2662 container, while MethodIsStatic represents the actual code
2665 * expression.cs (ParameterReference): Use the new MethodIsStatic
2666 instead of IsStatic.
2668 * anonymous.cs (AnonymousMethod.Compatible): Pass the
2669 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2670 set on the current EmitContext.
2672 * expression.cs (Cast): Overload DoResolveLValue so we can pass
2673 resolve our casted expression as an LValue. This triggers the
2674 proper LValue processing that is later required by Assign.
2678 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2680 2005-02-11 Marek Safar <marek.safar@seznam.cz>
2682 C# 2.0 Fixed buffer implementation
2684 * anonymous.cs: Update after RegisterHelperClass renaming.
2686 * attribute.cs (AttributeTester.fixed_buffer_cache):
2687 Cache of external fixed buffers.
2688 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2689 implementation if field is fixed buffer else null.
2692 (TypeContainer.AddField): Accept FieldMember instead of Field.
2693 (FieldBase.IsFieldClsCompliant): Extracted code from
2694 VerifyClsCompliance descendant customization.
2695 (FixedField): New class handles fixed buffer fields.
2696 (FixedFieldExternal): Keeps information about imported fixed
2698 (IFixedField): Make access to internal or external fixed buffer
2701 * cs-parser.jay: Add fixed buffer parsing.
2703 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2706 * expression.cs (Indirection): Extended implementation to accept
2708 (PointerArithmetic.Emit): Get element from fixed buffer as well.
2709 (ElementAccess.MakePointerAccess): Get type as parameter.
2710 (DoResolve): Add fixed buffer field expression conversion.
2711 (DoResolveLValue): Ditto.
2712 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2713 (ArrayPtr): Derives from FixedBufferPtr.
2714 (ArrayPtr.Emit): Add extra emit for array elements.
2716 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2718 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2719 for compiler generated types.
2720 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2722 * statement.cs (Fixed): Refactored to be easier add fixed buffer
2723 and consume less memory.
2724 (Fixed.Resolve): Add fixed buffer case.
2726 * typemanager.cs (compiler_generated_attr_ctor,
2727 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2728 (HasElementType): Add our own implementation to work on every
2731 2005-02-11 Miguel de Icaza <miguel@novell.com>
2733 * anonymous.cs (CaptureContext): Track whether `this' has been
2736 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
2737 only captured `this' if it was implicitly done (instance
2738 methods/variables were used).
2740 * codegen.cs (EmitContext.CaptureThis): New method to flag that
2741 `this' must be captured.
2743 2005-01-30 Miguel de Icaza <miguel@novell.com>
2745 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2746 is null it means that there has been no need to capture anything,
2747 so we just create a sibling.
2749 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2751 Just a partial fix. The other half is fairly elusive.
2753 2005-02-10 Raja R Harinath <rharinath@novell.com>
2755 Fix #52586, cs0121-4.cs.
2756 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
2757 and return a hashtable.
2758 (MemberCache.ClearDeclaredOnly): New.
2759 (MemberCache.MemberCache): Update to change. Make a deep copy of
2760 the method_hash of a base type too.
2761 (MemberCache.AddMethods): Adapt to having a deep copy of the base
2762 type methods. Overwrite entries with the same MethodHandle so
2763 that the ReflectedType is correct. The process leaves in base
2764 virtual functions and their overrides as distinct entries.
2765 (CacheEntry): Now a class instead of a struct. It shouldn't alter
2766 matters since it was boxed in a ArrayList before.
2767 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2769 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
2770 case of a virtual function and its override (choose the overload
2772 (Invocation.OverloadResolve): Avoid 'override' members during
2773 'applicable_type' calculation.
2775 2005-03-28 Raja R Harinath <rharinath@novell.com>
2777 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2778 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2779 GetTypeHandle. It is possible for a reflected type to derive from
2780 a TypeBuilder (e.g., int[] derives from the TypeBuilder
2781 System.Array during mscorlib compilation).
2782 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2783 contain a method_hash, don't create one either. Don't create a
2784 deep copy of the base cache's method_hash.
2785 (MemberCache.SetupCache): Rename back from DeepCopy.
2786 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2787 already initialized. If we see an override function, add its
2788 underlying base virtual function to the member_hash too.
2790 2005-02-09 Raja R Harinath <rharinath@novell.com>
2792 Combine two near-redundant caches.
2793 * typemanager.cs (method_params): Rename from method_internal_params.
2794 (TypeManager.GetParameterData): New. Replace
2795 Invocation.GetParameterData.
2796 (TypeManager.LookupParametersByBuilder): Remove.
2797 * expression.cs (Invocation.method_parameter_cache): Remove.
2798 (Invocation.GetParameterData): Remove.
2800 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2803 2005-02-08 Raja R Harinath <rharinath@novell.com>
2806 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2807 TypeManager.multicast_delegate_type is null, resolve it by looking
2808 up "System.MulticastDelegate".
2809 * rootcontext.cs (RootContext.ResolveCore): Simplify.
2811 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
2812 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
2813 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
2816 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2817 (LabeledStatement.AddReference): New. Set 'referenced'.
2818 (Goto.Resolve): Use it.
2820 2005-02-05 John Luke <john.luke@gmail.com>
2822 * driver.cs: remove duplicate -doc line in Usage ()
2824 2005-02-04 Raja R Harinath <rharinath@novell.com>
2826 * location.cs (Location.AddFile): Fix CS2002 error report.
2828 2005-02-02 Martin Baulig <martin@ximian.com>
2830 * delegate.cs (Delegate.DefineType): Report an internal error if
2831 TypeManager.multicast_delegate_type is null. See bug #72015 for
2834 2005-02-02 Raja R Harinath <rharinath@novell.com>
2836 Fix a crasher in a variant of #31984.
2837 * const.cs (Constant.CheckBase): New override that defers the
2838 new-or-override check in case the base type hasn't been populated
2840 (Constant.Define): Ensure the new-or-override check is performed.
2842 2005-02-01 Duncan Mak <duncan@ximian.com>
2844 * const.cs (LookupConstantValue): Check that `ce' is not null
2845 before calling GetValue ().
2847 2005-02-01 Raja R Harinath <rharinath@novell.com>
2849 Fix test-334.cs (#69519).
2850 * cs-parser.jay (using_alias_directive): Pass in an expression to
2851 NamespaceEntry.UsingAlias.
2852 (using_namespace_directive): Pass in an expression to
2853 NamespaceEntry.Using.
2854 (namespace_name): Don't flatten to a string.
2855 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2856 (NamespaceEntry.AliasEntry.Resolve): Lookup using
2858 (NamespaceEntry.UsingEntry): Likewise.
2859 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2861 (NamespaceEntry.LookupForUsing): Remove.
2862 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2864 (NamespaceEntry.Lookup): Remove support for dotted names.
2866 2005-02-01 Raja R Harinath <rharinath@novell.com>
2868 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2870 (NamespaceEntry.ImplicitParent): Compute on demand.
2871 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2872 parallels the current.
2873 (NamespaceEntry.LookupForUsing): Use it.
2874 (NamespaceEntry.Lookup): If the current namespace-entry is
2875 implicit, don't search aliases and using tables.
2877 2005-02-01 Raja R Harinath <rharinath@novell.com>
2880 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2882 (TypeContainer.BaseCache): Compute on demand.
2883 (TypeContainer.FindMembers): Define constants and types if they're
2884 not already created.
2885 (FieldMember.Define): Move resetting of ec.InUnsafe before error
2887 * const.cs (Constant.Define): Make idempotent.
2889 2005-01-29 Miguel de Icaza <miguel@novell.com>
2891 * pending.cs: Produce better code (no nops produced by using Ldarg
2894 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2895 i - 1' it should be arg + 1.
2899 2005-01-28 Raja R Harinath <rharinath@novell.com>
2901 * attribute.cs (Attribute.CheckAttributeType): Make private
2903 (Attribute.ResolveType): Make virtual.
2904 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2905 handling of RootContext.Tree.Types.
2907 2005-01-27 Raja R Harinath <rharinath@novell.com>
2909 Update attribute-handling to use the SimpleName/MemberAccess
2911 * cs-parser.jay (attribute): Pass in an expression to the
2912 constructors of Attribute and GlobalAttribute.
2913 * attribute.cs (Attribute): Take an expression for the name.
2914 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
2915 passed in attribute name expression.
2916 (Attribute.CheckAttributeType): Use it.
2917 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2918 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2919 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
2920 argument to prevent error messages if the lookup fails.
2922 2005-01-27 Marek Safar <marek.safar@seznam.cz>
2924 * expression.cs (Indirection): Implemented IVariable interface
2925 to support indirection in AddressOf operator.
2926 (PointerArithmetic.Emit): Add optimalization for case where
2927 result can be precomputed.
2929 2005-01-26 Martin Baulig <martin@ximian.com>
2931 * class.cs (TypeContainer.AttributeTargets): Return the correct
2932 AttributeTargets depending on our `Kind' instead of throwing an
2933 exception; fixes #71632.
2935 2005-01-26 Marek Safar <marek.safar@seznam.cz>
2938 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2941 2005-03-17 Martin Baulig <martin@ximian.com>
2943 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2944 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
2946 2005-03-17 Martin Baulig <martin@ximian.com>
2948 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2949 to bool so we can return an error condition.
2950 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2953 2005-03-17 Martin Baulig <martin@ximian.com>
2955 * generic.cs (TypeMananager.IsIEnumerable): New public method.
2957 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
2958 converting from an array-type of T to `IEnumerable<T>'.
2960 2005-03-16 Martin Baulig <martin@ximian.com>
2962 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
2963 (Nullable.LiftedUnaryMutator): New public class.
2965 * expression.cs (UnaryMutator.DoResolve): Added support for
2968 2005-03-14 Martin Baulig <martin@ximian.com>
2970 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
2972 2005-03-14 Martin Baulig <martin@ximian.com>
2974 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
2975 the comparision operators `<', `>', `<=' and `>='.
2977 2005-03-13 Martin Baulig <martin@ximian.com>
2980 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
2981 avoid confusion with the `NullLiteral'.
2982 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2984 2005-03-13 Martin Baulig <martin@ximian.com>
2986 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
2987 comparing arbitrary types with the null literal.
2989 2005-03-13 Martin Baulig <martin@ximian.com>
2991 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
2992 boolean operators '&&', '||', '&' and '|'.
2993 (Nullable.OperatorTrueOrFalse): New public class.
2995 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
2996 instead of a `StaticCallExpr'; added support for nullables.
2998 2005-03-10 Martin Baulig <martin@ximian.com>
3001 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
3002 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
3004 2005-03-07 Martin Baulig <martin@ximian.com>
3006 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
3007 it work if `expr' is not an IMemoryLocation.
3008 (Nullable.Lifted): Implement IMemoryLocation.
3009 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
3012 2005-03-05 Martin Baulig <martin@ximian.com>
3014 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
3015 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
3016 (Nullable): Added support for lifted unary and binary operators.
3018 * expression.cs (Unary.DoResolve): Added support for nullable types.
3019 (Binary.DoResolve): Likewise.
3020 (Conditional.DoResolve): Likewise.
3022 2005-03-02 Martin Baulig <martin@ximian.com>
3024 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
3026 * class.cs (ClassPart.SetParameterInfo): Override this.
3027 (PartialContainer.SetParameterInfo): Override this.
3028 (TypeContainer.CheckConstraints): New protected method.
3029 (PartialContainer.CheckConstraints): Override this and check
3030 whether the same contraints were specified in all parts of a
3031 partial generic type definition.
3032 (PartialContainer.UpdateConstraints): New public method.
3034 * generic.cs (TypeParameter.UpdateConstraints): New public method.
3036 2005-03-02 Martin Baulig <martin@ximian.com>
3038 Committing a patch from Carlos Alberto Cortez to fix #72887.
3040 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
3041 casts from `T []' to `int []'.
3043 2005-03-02 Martin Baulig <martin@ximian.com>
3045 * generic.cs (TypeManager.IsEqual): Make this symmetric.
3047 * expression.cs (Binary.ResolveOperator): When resolving a
3048 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
3049 `=='. Fixes #71866. See gen-127.cs.
3051 2005-03-02 Martin Baulig <martin@ximian.com>
3053 * class.cs (TypeContainer.DoDefineMembers): We also need a default
3054 static constructor in static classes.
3056 2005-03-02 Martin Baulig <martin@ximian.com>
3059 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
3060 (Nullable.LiftedConversion): Added support for user-defined
3063 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3065 * cs-parser.jay: Use ComposedCast everywhere instead of
3066 NullableType, so we don't need to check for NullableType
3068 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3069 case where we'll be resolved into a `parenthesized_expression_0'
3073 (Convert.UserDefinedConversion): Added nullable conversions.
3075 2005-02-28 Martin Baulig <martin@ximian.com>
3077 * generic.cs (TypeManager.IsNullableType): New static method.
3078 (Nullable): New abstract class.
3079 (Nullable.NullLiteral): New public class.
3080 (Nullable.LiftedConversion): New public class.
3082 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3083 `builtin_types opt_nullable'.
3086 (Convert.ImplicitConversionStandard): Added nullable conversions.
3087 (Convert.ExplicitConversionStandard): Likewise.
3088 (Convert.ExplicitConversion): Likewise.
3090 2005-02-26 Martin Baulig <martin@ximian.com>
3092 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3093 begin with a "?", for instance "?[]". Don't do a type lookup if
3096 2005-02-25 Martin Baulig <martin@ximian.com>
3098 The first part of Nullable Types :-)
3100 * generic.cs (NullableType): New public class.
3101 (NullCoalescingOperator): New public class.
3102 (TypeArguments.Resolve): Add a CS0306 check.
3104 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3105 (opt_nullable): New rule.
3106 (type): Added `opt_nullable' to `namespace_or_type_name',
3107 `builtin_types' and `pointer_type'.
3108 (array_type): Added `opt_nullable'.
3109 (opt_rank_specifier_or_nullable): New rule; this is the
3110 combination of `opt_rank_specifier' and `opt_nullable'.
3111 (opt_error): New rule; catch errors here.
3112 (nullable_type_or_conditional): New rule; we use this to check for
3113 nullable and still detect the conditional operator.
3114 (local_variable_type): Use `opt_rank_specifier_or_nullable'
3115 instead `opt_rank_specifier'.
3117 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3120 2005-02-24 Martin Baulig <martin@ximian.com>
3122 * README, README.Changes: Removed; they're old and obsolete.
3124 2005-02-22 Martin Baulig <martin@ximian.com>
3126 * generic.cs (TypeParameter.Resolve): If resolving the constraints
3127 returned an error, set `constraints' to null to avoid a crash
3129 (TypeParameter.ResolveType): Likewise.
3131 2005-02-22 Martin Baulig <martin@ximian.com>
3134 (Constraints.ResolveTypes): Protect against being called twice.
3135 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3136 (TypeParameter.ResolveType): New public method; calls
3137 constraints.ResolveTypes().
3138 (TypeParameter.DefineType): Moved constraints.ResolveType() out
3139 into the new ResolveType().
3140 (GenericMethod.Define): Call ResolveType() on all our
3143 2005-02-21 Martin Baulig <martin@ximian.com>
3146 (TypeManager.generic_nullable_type): New static public field.
3147 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3150 (RootContext.ResolveCore): Resolve "System.Nullable`1".
3152 2005-02-15 Martin Baulig <martin@ximian.com>
3154 * generic.cs (ConstructedType.Constraints): Correctly check
3155 constraints if the argument type is a type parameter; fixes
3158 2005-02-02 Martin Baulig <martin@ximian.com>
3160 * delegate.cs (Delegate.DefineType): Report an internal error if
3161 TypeManager.multicast_delegate_type is null. See bug #72015 for
3164 2005-01-29 Miguel de Icaza <miguel@novell.com>
3166 * pending.cs: Produce better code (no nops produced by using Ldarg
3169 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3170 i - 1' it should be arg + 1.
3174 2005-01-26 Martin Baulig <martin@ximian.com>
3176 * cs-parser.jay (indexer_declarator): Don't report an error if we
3177 have type parameters since we can be an explicit interface
3178 implementation; fixes #71449.
3180 2005-01-26 Martin Baulig <martin@ximian.com>
3182 * class.cs (TypeContainer.AttributeTargets): Return the correct
3183 AttributeTargets depending on our `Kind' instead of throwing an
3184 exception; fixes #71632.
3186 2005-01-26 Martin Baulig <martin@ximian.com>
3188 * delegate.cs (Delegate.DefineType): Correctly define our type
3189 parameters. Fixes #71483.
3191 2005-01-25 Raja R Harinath <rharinath@novell.com>
3194 * expression.cs (MemberAccess.DoResolve): Don't complain with
3195 cs0572 when the LHS of a member access has identical name and type
3198 2005-01-25 Marek Safar <marek.safar@seznam.cz>
3201 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3203 Create custom PermissionSet only for PermissionSetAttribute.
3205 2005-01-24 Marek Safar <marek.safar@seznam.cz>
3208 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3209 delegates in static class.
3211 2005-01-24 Martin Baulig <martin@ximian.com>
3213 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3214 merging an implicit block, just use its reachability.
3216 * statement.cs (Block.Resolve): Make the unreachable code check
3217 work wrt. implicit blocks; see test-337 from #63842.
3219 2005-01-21 Alp Toker <alp@atoker.com>
3221 * cs-parser.jay: destructor_declaration's container is PartialContainer
3222 not Class when partial types are used, so use Kind prop instead of
3225 2005-01-22 Miguel de Icaza <miguel@ximian.com>
3227 * cs-parser.jay: Improve error reporting when an interface
3230 2005-01-20 Dick Porter <dick@ximian.com>
3232 * support.cs: SeekableStreamReader fix from Sandor Dobos
3233 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3234 chars are read. Fixes bug 70369.
3236 2005-01-20 Raja R Harinath <rharinath@novell.com>
3238 * cs-parser.jay (catch_clause): Simplify current_block handling
3241 2005-01-17 Miguel de Icaza <miguel@ximian.com>
3243 * convert.cs (ImplicitStandardConversionExists): Synchronize the
3244 code with ImplicitStandardConversion to handle the implicit
3245 conversion of method groups into valid delegate invocations.
3247 The problem is that in parameter handling we were using this code
3248 path. Fixes bug #64698
3250 2005-01-19 Raja R Harinath <rharinath@novell.com>
3252 * cs-parser.jay: Fix several infelicities.
3253 - Avoid assigning to the parser value stack. Code like
3254 '$3 = null' is unclean. Synthesize a value for the code block
3256 - Avoid using oob_stack for storing location information. Use ...
3257 (_mark_): ... this. New (empty) rule. Saves the current location
3259 (foreach_statement): Avoid using oob_stack for current_block
3260 handling. Use technique used in for_statement and
3261 using_statement. Synthesize a value for the code block to store
3262 additional intermediate information.
3264 2005-01-13 Miguel de Icaza <miguel@ximian.com>
3266 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3267 of a different type is only allowed to private fields of a
3268 containing type, not on fields of a base class.
3270 See test-174.cs and error cs0122-9.cs
3272 2005-01-13 Raja R Harinath <rharinath@novell.com>
3274 Fix test-335.cs (bug #58126).
3275 * cs-parser.jay (argument): Split out non-expression parts of the
3276 rule into 'non_simple_argument'.
3277 (invocation_expression): Support parenthesized invocations with
3278 multiple arguments, and with single non-simple arguments.
3280 2005-01-13 Raja R Harinath <rharinath@novell.com>
3282 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3285 2005-01-12 Raja R Harinath <rharinath@novell.com>
3287 Fix cs0038-1.cs, cs1640-6.cs.
3288 * ecore.cs (Expression.Resolve): Remove special-case for
3289 SimpleName in error-handling.
3290 (Expression.almostMatchedMembers): Relax access permission to
3292 (Expression.MemberLookupFailed): Handle duplicates in
3293 almostMatchedMembers list.
3294 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3295 * expression.cs (New.DoResolve): Report CS1540 for more cases.
3296 * typemanager.cs (GetFullNameSignature): Use the MethodBase
3297 overload if the passed in MemberInfo is a MethodBase.
3299 2005-01-25 Martin Baulig <martin@ximian.com>
3302 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3304 2005-01-12 Marek Safar <marek.safar@seznam.cz>
3307 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3308 for non-CAS & merge permission sets properly.
3310 2005-01-11 Raja R Harinath <rharinath@novell.com>
3312 Improve standard-compliance of simple name and member access
3313 resolution. Fixes bugs #52697, #57200, #67520, #69519.
3314 * ecore.cs (FullNamedExpression): New abstract base class
3315 for Namespaces and TypeExpressions.
3316 (ResolveFlags.SimpleName): Remove.
3317 (SimpleName): Remove support for dotted names.
3318 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
3319 DeclSpace.FindType and DeclSpace.LookupType.
3320 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3321 (Expression.ExprClassName): Make member function.
3322 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3323 a namespace. Remove creation of dotted "SimpleName"s.
3324 (MemberAccess.DoResolve): Likewise.
3325 * decl.cs (DeclSpace.Cache): Make private.
3326 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3327 (DeclSpace.FindType): Update.
3328 (DeclSpace.LookupType): Move here from RootContext. Return a
3329 FullNamedExpression.
3330 * namespace.cs (Namespace): Derive from FullNamedExpression
3331 so that it can be part of expression resolution.
3332 (Namespace.Lookup): Return an FullNamedExpression.
3333 (NamespaceEntry.LookupAlias): Lookup aliases only in current
3335 * rootcontext.cs (NamespaceLookup): Remove.
3336 (LookupType): Move to DeclSpace.
3337 * attribute.cs (CheckAttributeType): Update.
3338 * doc.cs (FindDocumentedType): Remove allowAlias argument.
3339 (FindDocumentedTypeNonArray): Likewise.
3341 2005-01-11 Raja R Harinath <rharinath@novell.com>
3343 Fix cs0509.cs, cs1632.cs.
3344 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3345 is the same as IsInterface.
3346 (TypeContainer.GetClassBases): Likewise.
3347 * statement.cs (LabeledStatement.ig): New field.
3348 (LabeledStatement.LabelTarget): Save ILGenerator which created the
3350 (LabeledStatement.DoEmit): Check that the label was created with
3351 the same ILGenerator.
3353 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3356 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3357 accessors to its properties.
3359 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3360 from accessors to property.
3362 2005-01-10 Marek Safar <marek.safar@seznam.cz>
3365 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3368 2005-01-08 Miguel de Icaza <miguel@ximian.com>
3370 * attribute.cs: Check for null and empty strings.
3372 I have lost another battle to Paolo.
3374 2005-01-07 Marek Safar <marek.safar@seznam.cz>
3377 * class.cs (PropertyMethod): Set Parent field in ctors.
3378 (SetMethod.InternalParameters): Add unsafe switch hack.
3379 Override MarkForDuplicationCheck where it is appropriate.
3381 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3382 It says whether container allows members with the same name.
3384 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3385 Removed is_method parameter.
3387 2005-01-06 Duncan Mak <duncan@ximian.com>
3389 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3390 because the previous change led to incorrect reporting of CS1032
3391 ("Cannot define/undefine preprocessor symbols after first token in
3392 file"). Instead of using `tokens_seen' as the only flag that
3393 triggers CS1040, introduce `comments_seen'. This new flag is used
3394 to signify having seen comments on the current line, so it is
3395 unset after a newline.
3397 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
3399 * doc.cs : When searching for a type, find nested type too.
3400 This fixes bug #71040.
3402 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
3405 - Warn missing member comment on those classes which also does not
3406 have doc comments. Fixed bug #71041.
3407 - Don't warn missing doc comment on default constructor.
3410 2005-01-06 Duncan Mak <duncan@ximian.com>
3412 * cs-tokenizer.cs (xtoken): After handling traditional C-style
3413 comments, set `tokens_seen' to true. This allows us to detect
3414 misplaced preprocessor directives (i.e. not at the beginning of
3415 the a line, nor after whitespaces). In that case, report error
3416 CS1040. This fixes bug #56460.
3418 * cs-parser.jay (interface_member_declaration): Add checks for
3419 IsExplicitImpl, and report CS0541 error if an interface member is
3420 defined as an explicit interface declaration.
3422 2005-01-06 Marek Safar <marek.safar@seznam.cz>
3425 * class.cs (PropertyMethod): Set Parent field in ctors.
3426 (SetMethod.InternalParameters): Add unsafe switch hack.
3428 * decl.cs (MemberCore.Parent): Cannot be readonly.
3430 2005-01-06 Raja R Harinath <rharinath@novell.com>
3432 * decl.cs (DeclSpace.ResolveType): Remove.
3433 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3434 Merge in code from ...
3435 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
3436 * class.cs, enum.cs: Update to changes.
3438 2005-01-06 Miguel de Icaza <miguel@ximian.com>
3440 * anonymous.cs: Ensure that we init the scope of our parent if it
3441 has not been initialized yet.
3443 2004-12-30 Duncan Mak <duncan@ximian.com>
3445 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3446 if field.FieldBuilder is null. Fixes #70758.
3448 * convert.cs: Fixed some typos and updated some of the comments.
3449 (ImplicitStandardConversionExists):
3450 (TryImplicitIntConversion): If `target_type' is an interface and
3451 the type of `ic' implements this interface, return true or a new
3452 BoxedCast instead of null. This fixes #70468.
3454 2004-12-29 Duncan Mak <duncan@ximian.com>
3456 * expression.cs (Argument.Emit): Check that Expr is
3457 IMemoryLocation before casting to it, and report CS1510 otherwise.
3461 2004-12-21 Ben Maurer <bmaurer@ximian.com>
3463 * statement.cs (Block.ThisVariable): remove the recursion here, to
3464 make the --profile more sane.
3466 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
3468 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3469 assembly, by JB Evain.
3471 2004-12-17 Raja R Harinath <rharinath@novell.com>
3473 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
3474 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3475 "parent" refers to enclosing type/class. "base" refers to superclass.
3477 2004-12-17 Raja R Harinath <rharinath@novell.com>
3479 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3480 Ensure that we only have GlobalAttributes.
3481 * attribute.cs (Attribute.Emit): Make non-virtual.
3482 (GlobalAttribute.Emit): Remove.
3483 (Attribute.Resolve): Make virtual.
3484 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
3485 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3486 the argument. Don't create one.
3487 (Attribute.GetObsoleteAttribute): Likewise.
3488 (Attribute.GetClsCompliantAttributeValue): Likewise.
3489 * class.cs, decl.cs: Update to changes.
3491 2004-12-17 Marek Safar <marek.safar@seznam.cz>
3493 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3495 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3497 * statement.cs (Foreach.Resolve): Add error 186 report.
3499 2004-12-16 Marek Safar <marek.safar@seznam.cz>
3501 * expression.cs (Conditional.DoResolve): Add warning 429.
3503 * statement.cs (If.Resolve): Add warning 665.
3505 2004-12-16 Raja R Harinath <rharinath@novell.com>
3507 New invariant: RootContext.Tree.Types.NamespaceEntry == null
3508 except when in the parser, and in GlobalAttribute.
3509 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3510 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3511 RootContext.Tree.Types.NamespaceEntry once work is done.
3512 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
3513 and resets RootContext.Tree.Types.NamespaceEntry.
3515 2004-12-15 Marek Safar <marek.safar@seznam.cz>
3517 * cs-parser.jay: Don't create a block for every variable.
3519 2004-12-14 Miguel de Icaza <miguel@ximian.com>
3521 * location.cs: Provide extra information.
3523 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3524 variables from the captured environment, it is the ldarg_0.
3526 2004-12-14 Marek Safar <marek.safar@seznam.cz>
3528 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3531 * class.cs: Changed warning level for 169 to avoid developer
3532 displeasure from warning flooding. It will be changed back when they
3533 fix most of current BCL warnings.
3535 * RootContext.cs: Pushed default WarningLevel to 3.
3537 * statement.cs: Removed unused variable.
3539 2004-12-14 Marek Safar <marek.safar@seznam.cz>
3541 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3542 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3543 Add error 502 report.
3544 (StaticClass.DefineType): Add error 441 report.
3545 (Class.AllowedModifiersProp): New virtual property as temporary
3546 extension to AllowedModifiers.
3547 (Class.DefineType): Add error 418 report. Moved ModFlags check here
3548 to share implementation with StaticClass and don't call virtual
3551 * driver.cs (MainDriver): Add error 1558 test.
3553 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3554 report. Moved error 36 test here.
3556 * statement.cs (Throw.Resolve): Add error 724 report.
3558 * typemanager.cs: Add out_attribute_type core type.
3560 2004-12-13 Marek Safar <marek.safar@seznam.cz>
3562 * class.cs (TypeContainer.VerifyClsCompliance): Add error
3564 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3566 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3569 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3571 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
3572 Add error 3023 report.
3573 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3575 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3578 2004-12-12 John Luke <john.luke@gmail.com>
3580 * driver.cs (AddArgs): take -- into account when
3581 adding arguments, fixes bug 65710
3583 2004-12-12 Martin Baulig <martin@ximian.com>
3585 * expression.cs (Unary.TryReduceNegative): Added support for
3586 SByteConstant and ByteConstant.
3587 (Unary.Reduce): Check error values from TryReduceNegative().
3589 2004-12-10 Marek Safar <marek.safar@seznam.cz>
3591 * attributes.cs (Attribute.Resolve): Avoid multiple error report
3592 and report exception as error 182.
3594 2004-12-10 Raja R Harinath <rharinath@novell.com>
3596 * driver.cs (Main): Fix message when there are warnings.
3598 2004-12-09 Miguel de Icaza <miguel@ximian.com>
3600 * delegate.cs: Fixed my fix from yesterday, sorry about that.
3602 2004-12-09 Marek Safar <marek.safar@seznam.cz>
3604 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
3605 Reduced number of warnings.
3607 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3609 2004-12-08 Miguel de Icaza <miguel@ximian.com>
3611 * driver.cs: Removed message.
3613 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3615 2004-12-08 <vargaz@freemail.hu>
3617 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3619 2004-12-08 Martin Baulig <martin@ximian.com>
3621 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3622 instead of a CS3002 for properties and indexer.
3624 2004-12-08 Martin Baulig <martin@ximian.com>
3626 * decl.cs (MemberName.ToString): Make this work again.
3628 2004-12-08 Marek Safar <marek.safar@seznam.cz>
3630 * attribute.cs (Resolve): Add error 591 detection.
3632 * class.cs (FieldMember.Define): Add error 1547 detection.
3633 (Indexer.Define): Add error 620 detection.
3634 (Operator.Define): Add error 590 detection.
3636 * ecore.cs: Missing argument for error 79.
3638 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3641 2004-12-07 Marek Safar <marek.safar@seznam.cz>
3644 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3647 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
3649 * cs-parser.jay : handle doc comments on implicit/explicit operators.
3650 Some operator comments were suppressed.
3651 * doc.cs : Implicit/explicit operator name in doc comments are like
3652 "op_Explicit(type)~returnType", so added suffix handling.
3654 2005-01-21 Alp Toker <alp@atoker.com>
3656 * cs-parser.jay: destructor_declaration's container is PartialContainer
3657 not Class when partial types are used, so use Kind prop instead of 'is'.
3659 2004-12-12 Martin Baulig <martin@ximian.com>
3661 * expression.cs (Unary.TryReduceNegative): Added support for
3662 SByteConstant and ByteConstant.
3663 (Unary.Reduce): Check error values from TryReduceNegative().
3665 2004-12-11 Martin Baulig <martin@ximian.com>
3667 * support.cs (ReflectionParameters.ParameterName): If we have a
3668 `gpd', call `ParameterName' on it.
3670 * parameter.cs (Parameter.GetParameterAttributes): New static method.
3672 * pending.cs (PendingImplementation.DefineProxy): Call
3673 DefineParameter() for all of the MethodBuilder's arguments.
3675 2004-12-09 Martin Baulig <martin@ximian.com>
3677 * doc.cs (DocUtil): Make this a static class.
3679 2004-12-09 Martin Baulig <martin@ximian.com>
3681 * expression.cs (Invocation.InferType): Moved the type inference
3682 implementation into TypeManager.
3684 * generics.cs (TypeManager): Moved the type inference
3685 implementation here.
3687 2004-12-09 Martin Baulig <martin@ximian.com>
3689 * typemanager.cs (TypeManager): Make this a partial class.
3692 (TypeManager): Move the generics part of `TypeManager' here.
3694 2004-12-08 Martin Baulig <martin@ximian.com>
3696 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3697 instead of a CS3002 for properties and indexer. Added CS3024
3698 check for generic interfaces.
3700 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
3701 instances are not CLS-compliant.
3703 2004-12-08 Martin Baulig <martin@ximian.com>
3706 (void_pointer_expression): New rule for `void*', `void**' etc.
3707 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
3709 2004-12-08 Martin Baulig <martin@ximian.com>
3711 * expression.cs (Invocation.InferType): Removed the hack for
3712 MethodCore.MayUnify().
3714 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
3717 * class.cs (MethodCore.MayUnify): Use
3718 TypeManager.MayBecomeEqualGenericTypes().
3720 2004-12-08 Martin Baulig <martin@ximian.com>
3722 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
3723 parameter, box it. Fixes #69233.
3725 2004-12-08 Martin Baulig <martin@ximian.com>
3727 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
3728 have the ctor constraint. Fixes #68326.
3730 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
3732 * cs-parser.jay : interface comment was not consumed because of
3733 extra opt_semicolon before doc handling.
3735 2004-12-03 Raja R Harinath <rharinath@novell.com>
3737 Fix test-327.cs, test-328.cs, and put in early infrastructure
3738 for eventually fixing #52697.
3739 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3740 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3742 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3743 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3744 (VerifyUsing, error246): Update.
3745 * rootcontext.cs (RootContext.NamespaceLookup): Just use
3746 'NamespaceEntry.LookupNamespaceOrType'.
3748 2004-12-07 Martin Baulig <martin@ximian.com>
3750 * driver.cs: Call it "BETA SOFTWARE" :-)
3752 2004-12-06 Raja R Harinath <rharinath@novell.com>
3754 Fix crash on cs0657-17.cs.
3755 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3756 Use RootContext.Tree.Types, not 'new RootTypes ()'.
3757 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3758 the case where the NamespaceEntry gets overwritten.
3760 2004-12-06 Marek Safar <marek.safar@seznam.cz>
3762 Fixed #69195, #56821
3763 * ecore.cs (ResolveBoolean): Tiny refactoring.
3765 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3766 of right expression resolving when left is false constant and
3767 operator is LogicalAnd OR true constant and operator is LogicalOr.
3769 * statement.cs (ResolveUnreachable): Always reports warning.
3771 2004-12-05 Miguel de Icaza <miguel@ximian.com>
3773 * class.cs: Distinguish between 1721 and 1722 (just a little help
3774 for the programmer).
3776 2004-12-03 Miguel de Icaza <miguel@ximian.com>
3778 * delegate.cs: Only allow this on new versions of the language.
3780 2004-12-02 Duncan Mak <duncan@ximian.com>
3782 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3784 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3785 here as a static method. Take an additional bool out parameter
3786 `must_do_cs1540_check' for signaling to InstanceResolve.
3787 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3788 member field from PropertyExpr class and made it an argument of
3790 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3791 check for MarshalByRefObject, and report CS0122 instead of CS1540.
3792 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3793 and `remove_accessor' as well as InstanceResolve: report CS0122
3798 2004-12-07 Martin Baulig <martin@ximian.com>
3800 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
3801 and CS0692 where appropriate.
3803 2004-12-06 Martin Baulig <martin@ximian.com>
3805 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
3806 IsDuplicateImplementation() and improved it.
3808 * expression.cs (Invocation.InferTypeArguments): Added
3809 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
3810 and removed the "ref" modifier from `infered_types'.
3812 * decl.cs (MemberName.ToString): Removed the exception.
3814 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
3816 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3817 comments are allowed.
3819 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3821 * delegate.cs: Add checks for subtypes in paramaters and return values
3822 in VerifyMethod () to add support for Covariance/Contravariance
3825 2004-12-02 Miguel de Icaza <miguel@ximian.com>
3827 * report.cs: Remove extra closing parenthesis.
3829 * convert.cs (Error_CannotImplicitConversion): If the name of the
3830 types are the same, provide some extra information.
3832 2004-12-02 Marek Safar <marek.safar@seznam.cz>
3835 * attribute.cs (Resolve): Improved implementation of params
3836 attribute arguments.
3838 * support.cs (ParameterData): Add HasParams to be faster.
3840 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
3842 all things are for /doc support:
3844 * doc.cs: new file that supports XML documentation generation.
3845 * mcs.exe.sources: added doc.cs.
3847 Handle /doc command line option.
3848 Report error 2006 instead of 5 for missing file name for /doc.
3849 Generate XML documentation when required, after type resolution.
3851 Added support for picking up documentation (/// and /** ... */),
3852 including a new XmlCommentState enumeration.
3854 Added lines to fill Documentation element for field, constant,
3855 property, indexer, method, constructor, destructor, operator, event
3856 and class, struct, interface, delegate, enum.
3857 Added lines to warn incorrect comment.
3859 Added Documentation field (passed only when /doc was specified).
3861 Added DocComment, DocCommentHeader, GenerateDocComment() and
3862 OnGenerateDocComment() and some supporting private members for
3863 /doc feature to MemberCore.
3865 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3867 Added overriden DocCommentHeader.
3869 Added overriden DocCommentHeader and GenerateDocComment().
3871 2004-12-01 Miguel de Icaza <miguel@ximian.com>
3873 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3874 unwrapping the enumeration values, chain to
3875 DoConstantNumericPromotions again, so we can promote things to the
3876 fundamental types (takes care of enums that are bytes, sbytes).
3880 2004-12-01 Raja R Harinath <rharinath@novell.com>
3882 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3883 Fix long-standing bug in type-lookup. Use FindType instead of
3884 LookupType when ec.ResolvingTypeTree.
3885 (Attribute.ResolveType, Attribute.Resolve)
3886 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3888 (Attributes.Search): Remove internal version. Update.
3889 (Attributes.SearchMulti): Update.
3890 (Attributes.GetClsCompliantAttribute): Remove.
3891 (Attributes.GetIndexerNameAttribute): Remove.
3892 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3893 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3894 * class.cs (Indexer.Define): Likewise.
3896 2004-12-01 Marek Safar <marek.safar@seznam.cz>
3899 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3900 MarshallByReference members access.
3902 * expression.cs: Use CheckMarshallByRefAccess;
3903 Better error CS0197 message.
3905 * report.cs: Print whole related error message.
3907 2004-11-29 Marek Safar <marek.safar@seznam.cz>
3909 * class (GetClassBases): Better error 60 report.
3910 (EventProperty): Disabled warning 67 detection.
3912 2004-11-29 Marek Safar <marek.safar@seznam.cz>
3915 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3917 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3920 2004-11-29 Marek Safar <marek.safar@seznam.cz>
3923 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3925 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3927 2004-11-26 Miguel de Icaza <miguel@ximian.com>
3929 * attribute.cs (Attribute.Resolve): Refine error reporting and
3930 report a cs0117 if the identifier does not exist, to distinguish
3931 from 0617 which is a miss-use of the actual identifier.
3933 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3934 between cs0070 and cs0079.
3936 * class.cs (MemberBase.DoDefine): When reporting a wrong
3937 accessibility level, we use MethodCore to compare instead of
3938 Method (this was a regression in some refactoring effort).
3940 So now we correctly report cs0056 again.
3942 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3943 testing the target_type (which was known to be object_type) and
3944 not the source type (which is anonymous_method).
3946 Fixed reporting of error cs1660.
3948 * expression.cs (UserCast.Source): Expose the underlying cast.
3950 * statement.cs (Switch.SwitchGoverningType): Sort the list of
3951 allowed types to find a match to int32 first (most common).
3953 In addition, it ignores any ImplicitUserConversions that did an
3954 internal implicit conversion (as the switch statement allows only
3955 one integral conversion to exist).
3957 * class.cs (PartialContainer.Create): rename `name' to
3958 `member_name' for clarity. Then replace the string calls with a
3959 call to MemberName.GetPartialName, as now using
3960 MemberName.ToString is an error (this is due to the side effects
3961 it had, that were fixed in the past).
3963 This will restore the error reporting on a number of partial class
3964 errors that were missusing this (and getting an exception as a
3965 results, which is now just a plain textual warning, because
3966 yyparse debug output would crash otherwise).
3968 2004-11-26 Raja R Harinath <rharinath@novell.com>
3970 * Makefile (PROGRAM_INSTALL_DIR): Remove.
3972 2004-11-25 Ben Maurer <bmaurer@ximian.com>
3974 * rootcontext.cs (LookupType): Make sure to cache lookups that
3975 don't give us a negative result. This saves about 5% of corlib
3978 2004-11-25 Miguel de Icaza <miguel@ximian.com>
3980 * report.cs (AbstractMessage.Print): messages are sent to stderr
3982 * class.cs (TypeContainer.GetClassBases): It is an error to have a
3983 non-interface in the list of interfaces (at this point, either
3984 parent was properly set, or a base class is being listed in the
3985 interfaces section).
3987 This flags error 1722, and resolves the crash from bug 69259.
3989 2004-11-25 Ben Maurer <bmaurer@ximian.com>
3991 * statement.cs (Using.EmitExpressionFinally): make this work right
3992 for valuetypes. Fixes 69926.
3994 2004-11-25 Miguel de Icaza <miguel@ximian.com>
3996 * const.cs (Const.ChangeType): Cope with the "0 literal can be
3997 converted to an enum" here, before we try to change the underlying
3998 type. This code exists, but it is a different code path than the
3999 one used while encoding constants.
4001 (ImplicitReferenceConversionExists): In addition, resynchronized
4002 the code here, so it matches the same code in
4003 ImplicitReferenceConversionExists for the `from any class-type S
4004 to any interface-type T'.
4006 2004-11-25 Marek Safar <marek.safar@seznam.cz>
4008 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4010 2004-11-24 Miguel de Icaza <miguel@ximian.com>
4012 * cs-parser.jay: Use verbosity accordingly.
4014 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4016 * expression.cs (Unary.ResolveOperator): Do not report warning;
4017 AddressOf reads from variable.
4019 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4021 2004-11-24 Marek Safar <marek.safar@seznam.cz>
4025 * attribute.cs (Attributable): Removed CheckTargets.
4026 (Attributes.Emit): Explicit attribute targets are tested here.
4028 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4029 not enabled for interfaces.
4031 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4032 (GetAssemblyName): Ouch next bug there.
4034 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4036 * expression.cs: Error 275 added.
4038 2004-11-23 Marek Safar <marek.safar@seznam.cz>
4040 Fix bug #69177 (Implemented decimal constant support)
4042 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4043 (BinaryFold): Add DecimalConstant.
4045 * const.cs (Define): Decimal constant
4047 (ChangeType): Add decimal type handling.
4048 (LookupConstantValue): Don't set value for decimal type but
4049 emit DecimalConstantAttribute. Needed for constant optimization.
4051 * constant.cs (ToDecimal): New method.
4052 (ConvertToDecimal): New method.
4053 (IntConstant): Implemented ConvertToDecimal.
4054 (DecimalConstant.Emit): Emit optimized version for decimals in
4057 * expression.cs (ResolveOperator): Changed order of constant
4058 reduction to work correctly with native types which have
4059 overloaded operators.
4060 (ResolveMemberAccess): Extract constant value from attribute
4063 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4065 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4066 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4067 (ChangeType): Decimal is special.
4068 (TypeToCoreType): Add decimal type.
4070 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4072 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4075 2004-11-22 Marek Safar <marek.safar@seznam.cz>
4077 * class.cs (EventField.ApplyAttributeBuilder): Fix error
4080 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4082 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4084 * pending.cs (PendingImplementation): Grab only interfaces.
4086 2004-11-19 Marek Safar <marek.safar@seznam.cz>
4088 * statement.cs (ForeachHelperMethods): Add location member and
4089 error 202 detection.
4091 2004-11-18 Marek Safar <marek.safar@seznam.cz>
4093 * expression.cs (DoResolveBase): Fixed wrong warning for out
4096 2004-12-04 Martin Baulig <martin@ximian.com>
4098 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4099 to check whether the conversion is ok.
4101 * typemanager.cs (TypeManager.GetTypeArguments): Just return
4102 `Type.EmptyTypes' if we're not a generic TypeContainer.
4104 2004-11-25 Miguel de Icaza <miguel@ximian.com>
4106 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4107 old bug: when converting from the null literal to a pointer,
4108 return an EmptyCast, not the NullLiteral.
4110 This fixes #69921, the recent null_type changes probably made this
4113 2004-12-03 Martin Baulig <martin@ximian.com>
4115 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4116 method as our child, call AnonymousMethod.Compatible() on it.
4118 2004-12-02 Miguel de Icaza <miguel@ximian.com>
4120 * class.cs (FieldBase): Use an unused bit field from the field to
4121 encode the `has_offset' property from the FieldMember. This saves
4122 a couple of Ks on bootstrap compilation.
4124 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4125 method as our child, return the AnonymousMethod resolved
4128 * expression.cs (New.DoResolve): Allow return values from
4129 NewDelegate to also include AnonymousMethods.
4133 2004-11-29 Raja R Harinath <rharinath@novell.com>
4135 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4137 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4138 System.Runtime.InteropServices._Exception, since it's a base
4139 interface of the core type System.Exception in the net_2_0 profile.
4141 2004-11-27 Martin Baulig <martin@ximian.com>
4143 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4145 2004-11-26 Raja R Harinath <rharinath@novell.com>
4147 * Makefile: Convert to use executable.make.
4148 * gmcs.exe.sources: New.
4150 2004-11-25 Martin Baulig <martin@ximian.com>
4152 * expression.cs (Invocation.InferType): Added support for byref types.
4154 2004-11-25 Martin Baulig <martin@ximian.com>
4156 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4157 in TypeManager.TypeToCoreType().
4159 2004-11-25 Martin Baulig <martin@ximian.com>
4161 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4162 "Dispose" method from the `current_type'.
4163 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4164 DoDefineMembers() instead of using the MethodBuilder; this is
4165 required for generic iterators.
4167 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4169 2004-11-24 Martin Baulig <martin@ximian.com>
4171 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4173 2004-11-20 Martin Baulig <martin@ximian.com>
4175 * expression.cs (Invocation.InferType): Correctly infer generic
4176 instances; see gen-103.cs.
4177 (Invocation.InferTypeArguments): If a generic method doesn't have
4178 any unbound type parameters, we don't need to infer anything.
4180 2004-11-19 Raja R Harinath <rharinath@novell.com>
4182 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4184 2004-11-17 Raja R Harinath <rharinath@novell.com>
4186 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4187 (TypeHandle.GetMemberCache): New.
4188 (TypeHandle.TypeHandle): Update.
4189 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4190 (TypeManager.LookupParentInterfacesCache):
4191 Rename from LookupInterfaceCache. Optimize slightly.
4192 (TypeManager.MemberLookup_FindMembers): Update.
4193 * decl.cs (MemberCache.MemberCache): Set Container to null in the
4195 (AddCacheContents): Rename from AddHashtable.
4196 * class.cs (TypeContainer.parent_container): Remove.
4197 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4198 (TypeContainer.DoDefineMembers): Don't initialize it.
4199 Update to name changes.
4201 2004-11-17 Miguel de Icaza <miguel@ximian.com>
4203 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4204 that factors the code to check access modifiers on override.
4206 (PropertyBase): Use the code here.
4208 Patch from Lluis S'anchez, fixes bug #69361.
4210 2004-11-15 Miguel de Icaza <miguel@ximian.com>
4212 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4213 routine that is used to report the use of a captured variable
4214 whose address has been taken.
4216 There are two checks: one when variables are being captured and
4217 the other check is when the address of a variable is taken.
4219 (because an anonymous methods might be resolved before *or* after
4220 the address has been taken) and
4222 * expression.cs (Conditional.DoResolve): Remove the special
4223 casing that Martin added to trueExpr and falseExpr being both
4224 NullLiteral. We get the right behavior now just by introducing
4225 the null_type into the compiler.
4227 * convert.cs (ExplicitConversion): Change the code to use
4228 null_type instead of testing `expr is NullLiteral'.
4229 (ImplicitConversionStandard): use null_type too.
4230 (ImplicitReferenceConversionExists): use null_type too.
4231 (ImplicitReferenceConversion): use null_type too.
4233 * literal.cs: The type of `NullLiteral' is now null_type instead
4235 (Resolve): Set the type here.
4237 * typemanager.cs: Introduce null_type.
4239 2004-11-18 Martin Baulig <martin@ximian.com>
4242 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
4244 2004-11-18 Martin Baulig <martin@ximian.com>
4246 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
4248 2004-11-18 Martin Baulig <martin@ximian.com>
4250 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
4251 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
4252 call ResolveConstructedType() on it to resolve it without checking
4254 (Constraints.ResolveTypes): Check them here.
4255 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
4256 but don't check constraints.
4257 (ConstructedType.ResolveAsTypeTerminal): Override this and also
4258 check constraints here.
4259 (ConstructedType.ResolveConstructedType): New public method. This
4260 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
4261 resolve ourselves without checking constraints.
4263 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
4265 2004-11-18 Martin Baulig <martin@ximian.com>
4268 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
4270 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
4272 2004-11-18 Martin Baulig <martin@ximian.com>
4274 * ecore.cs (TypeExpr.ResolveType): Removed.
4275 (Expression.ResolveAsTypeTerminal): We always return a fully
4276 resolved `TypeExpr', so we can just access its `Type'.
4278 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
4280 2004-11-17 Martin Baulig <martin@ximian.com>
4282 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
4283 sure we don't return any unresolved TypeExpr's.
4284 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
4286 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
4288 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
4289 unresolved `ConstructedType's.
4291 2004-11-17 Martin Baulig <martin@ximian.com>
4293 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4295 2004-11-17 Martin Baulig <martin@ximian.com>
4298 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4300 * decl.cs (DeclSpace.ResolveType): Removed.
4301 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
4303 2004-11-17 Martin Baulig <martin@ximian.com>
4305 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4306 direction, like FindMembers() does. Fixes #69546, testcase is in
4309 2004-11-16 Martin Baulig <martin@ximian.com>
4311 This is based on a patch from Marek Safar, see bug #69082.
4312 Fixes bugs #63705 and #67130.
4314 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4315 method; create a MemberCache for an interface type and cache the
4318 * decl.cs (IMemberContainer.ParentContainer): Removed.
4319 (IMemberContainer.ParentCache): New property.
4320 (MemberCache.SetupCacheForInterface): Removed.
4321 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4322 to create a cache for an interface's "parent".
4324 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4327 2004-11-14 Ben Maurer <bmaurer@ximian.com>
4329 * statement.cs: Avoid adding bools to a hashtable.
4331 2004-11-15 Martin Baulig <martin@ximian.com>
4333 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4335 2004-11-11 Martin Baulig <martin@ximian.com>
4337 * typemanager.cs (TypeManager.GetMethodName): New method.
4339 * class.cs (MethodData.Define): Include the generic arity in the
4340 name of an explicit interface; also add it to the method name.
4342 * pending.cs (PendingImplementation.InterfaceMethod): The method
4343 name now includes the generic arity.
4345 2004-11-07 Miguel de Icaza <miguel@ximian.com>
4347 * expression.cs (Invocation.OverloadResolve): Flag error if we are
4348 calling an unsafe method from a safe location.
4350 2004-11-06 Marek Safar <marek.safar@seznam.cz>
4353 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4355 2004-11-06 Miguel de Icaza <miguel@ximian.com>
4357 * namespace.cs (VerifyUsing): use GetPartialName instead of
4360 2004-11-05 Miguel de Icaza <miguel@ximian.com>
4362 * statement.cs (Return.Resolve): Fix regression in typo: if
4363 `in_exc', we have to request a NeedReturnLabel, this was a typo
4364 introduced in the anonymous method check-in. Fixes #69131.
4366 * Indexers were using the ShortName when defining themselves,
4367 causing a regression in the compiler bootstrap when applying the
4368 patch from 2004-11-02 (first part), now they use their full name
4369 and the bug is gone.
4371 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
4373 * driver.cs: Strip the path from the names of embedded resources. Fixes
4376 2004-11-04 Raja R Harinath <rharinath@novell.com>
4378 Fix error message regression: cs0104-2.cs.
4379 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4380 (AliasEntry.Resolve): Update.
4381 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
4383 (RootContext.LookupType): Update.
4385 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
4387 * cs-parser.jay: Add support for handling accessor modifiers
4388 * class: Add support port accessor modifiers and error checking,
4389 define PropertyMethod.Define as virtual (not abstract anymore)
4390 * ecore.cs: Add checking for proeprties access with access modifiers
4391 * iterators.cs: Modify Accessor constructor call based in the modified
4393 2004-11-02 Ben Maurer <bmaurer@ximian.com>
4395 * expression.cs (StringConcat): Handle being called twice,
4396 as when we have a concat in a field init with more than two
4399 2004-11-02 Miguel de Icaza <miguel@ximian.com>
4401 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4402 special case explicit implementations, we should always produce
4403 the .property or .event declaration.
4405 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4406 since it will not return correct data if people use this
4407 unresolved in the presence of using statements (see test-313).
4409 * class.cs (MethodData.Define): If we are an explicit interface
4410 implementation, set the method name to the full name of the
4411 interface plus the name of the method.
4413 Notice that using the method.MethodName.GetFullName() does not
4414 work, as it will only contain the name as declared on the source
4415 file (it can be a shorthand in the presence of using statements)
4416 and not the fully qualifed type name, for example:
4420 class D : ICloneable {
4421 object ICloneable.Clone () {
4425 Would produce a method called `ICloneable.Clone' instead of
4426 `System.ICloneable.Clone'.
4428 * namespace.cs (Alias.Resolve): Use GetPartialName.
4430 2004-11-01 Marek Safar <marek.safar@seznam.cz>
4432 * cs-parser.jay: Add error 1055 report.
4434 2004-11-01 Miguel de Icaza <miguel@ximian.com>
4436 * assign.cs (Assign.DoResolve): Only do the transform of
4437 assignment into a New if the types are compatible, if not, fall
4438 through and let the implicit code deal with the errors and with
4439 the necessary conversions.
4441 2004-11-01 Marek Safar <marek.safar@seznam.cz>
4443 * cs-parser.jay: Add error 1031 report.
4445 * cs-tokenizer.cs: Add location for error 1038.
4447 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4449 * cs-parser.jay: Add error 1016 report.
4451 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4453 * cs-parser.jay: Add errors 1575,1611 report.
4455 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4457 * cs-parser.jay: Add error 1001 report.
4459 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4462 * attribute.cs (GetMarshal): Add method argument for
4463 caller identification.
4465 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4466 agument for GetMarshal and RuntimeMissingSupport.
4468 2004-10-31 Marek Safar <marek.safar@seznam.cz>
4470 * attribute.cs (ExtractSecurityPermissionSet): Removed
4471 TypeManager.code_access_permission_type.
4473 * typemanager.cs: Removed TypeManager.code_access_permission_type.
4475 2004-10-27 Miguel de Icaza <miguel@ximian.com>
4477 * expression.cs (LocalVariableReference.DoResolveLValue): Check
4478 for obsolete use of a variable here. Fixes regression on errors
4479 cs0619-25 and cs0619-26.
4481 2004-10-27 Marek Safar <marek.safar@seznam.cz>
4483 Fix #62358, implemented security attribute encoding.
4485 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4486 Tests permitted SecurityAction for assembly or other types.
4487 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4488 data from SecurityPermissionAttribute to PermisionSet class.
4490 * class.cs (ApplyAttributeBuilder): Added special handling
4491 for System.Security.Permissions.SecurityAttribute based types.
4493 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4494 special handling for System.Security.Permissions.SecurityAttribute
4497 * enum.cs (ApplyAttributeBuilder): Added special handling
4498 for System.Security.Permissions.SecurityAttribute based types.
4500 * parameter.cs (ApplyAttributeBuilder): Added special handling
4501 for System.Security.Permissions.SecurityAttribute based types.
4503 * rootcontext.cs: Next 2 core types.
4505 * typemanager.cs (TypeManager.security_permission_attr_type):
4506 Built in type for the SecurityPermission Attribute.
4507 (code_access_permission_type): Build in type.
4509 2004-10-17 Miguel de Icaza <miguel@ximian.com>
4511 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4512 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4513 all of this information into
4514 EmitContext.EmitCapturedVariableInstance.
4516 * codegen.cs (EmitCapturedVariableInstance): move here the
4517 funcionality of emitting an ldarg.0 in the presence of a
4518 remapping. This centralizes the instance emit code.
4520 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4521 then emit a load of this: it means that we have reached the
4522 topmost ScopeInfo: the one that contains the pointer to the
4523 instance of the class hosting the anonymous method.
4525 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4526 captures to the topmost CaptureContext.
4528 2004-10-12 Miguel de Icaza <miguel@ximian.com>
4530 * expression.cs (LocalVariableReference): Move the knowledge about
4531 the iterators into codegen's EmitCapturedVariableInstance.
4533 2004-10-11 Miguel de Icaza <miguel@ximian.com>
4535 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4536 all code paths return a value from an anonymous method (it is the
4537 same as the 161 error, but for anonymous methods).
4539 2004-10-08 Miguel de Icaza <miguel@ximian.com>
4541 The introduction of anonymous methods in the compiler changed
4542 various ways of doing things in the compiler. The most
4543 significant one is the hard split between the resolution phase
4544 and the emission phases of the compiler.
4546 For instance, routines that referenced local variables no
4547 longer can safely create temporary variables during the
4548 resolution phase: they must do so from the emission phase,
4549 since the variable might have been "captured", hence access to
4550 it can not be done with the local-variable operations from the runtime.
4554 (Block.Flags): New flag `IsTopLevel' to indicate that this block
4555 is a toplevel block.
4557 (ToplevelBlock): A new kind of Block, these are the blocks that
4558 are created by the parser for all toplevel method bodies. These
4559 include methods, accessors and anonymous methods.
4561 These contain some extra information not found in regular blocks:
4562 A pointer to an optional CaptureContext (for tracking captured
4563 local variables and parameters). A pointer to the parent
4566 (Return.Resolve): Catch missmatches when returning a value from an
4567 anonymous method (error 1662).
4568 Invoke NeedReturnLabel from the Resolve phase instead of the emit
4571 (Break.Resolve): ditto.
4573 (SwitchLabel): instead of defining the labels during the
4574 resolution phase, we now turned the public ILLabel and ILLabelCode
4575 labels into methods called GetILLabelCode() and GetILLabel() that
4576 only define the label during the Emit phase.
4578 (GotoCase): Track the SwitchLabel instead of the computed label
4579 (its contained therein). Emit the code by using
4580 SwitchLabel.GetILLabelCode ().
4582 (LocalInfo.Flags.Captured): A new flag has been introduce to track
4583 whether the Local has been captured or not.
4585 (LocalInfo.IsCaptured): New property, used to tell whether the
4586 local has been captured.
4588 * anonymous.cs: Vastly updated to contain the anonymous method
4591 The main classes here are: CaptureContext which tracks any
4592 captured information for a toplevel block and ScopeInfo used to
4593 track the activation frames for various local variables.
4595 Each toplevel block has an optional capture context associated
4596 with it. When a method contains an anonymous method both the
4597 toplevel method and the anonymous method will create a capture
4598 context. When variables or parameters are captured, they are
4599 recorded on the CaptureContext that owns them, for example:
4603 MyDelegate d = delegate {
4608 Here `a' will be recorded as captured on the toplevel
4609 CapturedContext, the inner captured context will not have anything
4610 (it will only have data if local variables or parameters from it
4611 are captured in a nested anonymous method.
4613 The ScopeInfo is used to track the activation frames for local
4614 variables, for example:
4616 for (int i = 0; i < 10; i++)
4617 for (int j = 0; j < 10; j++){
4618 MyDelegate d = delegate {
4623 At runtime this captures a single captured variable `i', but it
4624 captures 10 different versions of the variable `j'. The variable
4625 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4626 recorded on a child.
4628 The toplevel ScopeInfo will also track information like the `this'
4629 pointer if instance variables were referenced (this is necessary
4630 as the anonymous method lives inside a nested class in the host
4631 type of the method).
4633 (AnonymousMethod): Expanded to track the Toplevel, implement
4634 `AnonymousMethod.Compatible' to tell whether an anonymous method
4635 can be converted to a target delegate type.
4637 The routine now also produces the anonymous method content
4639 (AnonymousDelegate): A helper class that derives from
4640 DelegateCreation, this is used to generate the code necessary to
4641 produce the delegate for the anonymous method that was created.
4643 * assign.cs: API adjustments for new changes in
4644 Convert.ImplicitStandardConversionExists.
4646 * class.cs: Adjustments to cope with the fact that now toplevel
4647 blocks are of type `ToplevelBlock'.
4649 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4650 insteda of standard blocks.
4652 Flag errors if params arguments are passed to anonymous methods.
4654 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4655 `CurrentAnonymousMethod' which points to the current Anonymous
4656 Method. The variable points to the AnonymousMethod class that
4657 holds the code being compiled. It is set in the new EmitContext
4658 created for the anonymous method.
4660 (EmitContext.Phase): Introduce a variable and an enumeration to
4661 assist in enforcing some rules about when and where we are allowed
4662 to invoke certain methods (EmitContext.NeedsReturnLabel is the
4663 only one that enfonces this right now).
4665 (EmitContext.HaveCaptureInfo): new helper method that returns
4666 whether we have a CapturedContext initialized.
4668 (EmitContext.CaptureVariable): New method used to register that a
4669 LocalInfo must be flagged for capturing.
4671 (EmitContext.CapturedParameter): New method used to register that a
4672 parameters must be flagged for capturing.
4674 (EmitContext.CapturedField): New method used to register that a
4675 field must be flagged for capturing.
4677 (EmitContext.HaveCapturedVariables,
4678 EmitContext.HaveCapturedFields): Return whether there are captured
4679 variables or fields.
4681 (EmitContext.EmitMethodHostInstance): This is used to emit the
4682 instance for the anonymous method. The instance might be null
4683 (static methods), this (for anonymous methods that capture nothing
4684 and happen to live side-by-side with the current method body) or a
4685 more complicated expression if the method has a CaptureContext.
4687 (EmitContext.EmitTopBlock): Routine that drives the emission of
4688 code: it will first resolve the top block, then emit any metadata
4689 and then emit the code. The split is done so that we can extract
4690 any anonymous methods and flag any captured variables/parameters.
4692 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4693 during this phase, the ILGenerator should not be used as labels
4694 and local variables declared here might not be accessible to any
4695 code that is part of an anonymous method.
4697 Exceptions to this include the temporary variables that are
4698 created by some statements internally for holding temporary
4701 (EmitContext.EmitMeta): New routine, in charge of emitting all the
4704 (EmitContext.TemporaryReturn): This method is typically called
4705 from the Emit phase, and its the only place where we allow the
4706 ReturnLabel to be defined other than the EmitMeta. The reason is
4707 that otherwise we would have to duplicate a lot of logic in the
4708 Resolve phases of various methods that today is on the Emit
4711 (EmitContext.NeedReturnLabel): This no longer creates the label,
4712 as the ILGenerator is not valid during the resolve phase.
4714 (EmitContext.EmitThis): Extended the knowledge in this class to
4715 work in anonymous methods in addition to iterators.
4717 (EmitContext.EmitCapturedVariableInstance): This emits whatever
4718 code is necessary on the stack to access the instance to a local
4719 variable (the variable will be accessed as a field).
4721 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4722 EmitContext.EmitAddressOfParameter): Routines to support
4723 parameters (not completed at this point).
4725 Removals: Removed RemapLocal and RemapLocalLValue. We probably
4726 will also remove the parameters.
4728 * convert.cs (Convert): Define a `ConstantEC' which points to a
4729 null. This is just to prefity some code that uses
4730 ImplicitStandardConversion code and do not have an EmitContext
4733 The idea is to flag explicitly that at that point in time, it is
4734 known that the conversion will not trigger the delegate checking
4735 code in implicit conversions (which requires a valid
4738 Everywhere: pass new EmitContext parameter since
4739 ImplicitStandardConversionExists now requires it to check for
4740 anonymous method conversions.
4742 (Convert.ImplicitStandardConversionExists): If the type of an
4743 expression is the anonymous_method_type, and the type is a
4744 delegate, we invoke the AnonymousMethod.Compatible method to check
4745 whether an implicit conversion is possible.
4747 (Convert.ImplicitConversionStandard): Only do implicit method
4748 group conversions if the language level is not ISO_1.
4750 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4751 MethodInfo for the Invoke method. used by Delegate and
4754 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4755 method conversions if the target type is a delegate.
4757 Removed extra debugging nops.
4759 (LocalVariableReference): Turn the `local_info' into a public
4762 Add `prepared' field, the same hack used for FieldExprs to cope
4763 with composed assignments, as Local variables do not necessarily
4764 operate purely on the stack as they used to: they can be captured
4767 Add `temp' for a temporary result, like fields.
4769 Refactor DoResolve and DoResolveLValue into DoResolveBase.
4771 It now copes with Local variables that are captured and emits the
4772 proper instance variable to load it from a field in the captured
4775 (ParameterReference.DoResolveBase): During the resolve phase,
4776 capture parameters if we are in an anonymous method.
4778 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4779 anonymous method, use the EmitContext helper routines to emit the
4780 parameter reference.
4782 * iterators.cs: Set RemapToProxy to true/false during the
4785 * parameters.cs (GetParameterByName): New helper method.
4787 * typemanager.cs (anonymous_method_type) a new type that
4788 represents an anonyous method. This is always an internal type,
4789 used as a fencepost to test against the anonymous-methodness of an
4792 2004-10-20 Marek Safar <marek.safar@seznam.cz>
4794 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4796 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4798 2004-11-10 Martin Baulig <martin@ximian.com>
4800 * expression.cs (Invocation.BetterFunction): If two methods have
4801 equal parameter types, but only one of them is generic, the
4802 non-generic one wins.
4803 (New.DoResolve): Don't set `is_struct' to false if we're a generic
4804 instance; just use `Type.IsValueType' to determine whether
4805 something is a struct or not.
4806 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
4807 so we can be called multiple times.
4809 2004-11-10 Martin Baulig <martin@ximian.com>
4811 * generic.cs (TypeParameter.DefineConstraints): New public method.
4812 (TypeParameter.CheckAccessLevel): Override this and return true.
4813 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
4814 override ResolveType() anymore.
4815 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
4817 2004-11-10 Martin Baulig <martin@ximian.com>
4819 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
4820 call DeclSpace.ResolveNestedType() on it.
4822 2004-11-10 Martin Baulig <martin@ximian.com>
4824 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
4825 non-null, call ParameterModifier() on it.
4827 2004-11-10 Martin Baulig <martin@ximian.com>
4830 (Iterators): Added `current_type' and `this_type' fields.
4831 (Iterators.DefineIterator): Create a new EmitContext and store it
4832 in `ec'; compute `this_type'.
4834 2004-11-10 Martin Baulig <martin@ximian.com>
4837 (TypeManager.IsPrivateAccessible): New public method.
4838 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
4840 2004-11-10 Martin Baulig <martin@ximian.com>
4842 * class.cs (TypeContainer.DefineType): Call
4843 TypeBuilder.DefineGenericParameters() before resolving the type
4845 (MethodData.parent_method): New protected field.
4846 (MethodData..ctor): Added `MethodInfo parent_method' argument.
4847 (MethodData.Define): Compute `parent_method'.
4850 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4851 (MemberCore.GetClsCompliantAttributeValue): Likewise.
4852 (DeclSpace.ec): New protected field; store the EmitContext here.
4853 (DeclSpace.EmitContext): New public property.
4854 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
4855 (DeclSpace.ResolveNestedType): New public method.
4856 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
4857 (DeclSpace.NestedAccessible): Added `Type tb' argument.
4858 (DeclSpace.FamilyAccessible): Likewise.
4859 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
4860 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4863 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
4866 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4867 (Enum.Emit): Don't create a new EmitContext.
4869 2004-10-18 Martin Baulig <martin@ximian.com>
4871 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4872 `Type' directly, but call ResolveType() on it.
4873 (Catch.Resolve): Likewise.
4874 (Foreach.Resolve): Likewise.
4876 2004-10-18 Martin Baulig <martin@ximian.com>
4878 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4879 `Type' directly, but call ResolveType() on it.
4880 (Probe.DoResolve): Likewise.
4881 (ArrayCreation.LookupType): Likewise.
4882 (TypeOf.DoResolve): Likewise.
4883 (SizeOf.DoResolve): Likewise.
4885 2004-10-18 Raja R Harinath <rharinath@novell.com>
4887 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4890 2004-10-17 John Luke <john.luke@gmail.com>
4892 * class.cs (Operator.GetSignatureForError): use CSharpName
4894 * parameter.cs (Parameter.GetSignatureForError): Returns
4895 correct name even if was not defined.
4897 2004-10-13 Raja R Harinath <rharinath@novell.com>
4900 * class.cs (TypeContainer.EmitContext): New property.
4901 (DefineNestedTypes): Create an emitcontext for each part.
4902 (MethodCore.DoDefineParameters): Use container's emitcontext.
4903 Pass type array to InternalParameters.
4904 (MemberBase.DoDefine): Use container's emitcontext.
4905 (FieldMember.Define): Likewise.
4906 (Event.Define): Likewise.
4907 (SetMethod.GetParameterInfo): Change argument to EmitContext.
4908 Pass type array to InternalParameters.
4909 (SetIndexerMethod.GetParameterInfo): Likewise.
4910 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4911 * delegate.cs (Define): Pass emitcontext to
4912 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
4913 array to InternalParameters.
4914 * expression.cs (ParameterReference.DoResolveBase): Pass
4915 emitcontext to GetParameterInfo.
4916 (ComposedCast.DoResolveAsTypeStep): Remove check on
4917 ec.ResolvingTypeTree.
4918 * parameter.cs (Parameter.Resolve): Change argument to
4919 EmitContext. Use ResolveAsTypeTerminal.
4920 (Parameter.GetSignature): Change argument to EmitContext.
4921 (Parameters.ComputeSignature): Likewise.
4922 (Parameters.ComputeParameterTypes): Likewise.
4923 (Parameters.GetParameterInfo): Likewise.
4924 (Parameters.ComputeAndDefineParameterTypes): Likewise.
4925 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
4926 * support.cs (InternalParameters..ctor): Remove variant that takes
4928 * typemanager.cs (system_intptr_expr): New.
4929 (InitExpressionTypes): Initialize it.
4931 2004-10-12 Chris Toshok <toshok@ximian.com>
4933 * cs-parser.jay: fix location for try_statement and catch_clause.
4935 2004-10-18 Martin Baulig <martin@ximian.com>
4937 * class.cs (FieldMember.Define): Don't access the TypeExpr's
4938 `Type' directly, but call ResolveType() on it.
4939 (MemberBase.DoDefine): Likewise.
4941 * expression.cs (New.DoResolve): Don't access the TypeExpr's
4942 `Type' directly, but call ResolveType() on it.
4943 (ComposedCast.DoResolveAsTypeStep): Likewise.
4945 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4946 `Type' directly, but call ResolveType() on it.
4948 2004-10-17 John Luke <john.luke@gmail.com>
4950 * class.cs (Operator.GetSignatureForError): use CSharpName
4952 * parameter.cs (Parameter.GetSignatureForError): Returns
4953 correct name even if was not defined.
4955 2004-10-13 Raja R Harinath <rharinath@novell.com>
4958 * class.cs (TypeContainer.EmitContext): New property.
4959 (DefineNestedTypes): Create an emitcontext for each part.
4960 (MethodCore.DoDefineParameters): Use container's emitcontext.
4961 Pass type array to InternalParameters.
4962 (MemberBase.DoDefine): Use container's emitcontext.
4963 (FieldMember.Define): Likewise.
4964 (Event.Define): Likewise.
4965 (SetMethod.GetParameterInfo): Change argument to EmitContext.
4966 Pass type array to InternalParameters.
4967 (SetIndexerMethod.GetParameterInfo): Likewise.
4968 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4969 * delegate.cs (Define): Pass emitcontext to
4970 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
4971 array to InternalParameters.
4972 * expression.cs (ParameterReference.DoResolveBase): Pass
4973 emitcontext to GetParameterInfo.
4974 (ComposedCast.DoResolveAsTypeStep): Remove check on
4975 ec.ResolvingTypeTree.
4976 * parameter.cs (Parameter.Resolve): Change argument to
4977 EmitContext. Use ResolveAsTypeTerminal.
4978 (Parameter.GetSignature): Change argument to EmitContext.
4979 (Parameters.ComputeSignature): Likewise.
4980 (Parameters.ComputeParameterTypes): Likewise.
4981 (Parameters.GetParameterInfo): Likewise.
4982 (Parameters.ComputeAndDefineParameterTypes): Likewise.
4983 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
4984 * support.cs (InternalParameters..ctor): Remove variant that takes
4986 * typemanager.cs (system_intptr_expr): New.
4987 (InitExpressionTypes): Initialize it.
4989 2004-10-12 Chris Toshok <toshok@ximian.com>
4991 * cs-parser.jay: fix location for try_statement and catch_clause.
4993 2004-10-07 Raja R Harinath <rharinath@novell.com>
4995 More DeclSpace.ResolveType avoidance.
4996 * decl.cs (MemberCore.InUnsafe): New property.
4997 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
4998 with newly created EmitContext.
4999 (FieldMember.Define): Likewise.
5000 * delegate.cs (Delegate.Define): Likewise.
5001 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5002 only if normal name-lookup fails.
5003 (TypeExpr.DoResolve): Enable error-checking.
5004 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5005 (SizeOf.DoResolve): Likewise.
5006 (ComposedCast.DoResolveAsTypeStep): Likewise.
5007 (StackAlloc.DoResolve): Likewise.
5008 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5009 (Block.Unsafe): New property.
5010 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5011 (Unsafe): Set 'unsafe' flag of contained block.
5012 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5013 (Fixed.Resolve): Likewise.
5014 (Catch.Resolve): Likewise.
5015 (Using.ResolveLocalVariableDecls): Likewise.
5016 (Foreach.Resolve): Likewise.
5018 2004-10-05 John Luke <john.luke@gmail.com>
5020 * cs-parser.jay: add location to error CS0175
5022 2004-10-04 Miguel de Icaza <miguel@ximian.com>
5024 * ecore.cs (Expression.Constantity): Add support for turning null
5027 * const.cs (Const.Define): Allow constants to be reference types
5028 as long as the value is Null.
5030 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
5032 * namespace.cs (NamespaceEntry.Using): No matter which warning
5033 level is set, check if this namespace name has already been added.
5035 2004-10-03 Ben Maurer <bmaurer@ximian.com>
5037 * expression.cs: reftype [!=]= null should always use br[true,false].
5040 2004-10-03 Marek Safar <marek.safar@seznam.cz>
5043 * attribute.cs: Enum conversion moved to
5044 GetAttributeArgumentExpression to be applied to the all
5047 2004-10-01 Raja R Harinath <rharinath@novell.com>
5049 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5050 * class.c (TypeContainer.DefineType): Flag error if
5051 base types aren't accessible due to access permissions.
5052 * decl.cs (DeclSpace.ResolveType): Move logic to
5053 Expression.ResolveAsTypeTerminal.
5054 (DeclSpace.ResolveTypeExpr): Thin layer over
5055 Expression.ResolveAsTypeTerminal.
5056 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5057 Refactor code into NestedAccess. Use it.
5058 (DeclSpace.NestedAccess): New.
5059 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5060 argument to silence errors. Check access permissions.
5061 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5062 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5063 (Cast.DoResolve): Likewise.
5064 (New.DoResolve): Likewise.
5065 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5066 (TypeOf.DoResolve): Likewise.
5068 * expression.cs (Invocation.BetterConversion): Return the Type of
5069 the better conversion. Implement section 14.4.2.3 more faithfully.
5070 (Invocation.BetterFunction): Make boolean. Make correspondence to
5071 section 14.4.2.2 explicit.
5072 (Invocation.OverloadResolve): Update.
5073 (Invocation): Remove is_base field.
5074 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
5075 (Invocation.Emit): Likewise.
5077 2004-09-24 Marek Safar <marek.safar@seznam.cz>
5079 * cs-parser.jay: Reverted 642 warning fix.
5081 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5084 * decl.cs (FindMemberWithSameName): Indexer can have more than
5087 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5089 * expression.cs (LocalVariableReference.DoResolveLValue):
5090 Do not report warning 219 for out values.
5091 (EmptyExpression.Null): New member to avoid extra allocations.
5093 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5095 * cs-parser.jay: Fix wrong warning 642 report.
5097 * cs-tokenizer.cs (CheckNextToken): New helper;
5098 Inspect next character if is same as expected.
5100 2004-09-23 Martin Baulig <martin@ximian.com>
5102 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5103 (Convert.ImplicitReferenceConversionExists): Likewise.
5105 2004-11-09 Raja R Harinath <rharinath@novell.com>
5107 * Makefile (DISTFILES): Comment out a few missing files.
5109 2004-10-29 Raja R Harinath <rharinath@novell.com>
5111 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5112 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
5113 (gmcs.exe): Invoke bootstrap-libs.
5114 (clean-local): Clean the net_2_0_bootstrap profile too.
5115 (PROGRAM_INSTALL_DIR): New.
5116 (install-local): Use it.
5118 2004-10-13 Martin Baulig <martin@ximian.com>
5120 * generic.cs (TypeManager.InflatedConstraints): New nested class.
5121 (TypeParameter.DefineType): If we're a method type parameter and
5122 that method is overriding something, "inflate" its constraints.
5124 2004-10-12 Martin Baulig <martin@ximian.com>
5126 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5127 and have type arguments, create and resolve a ConstructedType.
5129 2004-10-12 Martin Baulig <martin@ximian.com>
5131 * decl.cs (MemberCache.FindMemberToOverride): Use
5132 TypeManager.IsEqual() to compare the parameters and Type.Equals()
5133 to compare the invocationType.
5135 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5136 When comparing two type parameters, only do the signature-only
5137 comparision for method type parameters.
5139 2004-10-11 Martin Baulig <martin@ximian.com>
5141 * report.cs: Don't make --fatal abort on warnings, we have
5142 -warnaserror for that.
5144 2004-10-11 Martin Baulig <martin@ximian.com>
5147 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5148 (TypeManager.IsEqual): Call ourself recursively instead of using
5151 2004-10-11 Martin Baulig <martin@ximian.com>
5153 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5154 on our own type parameters, not on the ones we inherit from a containing
5157 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5160 * generic.cs (TypeParameter.Define): We may only be called once.
5162 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5163 instead of TypeManager.IsEqual().
5165 2004-09-28 Martin Baulig <martin@ximian.com>
5168 (GenericConstraints.EffectiveBaseClass): New public property.
5169 (TypeParameter.GenericConstraints): New public property.
5170 (ConstructedType.CheckConstraints): Improved.
5172 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5173 (Convert.TypeParameterConversion): New private method; use this in
5174 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5175 for all conversions related to type parameters.
5177 2004-09-24 Martin Baulig <martin@ximian.com>
5179 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5180 type parameter conversions for type parameters which are known to
5183 2004-09-24 Martin Baulig <martin@ximian.com>
5185 * generic.cs (GenericConstraints): Added `IsReferenceType' and
5186 `IsValueType' properties.
5188 * support.cs (ReflectionConstraints): Use
5189 Type.GetGenericParameterConstraints() instead of the old hack.
5191 2004-09-24 Martin Baulig <martin@ximian.com>
5193 * generic.cs (GenericConstraints): Moved here and made it an
5196 * support.cs (GenericConstraints): Moved to generic.cs.
5198 2004-09-24 Martin Baulig <martin@ximian.com>
5201 (ReflectionConstraints): Un-nested this class and made it public.
5204 (TypeManager.GetTypeParameterConstraints): New public method.
5205 (TypeManager.HasConstructorConstraint): Use the attributes.
5207 2004-09-24 Martin Baulig <martin@ximian.com>
5209 * support.cs (GenericConstraints): Replaced `HasConstructor',
5210 `IsReferenceType' and `IsValueType' with `Attributes'.
5211 (ReflectionParameters.ReflectionConstraints): Removed the Create()
5212 method and made the .ctor public.
5214 * generic.cs (Constraints.Attributes): New public property.
5215 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5216 `IsReferenceType' -> `HasReferenceTypeConstraint' and
5217 `IsValueType' -> `HasValueTypeConstraint'.
5219 2004-09-23 Martin Baulig <martin@ximian.com>
5221 * generic.cs (Constraints): Reflect latest runtime changes.
5223 2004-09-23 Martin Baulig <martin@ximian.com>
5225 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5226 (Convert.ImplicitReferenceConversionExists): Likewise.
5228 2004-09-23 Marek Safar <marek.safar@seznam.cz>
5230 * class.cs (Operator.Define): Add error 448 and 559 report.
5232 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5234 * class.cs (MemberBase.IsTypePermitted): New protected
5235 method for checking error CS0610.
5237 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5239 * class.cs (TypeContainer.HasExplicitLayout): New property
5240 Returns whether container has StructLayout attribute set Explicit.
5241 (FieldMember): New abstract class for consts and fields.
5242 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5243 (Field): Reuse FieldMember.
5245 * const.cs (Const): Reuse FieldMember.
5247 * rootcontext.cs: EmitConstants call moved to class.
5249 2004-09-22 Martin Baulig <martin@ximian.com>
5251 Marek and me just fixed one of our oldest bugs: #28562 :-)
5253 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5255 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5256 we're an EnumConstant, just return that.
5257 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5258 an EnumConstant. In this case, we need to use GetValueAsEnumType()
5259 to get the value which'll actually be written into the attribute.
5260 However, we have to use GetValue() to access the attribute's value
5263 2004-09-22 Marek Safar <marek.safar@seznam.cz>
5265 * constant.cs (Constant.IsNegative): New abstract property
5268 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5269 (StackAlloc.DoResolve): Reused IsNegative.
5271 2004-09-22 Martin Baulig <martin@ximian.com>
5273 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
5274 public method; like LookupTypeContainer, but also works for
5277 * report.cs (Report.SymbolRelatedToPreviousError): Use
5278 TypeManager.LookupGenericTypeContainer().
5280 2004-09-22 Martin Baulig <martin@ximian.com>
5282 Thanks to Peter Sestoft for this bug report.
5284 * expression.cs (Conditional): If both the `trueExpr' and the
5285 `falseExpr' is a NullLiteral, return a NullLiteral.
5287 2004-09-22 Martin Baulig <martin@ximian.com>
5289 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5290 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5291 for the "get_Current" call.
5293 2004-09-21 Martin Baulig <martin@ximian.com>
5295 * convert.cs (Convert.ImplicitReferenceConversion): When
5296 converting to an interface type, first check whether we're
5297 converting from a reference type.
5299 2004-09-14 Martin Baulig <martin@ximian.com>
5301 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5303 2004-09-14 Marek Safar <marek.safar@seznam.cz>
5306 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5307 called and is obsolete then this member suppress message
5308 when call is inside next [Obsolete] method or type.
5310 * expression.cs: Use TestObsoleteMethodUsage member.
5312 2004-09-14 Martin Baulig <martin@ximian.com>
5314 * genericparser.cs: Removed.
5316 2004-09-13 Marek Safar <marek.safar@seznam.cz>
5318 * class.cs (MethodCore.CheckBase): Fix bug #65757.
5320 2004-09-12 Marek Safar <marek.safar@seznam.cz>
5322 * attribute.cs (Attribute.Resolve): Add error 653 report.
5324 * class.cs (Class.ApplyAttributeBuilder): Add error 641
5326 (Method.ApplyAttributeBuilder): Add error 685 report.
5327 (Operator.Define): Add error 564 report.
5329 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5331 * expression.cs (Invocation.DoResolve): Add error
5334 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5337 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5339 * class.cs (ConstructorInitializer.Resolve):
5340 Wrong error number (515->516).
5342 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5344 * class.cs (Indexer.Define): Add error 631 report.
5346 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5348 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5350 2004-09-11 Marek Safar <marek.safar@seznam.cz>
5352 * expression.cs (Probe.DoResolve): Add error CS0241 report.
5354 2004-09-10 Marek Safar <marek.safar@seznam.cz>
5356 * cs-parser.jay: Added error CS0241 report.
5358 2004-09-10 Raja R Harinath <rharinath@novell.com>
5360 * cs-parser.jay (fixed_statement): Introduce a scope for the
5361 declaration in the 'fixed' statement.
5363 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5365 * cs-parser.jay: Added CS0230 error report.
5367 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5369 * cs-parser.jay: Added errors CS0231 and CS0257 report.
5371 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5373 * expression.cs (Argument.Resolve): Added error CS0192 and
5376 2004-09-09 Marek Safar <marek.safar@seznam.cz>
5378 C# 2.0 #pragma warning feature
5380 * cs-tokenizer.cs (PreProcessPragma): New method;
5381 Handles #pragma directive.
5383 * report.cs (WarningRegions): New class; Support
5384 class for #pragma warning directive. It tests whether
5385 warning is enabled for a given line.
5387 2004-09-08 Miguel de Icaza <miguel@ximian.com>
5389 * const.cs: Add more descriptive error report, tahnks to
5392 2004-09-08 Marek Safar <marek.safar@seznam.cz>
5394 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5396 2004-09-07 Miguel de Icaza <miguel@ximian.com>
5398 * expression.cs: Apply patch from Ben: Remove dead code from
5399 ArrayCreation, and remove the TurnintoConstant call in const.cs,
5400 as that code just threw an exception anwyays.
5402 * const.cs: Remove the call to the turnintoconstant, for details
5405 * literal.cs: The type of the null-literal is the null type; So
5406 we use a placeholder type (literal.cs:System.Null, defined here)
5409 * expression.cs (Conditional.DoResolve): Remove some old code that
5410 is no longer needed, conversions have been fixed.
5412 (ArrayCreationExpression.DoResolve): Return false if we fail to
5413 resolve the inner expression.
5415 2004-09-07 Raja R Harinath <rharinath@novell.com>
5418 * cs-parser.jay (delegate_declaration): Record a delegate
5419 declaration as a type declaration.
5420 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5422 2004-09-06 Miguel de Icaza <miguel@ximian.com>
5424 * parameter.cs: Do not crash if the type can not be resolved.
5426 * expression.cs: Report errors with unsafe pointers, fixes #64896
5428 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
5430 * expression.cs: Pointer arith always needs to do a conv.i
5431 if the operand is a long. fix 65320
5433 2004-09-04 Marek Safar <marek.safar@seznam.cz>
5435 Fixed cs0619-37.cs, cs0619-38.cs
5437 * enum.cs (GetObsoleteAttribute): Removed.
5439 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5440 on Enum member is double staged. The first is tested member
5443 2004-09-04 Marek Safar <marek.safar@seznam.cz>
5445 Fixed #56986, #63631, #65231
5447 * class.cs: (TypeContainer.AddToMemberContainer): New method,
5448 adds member to name container.
5449 (TypeContainer.AddToTypeContainer): New method, adds type to
5451 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5452 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5453 AddOperator): Simplified by reusing AddToMemberContainer.
5454 (TypeContainer.UserDefinedStaticConstructor): Changed to property
5456 (Method.CheckForDuplications): Fixed implementation to test all
5458 (MemberBase): Detection whether member is explicit interface
5459 implementation is now in constructor.
5460 (MemberBase.UpdateMemberName): Handles IndexerName.
5461 (Accessor): Changed to keep also location information.
5462 (AbstractPropertyEventMethod): Is derived from MemberCore.
5463 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5464 will be emited or not.
5465 (PropertyBase.AreAccessorsDuplicateImplementation):
5466 Tests whether accessors are not in collision with some method.
5467 (Operator): Is derived from MethodCore to simplify common
5470 * decl.cs (Flags.TestMethodDuplication): Test for duplication
5472 (DeclSpace.AddToContainer): Adds the member to defined_names
5473 table. It tests for duplications and enclosing name conflicts.
5475 * enum.cs (EnumMember): Clean up to reuse the base structures
5477 2004-09-03 Martin Baulig <martin@ximian.com>
5479 Merged latest changes into gmcs. Please keep this comment in
5480 here, it makes it easier for me to see what changed in MCS since
5481 the last time I merged.
5483 2004-09-03 Martin Baulig <martin@ximian.com>
5485 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5486 into TypeContainer, to make partial classes work again.
5488 2004-09-03 Martin Baulig <martin@ximian.com>
5490 * rootcontext.cs (RootContext.V2): Removed.
5492 2004-03-23 Martin Baulig <martin@ximian.com>
5494 * expression.cs (Invocation.OverloadResolve): Added `bool
5495 may_fail' argument and use it instead of the Location.IsNull() hack.
5497 2004-09-09 Martin Baulig <martin@ximian.com>
5499 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
5501 2004-09-09 Martin Baulig <martin@ximian.com>
5503 * generic.cs (TypeParameter.DefineType): Added support for
5504 explicit interface methods.
5506 2004-09-09 Martin Baulig <martin@ximian.com>
5508 * README.Changes: New document. Started to list important changes
5509 between MCS and GMCS here.
5511 2004-09-08 Martin Baulig <martin@ximian.com>
5514 (TypeContainer.CheckRecursiveDefinition): New protected method.
5515 (TypeContainer.DefineType): Move the CS0146 check into
5516 CheckRecursiveDefinition().
5518 2004-09-06 Martin Baulig <martin@ximian.com>
5520 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
5521 types for the constructor constraint.
5523 2004-09-03 Martin Baulig <martin@ximian.com>
5525 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5526 into TypeContainer, to make partial classes work again.
5528 2004-09-03 Martin Baulig <martin@ximian.com>
5530 * rootcontext.cs (RootContext.V2): Removed.
5532 2004-03-23 Martin Baulig <martin@ximian.com>
5534 * expression.cs (Invocation.OverloadResolve): Added `bool
5535 may_fail' argument and use it instead of the Location.IsNull() hack.
5537 2004-09-03 Martin Baulig <martin@ximian.com>
5539 Merged latest changes into gmcs. Please keep this comment in
5540 here, it makes it easier for me to see what changed in MCS since
5541 the last time I merged.
5543 2004-09-03 Raja R Harinath <rharinath@novell.com>
5546 * expression.cs (BetterConversion): Don't allow either conversion
5547 to be null. Remove redundant implicit conversion test when 'q ==
5548 null' -- when this function is invoked, we already know that the
5549 implicit conversion exists.
5550 (BetterFunction): Assume that 'best' is non-null. Remove
5551 redundant reimplementation of IsApplicable when 'best' is null.
5552 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5553 number of arguments.
5554 (IsAncestralType): Extract from OverloadResolve.
5555 (OverloadResolve): Make robust to the MethodGroupExpr being
5556 unsorted. Implement all the logic of Section 14.5.5.1, and
5557 support overloading of methods from multiple applicable types.
5558 Clean up logic somewhat. Don't pass null methods to BetterFunction.
5560 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5561 (RealError, Warning): Append type of report to related symbol.
5563 2004-09-03 Marek Safar <marek.safar@seznam.cz>
5565 * enum.cs: Fixed CLS-Compliance checks for enum members.
5566 Error tests cs3008-8.cs, cs3014-8.cs
5568 2004-09-02 Marek Safar <marek.safar@seznam.cz>
5570 Fixed bug #62342, #63102
5571 * class.cs: ImplementIndexer uses member.IsExplicitImpl
5572 like ImplementMethod.
5574 2004-09-02 Marek Safar <marek.safar@seznam.cz>
5576 * attribute.cs (Attribute.GetAttributeArgumentExpression):
5579 2004-09-02 Martin Baulig <martin@ximian.com>
5581 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5582 TypeManager.GetArgumentTypes() rather than calling GetParameters()
5585 2004-09-01 Marek Safar <marek.safar@seznam.cz>
5587 C# 2.0 Static classes implemented
5589 * class.cs (TypeContainer): instance_constructors,
5590 initialized_fields, initialized_static_fields,
5591 default_constructor, base_inteface_types are protected to be
5592 accessible from StaticClass.
5593 (TypeContainer.DefineDefaultConstructor): New virtual method
5594 for custom default constructor generating
5595 (StaticClass): New class to handle "Static classes" feature.
5597 * cs-parser.jay: Handle static keyword on class like instance
5600 * driver.cs: Added "/langversion" command line switch with two
5601 options (iso-1, default).
5603 2004-08-31 Marek Safar <marek.safar@seznam.cz>
5605 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5607 2004-08-31 Miguel de Icaza <miguel@ximian.com>
5609 * delegate.cs: Style.
5611 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
5613 * delegate.cs: Add seperate instance expr field for miguel.
5615 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
5617 * PointerArithmetic (Resolve): make sure we are not doing
5618 pointer arith on void*. Also, make sure we are resolved
5619 by not setting eclass until resolve.
5621 All callers: Make sure that PointerArithmetic gets resolved.
5623 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
5625 * ArrayCreation (LookupType): If the type does not resolve
5626 to an array, give an error.
5628 2004-08-27 Marek Safar <marek.safar@seznam.cz>
5630 * statement.cs (Try.Resolve): Fixed bug #64222
5632 2004-08-27 Martin Baulig <martin@ximian.com>
5635 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5638 2004-08-26 Marek Safar <marek.safar@seznam.cz>
5640 * ecore.cs (Constantify): Get underlying type via
5641 System.Enum.GetUnderlyingType to avoid StackOverflow on the
5642 Windows in special cases.
5644 2004-08-26 Marek Safar <marek.safar@seznam.cz>
5646 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5647 for obtaining also private methods.
5648 (GetRemoveMethod): Used GetRemoveMethod (true)
5649 for obtaining also private methods.
5651 2004-09-02 Martin Baulig <martin@ximian.com>
5653 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5654 TypeManager.GetArgumentTypes() rather than calling GetParameters()
5657 2004-08-27 Martin Baulig <martin@ximian.com>
5660 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5663 2004-08-25 Martin Baulig <martin@ximian.com>
5665 * support.cs (ReflectionParameters..ctor): If this is a generic
5666 method, retrieve and store its type parameters.
5667 (InternalParameters..ctor): Added `TypeParameter[]' argument.
5668 (ReflectionParameters.GenericConstraints): The argument specifies
5669 the type parameter, not the method parameter.
5670 (InternalParameters.GenericConstraints): Likewise.
5672 * generic.cs (TypeParameter.DefineType): Correctly handle
5673 constraints wrt. generic methods in interfaces and their
5676 2004-08-24 Martin Baulig <martin@ximian.com>
5678 * generic.cs (TypeParameter.IsSubclassOf): New public method.
5679 (Constraints.IsSubclassOf): New internal method.
5681 * typemanager.cs (TypeManager.FindMembers): Added special support
5682 for GenericTypeParameterBuilder's.
5683 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
5686 2004-08-24 Martin Baulig <martin@ximian.com>
5689 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5690 this for accessibility checks.
5691 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5692 IsNestedFamilyAccessible.
5693 (TypeManager.IsSubclassOf): New method, do what the name actually
5696 2004-08-24 Martin Baulig <martin@ximian.com>
5698 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
5699 as a SimpleName, include the generic arity.
5701 2004-08-24 Martin Baulig <martin@ximian.com>
5703 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5704 MethodAttributes.HideBySig for operators.
5706 2004-08-23 Martin Baulig <martin@ximian.com>
5708 Back to the old error reporting system :-)
5710 * report.cs (Message): Removed.
5711 (Report.MessageData, ErrorData, WarningData): Removed.
5712 (Report.Error, Warning): Back to the old system.
5714 2004-08-23 Martin Baulig <martin@ximian.com>
5716 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5718 * class.cs (TypeContainer.ParentContainer): New public virtual
5719 method; replaces the explicit interface implementation.
5720 (ClassPart.ParentContainer): Override.
5722 2004-08-23 Martin Baulig <martin@ximian.com>
5724 * statement.cs (Switch): Added support for constant switches; see
5725 #59428 or test-285.cs.
5727 2004-08-22 Marek Safar <marek.safar@seznam.cz>
5730 * statement.cs (GetEnumeratorFilter): Removed useless
5731 logic because C# specs is strict. GetEnumerator must be
5734 2004-08-22 Martin Baulig <martin@ximian.com>
5736 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5737 a switch and may break, reset the barrier. Fixes #59867.
5739 2004-08-22 Marek Safar <marek.safar@seznam.cz>
5741 CLS-Compliance speed up (~5% for corlib)
5743 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5744 New method. Tests container for CLS-Compliant names
5746 * class.cs (TypeContainer.VerifyClsName): New method.
5747 Checks whether container name is CLS Compliant.
5748 (Constructor): Implements IMethodData.
5750 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5751 low-case table for CLS Compliance test.
5752 (MemberCache.VerifyClsParameterConflict): New method.
5753 Checks method parameters for CS3006 error.
5755 * enum.cs (EnumMember): Is derived from MemberCore.
5756 (Enum.VerifyClsName): Optimized for better performance.
5758 2004-08-06 Marek Safar <marek.safar@seznam.cz>
5760 * report.cs: Renamed Error_T to Error and changed all
5763 2004-08-06 Marek Safar <marek.safar@seznam.cz>
5765 * class.cs (TypeContainer.IndexerArrayList): New inner class
5766 container for indexers.
5767 (TypeContainer.DefaultIndexerName): New constant for default
5768 indexer name. Replaced all "Item" with this constant.
5769 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5771 * typemanager.cs (TypeManager.default_member_ctor): Cache here
5772 DefaultMemberAttribute constructor.
5774 2004-08-05 Martin Baulig <martin@ximian.com>
5776 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5779 2004-08-05 Marek Safar <marek.safar@seznam.cz>
5781 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5782 multi platforms problem.
5784 * compiler.csproj: Included shared files.
5786 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5788 Fix bug 60333, 55971 in the more general way
5789 * attribute.cs (Attribute.GetAttributeArgumentExpression):
5790 Added arg_type argument for constant conversion.
5791 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5793 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5796 * class.cs (TypeContainer ): New inner classes MethodArrayList,
5797 OperatorArrayList, MethodCoreArrayList for typecontainer
5798 containers. Changed class member types to these new types.
5799 (MethodArrayList.DefineMembers): Added test for CS0659.
5801 2004-08-04 Miguel de Icaza <miguel@ximian.com>
5803 * cfold.cs: Synchronize the folding with the code in expression.cs
5804 Binary.DoNumericPromotions for uint operands.
5806 * attribute.cs: Revert patch from Raja, it introduced a regression
5807 while building Blam-1.2.1 (hard to isolate a test case).
5809 2004-08-04 Marek Safar <marek.safar@seznam.cz>
5813 (TypeContainer.Define): Renamed to DefineContainerMembers because of
5815 (MethodCore.parent_method): New member. The method we're overriding
5816 if this is an override method.
5817 (MethodCore.CheckBase): Moved from Method class and made common.
5818 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5820 (MethodCore.CheckForDuplications): New abstract method. For custom
5821 member duplication search in a container
5822 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5823 method and its return type.
5824 (Event.conflict_symbol): New member. Symbol with same name in the
5828 (MemberCache.FindMemberWithSameName): New method. The method
5829 is looking for conflict with inherited symbols.
5831 2004-08-04 Martin Baulig <martin@ximian.com>
5833 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5835 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5837 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5839 * report.cs (Message): New enum for better error, warning reference in
5841 (MessageData): New inner abstract class. It generally handles printing of
5842 error and warning messages.
5843 Removed unused Error, Warning, Message methods.
5845 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5847 Fix for cs0592-8.cs test
5849 (Attributable.ValidAttributeTargets): Made public.
5850 (Attribute.ExplicitTarget): New member for explicit target value.
5851 (Attribute.CheckTargets): Now we translate explicit attribute
5852 target to Target here.
5854 2004-08-03 Ben Maurer <bmaurer@ximian.com>
5856 * ecore.cs (MethodGroupExpr): new IsBase property.
5858 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5860 * delegate.cs (DelegateCreation): store a MethodGroupExpr
5861 rather than an instance expr.
5863 (DelegateCreation.Emit): Use the method group rather than
5864 the instance expression. Also, if you have base.Foo as the
5865 method for a delegate, make sure to emit ldftn, not ldftnvirt.
5867 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
5869 (NewDelegate.DoResolve): Only check for the existance of Invoke
5870 if the method is going to be needed. Use MethodGroupExpr.
5872 (NewDelegate.Emit): Remove, DelegateCreation implements this.
5874 * expression.cs: For pointer arith., make sure to use
5875 the size of the type, not the size of the pointer to
5878 2004-08-03 Marek Safar <marek.safar@seznam.cz>
5881 * class.cs (Class): Added error CS0502 test.
5883 2004-08-03 John Luke <jluke@cfl.rr.com>
5884 Raja R Harinath <rharinath@novell.com>
5887 * attribute.cs (Attribute.complained_before): New flag.
5888 (Attribute.ResolveType, Attribute.Resolve),
5889 (Attribute.DefinePInvokeMethod): Set it.
5890 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5892 2004-08-03 Martin Baulig <martin@ximian.com>
5894 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5895 use a user-defined operator; we still need to do numeric
5896 promotions in case one argument is a builtin type and the other
5897 one has an implicit conversion to that type. Fixes #62322.
5899 2004-08-18 Martin Baulig <martin@ximian.com>
5901 * class.cs (Method.Define): Use the correct method name when
5902 creating the MethodBuilder for a generic method.
5904 2004-08-17 Martin Baulig <martin@ximian.com>
5906 * generic.cs (Constraints): Support type parameter constraints.
5908 2004-08-16 Martin Baulig <martin@ximian.com>
5910 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
5911 (Token.GENERIC_DIMENSION): New token; this is returned if we
5912 encounter an unbound generic type in a typeof() expression.
5914 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
5915 this token is only generated while parsing a typeof() expression.
5916 (typeof_expression): Removed the old unbound_type hack.
5918 * generic.cs (TypeArguments.IsUnbound): New public property.
5920 * decl.cs (MemberName): Added support for unbound types.
5922 2004-08-14 Martin Baulig <martin@ximian.com>
5925 (TypeManager.IsEqualGenericInstance): New static method.
5926 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
5927 just used to check accessibility, so follow the rules of 26.1.6.
5929 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
5930 ConstructedType instead of a TypeExpression if we have type arguments.
5932 * cs-parser.jay (typeof_expression): Support unbound generic types.
5934 * ecore.cs (UnboundTypeExpression): New public class.
5936 2004-08-12 Martin Baulig <martin@ximian.com>
5938 * typemanager.cs (TypeManager.IsNestedChildOf): Use
5939 TypeManager.IsEqual() rather than `=='.
5941 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
5942 generic instances as well.
5944 2004-08-12 Martin Baulig <martin@ximian.com>
5946 * expression.cs (Invocation.InferType): We can only infer method
5947 type parameters. Fixes #62647.
5949 2004-08-11 Martin Baulig <martin@ximian.com>
5951 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
5952 before resolving the base classes.
5954 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
5956 * Makefile: install .mdb file too.
5958 2004-08-05 Martin Baulig <martin@ximian.com>
5960 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
5961 initializer, the current type is just the TypeBuilder, not the
5962 instantiated generic type.
5963 (FieldExpr.IsFieldInitializer): New public property.
5965 2004-08-04 Martin Baulig <martin@ximian.com>
5967 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5969 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5971 2004-08-03 Martin Baulig <martin@ximian.com>
5973 * class.cs (MethodData.Define): If we're an explicit
5974 implementation, remove the generic arity from the type name.
5976 2004-08-03 Martin Baulig <martin@ximian.com>
5978 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5979 use a user-defined operator; we still need to do numeric
5980 promotions in case one argument is a builtin type and the other
5981 one has an implicit conversion to that type. Fixes #62322.
5983 2004-08-02 Martin Baulig <martin@ximian.com>
5985 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
5987 (TypeContainer.GetClassBases): Return the unexpanded list of
5988 interfaces; we expand them later.
5989 (TypeContainer.DefineType): After creating the TypeBuilder, call
5990 TypeManager.ExpandInterfaces() to get an expanded and resolved
5993 * ecore.cs (TypeExpr.GetInterfaces): Removed
5995 * generics.cs (Constraints.InterfaceConstraints): Remove.
5996 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
5997 register the interface constraints.
6000 (TypeManager.AddUserType): Removed the `ifaces' argument.
6001 (TypeManager.AddTypeParameter): Likewise.
6002 (TypeManager.AddUserInterface): Removed, was unused.
6003 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
6004 `TypeExpr[]' array for the interfaces.
6005 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
6006 has been defined, returns a list of the resolved interfaces types.
6007 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
6008 (TypeManager.GetExplicitInterfaces): Likewise.
6010 2004-08-02 Martin Baulig <martin@ximian.com>
6012 * expression.cs (Invocation.EmitCall): If we're invoking a method
6013 on a type parameter, use the new `Constrained' prefix opcode.
6015 2004-08-02 Martin Baulig <martin@ximian.com>
6017 * statement.cs (LocalInfo.Flags): Added `IsThis'.
6018 (LocalInfo.IsThis): New public property.
6019 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6021 2004-08-01 Martin Baulig <martin@ximian.com>
6023 * class.cs (TypeContainer.GetClassBases): Don't set the default
6024 here since we may get called from GetPartialBases().
6025 (TypeContainer.DefineType): If GetClassBases() didn't return a
6026 parent, use the default one.
6028 2004-07-30 Martin Baulig <martin@ximian.com>
6030 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6032 * class.cs (SourceMethod): New public class, derive from the
6033 symbol writer's ISourceMethod.
6034 (Method): Use the new symbol writer API.
6036 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6037 as argument and use the new symbol writer.
6040 (SourceFile): Implement the symbol writer's ISourceFile.
6041 (Location.SymbolDocument): Removed.
6042 (Location.SourceFile): New public property.
6044 * symbolwriter.cs: Use the new symbol writer API.
6046 2004-07-30 Raja R Harinath <rharinath@novell.com>
6048 * Makefile (install-local): Remove. Functionality moved to
6051 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
6053 * Makefile: Install mcs.exe.config file together with mcs.exe.
6054 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6055 correct runtime version.
6057 2004-07-25 Martin Baulig <martin@ximian.com>
6060 (TypeContainer.RegisterOrder): Removed, this was unused.
6061 (TypeContainer, interface_order): Removed.
6062 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6063 TypeContainer as argument since we can also be called with a
6064 `PartialContainer' for a partial class/struct/interface.
6065 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6066 of checking whether we're an `Interface' - we could be a
6068 (PartialContainer.Register): Override; call
6069 AddClass()/AddStruct()/AddInterface() on our parent.
6071 * cs-parser.jay (interface_member_declaration): Add things to the
6072 `current_container', not the `current_class'.
6074 * rootcontext.cs (RegisterOrder): The overloaded version which
6075 takes an `Interface' was unused, removed.
6077 * typemanager.cs (TypeManager.LookupInterface): Return a
6078 `TypeContainer', not an `Interface'.
6079 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6080 contain a `PartialContainer' for an interface, so check it's
6081 `Kind' to figure out what it is.
6083 2004-07-25 Martin Baulig <martin@ximian.com>
6085 * class.cs (Class.DefaultTypeAttributes): New public constant.
6086 (Struct.DefaultTypeAttributes): Likewise.
6087 (Interface.DefaultTypeAttributes): Likewise.
6088 (PartialContainer.TypeAttr): Override this and add the
6089 DefaultTypeAttributes.
6091 2004-07-25 Martin Baulig <martin@ximian.com>
6093 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6094 we can just use the `Parent' field instead.
6096 2004-07-25 Martin Baulig <martin@ximian.com>
6098 * class.cs (TypeContainer.Emit): Renamed to EmitType().
6100 2004-07-25 Martin Baulig <martin@ximian.com>
6102 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6103 our parts before defining any methods.
6104 (TypeContainer.VerifyImplements): Make this virtual.
6105 (ClassPart.VerifyImplements): Override and call VerifyImplements()
6106 on our PartialContainer.
6108 2004-07-25 Martin Baulig <martin@ximian.com>
6110 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6112 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6113 argument, we can just use the `Parent' field instead.
6116 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
6117 (MemberBase.DoDefine): Likewise.
6119 2004-07-24 Martin Baulig <martin@ximian.com>
6121 * decl.cs (MemberCore.Parent): New public field.
6122 (DeclSpace.Parent): Moved to MemberCore.
6124 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6125 (MemberBase.ctor): Added TypeContainer argument, pass it to our
6127 (FieldBase, Field, Operator): Likewise.
6128 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6129 (EventField, Event): Likewise.
6131 2004-07-23 Martin Baulig <martin@ximian.com>
6133 * class.cs (PartialContainer): New public class.
6134 (ClassPart): New public class.
6135 (TypeContainer): Added support for partial classes.
6136 (TypeContainer.GetClassBases): Splitted some of the functionality
6137 out into GetNormalBases() and GetPartialBases().
6139 * cs-tokenizer.cs (Token.PARTIAL): New token.
6140 (Tokenizer.consume_identifier): Added some hacks to recognize
6141 `partial', but only if it's immediately followed by `class',
6142 `struct' or `interface'.
6144 * cs-parser.jay: Added support for partial clases.
6146 2004-07-23 Martin Baulig <martin@ximian.com>
6148 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6149 a `DeclSpace' and also made it readonly.
6150 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6151 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6152 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6154 * cs-parser.jay: Pass the `current_class', not the
6155 `current_container' (at the moment, this is still the same thing)
6156 to a new Method, Property, Event, Indexer or Constructor.
6158 2004-07-23 Martin Baulig <martin@ximian.com>
6160 * cs-parser.jay (CSharpParser): Added a new `current_class' field
6161 and removed the `current_interface' one.
6162 (struct_declaration, class_declaration, interface_declaration):
6163 Set `current_class' to the newly created class/struct/interface;
6164 set their `Bases' and call Register() before parsing their body.
6166 2004-07-23 Martin Baulig <martin@ximian.com>
6168 * class.cs (Kind): New public enum.
6169 (TypeContainer): Made this class abstract.
6170 (TypeContainer.Kind): New public readonly field.
6171 (TypeContainer.CheckDef): New public method; moved here from
6173 (TypeContainer.Register): New public abstract method.
6174 (TypeContainer.GetPendingImplementations): New public abstract
6176 (TypeContainer.GetClassBases): Removed the `is_class' and
6177 `is_iface' parameters.
6178 (TypeContainer.DefineNestedTypes): Formerly known as
6180 (ClassOrStruct): Made this class abstract.
6182 * tree.cs (RootTypes): New public type.
6184 2004-07-20 Martin Baulig <martin@ximian.com>
6186 * tree.cs (Tree.RecordNamespace): Removed.
6187 (Tree.Namespaces): Removed.
6189 * rootcontext.cs (RootContext.IsNamespace): Removed.
6191 * cs-parser.jay (namespace_declaration): Just create a new
6192 NamespaceEntry here.
6194 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
6196 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6197 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6198 entry to make sure it runs in the correct runtime version.
6200 2004-07-18 Martin Baulig <martin@ximian.com>
6202 * generic.cs (ConstructedType.CheckConstraints): Improved
6203 constraints checking.
6205 2004-07-18 Martin Baulig <martin@ximian.com>
6207 * expression.cs (Invocation.BetterMethod): Call
6208 TypeManager.TypeToCoreType() on all types and removed my previous
6209 hack; we're already doig the right thing here.
6211 2004-07-17 Martin Baulig <martin@ximian.com>
6213 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6215 2004-07-16 Martin Baulig <martin@ximian.com>
6217 * iterators.cs: Added generics support.
6219 2004-07-16 Martin Baulig <martin@ximian.com>
6221 * iterators.cs: Rewrote this. We're now using one single Proxy
6222 class for both the IEnumerable and the IEnumerator interface and
6223 `Iterator' derives from Class so we can use the high-level API.
6225 * class.cs (TypeContainer.AddIterator): New method.
6226 (TypeContainer.DoDefineType): New protected virtual method, which
6227 is called from DefineType().
6228 (TypeContainer.DoDefineMembers): Call DefineType() and
6229 DefineMembers() on all our iterators.
6230 (TypeContainer.Emit): Call Emit() on all our iterators.
6231 (TypeContainer.CloseType): Call CloseType() on all our iterators.
6233 * codegen.cs (EmitContext.CurrentIterator): New public field.
6235 2004-07-15 Martin Baulig <martin@ximian.com>
6238 (TypeManager.not_supported_exception_type): New type.
6240 2004-07-14 Martin Baulig <martin@ximian.com>
6243 (TypeManager.generic_ienumerable_type): New type.
6244 (TypeManager.generic_ienumerator_type): New type.
6247 (RootContext.interfaces_first_stage): Added
6248 "System.Collections.Generic.IEnumerator`1" and
6249 "System.Collections.Generic.IEnumerable`1".
6251 2004-07-14 Martin Baulig <martin@ximian.com>
6253 * iterators.cs: Use real error numbers.
6255 2004-07-14 Martin Baulig <martin@ximian.com>
6257 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6258 requires this to be a System.Collection.IEnumerable and not a
6259 class implementing that interface.
6260 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
6262 2004-07-13 Marek Safar <marek.safar@seznam.cz>
6264 * class.cs: Fixed previous fix, it broke some error tests.
6266 2004-07-12 Martin Baulig <martin@ximian.com>
6268 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6271 2004-07-14 Martin Baulig <martin@ximian.com>
6273 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
6274 an exclamation mark (!) for the generic arity to reflect the
6275 latest spec changes; ie. use "System.Collections.Generic.IList`1".
6277 2004-07-13 Martin Baulig <martin@ximian.com>
6279 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
6280 specifiers being part of a type argument.
6282 2004-07-13 Martin Baulig <martin@ximian.com>
6284 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
6285 name for generic types.
6287 2004-07-13 Martin Baulig <martin@ximian.com>
6289 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
6292 2004-07-09 Miguel de Icaza <miguel@ximian.com>
6294 * assign.cs (LocalTemporary): Add new argument: is_address,If
6295 `is_address' is true, then the value that we store is the address
6296 to the real value, and not the value itself.
6298 * ecore.cs (PropertyExpr): use the new local temporary
6299 stuff to allow us to handle X.Y += z (where X is a struct)
6301 2004-07-08 Martin Baulig <martin@ximian.com>
6303 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6304 not always return, just like we're doing in Using.Resolve().
6306 2004-07-07 Miguel de Icaza <miguel@ximian.com>
6308 * cs-parser.jay (fixed_statement): flag this as Pinned.
6310 2004-07-06 Miguel de Icaza <miguel@ximian.com>
6312 * typemanager.cs (TypeManager): Removed MakePinned method, this
6313 mechanism is replaced with the .NET 2.x compatible mechanism of
6314 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6316 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
6317 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6318 `IsFixed' property which has a different meaning.
6320 2004-07-02 Raja R Harinath <rharinath@novell.com>
6322 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6323 visible from inside a nested class, not just the names of the
6324 immediately enclosing class.
6327 2004-06-24 Raja R Harinath <rharinath@novell.com>
6329 * expression.cs (BetterConversion): Remove buggy special-case
6330 handling of "implicit constant expression conversions". At this
6331 point, we already know that the conversion is possible -- we're
6332 only checking to see which is better.
6334 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6336 * cs-parser.jay: Added error CS0210 test.
6338 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6340 * cs-parser.jay: Added error CS0134 test.
6342 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6345 * cs-parser.jay: Added error CS0145 test.
6347 2004-06-24 Marek Safar <marek.safar@seznam.cz>
6349 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6351 2004-06-23 Ben Maurer <bmaurer@ximian.com>
6353 * expression.cs (StackAlloc.Resolve): The argument may not
6354 be a constant; deal with this case.
6356 2004-06-23 Marek Safar <marek.safar@seznam.cz>
6358 * attribute.cs (IndexerName_GetIndexerName): Renamed to
6359 GetIndexerAttributeValue.
6360 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6362 * class.cs (Indexer.Define): Added error tests for CS0415,
6365 2004-06-23 Miguel de Icaza <miguel@ximian.com>
6367 * attribute.cs (Attribute.Resolve): Keep field code in sync with
6370 2004-06-23 Martin Baulig <martin@ximian.com>
6372 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6373 neither return nor throw, reset the barrier as well. Fixes #60457.
6375 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
6377 * class.cs : EventAttributes is now set to None by default.
6378 This fixes bug #60459.
6380 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6383 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6384 Don't throw exception but return null (it's sufficient now).
6386 2004-06-18 Marek Safar <marek.safar@seznam.cz>
6388 * typemanager.cs (GetArgumentTypes): Faster implementation.
6390 2004-06-18 Martin Baulig <martin@ximian.com>
6392 * attribute.cs (Attribute.Resolve): Check whether we're an
6393 EmptyCast which a Constant child. Fixes #60333.
6395 2004-06-17 Ben Maurer <bmaurer@ximian.com>
6397 * statement.cs (EmitCollectionForeach): Account for the fact that
6398 not all valuetypes are in areas which we can take the address of.
6399 For these variables, we store to a temporary variable. Also, make
6400 sure that we dont emit a `callvirt' on a valuetype method.
6402 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6404 * expression.cs (StackAlloc.DoReSolve): Added test for
6405 negative parameter (CS0247).
6407 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6410 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6412 2004-06-15 Marek Safar <marek.safar@seznam.cz>
6415 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6418 2004-06-14 Marek Safar <marek.safar@seznam.cz>
6420 Fix bug #58254 & cs1555.cs, cs1556.cs
6421 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6423 2004-06-14 Marek Safar <marek.safar@seznam.cz>
6425 * cs-parser.jay: Added error CS1669 test for indexers.
6427 2004-06-18 Martin Baulig <martin@ximian.com>
6429 * generics.cs (GenericMethod.ctor): Don't take an Attributes
6430 argument. Fixes #60441.
6432 2004-06-16 Ben Maurer <bmaurer@ximian.com>
6433 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
6434 The name needs to have the actual name of the method in order
6435 for other tests (such as the one in OverloadResolve for Invoke
6436 on a delegate) to work. As well, it does not really help
6437 error reporting because the method group had multiple methods.
6438 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
6439 Make profiling work.
6441 2004-06-13 Martin Baulig <martin@ximian.com>
6443 * cs-parser.jay: Don't allow generic attributes.
6445 2004-06-13 Martin Baulig <martin@ximian.com>
6447 * class.cs (MemberBase.DoDefineBase): New protected method.
6448 (MemberBase.DoDefine): Compute the `flags' in the new
6449 DoDefineBase() which must be called first.
6450 (Method.Define): Call DoDefineBase() first so we have the flags
6451 when defining the generic method.
6453 * cs-parser.jay (interface_method_declaration): Support generic methods.
6455 2004-06-13 Martin Baulig <martin@ximian.com>
6457 * decl.cs (TypeName): Removed.
6458 (MemberName): Removed TypeName and MemberNow; now we just have
6461 * cs-parser.jay: Don't distinguish between type arguments and type
6462 parameters in the grammar and simplified the rules a bit. The
6463 reduce/reduce conflicts are now gone (except the one we inherited
6466 2004-06-11 Martin Baulig <martin@ximian.com>
6468 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6469 call this twice: for params and varargs methods.
6471 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6474 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6476 2004-06-11 Marek Safar <marek.safar@seznam.cz>
6478 * attribute.cs (Attribute.GetValidTargets): Made public.
6481 (AbstractPropertyEventMethod): New class for better code sharing.
6482 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6484 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6486 2004-06-09 Martin Baulig <martin@ximian.com>
6488 * cs-parser.jay: Removed a reduce/reduce conflict.
6490 2004-06-03 Martin Baulig <martin@ximian.com>
6492 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
6493 GetSimpleName() and return a SimpleName.
6495 * ecore.cs (SimpleName.Arguments): New public field.
6496 (SimpleName): Added overloaded ctor which takes an additional
6497 TypeArguments argument.
6498 (SimpleName.SimpleNameResolve): Added support for generic methods.
6499 (MethodGroupExpr.ResolveGeneric): New public method. The code was
6500 formerly in MemberAccess.DoResolve(), but we also need it in
6501 SimpleNameResolve().
6503 * expression.cs (MemberAccess.DoResolve): Use the new
6504 MethodGroupExpr.ResolveGeneric().
6506 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6508 * decl.cs: If possible, use lookuptypedirect here. We can only do
6509 this if there is no `.' after the namespace. Avoids using
6510 LookupType, which does lots of slow processing.
6511 (FindNestedType) New method, does what it says :-).
6512 * namespace.cs: use LookupTypeDirect.
6513 * rootcontext.cs: use membercache, if possible.
6514 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6516 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6519 According to the spec,
6521 In a member access of the form E.I, if E is a single identifier,
6522 and if the meaning of E as a simple-name (§7.5.2) is a constant,
6523 field, property, localvariable, or parameter with the same type as
6524 the meaning of E as a type-name (§3.8), then both possible
6525 meanings of E are permitted.
6527 We did not check that E as a simple-name had the same type as E as
6530 This trivial check gives us 5-7% on bootstrap time.
6532 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6534 * expression.cs (Invocation.OverloadResolve): Avoid the
6535 use of hashtables and boxing here by allocating on demand.
6537 2004-05-30 Martin Baulig <martin@ximian.com>
6539 * rootcontext.cs (RootContext.LookupType): Don't cache things if
6540 we're doing a silent lookup. Don't try to lookup nested types in
6541 TypeManager.object_type (thanks to Ben Maurer).
6543 2004-05-30 Martin Baulig <martin@ximian.com>
6545 Committing a patch from Ben Maurer.
6547 * rootcontext.cs (RootContext.LookupType): Cache negative results.
6549 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6551 * convert.cs: add a trivial cache for overload operator resolution.
6553 2004-05-31 Marek Safar <marek.safar@seznam.cz>
6556 (AttributeTester.GetObsoleteAttribute): Returns instance of
6557 ObsoleteAttribute when type is obsolete.
6560 (TypeContainer.VerifyObsoleteAttribute): Override.
6561 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6562 (MethodCode.VerifyObsoleteAttribute): Override.
6563 (MemberBase.VerifyObsoleteAttribute): Override.
6566 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6567 and report proper error.
6570 (Delegate.VerifyObsoleteAttribute): Override.
6573 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6574 and report proper error.
6575 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6578 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6582 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6583 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6584 Added test for ObsoleteAttribute.
6587 (Catch): Derived from Statement.
6589 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6591 * decl.cs: If possible, use lookuptypedirect here. We can only do
6592 this if there is no `.' after the namespace. Avoids using
6593 LookupType, which does lots of slow processing.
6594 (FindNestedType) New method, does what it says :-).
6595 * namespace.cs: use LookupTypeDirect.
6596 * rootcontext.cs: use membercache, if possible.
6597 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6599 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6602 According to the spec,
6604 In a member access of the form E.I, if E is a single identifier,
6605 and if the meaning of E as a simple-name (§7.5.2) is a constant,
6606 field, property, localvariable, or parameter with the same type as
6607 the meaning of E as a type-name (§3.8), then both possible
6608 meanings of E are permitted.
6610 We did not check that E as a simple-name had the same type as E as
6613 This trivial check gives us 5-7% on bootstrap time.
6615 2004-05-30 Marek Safar <marek.safar@seznam.cz>
6617 Fixed bug #59071 & cs0160.cs
6618 * statement.cs (Try.Resolve): Check here whether order of catch
6619 clauses matches their dependencies.
6621 2004-05-30 Marek Safar <marek.safar@seznam.cz>
6624 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
6627 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
6629 * expression.cs (Invocation.OverloadResolve): Avoid the
6630 use of hashtables and boxing here by allocating on demand.
6632 2004-05-30 Martin Baulig <martin@ximian.com>
6634 * rootcontext.cs (RootContext.LookupType): Don't cache things if
6635 we're doing a silent lookup. Don't try to lookup nested types in
6636 TypeManager.object_type (thanks to Ben Maurer).
6638 2004-05-30 Martin Baulig <martin@ximian.com>
6640 Committing a patch from Ben Maurer.
6642 * rootcontext.cs (RootContext.LookupType): Cache negative results.
6644 2004-05-29 Martin Baulig <martin@ximian.com>
6646 * class.cs (IMethodData.ShouldIgnore): New method.
6648 * typemanager.cs (TypeManager.MethodFlags): Don't take a
6649 `Location' argument, we don't need it anywhere. Use
6650 `IMethodData.ShouldIgnore ()' instead of
6651 `MethodData.GetMethodFlags ()'.
6652 (TypeManager.AddMethod): Removed.
6653 (TypeManager.AddMethod2): Renamed to AddMethod.
6655 2004-05-29 Martin Baulig <martin@ximian.com>
6657 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6659 * convert.cs (Convert.ImplicitReferenceConversion): If we're
6660 converting from a class type S to an interface type and we already
6661 have an object on the stack, don't box it again. Fixes #52578.
6663 2004-05-29 Martin Baulig <martin@ximian.com>
6665 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6666 Added support for `params' parameters. Fixes #59267.
6668 2004-05-29 Martin Baulig <martin@ximian.com>
6670 * literal.cs (NullPointer): Provide a private .ctor which sets
6671 `type' to TypeManager.object_type. Fixes #59048.
6673 2004-05-29 Martin Baulig <martin@ximian.com>
6675 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6676 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
6678 * ecore.cs (EventExpr.instance_expr): Make the field private.
6680 2004-05-26 Marek Safar <marek.safar@seznam.cz>
6682 Fixed bug #50080 & cs0214-2.cs
6683 * expression.cs (Cast.DoResolve): Check unsafe context here.
6685 * statement.cs (Resolve.DoResolve): Likewise.
6687 2004-05-26 Martin Baulig <martin@ximian.com>
6689 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6691 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6692 (RootContext.LookupType): Pass down the `silent' flag.
6694 2004-05-25 Martin Baulig <martin@ximian.com>
6697 (MethodGroupExpr.IdenticalTypeName): New public property.
6698 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6699 expression actually refers to a type.
6701 2004-05-25 Martin Baulig <martin@ximian.com>
6703 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6704 for #56176 and made it actually work.
6706 2004-05-25 Martin Baulig <martin@ximian.com>
6708 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6709 (FieldExpr, PropertyExpr): Override and implement
6710 CacheTemporaries. Fixes #52279.
6712 2004-05-25 Miguel de Icaza <miguel@ximian.com>
6714 * location.cs: In the new compiler listing a file twice is a
6715 warning, not an error.
6717 2004-05-24 Martin Baulig <martin@ximian.com>
6719 * enum.cs (Enum.DefineType): For the `BaseType' to be a
6720 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
6722 2004-05-24 Martin Baulig <martin@ximian.com>
6724 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6725 walking the `using' list. Fixes #53921.
6727 2004-05-24 Martin Baulig <martin@ximian.com>
6729 * const.cs (Const.LookupConstantValue): Added support for
6730 EmptyCast's; fixes #55251.
6732 2004-05-24 Martin Baulig <martin@ximian.com>
6734 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6735 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6736 which does the CS0135 check. The reason is that we first need to
6737 check whether the variable actually exists.
6739 2004-05-24 Martin Baulig <martin@ximian.com>
6741 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6742 than RootContext.LookupType() to find the explicit interface
6745 2004-05-24 Raja R Harinath <rharinath@novell.com>
6747 * Makefile: Simplify. Use executable.make.
6748 * mcs.exe.sources: New file. List of sources of mcs.exe.
6750 2004-05-24 Anders Carlsson <andersca@gnome.org>
6754 Use the invariant culture when doing String.Compare for CLS case
6757 2004-05-23 Martin Baulig <martin@ximian.com>
6759 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6760 don't have any dots. Fixes #52622, added cs0246-8.cs.
6762 * namespace.cs (NamespaceEntry.Lookup): Likewise.
6764 2004-05-23 Marek Safar <marek.safar@seznam.cz>
6766 * class.cs (MemberBase.Define): Reuse MemberType member for
6767 resolved type. Other methods can use it too.
6769 2004-05-23 Martin Baulig <martin@ximian.com>
6771 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6772 the variable also exists in the current block (otherwise, we need
6773 to report a CS0103). Fixes #58670.
6775 2004-05-23 Martin Baulig <martin@ximian.com>
6777 * flowanalysis.cs (Reachability.Reachable): Compute this
6778 on-the-fly rather than storing it as a field.
6780 2004-05-23 Martin Baulig <martin@ximian.com>
6782 * flowanalysis.cs (Reachability.And): Manually compute the
6783 resulting `barrier' from the reachability.
6785 2004-05-23 Marek Safar <marek.safar@seznam.cz>
6788 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6789 instance of ObsoleteAttribute when symbol is obsolete.
6792 (IMethodData): Extended interface for ObsoleteAttribute support.
6794 2004-05-22 Marek Safar <marek.safar@seznam.cz>
6796 * attribute.cs: Fix bug #55970
6798 2004-05-22 Marek Safar <marek.safar@seznam.cz>
6802 (GetObsoleteAttribute): New method. Creates the instance of
6804 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6805 ObsoleteAttribute when member is obsolete.
6806 (AttributeTester.Report_ObsoleteMessage): Common method for
6807 Obsolete error/warning reporting.
6810 (TypeContainer.base_classs_type): New member for storing parent type.
6813 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6814 for this MemberCore.
6816 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6818 * attribute.cs, const.cs: Fix bug #58590
6820 2004-05-21 Martin Baulig <martin@ximian.com>
6822 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6823 out parameters if the end of the method is unreachable. Fixes
6826 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6828 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6829 Hari was right, why extra method.
6831 2004-05-21 Marek Safar <marek.safar@seznam.cz>
6833 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6835 2004-05-20 Martin Baulig <martin@ximian.com>
6837 * delegate.cs: Convert this file to Unix mode - like the original
6840 2004-05-20 Martin Baulig <martin@ximian.com>
6842 * attribute.cs: Convert this file to Unix mode - like the original
6845 2004-05-19 Marek Safar <marek.safar@seznam.cz>
6847 Fix bug #58688 (MCS does not report error when the same attribute
6850 * attribute.cs (Attribute.Emit): Distinction between null and default.
6852 2004-05-19 Raja R Harinath <rharinath@novell.com>
6854 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6855 of a top-level attribute without an attribute target.
6856 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
6858 (Attribute.Conditional_GetConditionName),
6859 (Attribute.Obsolete_GetObsoleteMessage): Update.
6860 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
6861 part of ScanForIndexerName.
6862 (Attribute.CanIgnoreInvalidAttribute): New function.
6863 (Attribute.ScanForIndexerName): Move to ...
6864 (Attributes.ScanForIndexerName): ... here.
6865 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6866 (Attributes.Search): New internal variant that can choose not to
6867 complain if types aren't resolved. The original signature now
6869 (Attributes.GetClsCompliantAttribute): Use internal variant, with
6870 complaints suppressed.
6871 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6872 only if it not useful.
6873 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6874 top-level for attributes that are shared between the assembly
6875 and a top-level class.
6876 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6877 * class.cs: Update to reflect changes.
6878 (DefineIndexers): Fuse loops.
6879 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
6880 a couple more variants of attribute names.
6882 2004-05-18 Marek Safar <marek.safar@seznam.cz>
6884 Fix bug #52585 (Implemented explicit attribute declaration)
6887 (Attributable.ValidAttributeTargets): New abstract method. It gets
6888 list of valid attribute targets for explicit target declaration.
6889 (Attribute.Target): It holds target itself.
6890 (AttributeSection): Removed.
6891 (Attribute.CheckTargets): New method. It checks whether attribute
6892 target is valid for the current element.
6895 (EventProperty): New class. For events that are declared like
6896 property (with add and remove accessors).
6897 (EventField): New class. For events that are declared like field.
6900 * cs-parser.jay: Implemented explicit attribute target declaration.
6902 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
6903 Override ValidAttributeTargets.
6906 (ReturnParameter): Class for applying custom attributes on
6908 (ParameterAtribute): New class. Class for applying custom
6909 attributes on the parameter type.
6911 2004-05-17 Miguel de Icaza <miguel@ximian.com>
6913 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6916 (Method): Allow UNSAFE here.
6918 * modifiers.cs: Support unsafe reporting.
6920 2004-05-17 Marek Safar <marek.safar@seznam.cz>
6922 * decl.cs: Fix bug #58478.
6924 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6926 * statement.cs: When checking for unreachable code on an EmptyStatement,
6927 set the location. Fixes bug #58488.
6929 2004-05-13 Miguel de Icaza <miguel@ximian.com>
6931 * driver.cs: Add -pkg handling.
6933 From Gonzalo: UseShelLExecute=false
6935 2004-05-12 Marek Safar <marek.safar@seznam.cz>
6938 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6940 (Attribute.IsClsCompliaceRequired): Moved to base for better
6942 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6943 when attribute is AttributeUsageAttribute.
6944 (Attribute.GetValidTargets): Simplified.
6945 (Attribute.GetAttributeUsage): New method returns AttributeUsage
6946 attribute for this type.
6947 (Attribute.ApplyAttributes): Method renamed to Emit and make
6949 (GlobalAttributeSection): New class for special handling of global
6950 attributes (assembly, module).
6951 (AttributeSection.Emit): New method.
6953 * class.cs: Implemented Attributable abstract methods.
6954 (MethodCore.LabelParameters): Moved to Parameter class.
6955 (Accessor): Is back simple class.
6956 (PropertyMethod): Implemented Attributable abstract class.
6957 (DelegateMethod): Implemented Attributable abstract class.
6958 (Event): New constructor for disctintion between normal Event
6959 and Event with accessors.
6961 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6963 * codegen.cs, const.cs, decl.cs, delegate.cs:
6964 (CommonAssemblyModulClass): Implemented Attributable abstract class
6967 * enum.cs: Implement IAttributeSupport interface.
6968 (EnumMember): New class for emum members. Implemented Attributable
6972 (ParameterBase): Is abstract.
6973 (ReturnParameter): New class for easier [return:] attribute handling.
6975 * typemanager.cs: Removed builder_to_attr.
6977 2004-05-11 Raja R Harinath <rharinath@novell.com>
6980 * attribute.cs (Attribute.GetPositionalValue): New function.
6981 * class.cs (TypeContainer.VerifyMembers): New function.
6982 (TypeContainer.Emit): Use it.
6983 (ClassOrStruct): New base class for Class and Struct.
6984 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
6985 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6987 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6988 then each non-static field should have a FieldOffset attribute.
6989 Otherwise, none of the fields should have a FieldOffset attribute.
6990 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
6991 and FieldOffset attributes.
6992 * typemanager.cs (TypeManager.struct_layout_attribute_type)
6993 (TypeManager.field_offset_attribute_type): New core types.
6994 (TypeManager.InitCoreTypes): Initialize them.
6996 2004-05-11 Michal Moskal <malekith@pld-linux.org>
6998 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6999 Return correct type.
7002 2004-05-09 Miguel de Icaza <miguel@ximian.com>
7004 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7005 be implicitly converted to ulong.
7007 * expression.cs: The logic for allowing operator &, | and ^ worked
7008 was wrong, it worked before because we did not report an error in
7009 an else branch. Fixes 57895.
7011 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7012 allow volatile fields to be reference types.
7014 2004-05-07 Miguel de Icaza <miguel@ximian.com>
7016 * driver.cs: Add support for /debug-
7018 2004-05-07 Raja R Harinath <rharinath@novell.com>
7020 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
7021 Add a 'complain' parameter to silence errors.
7022 (Attribute.Resolve): Update to changes. Put in sanity check to catch
7023 silently overlooked type-resolutions.
7024 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7026 (Attributes.Search): New function.
7027 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7028 (Attributes.GetAttributeFullName): Remove hack.
7029 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
7030 Update to reflect changes.
7031 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7032 Use Attributes.Search instead of nested loops.
7034 2004-05-07 Marek Safar <marek.safar@seznam.cz>
7037 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7038 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7039 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7041 * report.cs: (Report.Warning): Renamed to Warning_T because of
7042 parameter collision.
7044 2004-05-05 Raja R Harinath <rharinath@novell.com>
7046 * expression.cs (MemberAccess.ResolveMemberAccess):
7047 Exit with non-zero status after Report.Error.
7048 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7050 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7052 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7054 * support.cs: Don't hang when the file is empty.
7056 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
7058 * support.cs: In SeekableStreamReader, compute the preamble size of the
7059 underlying stream. Position changes should take into account that initial
7062 2004-05-03 Todd Berman <tberman@sevenl.net>
7064 * driver.cs: remove unused GetSysVersion function.
7066 2004-05-03 Todd Berman <tberman@sevenl.net>
7068 * driver.cs: Remove the hack from saturday, as well as the hack
7069 from jackson (LoadAssemblyFromGac), also adds the CWD to the
7070 link_paths to get that bit proper.
7072 2004-05-01 Todd Berman <tberman@sevenl.net>
7074 * driver.cs: Try a LoadFrom before a Load, this checks the current
7075 path. This is currently a bug in mono that is be fixed, however, this
7076 provides a workaround for now. This will be removed when the bug
7079 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
7081 * CryptoConvert.cs: Updated to latest version. Fix issue with
7082 incomplete key pairs (#57941).
7084 2004-05-01 Todd Berman <tberman@sevenl.net>
7086 * driver.cs: Remove '.' from path_chars, now System.* loads properly
7089 2004-04-30 Jackson Harper <jackson@ximian.com>
7091 * codegen.cs: Open keys readonly.
7093 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7095 * typemanager.cs: don't report cyclic struct layout when a struct
7096 contains 2 or more fields of the same type. Failed for Pango.AttrShape
7097 which has 2 Pango.Rectangle fields.
7099 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
7101 * expression.cs: Handle IntPtr comparisons with IL code
7102 rather than a method call.
7104 2004-04-29 Martin Baulig <martin@ximian.com>
7106 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
7107 the list of PropertyInfo's in class hierarchy and find the
7108 accessor. Fixes #56013.
7110 2004-04-29 Martin Baulig <martin@ximian.com>
7112 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7114 2004-04-29 Martin Baulig <martin@ximian.com>
7116 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7118 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7120 2004-04-29 Martin Baulig <martin@ximian.com>
7122 * class.cs (ConstructorInitializer.Resolve): Check whether the
7123 parent .ctor is accessible. Fixes #52146.
7125 2004-04-29 Martin Baulig <martin@ximian.com>
7127 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7129 * statement.cs (Using.EmitLocalVariableDecls): Use
7130 TypeManager.idisposable_type, not typeof (IDisposable).
7131 (Foreach.EmitCollectionForeach): Added support for valuetypes.
7133 2004-04-29 Martin Baulig <martin@ximian.com>
7135 * class.cs (Event.Define): Don't emit the field and don't set
7136 RTSpecialName and SpecialName for events on interfaces. Fixes
7139 2004-04-29 Raja R Harinath <rharinath@novell.com>
7141 Refactor Attribute.ApplyAttributes.
7142 * attribute.cs (Attributable): New base class for objects that can
7143 have Attributes applied on them.
7144 (Attribute): Make AttributeUsage fields public.
7145 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7146 (Attribute.IsInternalCall): New property.
7147 (Attribute.UsageAttr): Convert to a public read-only property.
7148 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7149 (Attribute.ResolveType, Attribute.Resolve)
7150 (Attribute.ScanForIndexerName): Update to reflect changes.
7151 (Attribute.CheckAttributeTarget): Re-format.
7152 (Attribute.ApplyAttributes): Refactor, to various
7153 Attributable.ApplyAttributeBuilder methods.
7154 * decl.cs (MemberCore): Make Attributable.
7155 * class.cs (Accessor): Make Attributable.
7156 (MethodData.ApplyAttributes): Use proper attribute types, not
7158 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7159 (TypeContainer.ApplyAttributeBuilder)
7160 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7161 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
7162 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7163 (Operator.ApplyAttributeBuilder): New factored-out methods.
7164 * const.cs (Const.ApplyAttributeBuilder): Likewise.
7165 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7166 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7167 * parameter.cs (ParameterBase): New Attributable base class
7168 that can also represent Return types.
7169 (Parameter): Update to the changes.
7171 2004-04-29 Jackson Harper <jackson@ximian.com>
7173 * driver.cs: Prefer the corlib system version when looking for
7174 assemblies in the GAC. This is still a hack, but its a better hack
7177 2004-04-29 Marek Safar <marek.safar@seznam.cz>
7179 * decl.cs, enum.cs: Improved error 3005 reporting.
7181 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7182 (related_symbols): New private member for list of symbols
7183 related to reported error/warning.
7185 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7187 2004-04-29 Martin Baulig <martin@ximian.com>
7189 * ecore.cs (Expression.Constantify): If we're an enum and
7190 TypeManager.TypeToCoreType() doesn't give us another type, use
7191 t.UnderlyingSystemType. Fixes #56178.
7193 2004-04-29 Martin Baulig <martin@ximian.com>
7195 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7196 interfaces and for each interface, only add members directly
7197 declared in that interface. Fixes #53255.
7199 2004-04-28 Martin Baulig <martin@ximian.com>
7201 * expression.cs (ConditionalLogicalOperator): Use a temporary
7202 variable for `left' to avoid that we evaluate it more than once;
7205 2004-04-28 Martin Baulig <martin@ximian.com>
7207 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7210 2004-04-28 Martin Baulig <martin@ximian.com>
7212 * statement.cs (LocalInfo.Resolve): Check whether the type is not
7215 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7216 whether the type is not void (CS1547).
7218 2004-04-28 Martin Baulig <martin@ximian.com>
7220 * expression.cs (Unary.DoResolveLValue): Override this and report
7221 CS0131 for anything but Operator.Indirection.
7223 2004-04-28 Martin Baulig <martin@ximian.com>
7225 Committing a patch from Ben Maurer; see bug #50820.
7227 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7230 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7233 2004-04-28 Martin Baulig <martin@ximian.com>
7235 Committing a patch from Ben Maurer; see bug #50820.
7237 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7240 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7243 2004-04-28 Martin Baulig <martin@ximian.com>
7245 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7246 (Block.AddLabel): Call DoLookupLabel() to only search in the
7249 2004-04-28 Martin Baulig <martin@ximian.com>
7251 * cfold.cs (ConstantFold.BinaryFold): Added special support for
7252 comparing StringConstants and NullLiterals in Equality and Inequality.
7254 2004-04-28 Jackson Harper <jackson@ximian.com>
7256 * driver.cs: Attempt to load referenced assemblies from the
7257 GAC. This is the quick and dirty version of this method that
7258 doesnt take into account versions and just takes the first
7259 canidate found. Will be good enough for now as we will not have more
7260 then one version installed into the GAC until I update this method.
7262 2004-04-28 Martin Baulig <martin@ximian.com>
7264 * typemanager.cs (TypeManager.CheckStructCycles): New public
7265 static method to check for cycles in the struct layout.
7267 * rootcontext.cs (RootContext.PopulateTypes): Call
7268 TypeManager.CheckStructCycles() for each TypeContainer.
7269 [Note: We only need to visit each type once.]
7271 2004-04-28 Martin Baulig <martin@ximian.com>
7273 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7275 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7276 success and added `out object value'. Use a `bool resolved' field
7277 to check whether we've already been called rather than
7278 `ConstantValue != null' since this breaks for NullLiterals.
7280 2004-04-28 Raja R Harinath <rharinath@novell.com>
7282 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7283 setting of this flag, since the 'set' method may be non-public.
7285 2004-04-28 Raja R Harinath <rharinath@novell.com>
7287 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7288 check on current_vector.Block.
7290 2004-04-27 Martin Baulig <martin@ximian.com>
7292 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7293 a field initializer. Fixes #56459.
7295 2004-04-27 Martin Baulig <martin@ximian.com>
7297 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7298 we're not attempting to use an indexer. Fixes #52154.
7300 2004-04-27 Martin Baulig <martin@ximian.com>
7302 * statement.cs (Return): Don't create a return label if we don't
7303 need it; reverts my change from January 20th. Thanks to Ben
7306 2004-04-27 Martin Baulig <martin@ximian.com>
7308 According to the spec, `goto' can only leave a nested scope, but
7311 * statement.cs (Block.LookupLabel): Only lookup in the current
7312 block, don't recurse into parent or child blocks.
7313 (Block.AddLabel): Check in parent and child blocks, report
7314 CS0140/CS0158 if we find a duplicate.
7315 (Block): Removed this indexer for label lookups.
7316 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7317 this already does the error reporting for us.
7320 (FlowBranching.UsageVector.Block): New public variable; may be null.
7321 (FlowBranching.CreateSibling): Added `Block' argument.
7322 (FlowBranching.LookupLabel): New public virtual method. Lookup a
7323 label for the target of a `goto' and check whether we're not
7324 leaving a `finally'.
7326 2004-04-27 Martin Baulig <martin@ximian.com>
7328 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7329 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7332 2004-04-27 Martin Baulig <martin@ximian.com>
7334 * statement.cs (Block.AddLabel): Also check for implicit blocks
7335 and added a CS0158 check.
7337 2004-04-27 Martin Baulig <martin@ximian.com>
7339 * flowanalysis.cs (FlowBranchingLoop): New class.
7340 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7341 UsageVector's instead of an ArrayList.
7342 (FlowBranching.Label): Likewise.
7343 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7344 (FlowBranching.AddBreakVector): New method.
7346 2004-04-27 Miguel de Icaza <miguel@ximian.com>
7348 * attribute.cs: Small regression fix: only convert the type if we
7349 the type is different, fixes System.Drawing build.
7351 2004-04-27 Martin Baulig <martin@ximian.com>
7353 * attribute.cs (Attribute.Resolve): If we have a constant value
7354 for a named field or property, implicity convert it to the correct
7357 2004-04-27 Raja R Harinath <rharinath@novell.com>
7359 * statement.cs (Block.Block): Implicit blocks share
7360 'child_variable_names' fields with parent blocks.
7361 (Block.AddChildVariableNames): Remove.
7362 (Block.AddVariable): Mark variable as "used by a child block" in
7363 every surrounding block.
7364 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7365 been used in a child block, complain about violation of "Invariant
7366 meaning in blocks" rule.
7367 * cs-parser.jay (declare_local_variables): Don't use
7368 AddChildVariableNames.
7369 (foreach_statement): Don't create an implicit block: 'foreach'
7372 2004-04-23 Miguel de Icaza <miguel@ximian.com>
7374 * convert.cs (ImplicitNumericConversion): 0 is also positive when
7375 converting from 0L to ulong. Fixes 57522.
7377 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7379 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7380 derived class hides via 'new' keyword field from base class (test-242.cs).
7381 TODO: Handle this in the more general way.
7383 * class.cs (CheckBase): Ditto.
7385 2004-04-22 Marek Safar <marek.safar@seznam.cz>
7387 * decl.cs (caching_flags): New member for storing cached values
7389 (MemberCore.Flags): New enum where bit flags for caching_flags
7391 (MemberCore.cls_compliance): Moved to caching_flags.
7392 (DeclSpace.Created): Moved to caching_flags.
7394 * class.cs: Use caching_flags instead of DeclSpace.Created
7396 2004-04-21 Miguel de Icaza <miguel@ximian.com>
7398 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7399 if we are only a derived class, not a nested class.
7401 * typemanager.cs: Same as above, but do this at the MemberLookup
7402 level (used by field and methods, properties are handled in
7403 PropertyExpr). Allow for the qualified access if we are a nested
7406 2004-04-21 Marek Safar <marek.safar@seznam.cz>
7408 * class.cs: Refactoring.
7409 (IMethodData): New inteface; Holds links to parent members
7410 to avoid member duplication (reduced memory allocation).
7411 (Method): Implemented IMethodData interface.
7412 (PropertyBase): New inner classes for get/set methods.
7413 (PropertyBase.PropertyMethod): Implemented IMethodData interface
7414 (Event): New inner classes for add/remove methods.
7415 (Event.DelegateMethod): Implemented IMethodData interface.
7417 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7418 EmitContext (related to class.cs refactoring).
7420 2004-04-21 Raja R Harinath <rharinath@novell.com>
7422 * delegate.cs (Delegate.VerifyApplicability): If the number of
7423 arguments are the same as the number of parameters, first try to
7424 verify applicability ignoring any 'params' modifier on the last
7428 2004-04-08 Martin Baulig <martin@ximian.com>
7430 Merged latest changes into gmcs. Please keep this comment in
7431 here, it makes it easier for me to see what changed in MCS since
7432 the last time I merged.
7434 2004-04-16 Raja R Harinath <rharinath@novell.com>
7436 * class.cs (TypeContainer.AddIndexer): Use
7437 'ExplicitInterfaceName' to determine if interface name was
7438 explicitly specified. 'InterfaceType' is not initialized at this time.
7439 (TypeContainer.DefineIndexers): Remove use of temporary list. The
7440 Indexers array is already in the required order. Initialize
7441 'IndexerName' only if there are normal indexers.
7442 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7443 (TypeContainer.Emit): Emit DefaultMember attribute only if
7444 IndexerName is initialized.
7447 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
7449 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7452 2004-04-15 Raja R Harinath <rharinath@novell.com>
7454 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7458 * attribute.cs (Attribute.Resolve): Check for duplicate named
7462 2004-04-15 Miguel de Icaza <miguel@ximian.com>
7464 * iterators.cs (MarkYield): track whether we are in an exception,
7465 and generate code accordingly. Use a temporary value to store the
7466 result for our state.
7468 I had ignored a bit the interaction of try/catch with iterators
7469 since their behavior was not entirely obvious, but now it is
7470 possible to verify that our behavior is the same as MS .NET 2.0
7474 2004-04-14 Miguel de Icaza <miguel@ximian.com>
7476 * iterators.cs: Avoid creating temporaries if there is no work to
7479 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7480 Enumerations, use TypeManager.EnumToUnderlying and call
7483 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7486 (This.Emit): Use EmitContext.EmitThis to emit our
7489 (This.EmitAssign): Ditto.
7491 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7492 codepaths, we will move all the functionality into
7495 (FieldExpr.EmitAssign): Ditto.
7497 This fixes several hidden bugs that I uncovered while doing a code
7498 review of this today.
7500 * codegen.cs (EmitThis): reworked so the semantics are more clear
7501 and also support value types "this" instances.
7503 * iterators.cs: Changed so that for iterators in value types, we
7504 do not pass the value type as a parameter.
7506 Initialization of the enumerator helpers is now done in the caller
7507 instead of passing the parameters to the constructors and having
7508 the constructor set the fields.
7510 The fields have now `assembly' visibility instead of private.
7512 2004-04-11 Miguel de Icaza <miguel@ximian.com>
7514 * expression.cs (Argument.Resolve): Check if fields passed as ref
7515 or out are contained in a MarshalByRefObject.
7517 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7518 another compiler type.
7520 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
7522 * class.cs (Indexer.Define): use the new name checking method.
7523 Also, return false on an error.
7524 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7525 (is_identifier_[start/part]_character): make static.
7527 2004-04-10 Miguel de Icaza <miguel@ximian.com>
7529 * expression.cs (Binary.ResolveOperator): Do no append strings
7530 twice: since we can be invoked more than once (array evaluation)
7531 on the same concatenation, take care of this here. Based on a fix
7532 from Ben (bug #56454)
7534 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
7536 * codegen.cs: Fix another case where CS1548 must be reported (when
7537 delay-sign isn't specified and no private is available #56564). Fix
7538 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
7539 error when MCS is used on the MS runtime and we need to delay-sign
7540 (which seems unsupported by AssemblyBuilder - see #56621).
7542 2004-04-08 Marek Safar <marek.safar@seznam.cz>
7544 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7545 (TypeManager.ComputeNamespaces): Faster implementation for
7548 * compiler.csproj: Updated AssemblyName to mcs.
7550 2004-05-11 Jackson Harper <jackson@ximian.com>
7552 * Makefile: Preserve MONO_PATH
7554 2004-05-11 Jackson Harper <jackson@ximian.com>
7556 * Makefile: Use mono and mcs to build gmcs
7558 2004-05-03 Miguel de Icaza <miguel@ximian.com>
7560 * codegen.cs: Add patch from Robert Shade
7561 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
7564 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
7566 * CryptoConvert.cs: Updated to latest version. Fix issue with
7567 incomplete key pairs (#57941).
7569 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
7571 * codegen.cs: Fix another case where CS1548 must be reported (when
7572 delay-sign isn't specified and no private is available #56564). Fix
7573 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
7574 error when MCS is used on the MS runtime and we need to delay-sign
7575 (which seems unsupported by AssemblyBuilder - see #56621).
7577 2004-04-29 Jackson Harper <jackson@ximian.com>
7579 * Makefile: Set MONO_PATH to use the bootstrap corlib
7580 * driver.cs: Check the GAC for referenced assemblies.
7582 2004-04-29 Martin Baulig <martin@ximian.com>
7584 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
7586 2004-04-07 Martin Baulig <martin@ximian.com>
7588 * expression.cs (Binary.ResolveOperator): Added special case for
7589 Equality/Inequality between a type parameter and a null literal.
7591 2004-04-07 Martin Baulig <martin@ximian.com>
7593 * convert.cs: Check null literal -> type parameter conversions.
7595 2004-04-07 Martin Baulig <martin@ximian.com>
7597 * generic.cs (ConstructedType.CheckConstraints): Enforce the
7598 `class' and `struct' constraints.
7600 2004-04-07 Martin Baulig <martin@ximian.com>
7602 * generic.cs (SpecialConstraint): New public enum.
7603 (Constraints.Resolve): Added support for the `class' and `struct'
7606 * cs-parser.jay (type_parameter_constraint): Added support for the
7607 `class' and `struct' constraints.
7609 2004-04-07 Martin Baulig <martin@ximian.com>
7611 * support.cs (GenericConstraints): Replaced `Types' by
7612 `ClassConstraint' and `InterfaceConstraints'; added
7613 `HasClassConstraint'.
7615 2004-04-07 Martin Baulig <martin@ximian.com>
7618 (Constraints.InterfaceConstraints): New public property.
7619 (Constraints.Types): Make this property public
7620 (TypeParameter): Implement IMemberContainer.
7621 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
7622 instead of a TypeBuilder/MethodBuilder; pass the interface
7623 constraints to TypeManager.AddTypeParameter().
7624 (TypeParameter.DefineType): Just take an EmitContext and no
7625 TypeBuilder/MethodBuilder. Use the new public API.
7627 * typemanager.cs (TypeManager.AddTypeParameter): Added
7628 `TypeExpr[]' argument; add the interfaces to the
7629 `builder_to_ifaces' hash.
7630 (TypeManager.LookupMemberContainer): For
7631 GenericTypeParameterBuilders, get the TypeParameter from the
7632 `builder_to_type_param'.
7633 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
7634 the TypeParameter and call FindMembers on it.
7636 2004-04-07 Martin Baulig <martin@ximian.com>
7639 (MethodCore.GenericMethod): Moved this field here from Method.
7640 (MethodCore.IsDuplicateImplementation): Take the number of type
7641 parameters into account if we're a generic method.
7643 * expression.cs (Invocation.InferTypeArguments): Don't return true
7644 if `arguments' is null; we still need to check whether we actually
7645 don't need to infer anything in this case.
7646 (MemberAccess): Merged the functionality from GenericMemberAccess
7649 * generic.cs (GenericMemberAccess): Removed.
7651 2004-04-05 Martin Baulig <martin@ximian.com>
7653 * decl.cs (MemberCore): For generic classes, interfaces and
7654 structs, `Name' now includes the number of type parameters
7656 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
7657 encode the number of type arguments in the type name.
7659 * expression.cs (Expression.MemberLookup): Removed the
7660 `num_type_args' argument; we now encode the number of type
7661 arguments in the type name.
7663 * ecore.cs (SimpleName): Encode the number of type arguments in
7664 the type name itself.
7666 * generic.cs (ConstructedType): Likewise.
7668 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
7669 `MemberName'; we now include the number of type parameters in the
7672 * typemanager.cs (TypeManager.CheckGeneric): Removed.
7673 (TypeManager.MemberLookup): Removed the
7674 `num_type_args' argument; we now encode the number of type
7675 arguments in the type name.
7677 2004-04-03 Martin Baulig <martin@ximian.com>
7679 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
7680 (MemberCore.MemberName): Moved here from MemberBase.
7681 (DeclSpace.SetParameterInfo): Just take the constraints as an
7682 ArrayList; we already have the type parameters in our
7683 `MemberName'; also do the CS0080 reporting here.
7685 * cs-parser.jay (struct_declaration): Use `member_name' instead of
7686 `IDENTIFIER opt_type_parameter_list'; when constructing our
7687 `MemberName', it'll already include our type parameters.
7688 (class_declaration, interface_declaration): Likewise.
7689 (delegate_declaration): Likewise.
7690 (MakeName): Take a MemberName and return a MemberName.
7691 The following two changes are required to avoid shift/reduce conflicts:
7692 (member_name): Don't include a TypeName anymore; ie. this is now
7693 just 'IDENTIFIER opt_type_parameter_list'.
7694 (property_declaration, event_declaration): Use a
7695 `namespace_or_type_name' instead of a `member_name'.
7697 2004-04-03 Martin Baulig <martin@ximian.com>
7699 * decl.cs (MemberName): Renamed to `TypeName' and created a new
7701 (TypeName): Formerly known as MemberName.
7703 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
7704 instead of a `MemberName'.
7706 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
7707 (member_name): New rule; create a MemberName.
7709 2004-04-02 Martin Baulig <martin@ximian.com>
7711 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
7712 (CS0305 and CS0308).
7714 2004-04-02 Martin Baulig <martin@ximian.com>
7716 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
7717 support for nested types.
7719 2004-04-02 Martin Baulig <martin@ximian.com>
7721 * ecore.cs (IAlias): New public interface.
7722 (TypeExpr, TypeExpression): Implement IAlias.
7723 (TypeAliasExpression): New public class.
7725 * namespace.cs (Namespace): Implement IAlias.
7726 (Namespace.Lookup): Return an IAlias instead on an object.
7727 (Namespace.DefineName): Take an IAlias instead of an object.
7728 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
7730 (NamespaceEntry.UsingAlias): Take a Membername instead of an
7732 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
7734 (NamespaceEntry.Lookup): Likewise.
7736 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
7739 * decl.cs (DeclSpace): Implement IAlias.
7740 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
7742 * generic.cs (ConstructedType): Improved error checking.
7744 2004-04-02 Martin Baulig <martin@ximian.com>
7746 * convert.cs: Added type parameter conversions.
7749 (UnboxCast.Emit): Emit an `unbox.any' for type params.
7750 (ClassCast.Emit): If the source type is a type parameter, box it.
7751 If the target type is a type parameter, emit an `unbox.any'
7752 instead of a `classcast'.1
7754 2004-04-01 Martin Baulig <martin@ximian.com>
7756 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
7758 2004-04-01 Martin Baulig <martin@ximian.com>
7760 * generic.cs (ConstructedType.CheckConstraints): Use
7761 Convert.ImplicitStandardConversionExists(); user-defined implicit
7762 conversions are not allowed according to the spec.
7764 2004-03-30 Martin Baulig <martin@ximian.com>
7766 * expression.cs (New): Added support for type parameters.
7769 (TypeManager.activator_type): New public static field.
7770 (TypeManager.activator_create_instance): Likewise.
7772 2004-03-30 Martin Baulig <martin@ximian.com>
7774 * typemanager.cs (TypeManager.HasConstructorConstraint): New
7777 2004-03-30 Martin Baulig <martin@ximian.com>
7779 * generic.cs (ConstructedType.CheckConstraints): Actually follow
7780 the spec here: the argument type must be convertible to the
7783 2004-03-30 Martin Baulig <martin@ximian.com>
7786 (TypeParameter.Define, TypeParameter.DefineMethod): Call
7787 TypeManager.AddTypeParameter().
7788 (ConstructedType.CheckConstraints): Re-enable this and actually
7789 check whether we have a constructor constraint.
7792 (TypeManager.builder_to_type_param): New static field.
7793 (TypeManager.AddTypeParameter): New static method.
7794 (TypeManager.LookupTypeParameter): New public method.
7796 2004-03-30 Martin Baulig <martin@ximian.com>
7798 * generic.cs (TypeParameter.DefineType): Return a boolean and use
7799 the new API to actually define the constructor constraint.
7802 (TypeManager.new_constraint_attr_type): New static field.
7803 (TypeManager.InitCoreTypes): Initialize it.
7805 2004-03-30 Martin Baulig <martin@ximian.com>
7807 * generic.cs (Constraints): Completed error checking, use correct
7810 2004-03-29 Martin Baulig <martin@ximian.com>
7812 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
7814 * expression.cs (Invocation.InferTypeArguments): Added overloaded
7815 public version which takes a `ParameterData pd' instead of an
7818 2004-03-29 Martin Baulig <martin@ximian.com>
7820 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
7823 2004-03-29 Martin Baulig <martin@ximian.com>
7825 * expression.cs (Argument.ResolveMethodGroup): If we're a
7826 ConstructedType, call GetMemberAccess() on it.
7828 2004-03-29 Martin Baulig <martin@ximian.com>
7830 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
7831 (MethodCore.CheckGenericOverride): When overriding a generic
7832 method, check whether the constraints match.
7834 * support.cs (GenericConstraints): New public interface.
7835 (ParameterData.GenericConstraints): New public method.
7837 * parameter.cs (Parameter.Resolve): Check whether we're a generic
7838 method parameter and compute our constraints if appropriate.
7839 (Parameter.GenericConstraints): New public property.
7841 * generic.cs (Constraints): Implement GenericConstraints.
7843 2004-03-29 Martin Baulig <martin@ximian.com>
7845 * decl.cs (MemberCache.FindMemberToOverride): Use
7846 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
7848 2004-03-29 Martin Baulig <martin@ximian.com>
7850 * generic.cs (GenericMethod.Define): Resolve our type parameters.
7852 2004-03-29 Martin Baulig <martin@ximian.com>
7854 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
7855 not allowed on non-generic declarations").
7857 2004-03-29 Martin Baulig <martin@ximian.com>
7859 * expression.cs (Invocation.InferTypeArguments): Added overloaded
7860 public version of this method.
7862 * class.cs (MethodCore.IsDuplicateImplementation): Use
7863 Invocation.InferTypeArguments() to check this.
7865 2004-03-29 Martin Baulig <martin@ximian.com>
7867 * convert.cs: Use TypeManager.IsDelegateType() instead of
7868 comparing types correctly.
7870 2004-03-29 Martin Baulig <martin@ximian.com>
7872 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
7873 types directly to make it work for generic instances.
7875 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
7877 2004-03-29 Martin Baulig <martin@ximian.com>
7879 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
7882 2004-03-24 Martin Baulig <martin@ximian.com>
7884 * decl.cs (DeclSpace.FindType): Also use
7885 TypeManager.CheckGeneric() for types from the using clauses.
7887 2004-03-23 Martin Baulig <martin@ximian.com>
7889 * expression.cs (Invocation.OverloadResolve): Added `bool
7890 may_fail' argument and use it instead of the Location.IsNull() hack.
7892 2004-03-23 Martin Baulig <martin@ximian.com>
7894 * expression.cs (Invocation.InferType): Use correct type inference
7897 2004-03-23 Martin Baulig <martin@ximian.com>
7899 * ecore.cs (MethodGroupExpr.Name): Use
7900 TypeManager.CSharpSignature() instead of just the name.
7902 * expression.cs (Invocation.OverloadResolve): Provide better error
7904 (Invocation.DoResolve): OverloadResolve() never returns null
7905 without reporting an error, so removed the error -6 reporting here.
7907 2004-03-23 Martin Baulig <martin@ximian.com>
7909 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
7912 * cs-parser.jay (delegate_declaration): Support generic delegates.
7914 * delegate.cs: Support generic delegates.
7916 2004-03-22 Martin Baulig <martin@ximian.com>
7918 * expression.cs (Invocation.InferParamsTypeArguments): New static
7919 method; does type inference for params arguments.
7921 2004-03-21 Martin Baulig <martin@ximian.com>
7923 * typemanager.cs (TypeManager.IsGenericMethod): New public static
7924 method; checks whether a method is a generic method.
7926 * expression.cs (Invocation.InferTypeArguments): New static method;
7927 infer type arguments for generic method invocation.
7929 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
7930 property; we set this to true if we're resolving a generic method
7931 invocation and the user specified type arguments, ie. we're not
7932 doing type inference.
7934 2004-03-20 Martin Baulig <martin@ximian.com>
7936 * class.cs (MethodData.DeclaringType): New public property.
7937 (MethodData.Define): Set DeclaringType here.
7938 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
7939 instead of OperatorMethodBuilder.DeclaringType.
7941 2004-03-20 Martin Baulig <martin@ximian.com>
7943 * cs-tokenizer.cs (xtoken): Return a special
7944 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
7946 * cs-parser.jay (default_value_expression): Switch to the new
7949 2004-03-19 Martin Baulig <martin@ximian.com>
7951 * decl.cs (MemberName): New class. We use this to "construct"
7952 namespace_or_type_name's.
7954 * generics.cs (TypeArguments.GetDeclarations): New public method;
7955 returns the type arguments as a string[] and reports a CS0081 if
7956 one of them is not an identifier.
7958 * class.cs (MemberBase): The .ctor now takes the name as a
7959 MemberName instead of a string.
7960 (MemberBase.ExplicitInterfaceName): Changed type from string to
7962 (MemberBase.DoDefine): If we're an explicit implementation, the
7963 InterfaceType may be a generic instance.
7965 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
7966 (namespace_name): Call MemberName.GetName () to transform the
7967 MemberName into a string and ensure we don't have any type
7969 (type_name): Call MemberName.GetTypeExpression() to transfrom the
7970 MemberName into an expression.
7971 (method_header): Use namespace_or_type_name instead of member_name.
7973 2004-04-07 Miguel de Icaza <miguel@ximian.com>
7975 * rootcontext.cs: Add new types to the boot resolution.
7977 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7978 MulticastDelegate is not allowed.
7980 * typemanager.cs: Add new types to lookup: System.TypedReference
7983 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7984 check for TypedReference or ArgIterator, they are not allowed.
7986 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7987 makes us properly catch 1510 in some conditions (see bug 56016 for
7990 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
7992 * CryptoConvert.cs: update from corlib version
7995 2004-04-05 Miguel de Icaza <miguel@ximian.com>
7997 * class.cs (Indexer.Define): Check indexername declaration
7999 2004-04-05 Marek Safar <marek.safar@seznam.cz>
8001 * attribute.cs (IsClsCompliant): Fixed problem with handling
8002 all three states (compliant, not-compliant, undetected).
8004 2004-03-30 Marek Safar <marek.safar@seznam.cz>
8006 * attribute.cs (Attribute): Location is now public.
8007 (Resolve): Store resolved arguments (pos_values) in attribute class.
8008 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8009 (GetClsCompliantAttributeValue): New method that gets
8010 CLSCompliantAttribute value.
8011 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8012 if exists else null.
8013 (AttributeTester): New class for CLS-Compliant verification routines.
8015 * class.cs (Emit): Add CLS-Compliant verification.
8016 (Method.GetSignatureForError): Implemented.
8017 (Constructor.GetSignatureForError): Implemented
8018 (Constructor.HasCompliantArgs): Returns if constructor has
8019 CLS-Compliant arguments.
8020 (Constructor.Emit): Override.
8021 (Construcor.IsIdentifierClsCompliant): New method; For constructors
8022 is needed to test only parameters.
8023 (FieldBase.GetSignatureForError): Implemented.
8024 (TypeContainer): New member for storing base interfaces.
8025 (TypeContainer.FindMembers): Search in base interfaces too.
8027 * codegen.cs (GetClsComplianceAttribute): New method that gets
8028 assembly or module CLSCompliantAttribute value.
8029 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8031 (ModuleClass.Emit): Add error 3012 test.
8033 * const.cs (Emit): Override and call base for CLS-Compliant tests.
8035 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8036 state for all decl types.
8037 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8038 if CLS-Compliant tests are required.
8039 (IsClsCompliaceRequired): New method. Analyze whether code
8040 must be CLS-Compliant.
8041 (IsExposedFromAssembly): New method. Returns true when MemberCore
8042 is exposed from assembly.
8043 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8044 value or gets cached value.
8045 (HasClsCompliantAttribute): New method. Returns true if MemberCore
8046 is explicitly marked with CLSCompliantAttribute.
8047 (IsIdentifierClsCompliant): New abstract method. This method is
8048 used to testing error 3005.
8049 (IsIdentifierAndParamClsCompliant): New method. Common helper method
8050 for identifier and parameters CLS-Compliant testing.
8051 (VerifyClsCompliance): New method. The main virtual method for
8052 CLS-Compliant verifications.
8053 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8054 null. I don't know why is null (too many public members !).
8055 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8056 and get value of first CLSCompliantAttribute that found.
8058 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8059 (VerifyClsCompliance): Override and add extra tests.
8061 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8062 clscheck- disable CLS-Compliant verification event if assembly is has
8063 CLSCompliantAttribute(true).
8065 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8066 ApllyAttribute is now called in emit section as in the other cases.
8067 Possible future Emit integration.
8068 (IsIdentifierClsCompliant): New override.
8069 (VerifyClsCompliance): New override.
8070 (GetEnumeratorName): Returns full enum name.
8072 * parameter.cs (GetSignatureForError): Implemented.
8074 * report.cs (WarningData): New struct for Warning message information.
8075 (LocationOfPreviousError): New method.
8076 (Warning): New method. Reports warning based on the warning table.
8077 (Error_T): New method. Reports error based on the error table.
8079 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8080 verifications are done here.
8082 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8084 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8085 CLSCompliantAttribute.
8086 (all_imported_types): New member holds all imported types from other
8088 (LoadAllImportedTypes): New method fills static table with exported types
8089 from all referenced assemblies.
8090 (Modules): New property returns all assembly modules.
8092 2004-03-30 Miguel de Icaza <miguel@ximian.com>
8094 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8095 throwing a parser error.
8097 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8098 which removes the hardcoded get_/set_ prefixes for properties, as
8099 IL allows for the properties to be named something else.
8103 * expression.cs: Do not override operand before we know if it is
8106 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8108 * typemanager.cs: support for pinned variables.
8110 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8112 * decl.cs, typemanager.cs: Avoid using an arraylist
8113 as a buffer if there is only one result set.
8115 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8117 * expression.cs: Make sure you cant call a static method
8118 with an instance expression, bug #56174.
8120 2004-03-29 Miguel de Icaza <miguel@ximian.com>
8122 * class.cs (IsDuplicateImplementation): Improve error reporting to
8123 flag 663 (method only differs in parameter modifier).
8125 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8126 in preprocessor directives.
8128 * location.cs (LookupFile): Allow for the empty path.
8130 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
8131 better approach for some of that patch, but its failing with the
8132 CharSet enumeration. For now try/catch will do.
8134 * typemanager.cs: Do not crash if a struct does not have fields.
8137 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8139 * expression.cs: cs0213, cant fix a fixed expression.
8142 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8144 * cs-parser.jay: detect invalid embeded statements gracefully.
8147 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8149 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8152 the invocation type may not be a subclass of the tye of the item/
8153 The type of the item must be a subclass of the invocation item.
8158 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
8160 * attribute.cs: Added methods to get a string and a bool from an
8161 attribute. Required to information from AssemblyKeyFileAttribute,
8162 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8163 * codegen.cs: Modified AssemblyName creation to include support for
8164 strongnames. Catch additional exceptions to report them as CS1548.
8165 * compiler.csproj: Updated include CryptoConvert.cs.
8166 * compiler.csproj.user: Removed file - user specific configuration.
8167 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
8168 Mono.Security assembly. The original class is maintained and tested in
8169 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8170 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8171 like CSC 8.0 (C# v2) supports.
8172 * Makefile: Added CryptoConvert.cs to mcs sources.
8173 * rootcontext.cs: Added new options for strongnames.
8175 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
8177 * driver.cs: For --expect-error, report error code `2'
8178 if the program compiled with no errors, error code `1' if
8179 it compiled with an error other than the one expected.
8181 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
8183 * compiler.csproj: Updated for Visual Studio .NET 2003.
8184 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8185 * compiler.sln: Updated for Visual Studio .NET 2003.
8187 2004-03-24 Ravi Pratap M <ravi@ximian.com>
8189 * expression.cs: Fix bug #47234. We basically need to apply the
8190 rule that we prefer the conversion of null to a reference type
8191 when faced with a conversion to 'object' (csc behaviour).
8193 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8195 * statement.cs: Shorter form for foreach, eliminates
8196 a local variable. r=Martin.
8198 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8200 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8201 checks if we can use brtrue/brfalse to test for 0.
8202 * expression.cs: use the above in the test for using brtrue/brfalse.
8205 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8207 * expression.cs: Rewrite string concat stuff. Benefits:
8209 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8210 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8211 rather than a concat chain.
8213 * typemanager.cs: Add lookups for more concat overloads.
8215 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
8217 * expression.cs: Emit shorter il code for array init.
8234 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
8236 * statement.cs: Before, two switch blocks would be merged if the
8237 total size of the blocks (end_item - begin_item + 1) was less than
8238 two times the combined sizes of the blocks.
8240 Now, it will only merge if after the merge at least half of the
8245 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
8247 * class.cs : csc build fix for GetMethods(). See bug #52503.
8249 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
8251 * expression.cs: Make sure fp comparisons work with NaN.
8252 This fixes bug #54303. Mig approved this patch a long
8253 time ago, but we were not able to test b/c the runtime
8256 2004-03-19 Miguel de Icaza <miguel@ximian.com>
8258 * ecore.cs (TypExpr.GetHashCode): implement this overload.
8260 2004-03-19 Martin Baulig <martin@ximian.com>
8262 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
8263 two overloads may unify for some type parameter substitutions and
8264 report a CS0408 if appropriate.
8266 2004-03-19 Martin Baulig <martin@ximian.com>
8268 * class.cs (MemberCore.IsDuplicateImplementation): Report the
8269 error here and not in our caller.
8271 2004-03-19 Martin Baulig <martin@ximian.com>
8273 * interface.cs: Completely killed this file.
8274 (Interface): We're now a TypeContainer and live in class.cs.
8276 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8277 argument; we're now also called for interfaces.
8278 (TypeContainer.DefineMembers): Allow this method being called
8280 (TypeContainer.GetMethods): New public method; formerly known as
8281 Interface.GetMethod(). This is used by PendingImplementation.
8282 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8283 it's now private and non-static.
8284 (Interface): Moved this here; it's now implemented similar to
8286 (Method, Property, Event, Indexer): Added `bool is_interface'
8287 argument to their .ctor's.
8288 (MemberBase.IsInterface): New public field.
8290 * cs-parser.jay: Create normal Method, Property, Event, Indexer
8291 instances instead of InterfaceMethod, InterfaceProperty, etc.
8292 (opt_interface_base): Removed; we now use `opt_class_base' instead.
8293 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8295 2004-03-19 Martin Baulig <martin@ximian.com>
8297 * class.cs (MethodCore.IsDuplicateImplementation): New private
8298 method which does the CS0111 checking.
8299 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8300 Use IsDuplicateImplementation().
8302 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
8304 * decl.cs (FindMemberToOverride): New method to find the correct
8305 method or property to override in the base class.
8307 - Make Method/Property use the above method to find the
8308 version in the base class.
8309 - Remove the InheritableMemberSignatureCompare as it is now
8312 This patch makes large code bases much faster to compile, as it is
8313 O(n) rather than O(n^2) to do this validation.
8315 Also, it fixes bug 52458 which is that nested classes are not
8316 taken into account when finding the base class member.
8318 Reviewed/Approved by Martin.
8320 2004-03-17 Martin Baulig <martin@ximian.com>
8322 * expression.cs (MemberAccess.DoResolve): Take the parent's number
8323 of type arguments into account; use the `real_num_type_args'
8324 approach like in DoResolveAsTypeStep().
8326 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8329 2004-03-17 Marek Safar <marek.safar@seznam.cz>
8331 * interface.cs: In all interface classes removed redundant
8332 member initialization.
8334 2004-03-16 Martin Baulig <martin@ximian.com>
8336 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8338 2004-03-15 Miguel de Icaza <miguel@ximian.com>
8340 * decl.cs (DefineTypeAndParents): New helper method to define a
8341 type's containers before the type itself is defined; This is a
8342 bug exposed by the recent changes to Windows.Forms when an
8343 implemented interface was defined inside a class that had not been
8346 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8348 (Check): Loop correctly to report errors modifiers
8349 (UNSAFE was not in the loop, since it was the same as TOP).
8351 * interface.cs: Every interface member now takes a ModFlags,
8352 instead of a "is_new" bool, which we set on the base MemberCore.
8354 Every place where we called "UnsafeOk" in the interface, now we
8355 call the proper member (InterfaceMethod.UnsafeOK) instead to get
8356 the unsafe settings from the member declaration instead of the
8357 container interface.
8359 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
8361 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8362 `set_indexer_name' to the pending bits (one per type).
8364 We fixed a bug today that was picking the wrong method to
8365 override, since for properties the existing InterfaceMethod code
8366 basically ignored the method name. Now we make sure that the
8367 method name is one of the valid indexer names.
8369 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
8371 * support.cs (SeekableStreamReader): Keep track of stream byte
8372 positions and don't mix them with character offsets to the buffer.
8374 Patch from Gustavo Giráldez
8376 2004-03-15 Marek Safar <marek.safar@seznam.cz>
8378 * interface.cs (InterfaceSetGetBase): Removed double member
8379 initialization, base class does it as well.
8381 2004-03-13 Martin Baulig <martin@ximian.com>
8383 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8384 when compiling corlib.
8386 2004-03-13 Miguel de Icaza <miguel@ximian.com>
8388 * convert.cs (ExplicitConversion): We were reporting an error on
8389 certain conversions (object_type source to a value type, when the
8390 expression was `null') before we had a chance to pass it through
8391 the user defined conversions.
8393 * driver.cs: Replace / and \ in resource specifications to dots.
8396 * class.cs: Add check for duplicate operators. Fixes 52477
8398 2004-03-11 Miguel de Icaza <miguel@ximian.com>
8400 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8401 that are in the middle of the statements, not only at the end.
8404 * class.cs (TypeContainer.AddField): No longer set the
8405 `HaveStaticConstructor' flag, now we call it
8406 `UserDefineStaticConstructor' to diferentiate the slightly
8407 semantic difference.
8409 The situation is that we were not adding BeforeFieldInit (from
8410 Modifiers.TypeAttr) to classes that could have it.
8411 BeforeFieldInit should be set to classes that have no static
8416 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8418 And most importantly Zoltan's comment:
8420 http://bugzilla.ximian.com/show_bug.cgi?id=44229
8422 "I think beforefieldinit means 'it's ok to initialize the type sometime
8423 before its static fields are used', i.e. initialization does not need
8424 to be triggered by the first access to the type. Setting this flag
8425 helps the JIT to compile better code, since it can run the static
8426 constructor at JIT time, and does not need to generate code to call it
8427 (possibly lots of times) at runtime. Unfortunately, mcs does not set
8428 this flag for lots of classes like String.
8430 csc sets this flag if the type does not have an explicit static
8431 constructor. The reasoning seems to be that if there are only static
8432 initalizers for a type, and no static constructor, then the programmer
8433 does not care when this initialization happens, so beforefieldinit
8436 This bug prevents the AOT compiler from being usable, since it
8437 generates so many calls to mono_runtime_class_init that the AOT code
8438 is much slower than the JITted code. The JITted code is faster,
8439 because it does not generate these calls if the vtable is type is
8440 already initialized, which is true in the majority of cases. But the
8441 AOT compiler can't do this."
8443 2004-03-10 Miguel de Icaza <miguel@ximian.com>
8445 * class.cs (MethodData.Emit): Refactor the code so symbolic
8446 information is generated for destructors; For some reasons we
8447 were taking a code path that did not generate symbolic information
8450 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
8452 * class.cs: Create a Constructor.CheckBase method that
8453 takes care of all validation type code. The method
8454 contains some code that was moved from Define.
8456 It also includes new code that checks for duplicate ctors.
8457 This fixes bug #55148.
8459 2004-03-09 Joshua Tauberer <tauberer@for.net>
8461 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8462 a { ... }-style array creation invokes EmitStaticInitializers
8463 which is not good for reference-type arrays. String, decimal
8464 and now null constants (NullCast) are not counted toward
8465 static initializers.
8467 2004-03-05 Martin Baulig <martin@ximian.com>
8469 * location.cs (SourceFile.HasLineDirective): New public field;
8470 specifies whether the file contains or is referenced by a "#line"
8472 (Location.DefineSymbolDocuments): Ignore source files which
8473 either contain or are referenced by a "#line" directive.
8475 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
8477 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8478 direct access to our parent, so check the method inline there.
8480 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
8482 * expression.cs (Invocation.EmitCall): Miguel's last commit
8483 caused a regression. If you had:
8488 In Foo the implict this would be null.
8490 2004-02-27 Miguel de Icaza <miguel@ximian.com>
8492 * expression.cs (Invocation.EmitCall): If the method is not
8493 virtual, do not emit a CallVirt to it, use Call.
8495 * typemanager.cs (GetFullNameSignature): Improve the method to
8496 cope with ".ctor" and replace it with the type name.
8498 * class.cs (ConstructorInitializer.Resolve): Now the method takes
8499 as an argument the ConstructorBuilder where it is being defined,
8500 to catch the recursive constructor invocations.
8502 2004-03-16 Martin Baulig <martin@ximian.com>
8504 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
8505 ConstructedType, call ResolveType() on it to get the type rather
8506 than just using `expr.Type'.
8508 2004-03-16 Martin Baulig <martin@ximian.com>
8510 * generics.cs (ConstructedType.GetMemberAccess): Take the
8511 EmitContext instead on the TypeExpr and use
8512 ec.TypeContainer.CurrentType/ec.ContainerType.
8514 2004-03-16 Martin Baulig <martin@ximian.com>
8516 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
8517 parameters before aliases.
8519 2004-03-16 Martin Baulig <martin@ximian.com>
8521 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
8522 New oublic function; checks whether two generic instances may become
8523 equal under some instantiations (26.3.1).
8525 * class.cs (TypeContainer.Define): Call
8526 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
8529 2004-03-16 Martin Baulig <martin@ximian.com>
8531 * class.cs (TypeContainer.GetClassBases): Moved
8532 Error_TypeParameterAsBase() here and also check whether the base
8533 class is not an attribute.
8535 2004-03-16 Martin Baulig <martin@ximian.com>
8537 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8539 2004-03-16 Martin Baulig <martin@ximian.com>
8541 * class.cs (Error_TypeParameterAsBase): Use correct error number
8544 2004-03-16 Martin Baulig <martin@ximian.com>
8546 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
8549 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
8552 2004-03-15 Martin Baulig <martin@ximian.com>
8554 * typemanager.cs (TypeManager.GetFullName): New public method.
8555 (TypeManager.MemberLookup): Added `int_num_type_arguments'
8556 argument; only return members with the correct number of type
8558 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
8559 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
8560 whether the number of type arguments matches.
8562 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
8563 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
8565 * expression.cs (MemberAccess): Added public `NumTypeArguments'
8566 field; it's set by the protected .ctor when we're actually a
8567 GenericMemberAccess.
8568 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
8569 arguments and pass it to MemberLookupFinal ().
8571 * ecore.cs (Expression.MemberLookup): Added `int
8572 num_type_arguments' argument; only return members with the correct
8573 number of type arguments.
8574 (Expression.MemberLookupFailed): Check whether the MemberLookup
8575 failed because we did not have the correct number of type
8576 arguments; report CS0305 in this case.
8578 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
8579 `e.ResolveAsTypeTerminal()' already did so.
8581 2004-03-15 Martin Baulig <martin@ximian.com>
8583 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
8584 we're a ConstructedType; in this case, the caller must report an
8585 error (for instance CS0131).
8587 * generic.cs (TypeArguments): Added Location argument to the .ctor.
8588 (TypeArguments.Resolve): Actually report errors here.
8590 2004-03-15 Miguel de Icaza <miguel@ximian.com>
8592 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8593 `set_indexer_name' to the pending bits (one per type).
8595 We fixed a bug today that was picking the wrong method to
8596 override, since for properties the existing InterfaceMethod code
8597 basically ignored the method name. Now we make sure that the
8598 method name is one of the valid indexer names.
8600 2004-03-15 Martin Baulig <martin@ximian.com>
8602 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
8603 for generic instances.
8605 2004-03-13 Martin Baulig <martin@ximian.com>
8607 * class.cs (TypeContainer.DefineType): Call
8608 TypeManager.AddUserType() immediately after creating the
8609 TypeBuilder; pass all type parameters when creating the
8612 * decl.cs (DeclSpace.FindNestedType): New public method.
8613 (DeclSpace.FindType): Added `int num_type_args' argument; only
8614 return types with the correct number of type parameters.
8615 (DeclSpace.CountTypeParams): New public property.
8617 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
8618 the number of type parameters; defaults to zero.
8620 * generic.cs (TypeArguments.Count): New public property.
8621 (ConstructedType.DoResolveAsTypeStep): First call
8622 ds.FindNestedType() to find out whether we're nested in the
8623 current generic type; in this case, we inherit all type parameters
8624 from the current class.
8626 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
8627 num_type_args' argument.
8628 (RootContext.LookupType): Added overloaded version which takes the
8629 number of type arguments; only return types with the correct
8630 number of type arguments.
8632 * typemanager.cs (TypeManager.CheckGeneric): New public function;
8633 checks whether `Type t' has `int num_type_args'.
8635 2004-03-13 Martin Baulig <martin@ximian.com>
8637 * generic.cs (GenericMethod.DefineType): New method; calls
8638 DefineType() on all the type parameters.
8640 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
8641 (MethodData.Define): If we're a generic method, call
8642 GenericMethod.DefineType() to define the type parameters.
8644 2004-03-10 Martin Baulig <martin@ximian.com>
8646 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
8647 instead of IsAssignableFrom.
8649 2004-03-10 Martin Baulig <martin@ximian.com>
8651 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
8653 * support.cs (ParameterData.HasArrayParameter): New property.
8654 (ReflectionParameters.ctor): Take a MethodBase instead of a
8655 ParameterInfo[]. If we have any type parameters, get the generic
8656 method definition and ask it whether we have variable arguments.
8658 2004-02-26 Miguel de Icaza <miguel@ximian.com>
8660 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8661 routines to check if a type is an enumerable/enumerator allow
8662 classes that implement the IEnumerable or IEnumerator interfaces.
8664 * class.cs (Property, Operator): Implement IIteratorContainer, and
8665 implement SetYields.
8667 (Property.Define): Do the block swapping for get_methods in the
8668 context of iterators. We need to check if Properties also
8669 include indexers or not.
8671 (Operator): Assign the Block before invoking the
8672 OperatorMethod.Define, so we can trigger the Iterator code
8675 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
8676 Property and Operator classes are not created when we parse the
8677 declarator but until we have the block completed, so we use a
8678 singleton SimpleIteratorContainer.Simple to flag whether the
8679 SetYields has been invoked.
8681 We propagate this setting then to the Property or the Operator to
8682 allow the `yield' to function.
8684 2004-02-25 Marek Safar <marek.safar@seznam.cz>
8686 * codegen.cs: Implemented attribute support for modules.
8687 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8688 Assembly/Module functionality.
8690 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8691 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8692 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8694 2004-02-16 Marek Safar <marek.safar@seznam.cz>
8696 * interface.cs (FindMembers): The operation is performed on all base
8697 interfaces and not only on the first. It is required for future CLS Compliance patch.
8699 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
8701 * statement.cs, codegen.cs:
8702 This patch deals with patterns such as:
8704 public class List : IEnumerable {
8706 public MyEnumerator GetEnumerator () {
8707 return new MyEnumerator(this);
8710 IEnumerator IEnumerable.GetEnumerator () {
8714 public struct MyEnumerator : IEnumerator {
8719 Before, there were a few things we did wrong:
8720 1) we would emit callvirt on a struct, which is illegal
8721 2) we emited ldarg when we needed to emit ldarga
8722 3) we would mistakenly call the interface methods on an enumerator
8723 type that derived from IEnumerator and was in another assembly. For example:
8725 public class MyEnumerator : IEnumerator
8727 Would have the interface methods called, even if there were public impls of the
8728 method. In a struct, this lead to invalid IL code.
8730 2004-02-11 Marek Safar <marek.safar@seznam.cz>
8732 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8735 * delegate.cs (Define): Fixed crash when delegate type is undefined.
8737 2004-02-11 Miguel de Icaza <miguel@ximian.com>
8739 * cs-parser.jay: Fix small regression: we were not testing V2
8740 compiler features correctly.
8742 * interface.cs: If the emit context is null, then create one
8744 2004-02-09 Marek Safar <marek.safar@seznam.cz>
8746 * decl.cs (GetSignatureForError): New virtual method to get full name
8749 * attribute.cs (IAttributeSupport): New interface for attribute setting.
8750 Now it is possible to rewrite ApplyAttributes method to be less if/else.
8752 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8753 Duplicated members and code in these classes has been removed.
8754 Better encapsulation in these classes.
8756 2004-02-07 Miguel de Icaza <miguel@ximian.com>
8758 * assign.cs (Assign.DoResolve): When dealing with compound
8759 assignments, there is a new rule in ECMA C# 2.4 (might have been
8760 there before, but it is documented here) that states that in:
8764 If b is of type int, and the `op' is a shift-operator, then the
8765 above is evaluated as:
8769 * expression.cs (Binary.ResolveOperator): Instead of testing for
8770 int/uint/long/ulong, try to implicitly convert to any of those
8771 types and use that in pointer arithmetic.
8773 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8774 method to print information for from the type, not from the
8775 null-method we were given.
8777 2004-02-01 Duncan Mak <duncan@ximian.com>
8779 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8780 parsing for cmd, fixes bug #53694.
8782 2004-02-04 Marek Safar <marek.safar@seznam.cz>
8784 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8785 in the member name duplication tests. Property and operator name duplication
8786 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8788 2004-02-03 Marek Safar <marek.safar@seznam.cz>
8790 * interface.cs (PopulateMethod): Fixed crash when interface method
8791 returns not existing type (error test cs0246-3.cs).
8793 2004-02-02 Ravi Pratap M <ravi@ximian.com>
8795 * cs-parser.jay (interface_accessors): Re-write actions to also
8796 store attributes attached to get and set methods. Fix spelling
8799 (inteface_property_declaration): Modify accordingly.
8801 (InterfaceAccessorInfo): New helper class to store information to pass
8802 around between rules that use interface_accessors.
8804 * interface.cs (Emit): Apply attributes on the get and set
8805 accessors of properties and indexers too.
8807 * attribute.cs (ApplyAttributes): Modify accordingly to use the
8808 right MethodBuilder when applying attributes to the get and set accessors.
8810 2004-01-31 Miguel de Icaza <miguel@ximian.com>
8812 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8814 2004-01-26 Miguel de Icaza <miguel@ximian.com>
8816 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8818 2004-01-25 Miguel de Icaza <miguel@ximian.com>
8820 * cs-parser.jay: Remove YIELD token, instead use the new grammar
8821 changes that treat `yield' specially when present before `break'
8824 * cs-tokenizer.cs: yield is no longer a keyword.
8826 2004-01-23 Marek Safar <marek.safar@seznam.cz>
8828 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8829 setting for default constructors.
8830 For default constructors are almost every time set wrong Modifier. The
8831 generated IL code has been alright. But inside mcs this values was
8832 wrong and this was reason why several of my CLS Compliance tests
8835 2004-02-27 Martin Baulig <martin@ximian.com>
8837 * generics.cs (ConstructedType.ResolveType): Make the nested type
8838 stuff actually work.
8840 2004-02-25 Martin Baulig <martin@ximian.com>
8842 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
8843 property; returns the type parameters just from the current type,
8844 ie. with the ones from outer classes.
8845 (DeclSpace.LookupGeneric): First search in the current class, then
8847 (DeclSpace.initialize_type_params): When hiding a type parameter
8848 from an outer class, put it into the `type_param_list' anyways.
8850 * expression.cs (MemberAccess.expr): Made this field protected.
8852 * class.cs (TypeContainer.Define): The `CurrentType' just contains
8853 the type parameters from the current class.
8855 * generic.cs (ConstructedType.ResolveType): Support nested generic
8856 types by taking the type parameters which we inherit from outer
8857 classes into account.
8858 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
8859 support for nested generic types.
8861 2004-02-23 Martin Baulig <martin@ximian.com>
8863 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
8864 field and check whether we're nested inside a generic type.
8865 (DeclSpace.ResolveType): If we're resolving to a generic type
8866 definition, create a ConstructedType and return its resolved type.
8867 (DeclSpace.initialize_type_params): New private method;
8868 initializes the `type_param_list' field from the type parameters
8869 from this and all enclosing classes.
8870 (DeclSpace.TypeParameters): Call initialize_type_params() unless
8871 we're already initialized.
8873 2004-02-23 Martin Baulig <martin@ximian.com>
8875 * class.cs (Method.Define): Create the generic method before
8877 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
8878 the TypeContainer one); we use this for generic methods.
8880 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
8881 parent's TypeBuilder.
8883 2004-02-18 Martin Baulig <martin@ximian.com>
8885 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
8886 to check for equality.
8888 2004-02-05 Martin Baulig <martin@ximian.com>
8890 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
8891 `ec.TypeContainer.CurrentType', use it instead of
8892 `ec.ContainerType' to check whether we're in the type's ctor.
8894 2004-01-29 Martin Baulig <martin@ximian.com>
8896 * expression.cs (Invocation.DoResolve): If we're a
8897 `ConstructedType', then we're actually a generic method, so
8898 rewrite the expr as a GenericMemberAccess.
8900 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
8901 here; manually parse it into a string.
8903 2004-01-28 Martin Baulig <martin@ximian.com>
8905 * typemanager.cs (TypeManager.IsEqual): New static method.
8906 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
8907 check for equality instead of using `=='.
8909 2004-01-26 Martin Baulig <martin@ximian.com>
8911 * decl.cs (DeclSpace.CurrentType): New public field.
8913 * expression.cs (This.ResolveBase): If we have an
8914 `ec.TypeContainer.CurrentType', use it instead of
8917 * class.cs (TypeContainer.DefineType): If we're a generic type,
8918 create the `CurrentType' (unresolved).
8919 (TypeContainer.GenericType): New private field.
8920 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
8921 it and store it in `GenericType' before creating the MemberCache.
8922 (TypeContainer.GetMembers): If we have a `GenericType', call
8923 TypeManager.FindMembers() on it.
8925 * interface.cs (Interface.GenericType): New private field.
8926 (Interface.DefineType): If we're a generic type, create the
8927 `CurrentType' (unresolved).
8928 (Interface.DefineMembers): If we have a `CurrentType', resolve it
8929 and store it in `GenericType' before creating the MemberCache.
8930 (Interface.GetMembers): If we have a `GenericType', call
8931 TypeManager.FindMembers() on it.
8933 2004-01-22 Martin Baulig <martin@ximian.com>
8935 * cs-parser.jay (namespace_or_type_name): Return an Expression,
8936 not a QualifiedIdentifier. This is what `type_name_expression'
8937 was previously doing.
8938 (type_name_expression): Removed; the code is now in
8939 `namespace_or_type_name'.
8940 (qualified_identifier): Removed, use `namespace_or_type_name'
8942 (QualifiedIdentifier): Removed this class.
8944 2004-01-22 Martin Baulig <martin@ximian.com>
8946 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8947 not a string as alias name.
8949 2004-01-21 Miguel de Icaza <miguel@ximian.com>
8951 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8952 #52730 bug, and instead compute correctly the need to use a
8953 temporary variable when requesting an address based on the
8954 static/instace modified of the field and the constructor.
8956 2004-01-21 Martin Baulig <martin@ximian.com>
8958 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8959 class and namespace before looking up aliases. Fixes #52517.
8961 2004-01-21 Martin Baulig <martin@ximian.com>
8963 * flowanalysis.cs (UsageVector.Merge): Allow variables being
8964 assinged in a 'try'; fixes exception4.cs.
8966 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8967 * class.cs : Implemented parameter-less constructor for TypeContainer
8969 * decl.cs: Attributes are now stored here. New property OptAttributes
8971 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8973 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8975 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8977 * typemanager.cs (CSharpSignature): Now reports also inner class name.
8978 (CSharpSignature): New method for indexer and property signature.
8980 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8982 * pending.cs (IsVirtualFilter): Faster implementation.
8984 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8986 * typemanager.cs: Avoid inclusion of same assembly more than once.
8988 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8990 * cs-parser.jay: Fixed problem where the last assembly attribute
8991 has been applied also to following declaration (class, struct, etc.)
8993 2004-01-21 Marek Safar <marek.safar@seznam.cz>
8995 * class.cs: Added error CS0538, CS0539 reporting.
8996 Fixed crash on Microsoft runtime when field type is void.
8998 * cs-parser.jay: Added error CS0537 reporting.
9000 * pending.cs: Added error CS0535 reporting.
9001 Improved error report for errors CS0536, CS0534.
9003 2004-01-20 Miguel de Icaza <miguel@ximian.com>
9005 Merge a few bits from the Anonymous Method MCS tree.
9007 * statement.cs (ToplevelBlock): New class for toplevel methods,
9008 will hold anonymous methods, lifted variables.
9010 * cs-parser.jay: Create toplevel blocks for delegates and for
9011 regular blocks of code.
9013 2004-01-20 Martin Baulig <martin@ximian.com>
9015 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9016 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9017 and `NeedExplicitReturn'; added `IsLastStatement'.
9018 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9019 have a `ReturnLabel' or we're not unreachable.
9021 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9022 child's reachability; don't just override ours with it. Fixes
9023 #58058 (lluis's example).
9024 (FlowBranching): Added public InTryOrCatch(), InCatch(),
9025 InFinally(), InLoop(), InSwitch() and
9026 BreakCrossesTryCatchBoundary() methods.
9028 * statement.cs (Return): Do all error checking in Resolve().
9029 Unless we are the last statement in a top-level block, always
9030 create a return label and jump to it.
9031 (Break, Continue): Do all error checking in Resolve(); also make
9032 sure we aren't leaving a `finally'.
9033 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9034 statement in a top-level block.
9035 (Block.Flags): Added `IsDestructor'.
9036 (Block.IsDestructor): New public property.
9038 2004-01-20 Martin Baulig <martin@ximian.com>
9040 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9042 2004-01-20 Martin Baulig <martin@ximian.com>
9044 * statement.cs (Statement.ResolveUnreachable): New public method.
9045 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9046 (Block.Resolve): Resolve unreachable statements.
9048 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9050 * expression.cs: We need to fix the case where we do
9051 not have a temp variable here.
9053 * assign.cs: Only expression compound assignments need
9054 temporary variables.
9056 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9058 * flowanalysis.cs: Reduce memory allocation in a few ways:
9059 - A block with no variables should not allocate a bit
9061 - A method with no out parameters does not need any tracking
9062 for assignment of the parameters, so we need not allocate
9065 public readonly Type[] VariableTypes;
9066 public readonly string[] VariableNames;
9067 Are redundant. The data is already stored in the variable
9068 map, so we need not allocate another array for it.
9069 - We need to add alot of checks for if (params | locals) == null
9070 due to the first two changes.
9072 2004-01-18 Miguel de Icaza <miguel@ximian.com>
9074 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9075 implement IMemoryLocation, we store a copy on a local variable and
9076 take the address of it. Patch from Benjamin Jemlich
9078 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9079 to use a special "type_name_expression" rule which reduces the
9080 number of "QualifiedIdentifier" classes created, and instead
9081 directly creates MemberAccess expressions.
9083 2004-01-17 Miguel de Icaza <miguel@ximian.com>
9085 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9086 that fixes #52853. Null literal assignment to ValueType
9088 * class.cs (MethodData.Emit): Instead of checking the name of the
9089 method to determine if its a destructor, create a new derived
9090 class from Method called Destructor, and test for that.
9092 * cs-parser.jay: Create a Destructor object instead of a Method.
9094 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9098 2004-01-16 Miguel de Icaza <miguel@ximian.com>
9100 * expression.cs (Binary.ResolveOperator): Perform an implicit
9101 conversion from MethodGroups to their delegate types on the
9104 * delegate.cs: Introduce a new class DelegateCreation that is the
9105 base class for `NewDelegate' and `ImplicitDelegateCreation',
9106 factor some code in here.
9108 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9109 conversion from MethodGroups to compatible delegate types.
9111 * ecore.cs (Expression.Resolve): Do not flag error 654
9112 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9113 we allow conversions from MethodGroups to delegate types now.
9115 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9116 assignments in v2 either.
9118 2004-01-10 Miguel de Icaza <miguel@ximian.com>
9120 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9121 static read-only fields in ctors.
9123 Applied patch from Benjamin Jemlich
9125 * expression.cs (UnaryMutator): Avoid leaking local variables.
9127 2004-01-09 Miguel de Icaza <miguel@ximian.com>
9129 * cs-tokenizer.cs (IsCastToken): Allow the various native types
9130 here to return true, as they can be used like this:
9134 Fixed 49836 and all the other dups
9136 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
9138 * driver.cs: Implement /win32res and /win32icon.
9140 2004-01-08 Miguel de Icaza <miguel@ximian.com>
9142 * cs-parser.jay: Add a rule to improve error handling for the
9143 common mistake of placing modifiers after the type.
9145 2004-01-07 Miguel de Icaza <miguel@ximian.com>
9147 * cs-parser.jay (interface_event_declaration): Catch
9148 initialization of events on interfaces, and report cs0068
9150 * cs-parser.jay (interface_event_declaration): Catch
9151 initialization of events.
9153 * ecore.cs: Better report missing constructors.
9155 * expression.cs (Binary.ResolveOperator): My previous bug fix had
9156 the error reporting done in the wrong place. Fix.
9158 * expression.cs (Binary.ResolveOperator): Catch the
9159 operator + (E x, E y) error earlier, and later allow for implicit
9160 conversions in operator +/- (E e, U x) from U to the underlying
9163 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9164 52596, if the container class is abstract, the default constructor
9165 is protected otherwise its public (before, we were always public).
9167 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9170 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9171 Jemlich that fixes bug #52597, MCS was generating invalid code for
9172 idisposable structs. Thanks to Ben for following up with this
9175 2004-01-06 Miguel de Icaza <miguel@ximian.com>
9177 * driver.cs: Allow assemblies without code to be generated, fixes
9180 2004-01-07 Nick Drochak <ndrochak@gol.com>
9182 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9184 2004-01-05 Miguel de Icaza <miguel@ximian.com>
9186 * cs-parser.jay: Add rules to improve error reporting if fields or
9187 methods are declared at the namespace level (error 116)
9189 * Add rules to catch event add/remove
9191 2004-01-04 David Sheldon <dave-mono@earth.li>
9193 * expression.cs: Added matching ")" to error message for
9196 2004-01-03 Todd Berman <tberman@gentoo.org>
9198 * ecore.cs, attribute.cs:
9199 Applying fix from #52429.
9201 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9203 * ecore.cs, expression.cs, statement.cs:
9204 Total rewrite of how we handle branching. We
9205 now handle complex boolean expressions with fewer
9206 jumps. As well if (x == 0) no longer emits a ceq.
9208 if (x is Foo) is much faster now, because we generate
9211 Overall, we get a pretty big improvement on our benchmark
9212 tests. The code we generate is smaller and more readable.
9214 I did a full two-stage bootstrap. The patch was reviewed
9215 by Martin and Miguel.
9217 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9219 * cs-parser.jay: Make primary_expression not take a QI.
9220 we dont need this because the member_access rule covers
9221 us here. So we replace the rule with just IDENTIFIER.
9223 This has two good effects. First, we remove a s/r conflict.
9224 Second, we allocate many fewer QualifiedIdentifier objects.
9226 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9228 * attribute.cs: Handle MarshalAs attributes as pseudo, and
9229 set the correct information via SRE. This prevents
9230 hanging on the MS runtime. Fixes #29374.
9232 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9234 * convert.cs: correctly handle conversions to value types
9235 from Enum and ValueType as unboxing conversions.
9237 Fixes bug #52569. Patch by Benjamin Jemlich.
9239 2004-01-02 Ravi Pratap <ravi@ximian.com>
9241 * expression.cs (BetterConversion): Prefer int -> uint
9242 over int -> ulong (csc's behaviour). This fixed bug #52046.
9244 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
9246 * decl.cs (MemberCache.FindMembers): now returns a
9249 * typemanager.cs: In general, go with with ^^.
9250 (CopyNewMethods): take an IList.
9251 (RealMemberLookup): Only allocate an arraylist
9252 if we copy from two sets of methods.
9254 This change basically does two things:
9255 1) Fewer array lists allocated due to CopyNewMethods.
9256 2) the explicit cast in MemberList costed ALOT.
9258 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
9260 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9261 a hashtable to avoid needless string allocations when an identifier is
9262 used more than once (the common case).
9264 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9266 * pending.cs: MS's TypeBuilder.GetInterfaces ()
9267 is broken, it will not return anything. So, we
9268 have to use the information we have in mcs to
9271 * typemanager.cs: Add a cache for GetInterfaces,
9272 since this will now be used more often (due to ^^)
9274 (GetExplicitInterfaces) New method that gets the
9275 declared, not effective, interfaces on a type
9276 builder (eg, if you have interface IFoo, interface
9277 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9280 This patch makes MCS able to bootstrap itself on
9283 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9285 * expression.cs: Remove the Nop's that Miguel put
9288 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9290 * report.cs, codegen.cs: Give the real stack trace to
9291 the error when an exception is thrown.
9293 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9295 * decl.cs: only allocate hashtables for ifaces if
9298 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9300 * expression.cs: fix the error from cs0121-2.cs
9301 (a parent interface has two child interfaces that
9302 have a function with the same name and 0 params
9303 and the function is called through the parent).
9305 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
9307 * class.cs, rootcontext.cs, typmanager.cs: do not
9310 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
9312 * codegen.cs: remove stack for the ec flow branching.
9313 It is already a linked list, so no need.
9315 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
9317 * Makefile: Allow custom profiler here.
9319 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
9321 * typemanager.cs (LookupType):
9322 - Use a static char [], because split takes
9323 a param array for args, so it was allocating
9325 - Do not store true in a hashtable, it boxes.
9327 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
9329 * flowanalysis.cs: bytify common enums.
9331 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9333 * modifiers.cs: Add a new set of flags for the
9334 flags allowed on explicit interface impls.
9335 * cs-parser.jay: catch the use of modifiers in
9336 interfaces correctly.
9337 * class.cs: catch private void IFoo.Blah ().
9339 All related to bug #50572.
9341 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9343 * decl.cs: Rewrite the consistant accessability checking.
9344 Accessability is not linear, it must be implemented in
9345 a tableish way. Fixes #49704.
9347 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9349 * expression.cs: Handle negation in a checked context.
9350 We must use subtraction from zero. Fixes #38674.
9352 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9354 * class.cs: Ignore static void main in DLLs.
9355 * rootcontext.cs: Handle the target type here,
9356 since we are have to access it from class.cs
9357 * driver.cs: account for the above.
9359 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9361 * report.cs: Give line numbers and files if available.
9363 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
9365 * driver.cs: Implement /addmodule.
9367 * typemanager.cs: Change 'modules' field so it now contains Modules not
9370 2003-12-20 Martin Baulig <martin@ximian.com>
9372 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9373 (FieldBase.IsAssigned): Removed this field.
9374 (FieldBase.SetAssigned): New public method.
9375 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9377 2003-12-20 Martin Baulig <martin@ximian.com>
9379 * expression.cs (LocalVariableReference.DoResolve): Don't set
9380 `vi.Used' if we're called from DoResolveLValue().
9382 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9383 returns the usage vector it just merged into the current one -
9384 pass this one to UsageWarning().
9385 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9386 of the `EmitContext', don't call this recursively on our children.
9388 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
9390 * driver.cs: Implement /target:module.
9392 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
9394 * support.cs (CharArrayHashtable): New helper class.
9396 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
9397 char arrays, not strings, so we can avoid creating a string in
9398 consume_identifier if the identifier is a keyword.
9400 2003-12-16 Martin Baulig <martin@ximian.com>
9402 * statement.cs (LocalInfo.Assigned): Removed this property.
9403 (LocalInfo.Flags): Removed `Assigned'.
9404 (LocalInfo.IsAssigned): New public method; takes the EmitContext
9405 and uses flow analysis.
9406 (Block.UsageWarning): Made this method private.
9407 (Block.Resolve): Call UsageWarning() if appropriate.
9409 * expression.cs (LocalVariableReference.DoResolve): Always set
9410 LocalInfo.Used here.
9412 2003-12-13 Martin Baulig <martin@ximian.com>
9414 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9415 any value here; we're now using flow analysis to figure out
9416 whether a statement/block returns a value.
9418 2003-12-13 Martin Baulig <martin@ximian.com>
9420 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9422 (FlowBranching.MergeFinally): Don't call
9423 `branching.CheckOutParameters()' here, this is called in
9425 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9426 when adding the `finally' vector.
9428 2003-12-13 Martin Baulig <martin@ximian.com>
9431 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9432 actually work and also fix #48962.
9434 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
9436 * decl.cs: Do not check System.Object for nested types,
9437 since we know it does not have any. Big bang for buck:
9442 corlib: 17.99 seconds
9446 corlib: 17.39 seconds
9448 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
9450 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9451 time we are returning 0 members, so we save alot here.
9453 2003-12-11 Martin Baulig <martin@ximian.com>
9455 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9456 `MergeChild()', also just take the `FlowBranching' as argument;
9457 call Merge() on it and return the result.
9458 (FlowBranching.Merge): We don't need to do anything if we just
9461 2003-12-11 Martin Baulig <martin@ximian.com>
9463 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9464 them in an `ArrayList' to reduce memory usage. Thanks to Ben
9465 Maurer for this idea.
9467 2003-12-11 Martin Baulig <martin@ximian.com>
9469 * flowanalysis.cs (MergeResult): This class is now gone; we now
9470 use the `UsageVector' for this. The reason for this is that if a
9471 branching just has one sibling, we don't need to "merge" them at
9472 all - that's the next step to do.
9473 (FlowBranching.Merge): We now return a `UsageVector' instead of a
9476 2003-12-11 Martin Baulig <martin@ximian.com>
9478 Reworked flow analyis and made it more precise and bug-free. The
9479 most important change is that we're now using a special `Reachability'
9480 class instead of having "magic" meanings of `FlowReturns'. I'll
9481 do some more cleanups and optimizations and also add some more
9482 documentation this week.
9484 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9485 largely reworked this class.
9486 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9487 the new `Reachability' class instead of having "magic" values here.
9488 (FlowBranching): We're now using an instance of `Reachability'
9489 instead of having separate `Returns', `Breaks' etc. fields.
9491 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9492 based on flow analysis; ignore the return value of block.Emit ().
9494 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
9496 * driver.cs typemanager.cs: Find the mono extensions to corlib even
9497 if they are private.
9499 2003-12-09 Martin Baulig <martin@ximian.com>
9501 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9502 call them directly on the UsageVector.
9504 2003-12-09 Martin Baulig <martin@ximian.com>
9506 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9507 Changed return type from `FlowReturns' to `Reachability'.
9509 2003-12-09 Martin Baulig <martin@ximian.com>
9511 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9512 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9513 `Reachable' fields with a single `Reachability' one.
9515 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
9517 * class.cs (FindMembers): Remove foreach's.
9530 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
9535 This patch does a few things:
9536 1. EmptyStatement is now a singleton, so it is never reallocated.
9537 2. All blah is EmptyStatement constructs have been changed to
9538 blah == EmptyStatement.Value, which is much faster and valid
9539 now that EmptyStatement is a singleton.
9540 3. When resolving a block, rather than allocating a new array for
9541 the non-empty statements, empty statements are replaced with
9542 EmptyStatement.Value
9543 4. Some recursive functions have been made non-recursive.
9544 Mainly the performance impact is from (3), however (1) and (2) are needed for
9545 this to work. (4) does not make a big difference in normal situations, however
9546 it makes the profile look saner.
9551 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9552 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9553 Total memory allocated: 56397 KB
9556 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9557 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9558 Total memory allocated: 55666 KB
9560 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
9562 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9563 than the hashtable in a hashtable version
9565 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9566 we always end up concating a string. This results in a huge perf
9567 loss, because many strings have to be tracked by the GC. In this
9568 patch, we first use a hashtable that works with two keys, so that
9569 the strings do not need to be concat'ed.
9580 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
9582 * Makefile: Add a new target `do-time' that does a quick and simple
9583 profile, leaving easy to parse output.
9585 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
9587 * codegen.cs (Init): Create the dynamic assembly with
9588 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9590 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
9592 * support.cs: Make the PtrHashtable use only one
9593 instance of its comparer.
9595 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
9597 * typemanager.cs: Fix lookup of GetNamespaces.
9599 2003-11-29 Miguel de Icaza <miguel@ximian.com>
9601 * expression.cs: Removed redundant line.
9603 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9604 ArrayLists, use for loops with bounds.
9606 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9609 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9610 arraylists, use for loop with bounds.
9612 The above three changes give us a 0.071 second performance
9613 improvement out of 3.294 seconds down to 3.223. On my machine
9614 the above changes reduced the memory usage by 1,387 KB during
9617 * cs-parser.jay (QualifiedIdentifier): New class used to represent
9618 QualifiedIdentifiers. Before we created a new string through
9619 concatenation, and mostly later on, the result would be
9620 manipulated by DecomposeQI through string manipulation.
9622 This reduced the compiler memory usage for bootstrapping from
9623 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9624 compile times in 0.05 seconds.
9626 2003-11-28 Dick Porter <dick@ximian.com>
9628 * support.cs: Do string compares with the Invariant culture.
9636 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9637 the comparison is done with the Invariant culture.
9639 2003-11-27 Miguel de Icaza <miguel@ximian.com>
9641 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9642 GetEnumerator method.
9644 (ProbeCollectionType): Iterate starting at the most specific type
9645 upwards looking for a GetEnumerator
9647 * expression.cs: Shift count can be up to 31 for int/uint and 63
9650 2003-11-26 Miguel de Icaza <miguel@ximian.com>
9652 * statement.cs (Block.LookupLabel): Also look for the label on the
9653 children blocks. Use a hash table to keep track of visited
9656 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9657 we actually did transform the other operand, otherwise fall back
9658 to the common codepath that casts to long.
9660 * cs-tokenizer.cs: Use the same code pattern as the int case.
9661 Maybe I should do the parsing myself, and avoid depending on the
9662 Parse routines to get this done.
9664 2003-11-25 Miguel de Icaza <miguel@ximian.com>
9666 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
9667 which fixes bug 51347. This time test it.
9669 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9670 attributes for example can not tell the difference between these.
9671 The difference was only a syntax feature of the language.
9673 * attribute.cs: Apply attributes to delegates.
9675 * delegate.cs: Call the apply attributes method.
9677 2003-11-24 Miguel de Icaza <miguel@ximian.com>
9679 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9680 comparing 0 vs Byte.MinValue, not the value
9682 (ImplicitConversionRequired): When reporting a conversion error,
9683 use error 31 to print out the constant error instead of the
9686 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
9687 which fixes bug 51347.
9689 2003-11-22 Miguel de Icaza <miguel@ximian.com>
9691 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
9692 which fixes the -warnaserror command line option.
9694 2003-11-21 Miguel de Icaza <miguel@ximian.com>
9696 * cfold.cs (DoNumericPromotions): During constant folding of
9697 additions on UIntConstant, special case intconstants with
9698 IntConstants like we do on the expression binary operator.
9700 2003-11-12 Miguel de Icaza <miguel@ximian.com>
9702 * convert.cs (ImplicitReferenceConversion): We were missing a case
9703 (System.Enum are not value types or class types, so we need to
9704 classify them separatedly).
9706 * driver.cs: We do not support error 2007.
9708 2003-11-12 Jackson Harper <jackson@ximian.com>
9710 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9711 system directory. Also use the full file name so users can
9712 libraries names mscorlib-o-tron.dll in a non system dir.
9714 2004-01-04 David Sheldon <dave-mono@earth.li>
9716 * expression.cs: Added matching ")" to error message for CS0077.
9718 2003-12-19 Martin Baulig <martin@ximian.com>
9720 * typemanager.cs (TypeManager.IsEqualGenericType): New public
9721 static method; see documentation in the method.
9722 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
9724 * convert.cs (Convert.ImplicitReferenceConversion,
9725 Convert.ImplicitReferenceConversionExists): Add support for
9726 generic type declarations; see gen-36.cs.
9728 2003-12-19 Martin Baulig <martin@ximian.com>
9730 * pending.cs (Pending.InterfaceMethod): Use
9731 `Type.IsAssignableFrom()' instead of `=='.
9733 2003-12-18 Martin Baulig <martin@ximian.com>
9735 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
9738 * convert.cs (Convert.ImplicitStandardConversionExists): Use
9739 `expr_type.Equals (target_type)' instead of `=='.
9741 2003-12-08 Martin Baulig <martin@ximian.com>
9743 * generics.cs (Constraints.Types): Removed.
9744 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
9746 (Constraints.ResolveTypes): New public method; resolves the
9747 TypeExpr's to Type's.
9748 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
9749 longer takes the constraints.
9750 (TypeParameter.DefineMethod): Likewise.
9751 (TypeParameter.DefineType): New public method. Calls
9752 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
9755 2003-12-08 Martin Baulig <martin@ximian.com>
9757 * convert.cs (Convert.ImplicitConversionStandard): Use
9758 `expr_type.Equals (target_type)' instead of `=='.
9760 2003-12-08 Martin Baulig <martin@ximian.com>
9762 * typemanager.cs (TypeManager.GetReferenceType): Call
9763 `Type.MakeByRefType ()'.
9765 2003-12-08 Martin Baulig <martin@ximian.com>
9767 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
9768 just has some special meaning in some situations. For instance,
9769 it is allowed to use `where' as the name of a variable etc.
9771 2003-12-04 Martin Baulig <martin@ximian.com>
9773 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9774 `Type.MakeArrayType()' for array types.
9776 2003-11-18 Miguel de Icaza <miguel@ximian.com>
9778 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
9781 (SizeOf.DoResolve): assign the `type_queried' field. This gets
9784 2003-11-16 Martin Baulig <martin@ximian.com>
9786 * codegen.cs (EmitContext.IsGeneric): Removed.
9788 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
9789 ResolveGeneric() on the DeclSpace.
9791 2003-11-16 Martin Baulig <martin@ximian.com>
9793 * generic.cs (TypeArguments.Resolve):
9794 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
9795 `ResolveType()' on it to get the Type.
9797 2003-11-15 Martin Baulig <martin@ximian.com>
9799 * generic.cs (ConstructedType.GetInterfaces): Override this.
9801 2003-11-14 Martin Baulig <martin@ximian.com>
9803 * interface.cs (Interface.DefineType): Define all type parameters
9804 before adding the interfaces we inherit.
9806 2003-11-11 Martin Baulig <martin@ximian.com>
9808 * generic.cs (ConstructedType.ResolveType): Always call
9809 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
9811 2003-11-10 Martin Baulig <martin@ximian.com>
9813 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9814 (TypeManager.InitCoreTypes): Initialize them here, but instead of
9815 calling `ResolveType()' on them, directly assign their `Type'.
9817 2003-11-08 Martin Baulig <martin@ximian.com>
9819 * generic.cs (ConstructedType): Override `IsClass' etc.
9821 2003-11-08 Martin Baulig <martin@ximian.com>
9823 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9824 return value and the `out parent' parameter.
9825 (TypeContainer.DefineType): Moved the CS0644 check into
9826 GetClassBases(). Don't pass the interface types to the
9827 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9828 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9830 * ecore.cs (TypeExpr.IsAttribute): New property.
9831 (TypeExpr.GetInterfaces): New method.
9833 * interface.cs (Interface.GetInterfaceTypeByName): Return a
9834 TypeExpr instead of a Type.
9835 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9836 (Interface.DefineType): Don't pass the interface types to the
9837 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9838 them later and then call `TypeBulider.AddInterfaceImplementation()'.
9840 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9841 instead of a `Type[]'.
9842 (TypeManager.RegisterBuilder): Likewise.
9843 (TypeManager.AddUserInterface): Likewise.
9844 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9845 `Type[]' and also return a `TypeExpr[]'.
9846 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9848 2003-11-08 Martin Baulig <martin@ximian.com>
9850 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9853 2003-11-08 Martin Baulig <martin@ximian.com>
9855 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9856 TypeManager.ResolveExpressionTypes().
9858 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9859 instead of an Expression.
9860 (TypeExpr): This is now an abstract base class for `TypeExpression'.
9861 (TypeExpression): New public class; formerly known as `TypeExpr'.
9863 * expression.cs (ComposedCast): Derive from TypeExpr.
9865 * typemanager.cs (TypeManager.system_*_expr): These are now
9866 TypExpr's instead of Expression's.
9867 (TypeManager.ResolveExpressionTypes): New public static function;
9868 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9871 2003-11-06 Miguel de Icaza <miguel@ximian.com>
9873 * expression.cs (New.DoResolve): Do not dereference value that
9874 might be a null return.
9876 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9877 sure that the constant value has the right type. Fixes an
9878 unreported bug, similar to 50425.
9880 * const.cs (Const.LookupConstantValue): Call
9881 ImplicitStandardConversionExists before doing a conversion to
9882 avoid havng the TypeManager.ChangeType do conversions.
9884 Reduced the number of casts used
9886 (Const.ChangeType): New routine to enable reuse of the constant
9887 type changing code from statement.
9889 * typemanager.cs (ChangeType): Move common initialization to
9890 static global variables.
9894 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9895 every value type to go through, even if it was void. Fix that.
9897 * cs-tokenizer.cs: Use is_identifier_start_character on the start
9898 character of the define, and the is_identifier_part_character for
9899 the rest of the string.
9901 2003-11-05 Miguel de Icaza <miguel@ximian.com>
9903 * expression.cs (UnaryMutator.EmitCode): When I updated
9904 LocalVariableReference.DoResolve, I overdid it, and dropped an
9905 optimization done on local variable references.
9907 2003-11-04 Miguel de Icaza <miguel@ximian.com>
9909 * ecore.cs: Convert the return from Ldlen into an int.
9911 2003-10-20 Miguel de Icaza <miguel@ximian.com>
9913 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9914 the accessibility, this is a special case for toplevel non-public
9915 classes (internal for instance).
9917 2003-10-20 Nick Drochak <ndrochak@gol.com>
9919 * ecore.cs: Fix typo and build. Needed another right paren.
9921 2003-10-19 Miguel de Icaza <miguel@ximian.com>
9923 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
9924 `internal' case regular and protected, but not allowing protected
9925 to be evaluated later. Bug 49840
9927 2003-10-15 Miguel de Icaza <miguel@ximian.com>
9929 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9930 to kb.Nlast, and not the kb.nFirst to isolate the switch
9933 Extract the underlying type, so enumerations of long/ulong are
9934 treated like long/ulong.
9936 2003-10-14 Miguel de Icaza <miguel@ximian.com>
9938 * expression.cs (New): Overload the meaning of RequestedType to
9939 track the possible creation of the NewDelegate type, since
9940 DoResolve is invoked more than once for new constructors on field
9943 See bugs: #48800 and #37014
9945 * cs-parser.jay (declare_local_constants): Take an arraylist
9946 instead of a single constant.
9948 (local_constant_declaration): It should take a
9949 constant_declarators, not a constant_declarator. Fixes 49487
9951 * convert.cs: Fix error report.
9953 2003-10-13 Jackson Harper <jackson@ximian.com>
9955 * typemanager.cs (TypeToCoreType): Add float and double this fixes
9958 2003-11-03 Martin Baulig <martin@ximian.com>
9960 * expression.cs (ArrayAccess.GetStoreOpcode): Added
9961 `out bool has_type_arg'; if set, we need to pass the type to
9963 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
9964 Stelem_Any/Ldelem_Any for generic parameters.
9966 2003-11-02 Martin Baulig <martin@ximian.com>
9968 * expression.cs (Invocation.EmitCall): Use
9969 `TypeManager.IsValueType()' to check whether it's a value type.
9970 Don't set `struct_call' when calling a method on a type parameter.
9972 2003-11-02 Martin Baulig <martin@ximian.com>
9974 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
9975 and removed the TypeBuilder argument.
9977 * typemanager.cs (TypeManager.IsValueType): Return
9978 `t.IsGenericParameter || t.IsValueType'.
9980 2003-10-25 Martin Baulig <martin@ximian.com>
9982 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
9983 call ConstructedType.Resolve() on it.
9985 * generic.cs (ConstructedType.Resolve): Set `type' on success.
9987 2003-10-25 Martin Baulig <martin@ximian.com>
9989 * class.cs (TypeContainer.GetClassBases): Changed
9990 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
9991 CS8214 reporting here.
9992 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
9993 instead of a `Type' for our parent. In case of a recursive
9994 declaration (see tests/gen-23.cs for an example), our parent is a
9995 ConstructedType and it doesn't have its type set. So, first
9996 create our own TypeBuilder, then call constructed.Resolve() to get
9997 the parent's type and finally TypeBuilder.SetParent() it.
9999 * ecore.cs (TypeExpr.Name): New public virtual property.
10002 (ConstructedType): We're now a TypeExpr and not just an Expression.
10003 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
10004 arguments here; this is done later.
10005 (ConstructedType.Resolve): New public method to resolve the type
10006 arguments and bind them.
10008 2003-10-21 Martin Baulig <martin@ximian.com>
10010 * convert.cs: Use `TypeManager.IsValueType' instead of
10011 'type.IsValueType' everywhere.
10013 * typemanager.cs (TypeManager.IsValueType): Return true for type
10014 parameters. The reason for this is that we need to box a type
10015 parameter when converting it to a reference type.
10017 * cs-parser.jay: Added support for default value expressions.
10019 * generics.cs (DefaultValueExpression): New public class.
10021 2003-10-17 Martin Baulig <martin@ximian.com>
10023 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
10024 TypeContainer so we can also use this for Interfaces.
10025 (TypeParameter.Resolve): Likewise.
10027 * interface.cs (Interface.DefineType): Added support for generic
10030 * cs-parser.jay: Added support for generic structs and interfaces.
10032 2003-10-17 Martin Baulig <martin@ximian.com>
10034 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
10035 call generic methods :-)
10037 2003-10-16 Martin Baulig <martin@ximian.com>
10039 * cs-parser.jay (namespace_or_type_name): Only create a
10040 GenericMemberAccess if we actually have type arguments.
10042 2003-10-13 Martin Baulig <martin@ximian.com>
10044 * class.cs (Method.Define): If we're a generic method, call
10045 TypeBuilder.DefineGenericMethod () before resolving
10047 (MethodData): Added .ctor which takes an additional MethodBuilder
10048 argument; this is used for generic methods.
10049 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
10050 we already have a MethodBuilder.
10052 2003-10-10 Martin Baulig <martin@ximian.com>
10054 * class.cs (Method): Added .ctor which takes a `GenericMethod'
10055 instead of a `DeclSpace'. This is used for generic methods.
10057 * cs-parser.jay (method_header): Added support for generic
10058 methods; create a `GenericMethod' instance and pass it to the
10059 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
10060 parameters and locals.
10062 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10063 since we already have the location. Check whether we're a generic
10064 type declaration or a generic method and create the correct type
10067 * generic.cs (TypeParameter.DefineMethod): New public method.
10068 (GenericMethod): New public class; derives from DeclSpace and is
10069 used for generic methods.
10071 2003-10-09 Martin Baulig <martin@ximian.com>
10073 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10075 (MethodCore.DoDefineParameters): Removed the TypeContainer
10076 argument; use the DeclSpace which was passed to the .ctor instead.
10077 (MethodCore.CheckParameter): Take a DeclSpace instead of a
10078 TypeContainer; we only need a DeclSpace here.
10080 2003-10-09 Martin Baulig <martin@ximian.com>
10082 * class.cs (MethodData): Added additional `DeclSpace ds' argument
10084 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10085 EmitContext's .ctor.
10087 2003-10-09 Martin Baulig <martin@ximian.com>
10089 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10090 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10091 AsAccessible(), moved them as well.
10093 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10095 2003-10-07 Miguel de Icaza <miguel@ximian.com>
10097 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10098 generation for >=, as spotted by Paolo, bug 48679.
10099 Patch from David Waite.
10101 * cs-tokenizer.cs: Add handling for #pragma.
10103 * cs-parser.jay: Allow for both yield and yield return in the
10104 syntax. The anti-cobolization of C# fight will go on!
10106 * class.cs (TypeBuilder.DefineType): Catch error condition here
10107 (Parent.DefineType erroring out and returning null).
10109 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10110 coping with enumerations variables, we were mistakenly processing
10111 them as a regular value type instead of built-in types. Fixes the
10114 * typemanager.cs (IsBuiltinOrEnum): New method.
10116 2003-09-30 Miguel de Icaza <miguel@ximian.com>
10118 * cs-parser.jay: Upgrade: yield now needs the return clause.
10120 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10122 * cs-parser.jay : Renamed yyName to yyNames related to jay.
10124 2003-09-29 Martin Baulig <martin@ximian.com>
10126 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10127 inflated generic methods.
10129 * generics.cs (ConstructedType): Distinguish between open and
10130 closed constructed types; correctly resolve the arguments.
10132 2003-09-22 Martin Baulig <martin@ximian.com>
10134 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10135 all type arguments meet their constraints.
10137 2003-09-19 Martin Baulig <martin@ximian.com>
10139 * decl.cs (MemberCache.SetupCacheForInterface): Take a
10140 `MemberCache parent' argument. Normally, an interface doesn't
10141 have a parent type except System.Object, but we use this in gmcs
10142 for generic type parameters.
10144 2003-09-18 Martin Baulig <martin@ximian.com>
10146 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10147 on `type.IsInterface'; don't check whether the type has a parent
10148 to determine whether it's an interface.
10150 2003-09-17 Martin Baulig <martin@ximian.com>
10152 * generic.cs (ConstructedType.ToString): Always use `name' as the
10155 2003-09-15 Martin Baulig <martin@ximian.com>
10157 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10159 * generic.cs (Constraints.Resolve): New public method; this is
10160 called to resolve the constraint types and to check whether all
10161 the constraints are correct.
10162 (Constraints.Types): New public property.
10163 (TypeParameter.Resolve): New public method; resolves all the
10164 type's constraints.
10166 * class.cs (TypeContainer.DefineType): Call
10167 TypeParameter.Resolve() before actually defining the type.
10169 2003-09-15 Martin Baulig <martin@ximian.com>
10171 * class.cs (TypeContainer.DefineType): Added an error flag to
10172 avoid reporting duplicate CS0146's ("class definition is
10175 * driver.cs (Driver.MainDriver): Abort if
10176 RootContext.ResolveTree() reported any errors.
10178 2003-09-07 Martin Baulig <martin@ximian.com>
10180 * report.cs (Error, Warning): Added overloaded versions which take
10181 a `params object[] args' and call String.Format().
10183 2003-09-07 Martin Baulig <martin@ximian.com>
10185 * decl.cs (DeclSpace..ctor): Don't call
10186 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10187 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
10188 (DeclSpace.RecordDecl): New method.
10190 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10192 2003-09-02 Ravi Pratap <ravi@ximian.com>
10194 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10195 value attributes to be applied to ParameterBuilders.
10197 * class.cs (MethodCore.LabelParameters): Make static and more
10198 generic so that it can be used from other places - like interface
10199 methods, for instance.
10201 * interface.cs (Interface.Emit): Call LabelParameters before
10202 emitting attributes on the InterfaceMethod.
10204 2003-09-07 Martin Baulig <martin@ximian.com>
10206 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10207 if the number of type parameters doesn't match.
10209 2003-09-04 Martin Baulig <martin@ximian.com>
10211 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10212 for arrays of generic type params (ie. `!0[]').
10214 2003-09-04 Martin Baulig <martin@ximian.com>
10216 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10219 2003-09-04 Martin Baulig <martin@ximian.com>
10221 * decl.cs (DeclSpace.LookupGeneric): New method.
10222 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10225 * generic.cs (TypeParameterExpr): Take a TypeParameter as
10226 argument, not just a string.
10227 (TypeParameter.Define): New public method; this is called to
10228 actually define the generic parameter; after this, you can use the
10229 new `Type' property to get the type.
10231 2003-09-04 Martin Baulig <martin@ximian.com>
10233 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
10234 is now an ArrayList; initialize the result of the `TypeParameters'
10236 (DeclSpace.GetGenericData): Removed.
10237 (DeclSpace.LookupGeneric): Temporarily removed; we need to
10238 implement this in a different way.
10239 (DeclSpace.GetTypeParameters): Removed; there's now a
10240 `TypeParameters' property.
10241 (DeclSpace.TypeParameters): New public property.
10243 * generic.cs (Constraints): Make this class public.
10244 (TypeParameter): New public class.
10246 2003-09-04 Martin Baulig <martin@ximian.com>
10248 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
10249 generic parameters.
10251 * class.cs (TypeContainer.DefineType): Call
10252 TypeBuilder.DefineGenericParameter () on all generic parameters if
10253 this is a generic type.
10255 2003-08-28 Martin Baulig <martin@ximian.com>
10257 * sample-stack.il: Compile this with ilasm: "ilasm /dll
10260 * sample-hello.cs: Compile this with gmcs: "gmcs
10261 /r:sample-stack.dll sample-hello.cs".
10263 2003-08-28 Martin Baulig <martin@ximian.com>
10265 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
10266 the parameters to the generic type.
10268 2003-08-28 Martin Baulig <martin@ximian.com>
10270 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
10272 2003-08-28 Martin Baulig <martin@ximian.com>
10274 * cs-parser.jay (opt_type_argument_list): Use
10275 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
10276 (primary_expression): Replace `qualified_identifier' with `type_name'.
10277 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
10279 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
10280 parser to check whether it is syntactically a type parameter list;
10281 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
10284 2003-08-26 Martin Baulig <martin@ximian.com>
10286 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10287 resolving aliases; fixes #47927.
10289 2003-08-26 Martin Baulig <martin@ximian.com>
10291 * statement.cs (Using.DoResolve): This is internally emitting a
10292 try/finally clause, so we need to set ec.NeedExplicitReturn if we
10293 do not always return. Fixes #47681.
10295 2003-08-26 Martin Baulig <martin@ximian.com>
10297 * decl.cs (MemberCore): Moved WarningNotHiding(),
10298 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10300 (AdditionResult): Make this nested in DeclSpace.
10301 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10302 argument; call NamespaceEntry.Define() unless we're nested in a
10305 * namespace.cs (Namespace.DefineName): New public function. This
10306 is called from DeclSpace's .ctor to add
10307 (Namespace.Lookup): Include DeclSpaces in the lookup.
10309 * class.cs (Operator): Derive from MemberBase, not MemberCore.
10311 * const.cs (Const): Derive from MemberBase, not MemberCore.
10313 2003-08-25 Martin Baulig <martin@ximian.com>
10315 * convert.cs (Convert.ExplicitReferenceConversion): When
10316 converting from an interface type to a class, unbox if the target
10317 type is a struct type. Fixes #47822.
10319 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10321 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10324 2003-08-22 Martin Baulig <martin@ximian.com>
10326 * class.cs (TypeManager.DefineType): When defining a nested type,
10327 call DefineType() on our parent; fixes #47801.
10329 2003-08-22 Martin Baulig <martin@ximian.com>
10331 * class.cs (MethodData.Define): While checking if a method is an
10332 interface implementation, improve the test a bit more to fix #47654.
10334 2003-08-22 Martin Baulig <martin@ximian.com>
10336 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10337 correctly; fixes #47722.
10339 2003-08-22 Martin Baulig <martin@ximian.com>
10341 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10342 LocalVariableReference, ensure it's not read-only. Fixes #47536.
10344 * statement.cs (Fixed.DoResolve): Make all variables read-only.
10346 2003-08-22 Martin Baulig <martin@ximian.com>
10348 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10349 can only be assigned in static constructors. Fixes #47161.
10351 2003-08-22 Martin Baulig <martin@ximian.com>
10353 Rewrote and improved the flow analysis code.
10355 * flowbranching.cs (FlowBranching): Make this class abstract.
10356 (FlowBranching.CreateBranching): New static function to create a
10357 new flow branching.
10358 (FlowBranchingBlock, FlowBranchingException): New classes.
10359 (FlowBranching.UsageVector.Type): New public readonly field.
10360 (FlowBranching.UsageVector.Breaks): Removed the setter.
10361 (FlowBranching.UsageVector.Returns): Removed the setter.
10362 (FlowBranching.UsageVector): Added Break(), Return(),
10363 NeverReachable() and Throw() methods to modify the reachability.
10364 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10365 done by FlowBranching.Merge().
10366 (FlowBranching.UsageVector.MergeChild): New method; merges the
10367 merge result into the current vector.
10368 (FlowBranching.Merge): New abstract method to merge a branching.
10370 2003-08-12 Martin Baulig <martin@ximian.com>
10372 * expression.cs (Indirection.CacheTemporaries): Create the
10373 LocalTemporary with the pointer type, not its element type.
10375 2003-08-10 Miguel de Icaza <miguel@ximian.com>
10377 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10378 token was a keyword or not.
10380 Add `error' options where an IDENTIFIER was expected; Provide
10381 CheckToken and CheckIdentifierToken convenience error reporting
10384 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10386 * decl.cs: Rename `NamespaceEntry Namespace' public field into
10387 NameSpaceEntry NameSpaceEntry.
10389 (LookupInterfaceOrClass): Avoid creating a full qualified name
10390 from namespace and name: avoid doing lookups when we know the
10391 namespace is non-existant. Use new Tree.LookupByNamespace which
10392 looks up DeclSpaces based on their namespace, name pair.
10394 * driver.cs: Provide a new `parser verbose' to display the
10395 exception thrown during parsing. This is turned off by default
10396 now, so the output of a failure from mcs is more graceful.
10398 * namespace.cs: Track all the namespaces defined in a hashtable
10401 (IsNamespace): New method
10403 2003-08-09 Miguel de Icaza <miguel@ximian.com>
10405 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
10406 we know that we need to concatenate (full typename can never be
10411 * statement.cs: Use a bitfield; Do not initialize to null things
10412 which are done by the constructor by default.
10414 * cs-parser.jay: bug fix, parameter was 4, not 3.
10416 * expression.cs: Just use the property;
10418 * statement.cs: No need for GetVariableInfo method.
10420 2003-08-08 Martin Baulig <martin@ximian.com>
10422 * flowanalysis.cs (FlowReturns): This is now nested in the
10423 `FlowBranching' class.
10424 (MyBitVector): Moved this here from statement.cs.
10425 (FlowBranching.SiblingType): New enum type.
10426 (FlowBranching.CreateSibling): Added `SiblingType' argument.
10428 2003-08-07 Martin Baulig <martin@ximian.com>
10430 * flowanalysis.cs (FlowBranchingType): This is now nested in the
10431 `FlowBranching' class and called `BranchingType'.
10433 2003-08-07 Martin Baulig <martin@ximian.com>
10435 * flowanalysis.cs: Moved all the control flow analysis code into
10438 2003-08-07 Martin Baulig <martin@ximian.com>
10440 * assign.cs (Assign.DoResolve): `target' must either be an
10441 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
10444 2003-08-07 Miguel de Icaza <miguel@ximian.com>
10446 * expression.cs (BinaryMethod): This kind of expression is created by the
10447 Binary class if it determines that the operator has to be handled
10450 (BinaryDelegate): This kind of expression is created if we are
10451 dealing with a + or - operator on delegates.
10453 (Binary): remove method, argumetns, and DelegateOperator: when
10454 dealing with methods,
10456 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10458 * statement.cs (Block): use bitfields for the three extra booleans
10459 we had in use. Remove unused topblock parameter.
10461 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10463 * assign.cs: Drop extra unneeded tests.
10465 2003-08-06 Miguel de Icaza <miguel@ximian.com>
10467 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10469 * statement.cs (Foreach): Use VariableStorage instead of
10472 * codegen.cs (VariableStorage): New class used by clients that
10473 require a variable stored: locals or fields for variables that
10474 need to live across yield.
10476 Maybe provide a convenience api for EmitThis+EmitLoad?
10478 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
10481 2003-08-05 Miguel de Icaza <miguel@ximian.com>
10483 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
10484 RemapParameterLValue): New methods that are used to turn a
10485 precomputed FieldInfo into an expression like this:
10489 The idea is to use this instead of making LocalVariableReference
10490 have more than one meaning.
10492 * cs-parser.jay: Add error production to BASE.
10494 * ecore.cs: Deal with TypeManager.GetField returning null, which
10495 is now a valid return value.
10497 (FieldExprNoAddress): New expression for Fields whose address can
10500 * expression.cs (LocalVariableReference): During the resolve
10501 phases, create new expressions if we are in a remapping context.
10502 Remove code that dealt with remapping here.
10504 (ParameterReference): same.
10506 (ProxyInstance): New expression, like the `This' expression, but
10507 it is born fully resolved. We know what we are doing, so remove
10508 the errors that are targeted to user-provided uses of `this'.
10510 * statement.cs (Foreach): our variable is now stored as an
10511 Expression; During resolution, follow the protocol, dont just
10512 assume it will return this.
10514 2003-08-06 Martin Baulig <martin@ximian.com>
10516 * support.cs (SeekableStreamReader.cs): New public class.
10518 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
10519 SeekableStreamReader instead of the normal StreamReader.
10521 2003-08-04 Martin Baulig <martin@ximian.com>
10523 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
10524 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
10525 deambiguate casts and delegate invocations.
10526 (parenthesized_expression): Use the new tokens to ensure this is
10527 not a cast of method invocation.
10529 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
10530 when reading a `)' and Deambiguate_CloseParens () was previously
10533 * expression.cs (ParenthesizedExpression): New class. This is
10534 just used for the CS0075 test.
10535 (Binary.DoResolve): Check for CS0075.
10537 2003-07-29 Ravi Pratap <ravi@ximian.com>
10539 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
10540 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
10541 reference comparison.
10543 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
10544 examine the ReturnType for equality - this is necessary in the
10545 cases of implicit and explicit operators whose signature also
10546 includes the return type.
10548 2003-07-26 Miguel de Icaza <miguel@ximian.com>
10550 * namespace.cs: Cache the result of the namespace computation,
10551 instead of computing it every time.
10553 2003-07-24 Miguel de Icaza <miguel@ximian.com>
10555 * decl.cs: Use a global arraylist that we reuse over invocations
10556 to avoid excesive memory consumption. Reduces memory usage on an
10557 mcs compile by one meg (45 average).
10559 * typemanager.cs (LookupTypeReflection): In .NET pointers are
10560 private, work around that.
10562 2003-07-23 Miguel de Icaza <miguel@ximian.com>
10564 * literal.cs (IntLiteral): Define Zero and One static literals.
10566 * cs-parser.jay (integer_literal): use static literals to reduce
10567 memory usage for the most used literals (0, 1 and -1). 211kb
10568 reduced in memory usage.
10570 Replace all calls to `new ArrayList' with `new
10571 ArrayList(4)' which is a good average number for most allocations,
10572 and also requires only 16 bytes of memory for its buffer by
10575 This reduced MCS memory usage in seven megabytes for the RSS after
10578 2003-07-28 Ravi Pratap <ravi@ximian.com>
10580 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10581 handle params methods the correct way by forming only one
10582 applicable set with params and normal methods in them. Earlier we
10583 were looking at params methods only if we found no normal methods
10584 which was not the correct thing to do.
10586 (Invocation.BetterFunction): Take separate arguments indicating
10587 when candidate and the best method are params methods in their
10590 This fixes bugs #43367 and #46199.
10592 * attribute.cs: Documentation updates.
10594 (CheckAttribute): Rename to CheckAttributeTarget.
10595 (GetValidPlaces): Rename to GetValidTargets.
10597 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10598 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10602 2003-07-28 Miguel de Icaza <miguel@ximian.com>
10604 * codegen.cs: Compute IsGeneric correctly.
10606 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
10609 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
10610 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
10611 regressions, and I was chasing more bugs than I required.
10613 * interface.cs: Use expressions for base type names (like classes
10614 and structs have been doing for a while now), and resolve that.
10615 This patch should probably go into head as well.
10617 This makes it one less user of FindType.
10619 2003-07-24 Miguel de Icaza <miguel@ximian.com>
10621 This compiler can not self host currently. Need to fix that.
10623 * Makefile: compile to `gmcs.exe'
10625 * driver.cs: Turn on v2 by default on gmcs.
10627 * generic.cs (ConstructedType): Does no longer take a container
10628 type argument; That will be taken care of later.
10630 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
10631 Use SimpleName to resolve for now, so we can continue the work on
10632 the parser, until we get Type.GetType that understands generics.
10634 (ConstructedType.ToString): Implement
10636 (TypeArguments.Resolve): Resolve the child expressions as types.
10638 * cs-parser.jay: Rename interface_constraints to
10639 type_parameter_constraints
10641 (namespace_or_type_name): Only use constructed types for the basic
10642 construction, we will deal with identifier<...> later.
10644 (type/type_name): No longer call DecomposeQI, as
10645 namespace_or_type_name is always decoded now.
10647 2003-07-22 Ravi Pratap <ravi@ximian.com>
10649 * expression.cs (Invocation.OverloadResolve): Follow the spec more
10650 closely: we eliminate methods in base types when we have an
10651 applicable method in a top-level type.
10653 Please see section 14.5.5.1 for an exact description of what goes
10656 This fixes bug #45127 and a host of other related to corlib compilation.
10658 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10659 array is the method corresponding to the top-level type (this is
10660 because of the changes made to icall.c) so we change this
10663 (MethodGroupExpr.Name): This too.
10665 * typemanager.cs (GetElementType): New method which does the right
10666 thing when compiling corlib.
10668 * everywhere: Make use of the above in the relevant places.
10670 2003-07-22 Martin Baulig <martin@ximian.com>
10672 * cs-parser.jay (invocation_expression): Moved
10673 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10674 `cast_expression', but create a InvocationOrCast which later
10675 resolves to either an Invocation or a Cast.
10677 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10678 method; call this before EmitStatement() to make sure that this
10679 expression can be used as a statement.
10681 * expression.cs (InvocationOrCast): New class; resolves to either
10682 an Invocation or a Cast.
10684 * statement.cs (StatementExpression): Call ResolveStatement() on
10685 the ExpressionStatement before emitting it.
10687 2003-07-21 Martin Baulig <martin@ximian.com>
10689 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10690 `ref' and `out' attributes match; fixes #46220.
10691 (MemberAccess.ResolveMemberAccess): You can't reference a type
10692 through an expression; fixes #33180.
10693 (Indexers.GetIndexersForType): Don't return the indexers from
10694 interfaces the class implements; fixes #46502.
10696 2003-07-21 Martin Baulig <martin@ximian.com>
10698 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10699 CS0661 checks; fixes bug #30442.
10701 2003-07-21 Martin Baulig <martin@ximian.com>
10703 * decl.cs (AdditionResult): Added `Error'.
10705 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10707 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
10708 cs0031.cs actually work.
10710 2003-07-20 Miguel de Icaza <miguel@ximian.com>
10712 * cs-parser.jay (namespace_name): do not use
10713 namespace_or_type_name, use qualified_identifier, because
10714 namespace_or_type_name will soon return a composed expression
10715 instead of a string.
10717 (namespace_or_type_name): Instead of returning a string, now this
10718 production returns an expression.
10720 * codegen.cs (EmitContext): Setup IsGeneric property based on
10721 whether our DeclSpace is generic, our the method is generic.
10723 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
10724 the method is generic.
10726 * cs-parser.jay (type_arguments, opt_type_argument_list,
10727 type_parameters, type_parameter_list, opt_type_parameter_list,
10728 type_parameter,, opt_type_parameter_constraints_clauses,
10729 type_parameter_constraints_clauses,
10730 type_parameter_constraint_clause, type_parameter_constraint,
10731 interface_constraints): Add new production
10733 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
10734 DeclSpace is generic or not.
10736 (DeclSpace.SetParameterInfo): New routine, used to set the
10737 parameter info for a type.
10739 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
10740 returns a GenericTypeExpr
10742 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
10743 generic, lookup the generic argument.
10745 * attribute.cs: Do not allow TypeParameterExpressions in
10748 * class.cs: Do not allow the Main method to be defined in a
10751 * expression.cs (SizeOf): Do not allow generic types to be used as
10752 arguments to sizeof.
10754 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
10755 it: whether a type is generic or not. Only works for types we are
10756 currently building for now.
10758 2003-07-20 Martin Baulig <martin@ximian.com>
10760 * namespace.cs: Fixed that bug which caused a crash when compiling
10761 the debugger's GUI.
10763 2003-07-20 Miguel de Icaza <miguel@ximian.com>
10765 * typemanager.cs (LookupTypeReflection): Never expose types which
10766 are NotPublic, NestedPrivate, NestedAssembly, or
10767 NestedFamANDAssem. We used to return these, and later do a check
10768 that would report a meaningful error, but the problem is that we
10769 would not get the real match, if there was a name override.
10771 2003-07-18 Miguel de Icaza <miguel@ximian.com>
10773 * namespace.cs (Namespace, Name): Do not compute the namespace
10774 name dynamically, compute it in the constructor. This reduced
10775 memory usage by 1697 KB.
10777 * driver.cs: Use --pause to pause at the end.
10779 2003-07-17 Peter Williams <peter@newton.cx>
10781 * Makefile: Change the name of the test target so that it doesn't
10782 conflict with the recursive test target.
10784 2003-07-17 Miguel de Icaza <miguel@ximian.com>
10786 * expression.cs (LocalVariableReference.Emit, EmitAssign,
10787 AddressOf): Do not use EmitThis, that was wrong, use the actual
10790 2003-07-15 Miguel de Icaza <miguel@ximian.com>
10792 * class.cs (MethodData.Define): While checking if a method is an
10793 interface implementation, improve the test: If we are not public
10794 (use new test here: use the computed MethodAttributes directly,
10795 instead of the parsed modifier flags) check if the `implementing'
10796 method comes from an interface or not.
10798 * pending.cs (VerifyPendingMethods): Slightly better error
10801 * makefile: add test target that does the mcs bootstrap.
10803 2003-07-16 Ravi Pratap <ravi@ximian.com>
10805 * interface.cs (Define): Do nothing here since there are no
10806 members to populate etc. Move the attribute emission out of here
10807 since this was just totally the wrong place to put it. Attribute
10808 application happens during the 'Emit' phase, not in the 'Define'
10811 (Emit): Add this method and move the attribute emission here
10813 * rootcontext.cs (EmitCode): Call the Emit method on interface
10816 2003-07-14 Ravi Pratap M <ravi@ximian.com>
10818 * expression.cs (OverloadResolve): Report error only if Location
10819 is not 'Null' which means that there was a probe going on.
10821 2003-07-14 Martin Baulig <martin@ximian.com>
10823 * expression.cs (ConditionalLogicalOperator): New public class to
10824 implement user defined conditional logical operators.
10825 This is section 14.11.2 in the spec and bug #40505.
10827 2003-07-14 Martin Baulig <martin@ximian.com>
10829 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10831 2003-07-14 Martin Baulig <martin@ximian.com>
10833 * codegen.cs (EmitContext.InFixedInitializer): New public field.
10835 * ecore.cs (IVariable.VerifyFixed): New interface method.
10837 * expression.cs (Unary.ResolveOperator): When resolving the `&'
10838 operator, check whether the variable is actually fixed. Fixes bug
10839 #36055. Set a variable definitely assigned when taking its
10840 address as required by the spec.
10842 * statement.cs (LocalInfo.IsFixed): New field.
10843 (LocalInfo.MakePinned): Set `IsFixed' to true.
10845 2003-07-14 Ravi Pratap M <ravi@ximian.com>
10847 * attribute.cs (Attribute.Resolve): While doing a Member lookup
10848 for .ctors, ensure that we only ask for members declared in the
10849 attribute type (BindingFlags.DeclaredOnly).
10853 * expression.cs (Error_WrongNumArguments): Report error 1501
10854 correctly the way CSC does.
10856 2003-07-13 Martin Baulig <martin@ximian.com>
10858 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10859 lookup on the fully qualified name, to make things like "X.X" work
10860 where "X.X" is a fully qualified type name, but we also have a
10861 namespace "X" in the using list. Fixes #41975.
10863 2003-07-13 Martin Baulig <martin@ximian.com>
10865 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10866 function. If we're a CompoundAssign, we need to create an embedded
10867 CompoundAssign, not an embedded Assign.
10868 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10871 2003-07-13 Martin Baulig <martin@ximian.com>
10873 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10874 work to fix bug #46088.
10876 2003-07-13 Ravi Pratap <ravi@ximian.com>
10878 * class.cs (Operator.Emit): Do not emit attributes here - it is
10879 taken care of by the Method class that we delegate too. This takes
10880 care of bug #45876.
10882 2003-07-10 Martin Baulig <martin@ximian.com>
10884 * expression.cs (TypeOfVoid): New class.
10885 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
10887 2003-07-10 Martin Baulig <martin@ximian.com>
10889 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10892 2003-07-10 Martin Baulig <martin@ximian.com>
10894 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10895 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10897 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10899 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10901 2003-07-10 Martin Baulig <martin@ximian.com>
10903 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10904 of decimal. Fixes #42850.
10906 NOTE: I also fixed the created byte blob, but this doesn't work on
10907 the MS runtime and csc never produces any byte blobs for decimal
10910 2003-07-10 Martin Baulig <martin@ximian.com>
10912 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10913 structs; fixes #32068.
10914 (Block.AddChildVariableNames): Fixed #44302.
10916 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10918 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10920 2003-07-07 Miguel de Icaza <miguel@ximian.com>
10922 * attribute.cs: And this test is onger needed.
10924 2003-07-08 Martin Baulig <martin@ximian.com>
10926 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10927 inaccessible types. Fixes #36313.
10929 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10931 * namespace.cs (NamespaceEntry): Create implicit entries for all
10932 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10933 implicit entries for N1.N2 and N1.
10935 2003-07-08 Martin Baulig <martin@ximian.com>
10937 Rewrote the handling of namespaces to fix a lot of the issues
10938 wrt. `using' aliases etc.
10940 * namespace.cs (Namespace): Splitted this class into a
10941 per-assembly `Namespace' and a per-file `NamespaceEntry'.
10943 * typemanager.cs (TypeManager.IsNamespace): Removed.
10944 (TypeManager.ComputeNamespaces): Only compute namespaces from
10945 loaded assemblies here, not the namespaces from the assembly we're
10946 currently compiling.
10948 2003-07-08 Martin Baulig <martin@ximian.com>
10950 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10952 2003-07-07 Miguel de Icaza <miguel@ximian.com>
10954 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10957 I thought about the memory savings here, but LookupTypeReflection
10958 is used under already very constrained scenarios. Compiling
10959 corlib or mcs only exposes one hit, so it would not really reduce
10960 any memory consumption.
10962 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10964 * typemanager.cs: fixes bug #45889 by only adding public types from
10965 other assemblies to the list of known types.
10967 2003-07-07 Miguel de Icaza <miguel@ximian.com>
10969 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10970 on the type we resolved.
10972 2003-07-05 Martin Baulig <martin@ximian.com>
10974 * pending.cs (PendingImplementation.ParentImplements): Don't
10975 create the proxy if the parent is abstract.
10977 * class.cs (TypeContainer.DefineIndexers): Process explicit
10978 interface implementations first. Fixes #37714.
10980 2003-07-04 Miguel de Icaza <miguel@ximian.com>
10982 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10983 defined recursively; but since we modify the input parameters
10984 (left is set to `this' temporarily), we reset this value if the
10985 left_is_explicit is false, which gives the original semantics to
10988 * literal.cs (NullPointer): new class used to represent a null
10989 literal in a pointer context.
10991 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10992 type is a pointer, use a NullPointer object instead of a
10993 NullLiteral. Closes 43687
10995 (ExplicitConversion): Convert pointer values using
10996 the conv opcode to the proper type.
10998 * ecore.cs (New): change ValueTypeVariable property into a method,
10999 that returns whether the valuetype is suitable for being used.
11001 * expression.cs (Binary.DoNumericPromotions): Only return if we
11002 the int constant was a valid uint, and we can return both left and
11003 right as uints. If not, we continue processing, to trigger the
11004 type conversion. This fixes 39018.
11006 * statement.cs (Block.EmitMeta): During constant resolution, set
11007 the CurrentBlock property on the emitcontext, so that we resolve
11008 constants propertly.
11010 2003-07-02 Martin Baulig <martin@ximian.com>
11012 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11013 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11015 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11016 than emitting it here.
11018 * statement.cs: Fixed some more flow analysis bugs.
11020 2003-07-02 Martin Baulig <martin@ximian.com>
11022 * class.cs (MethodData.Define): When implementing interface
11023 methods, set Final unless we're Virtual.
11025 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11026 check work for interface methods.
11028 2003-07-01 Martin Baulig <martin@ximian.com>
11030 * ecore.cs (EmitContext.This): Replaced this property with a
11031 GetThis() method which takes a Location argument. This ensures
11032 that we get the correct error location for a CS0188.
11034 2003-07-01 Miguel de Icaza <miguel@ximian.com>
11036 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11037 ImplicitStandardConversion.
11039 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11041 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
11043 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11046 2003-06-30 Miguel de Icaza <miguel@ximian.com>
11048 * class.cs (Constructor.Define): Turn off initlocals for unsafe
11051 (MethodData.Define): Turn off initlocals for unsafe methods.
11053 2003-06-29 Miguel de Icaza <miguel@ximian.com>
11055 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11056 complete; Fixes #37521.
11058 * delegate.cs: Use Modifiers.TypeAttr to compute the
11059 TypeAttributes, instead of rolling our own. This makes the flags
11060 correct for the delegates.
11062 2003-06-28 Miguel de Icaza <miguel@ximian.com>
11064 * class.cs (Constructor.Define): Set the private flag for static
11065 constructors as well.
11067 * cs-parser.jay (statement_expression): Set the return value to
11068 null, to avoid a crash when we catch an error.
11070 2003-06-24 Miguel de Icaza <miguel@ximian.com>
11072 * cs-parser.jay: Applied patch from Jackson that adds support for
11073 extern and unsafe modifiers to destructor declarations.
11075 * expression.cs: Report error 21 if the user is trying to index a
11078 * driver.cs: Add an error message, suggested by the bug report.
11080 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11081 if we do not have a ": this ()" constructor initializer. Fixes 45149
11083 2003-06-14 Miguel de Icaza <miguel@ximian.com>
11085 * namespace.cs: Add some information to reduce FAQs.
11087 2003-06-13 Miguel de Icaza <miguel@ximian.com>
11089 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11090 underlying enumeration types. Fixes #43915.
11092 * expression.cs: Treat ushort/short as legal values to be used in
11093 bitwise operations.
11095 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11097 * delegate.cs: transfer custom attributes for paramenters from
11098 the delegate declaration to Invoke and BeginInvoke.
11100 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11102 * attribute.cs: handle custom marshalers and emit marshal info
11105 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
11107 * makefile.gnu: Added anonymous.cs to the compiler sources.
11109 2003-05-28 Miguel de Icaza <miguel@ximian.com>
11111 * iterators.cs: Change the name of the proxy class to include two
11114 * cs-parser.jay: Update grammar to include anonymous methods.
11116 * anonymous.cs: new file.
11118 2003-05-27 Miguel de Icaza <miguel@ximian.com>
11120 * class.cs (Field.Define): Add missing test for pointers and
11123 2003-05-27 Ravi Pratap <ravi@ximian.com>
11125 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11126 we use the stobj opcode.
11128 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11129 since it wasn't the correct fix.
11131 It still is puzzling that we are required to use stobj for IntPtr
11132 which seems to be a ValueType.
11134 2003-05-26 Miguel de Icaza <miguel@ximian.com>
11136 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11137 during regular simple name resolution. Now, the trick is that
11138 instead of returning for processing the simplename, we do a
11139 TypeManager.LookupType (ie, a rooted lookup as opposed to a
11140 contextual lookup type). If a match is found, return that, if
11141 not, return for further composition.
11143 This fixes long-standing 30485.
11145 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11146 using the address to initialize an object, do an Stobj instead of
11147 using the regular Stelem.
11149 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11150 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11151 Because if we are a BaseIndexerAccess that value will be true.
11154 * statement.cs (GotoCase.Resolve): Return after reporting an
11155 error, do not attempt to continue.
11157 * expression.cs (PointerArithmetic.Emit): If our operand is a
11158 long, convert our constants to match the operand before
11159 multiplying. Convert to I type before adding. Fixes 43670.
11161 2003-05-14 Ravi Pratap <ravi@ximian.com>
11163 * enum.cs (ImplicitConversionExists) : Rename to
11164 ImplicitEnumConversionExists to remove ambiguity.
11166 * ecore.cs (NullCast): New type of cast expression class which
11167 basically is very similar to EmptyCast with the difference being
11168 it still is a constant since it is used only to cast a null to
11170 (eg. (string) null)
11172 * convert.cs (ImplicitReferenceConversion): When casting a null
11173 literal, we return a NullCast.
11175 * literal.cs (NullLiteralTyped): Remove - I don't see why this
11176 should be around anymore.
11178 The renaming (reported was slightly wrong). Corrections:
11180 ConvertImplicitStandard -> ImplicitConversionStandard
11181 ConvertExplicitStandard -> ExplicitConversionStandard
11183 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11184 before passing them in !
11186 * convert.cs (ImplicitConversionStandard): When comparing for
11187 equal expr and target types, ensure that expr is not a
11190 In general, we must not be checking (expr_type ==
11191 target_type) in the top level conversion methods
11192 (ImplicitConversion, ExplicitConversion etc). This checking is
11193 done in the methods that they delegate to.
11195 2003-05-20 Miguel de Icaza <miguel@ximian.com>
11197 * convert.cs: Move Error_CannotConvertType,
11198 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11199 ImplicitNumericConversion, ImplicitConversionExists,
11200 ImplicitUserConversionExists, StandardConversionExists,
11201 FindMostEncompassedType, FindMostSpecificSource,
11202 FindMostSpecificTarget, ImplicitUserConversion,
11203 ExplicitUserConversion, GetConversionOperators,
11204 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11205 TryImplicitIntConversion, Error_CannotConvertImplicit,
11206 ConvertImplicitRequired, ConvertNumericExplicit,
11207 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11208 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11211 Perform the following renames:
11213 StandardConversionExists -> ImplicitStandardConversionExists
11214 ConvertImplicit -> ImplicitConversion
11215 ConvertImplicitStandard -> ImplicitStandardConversion
11216 TryImplicitIntConversion -> ImplicitIntConversion
11217 ConvertImplicitRequired -> ImplicitConversionRequired
11218 ConvertNumericExplicit -> ExplicitNumericConversion
11219 ConvertReferenceExplicit -> ExplicitReferenceConversion
11220 ConvertExplicit -> ExplicitConversion
11221 ConvertExplicitStandard -> ExplicitStandardConversion
11223 2003-05-19 Martin Baulig <martin@ximian.com>
11225 * statement.cs (TypeInfo.StructInfo): Made this type protected.
11226 (TypeInfo): Added support for structs having structs as fields.
11228 * ecore.cs (FieldExpr): Implement IVariable.
11229 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11230 VariableInfo for the field.
11232 2003-05-18 Martin Baulig <martin@ximian.com>
11234 * expression.cs (This.DoResolve): Report a CS0027 if we're
11235 emitting a field initializer.
11237 2003-05-18 Martin Baulig <martin@ximian.com>
11239 * expression.cs (This.ResolveBase): New public function.
11240 (This.DoResolve): Check for CS0188.
11242 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11245 * ecore.cs (MethodGroupExpr.DoResolve): Set the
11246 `instance_expression' to null if we don't have any non-static
11249 2003-05-18 Martin Baulig <martin@ximian.com>
11251 Reworked the way how local variables and parameters are handled by
11252 the flow analysis code.
11254 * statement.cs (TypeInfo, VariableMap): New public classes.
11255 (VariableInfo): New public class. This is now responsible for
11256 checking whether a variable has been assigned. It is used for
11257 parameters and local variables.
11258 (Block.EmitMeta): Take the InternalParameters as argument; compute
11259 the layout of the flow vectors here.
11260 (Block.LocalMap, Block.ParameterMap): New public properties.
11261 (FlowBranching): The .ctor doesn't get the InternalParameters
11262 anymore since Block.EmitMeta() now computes the layout of the flow
11264 (MyStructInfo): This class is now known as `StructInfo' and nested
11265 in `TypeInfo'; we don't access this directly anymore.
11267 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11268 property and removed IsAssigned(), IsFieldAssigned(),
11269 SetAssigned() and SetFieldAssigned(); we now call them on the
11270 VariableInfo so we don't need to duplicate this code everywhere.
11272 * expression.cs (ParameterReference): Added `Block block' argument
11274 (LocalVariableReference, ParameterReference, This): The new
11275 VariableInfo class is now responsible for all the definite
11278 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11279 IsParameterAssigned, SetParameterAssigned): Removed.
11281 2003-05-18 Martin Baulig <martin@ximian.com>
11283 * typemanager.cs (InitCoreTypes): Try calling
11284 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11285 the 3-args-version. Corlib now also needs our `void_type'.
11286 (GetMethod): Added overloaded version which takes an optional
11287 `bool report_errors' to allow lookups of optional methods.
11289 2003-05-12 Martin Baulig <martin@ximian.com>
11291 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11292 only used for locals and not for parameters.
11294 2003-05-12 Miguel de Icaza <miguel@ximian.com>
11296 * support.cs (InternalParameters.ParameterType): Return the
11297 ExternalType of the parameter.
11299 * parameter.cs (Parameter.ExternalType): drop the two arguments,
11302 2003-05-11 Miguel de Icaza <miguel@ximian.com>
11304 * class.cs (MethodData.Define): Do not set the `newslot' on
11305 interface members, if they are also flagged as "override".
11307 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11308 better code for ++i and i++. This only works for static fields
11309 and local variables.
11311 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11312 want to pull the DeclSpace out of the builder_to_declspace instead
11313 of the TypeBuilder (like in TypeContainer.FindMembers).
11315 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11316 instead of LookupTypeContainer. Fixes the crash on .NET for
11317 looking up interface members.
11319 * const.cs: Create our own emit context during the Definition
11320 stage, so that constants are evaluated in the proper context, when
11321 a recursive definition happens.
11323 2003-05-11 Martin Baulig <martin@ximian.com>
11325 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
11326 new block for a switch section.
11327 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11328 the adding/lookup in the switch block. Fixes #39828.
11330 2003-05-09 Miguel de Icaza <miguel@ximian.com>
11332 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11333 functionality: I needed to convert the data after I had performed
11334 the add/sub operation into the operands type size.
11336 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11337 pass the type for the box operation, otherwise the resulting
11338 object would have been of type object.
11340 (BoxedCast): Add constructor to specify the type to box as.
11342 2003-05-07 Miguel de Icaza <miguel@ximian.com>
11344 * iterators.cs: I was reusing the `count' variable inadvertently,
11345 take steps to not allow this to happen.
11347 2003-05-06 Miguel de Icaza <miguel@ximian.com>
11349 * attribute.cs (Attribute.Resolve): Params attributes are encoded
11350 by creating an array at the point where the params starts and
11351 putting all those arguments there, then adjusting the size of the
11354 2003-05-05 Miguel de Icaza <miguel@ximian.com>
11356 * expression.cs (New.AddressOf): Implement interface
11357 IMemoryLocation. This is used when the `new' operator is used in
11358 the context of an invocation to a method on a value type.
11360 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11363 * namespace.cs: Also check the using aliases here.
11365 * driver.cs: Move the test for using validity after the types have
11366 been entered, so we do a single pass that also includes the using
11369 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11370 in the regular case. CreateSiblingForFinally is doing extra
11373 * attribute.cs (GetAttributeArgumentExpression): Store the result
11374 on an out value, and use the return value to indicate failure
11375 instead of using null (which is a valid return for Constant.GetValue).
11377 * statement.cs: Perform the analysis flow for the increment
11378 portion after the statement, because this will be the real flow of
11379 execution. Fixes #42385
11381 * codegen.cs (EmitContext.EmitArgument,
11382 EmitContext.EmitStoreArgument): New helper functions when the
11383 RemapToProxy flag is set.
11385 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11388 Add support for remapping parameters.
11390 * iterators.cs: Propagate parameter values; Store parameter
11391 values in the proxy classes.
11393 2003-05-04 Miguel de Icaza <miguel@ximian.com>
11395 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
11396 need a proxy reference; I do not know what I was thinking
11398 * cs-parser.jay (constructor_initializer): catch another error,
11399 and display nice message.
11401 (field_declaration): catch void field declaration
11402 to flag a better error.
11404 * class.cs (MemberBase.CheckBase): Report an error instead of a
11405 warning if a new protected member is declared in a struct.
11406 (Field.Define): catch the error of readonly/volatile.
11408 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11410 (FieldExpr.AddressOf): ditto. Catch error where the address of a
11411 volatile variable is taken
11413 2003-05-02 Miguel de Icaza <miguel@ximian.com>
11415 * statement.cs (Fixed.Resolve): Report an error if we are not in
11418 2003-05-01 Miguel de Icaza <miguel@ximian.com>
11420 * typemanager.cs: reuse the code that handles type clashes for
11421 delegates and enumerations.
11423 * class.cs (Report28): Always report.
11425 * expression.cs (EncodeAsAttribute): Allow nulls here.
11427 2003-04-28 Miguel de Icaza <miguel@ximian.com>
11429 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11430 the functionality for testing whether an expression is valid for
11431 an attribute here. Also handle the case of arrays of elements
11434 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11435 encoding a linear array into an array of objects that are suitable
11436 to be passed to an CustomAttributeBuilder.
11438 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11440 * ecore.cs: (FieldExpr): Handle field remapping here.
11442 * iteratators.cs: Pass the instance variable (if the method is an
11443 instance method) to the constructors, so we can access the field
11444 variables on the class.
11446 TODO: Test this with structs. I think the THIS variable on
11447 structs might have to be a pointer, and not a refenrece
11449 2003-04-27 Miguel de Icaza <miguel@ximian.com>
11451 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11452 local variables to fields in a proxy class.
11454 * iterators.cs (PopulateProxy): Rename our internal fields to
11456 Create a <THIS> field if we are an instance method, so we can
11457 reference our parent container variables.
11458 (MapVariable): Called back from the EmitContext code to enter a
11459 new variable to field mapping into the proxy class (we just create
11463 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11464 for using the remapped locals to fields.
11466 I placed the code here, because that gives the same semantics to
11467 local variables, and only changes the Emit code.
11469 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11470 statements inside iterators.
11471 (VariableInfo): Add a FieldBuilder for the cases when we are
11472 remapping local variables to fields in a proxy class
11474 * ecore.cs (SimpleNameResolve): Avoid testing two times for
11475 current_block != null.
11477 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
11478 not cope with strings, as it has been moved to the
11479 TableSwitchEmit. Fixed bug in switch generation.
11481 * expression.cs (New.DoResolve): Provide more context for the user
11482 when reporting an error.
11484 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
11487 * expression.cs (MemberAccess.DoResolve): When we get a type back,
11488 check the permissions for it. Note than in a type-resolution
11489 context the check was already present in DeclSpace.ResolveType,
11490 but was missing from the MemberAccess.
11492 (ArrayCreation.CheckIndices): warn if the user has
11493 more nested levels of expressions, but there are no more
11494 dimensions specified. Avoids crash on bug 41906.
11496 2003-04-26 Miguel de Icaza <miguel@ximian.com>
11498 * statement.cs (Block): replace Implicit bool, for a generic
11500 New flag: `Unchecked'. This is used during the EmitMeta phase
11501 (which is out-of-line with the regular Resolve/Emit process for a
11502 statement, as this is done ahead of time, but still gets a chance
11503 to call constant resolve).
11505 (Block.Flags): new enum for adding a new flag.
11507 (Block.EmitMeta): track the state of unchecked.
11509 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
11510 to enable constant resolution to work there as well.
11512 2003-04-22 Miguel de Icaza <miguel@ximian.com>
11514 * typemanager.cs (ienumerable_type): Also look up
11515 System.Collections.IEnumerable.
11517 2003-04-21 Miguel de Icaza <miguel@ximian.com>
11519 TODO: Test more than one conditional per method.
11521 * class.cs (Indexer.Define): Report the location where the user is
11522 referencing the unsupported feature.
11524 (MethodData): Overload the use of `conditionals' to
11525 minimize the creation of needless ArrayLists. This saves roughly
11526 212kb on my machine.
11528 (Method): Implement the new IIteratorContainer interface.
11529 (Method.SetYields): Implement the method by setting the ModFlags
11530 to contain METHOD_YIELDS.
11532 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
11533 which just got set to null.
11535 * iterators.cs: New file.
11537 (Yield, YieldBreak): New statements.
11539 * statement.cs (Return.Resolve): Flag an error if we are used in
11540 an iterator method.
11542 * codegen.cs (InIterator): New flag set if the code is being
11543 compiled in an iterator method.
11545 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
11546 internal modifier, and we just use it to avoid adding extra
11547 fields, as this is seldom used.
11549 * cs-parser.jay: Add yield_statement (yield and yield break).
11551 * driver.cs: New flag -v2 to turn on version 2 features.
11553 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
11554 hashtable when v2 is enabled.
11556 2003-04-20 Miguel de Icaza <miguel@ximian.com>
11558 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
11559 there is already a namespace defined with this name.
11561 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
11562 people upgraded their corlibs.
11564 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
11565 always use fully qualified types, no need to use the compiler
11568 (TypeManager.IsNamespace): Use binarysearch.
11570 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
11571 AddDelegate): I did not quite use the new IsValid API properly: I
11572 have to pass the short-name and the fullname. I was passing only
11573 the basename instead of the fullname sometimes.
11575 (TypeContainer.DefineType): call NamespaceClash.
11577 * interface.cs (Interface.DefineType): use NamespaceClash before
11580 * delegate.cs (Delegate.DefineType): use NamespaceClash before
11583 * enum.cs: (Enum.DefineType): use NamespaceClash before
11586 * typemanager.cs (: 3-line patch that gives us some tasty 11%
11587 speed increase. First, use the negative_hits cache when we get a
11588 negative. Second, add the type with its full original name
11589 instead of the new . and + encoded name (reflection uses + to
11590 separate type from a nested type). Use LookupTypeReflection
11591 directly which bypasses the type->name hashtable (that we already
11592 know does not contain the type.
11594 * decl.cs (DeclSpace.ResolveTypeExpr): track the
11595 location/container type.
11597 * driver.cs: When passing utf8, use directly the UTF8Encoding.
11599 2003-04-19 Miguel de Icaza <miguel@ximian.com>
11601 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11603 * delegate.cs (NewDelegate.Resolve): Test whether an instance
11604 method is being referenced in the method group from a static
11605 context, and report error 120 if so.
11607 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11610 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11611 is created, we create the A namespace).
11613 * cs-parser.jay: A namespace also introduces a DeclarationFound.
11616 2003-04-18 Miguel de Icaza <miguel@ximian.com>
11618 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11619 invocation to ModuleBuilder.GetType with the same values will
11620 return a new type instance, so we need to cache its return
11623 * expression.cs (Binary.ResolveOperator): Only allow the compare
11624 operators on enums if they are of the same type.
11626 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11627 types of ValueType on their own case. Before we were giving them
11628 the same treatment as objects.
11630 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11631 fullname. Short name is used to compare against container name.
11632 Fullname is used to check against defined namespace names.
11634 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11635 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11637 (Method.CheckBase): Call parent.
11638 (MemberBase.CheckBase): Check for protected members on sealed
11640 (PropertyBase.CheckBase): Call parent.
11641 (Field.Define): Call parent.
11643 * report.cs: Negative error codes are now mapped to 8000 - code,
11644 so that the display is render more nicely.
11646 * typemanager.cs: Do not use try/catch, instead report a regular
11649 (GetPointerType, GetReferenceType): These methods provide
11650 mechanisms to obtain the T* and T& from a T. We had the code
11651 previously scattered around the code base, and it also used
11652 TypeManager.LookupType that would go through plenty of caches.
11653 This one goes directly to the type source.
11655 In some places we did the Type.GetType followed by
11656 ModuleBuilder.GetType, but not in others, so this unifies the
11657 processing as well.
11659 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11660 statements now that we have namespace information.
11662 * typemanager.cs (IsNamespace): New method, returns whether the
11663 string presented is a namespace or not.
11665 (ComputeNamespaces): New public entry point, computes the list of
11666 available namespaces, using the GetNamespaces API call in Mono, or
11667 the slower version in MS.NET.
11669 Now before we start the semantic analysis phase, we have a
11670 complete list of namespaces including everything that the user has
11673 Deleted old code to cache namespaces in .nsc files.
11675 2003-04-17 Miguel de Icaza <miguel@ximian.com>
11677 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11678 class/struct location definition Location for the implicit
11679 constructor location.
11681 (Operator.Define): Use the location of the operator for the
11682 implicit Method definition.
11684 (Constructor.Emit): use the constructor location for the implicit
11685 base initializer constructor.
11687 * ecore.cs: Remove ITypeExpression. This interface is now gone,
11688 and the Expression class now contains two new methods:
11690 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
11691 isolate type lookup from the rest of the resolution process.
11693 Since we use Expressions to hold type definitions due to the way
11694 we parse the input we have historically overloaded Resolve to
11695 perform the Type lookups if a special flag is passed. Now this is
11696 eliminated and two methods take their place.
11698 The differences in the two methods between xStep and xTerminal is
11699 that xStep is involved in our current lookup system that uses
11700 SimpleNames to compose a name, while xTerminal is used just to
11701 catch the case where the simplename lookup failed.
11703 2003-04-16 Miguel de Icaza <miguel@ximian.com>
11705 * expression.cs (ResolveMemberAccess): Remove redundant code.
11706 TypeExpr expressions are always born fully resolved.
11708 * interface.cs (PopulateMethod): Do not lookup the types twice.
11709 We were doing it once during SemanticAnalysis and once during
11712 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11713 in local variable type definitions, were being returned as a
11714 SimpleName (we decomposed everything into a string), that is
11715 because primary_expression was being used instead of a type in the
11716 grammar (reduce/reduce conflicts).
11718 The part that was wrong is that we converted the expression into a
11719 string (an oversimplification in one hand, compounded with primary
11720 expressions doing string concatenation).
11726 Would return "A.B.C[]" as a SimpleName. This stopped things like
11727 using clauses from working on this particular context. And a type
11728 was being matched directly against "A.B.C[]".
11730 We now use the correct approach, and allow for ComposedCast to be
11731 part of the unary expression. So the "A.B.C []" become a composed
11732 cast of "A.B.C" (as a nested group of MemberAccess with a
11733 SimpleName at the end) plus the rank composition "[]".
11737 2003-04-10 Miguel de Icaza <miguel@ximian.com>
11739 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11740 for the access level checking.
11742 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
11743 `TypeContainer container', because I kept getting confused when I
11744 was debugging this code.
11746 * expression.cs (Indexers): Instead of tracking getters/setters,
11747 we now track them in parallel. We create one arraylist less, but
11748 most importantly it is possible now for the LValue code to find a
11749 matching get for a set.
11751 (IndexerAccess.DoResolveLValue): Update the code.
11752 GetIndexersForType has been modified already to extract all the
11753 indexers from a type. The code assumed it did not.
11755 Also make the code set the correct return type for the indexer.
11756 This was fixed a long time ago for properties, but was missing for
11757 indexers. It used to be void_type.
11759 (Binary.Emit): Test first for doubles instead of
11760 floats, as they are more common.
11762 (Binary.EmitBranchable): Use the .un version of the branch opcodes
11763 when dealing with floats and the <=, >= operators. This fixes bug
11766 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11767 to load the array value by emitting a load on the foreach variable
11768 type. This was incorrect.
11770 We now emit the code to load an element using the the array
11771 variable type, and then we emit the conversion operator.
11775 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
11777 * attribute.cs: Avoid allocation of ArrayLists in the common case.
11779 2003-04-09 Miguel de Icaza <miguel@ximian.com>
11781 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11782 test for protection before we test for signatures.
11784 (MethodSignature.ToString): implement.
11786 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11787 to the case where we reduced into a LongConstant.
11789 * decl.cs (CheckAccessLevel): If the type is an array, we can not
11790 depend on whether the information is acurrate, because the
11791 Microsoft runtime will always claim that the array type is public,
11792 regardless of the real state.
11794 If the type is a pointer, another problem happens: the type is
11795 reported as non-public in Microsoft.
11797 In both cases we have to call CheckAccessLevel recursively with
11798 the underlying type as the argument to be tested.
11800 2003-04-08 Miguel de Icaza <miguel@ximian.com>
11802 * assign.cs (Assign.Emit): If we are dealing with a compound
11803 assignment expression, we should use the code path that stores the
11804 intermediate result in a temporary value. This fixes #40903.
11806 *expression.cs (Indirection.ToString): Provide ToString method for
11809 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
11811 * class.cs: Null out fields holding references to Block objects so
11812 they can be garbage collected.
11814 * expression.cs (OverloadResolve): Remove unused local.
11816 2003-04-07 Martin Baulig <martin@ximian.com>
11818 * codegen.cs (EmitContext.CurrentFile): New public field.
11819 (EmitContext.Mark): Use the CurrentFile to check whether the
11820 location is in the correct file.
11821 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11823 2003-04-07 Martin Baulig <martin@ximian.com>
11825 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11827 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11828 location. [FIXME: The location argument which gets passed to this
11829 method is sometimes wrong!]
11831 2003-04-07 Nick Drochak <ndrochak@gol.com>
11833 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11835 2003-04-07 Miguel de Icaza <miguel@ximian.com>
11837 * expression.cs (Indirection.EmitAssign): We were using the
11838 temporary, but returning immediately instead of continuing the
11841 2003-04-06 Martin Baulig <martin@ximian.com>
11843 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11844 if it's a nested child, but also deriving from the outer class.
11847 * typemanager.cs (IsNestedChildOf): Make this work if it's a
11848 nested child, but also deriving from the outer class. See
11850 (FilterWithClosure): We may access private members of the outer
11851 class if we're a nested child and deriving from the outer class.
11852 (RealMemberLookup): Only set `closure_private_ok' if the
11853 `original_bf' contained BindingFlags.NonPublic.
11855 2003-04-05 Martin Baulig <martin@ximian.com>
11857 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
11858 probe if its a type parameter, and if so, flag an error.
11860 * decl.cs: Move here the SetParameterInfo code from class.cs.
11861 Handle IsGeneric here.
11863 Handle a variety of errors in the parameter info definition.
11865 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
11866 type parameters here.
11868 * cs-parser.jay (class_declaration): report errors for parameters
11871 2003-01-21 Miguel de Icaza <miguel@ximian.com>
11873 * generic.cs: New file, contains support code for generics.
11875 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
11876 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
11878 Update parser for the above removals.
11880 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
11881 now taken care of in the parser.
11883 2003-04-02 Miguel de Icaza <miguel@ximian.com>
11885 * class.cs (Event.Define): Do not allow abstract events to have
11888 2003-04-01 Miguel de Icaza <miguel@ximian.com>
11890 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11891 block in event declarations.
11893 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11894 value type, get its address.
11896 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11897 leaving a class on the stack instead of a boolean value (int
11898 0/1). Change the code so we compare against null, and then the
11899 result against zero.
11901 * class.cs (TypeContainer.GetClassBases): We were checking for the
11902 parent class being sealed too late.
11904 * expression.cs (Binary.Emit): For <= and >= when dealing with
11905 floating point values, use cgt.un and clt.un instead of cgt and
11908 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
11910 * statement.cs: Apply the same optimization as MS: skip the
11911 GetEnumerator returning an IEnumerator, and use the one returning a
11912 CharEnumerator instead. This allows us to avoid the try-finally block
11915 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
11917 * cs-parser.jay: Attributes cannot be applied to
11918 namespaces. Fixes #40473
11920 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11923 (Add*): check if the name is valid using the full name for constants,
11924 fields, properties and events.
11926 2003-03-28 Miguel de Icaza <miguel@ximian.com>
11928 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11929 char constants to be part of the enumeration.
11931 * expression.cs (Conditional.DoResolve): Add support for operator
11932 true. Implements the missing functionality from 14.12
11934 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11935 operator true/false as required by the spec.
11937 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11938 implicit conversion to boolean.
11940 * statement.cs (Statement.ResolveBoolean): A boolean expression is
11941 also one where the type implements `operator true'.
11943 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11944 get an expression that will invoke operator true based on an
11947 (GetConversionOperators): Removed the hack that called op_True
11950 (Expression.ResolveBoolean): Move this from Statement.
11952 2003-03-17 Miguel de Icaza <miguel@ximian.com>
11954 * ecore.cs (FieldExpr): do not allow initialization of initonly
11955 fields on derived classes
11957 2003-03-13 Martin Baulig <martin@ximian.com>
11959 * statement.cs (Block.Emit): Call ig.BeginScope() and
11960 ig.EndScope() when compiling with debugging info; call
11961 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11963 2003-03-08 Miguel de Icaza <miguel@ximian.com>
11965 * expression.cs (Indexers): Do not construct immediately, allow
11966 for new members to be appended as we go. Fixes 38143
11968 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11970 * expression.cs: save/restore context when resolving an unchecked
11973 2003-03-05 Miguel de Icaza <miguel@ximian.com>
11975 * cfold.cs: Catch division by zero in modulus operator during
11978 2003-03-03 Miguel de Icaza <miguel@ximian.com>
11980 * interface.cs (Interface.DefineMembers): Avoid defining members
11983 2003-02-27 Miguel de Icaza <miguel@ximian.com>
11985 * driver.cs: handle the +/- options for -noconfig
11987 * statement.cs (Unckeched.Resolve): Also track the state of
11988 unchecked in the Resolve phase.
11990 2003-02-27 Martin Baulig <martin@ximian.com>
11992 * ecore.cs (Expression.MemberLookup): Don't create a
11993 MethodGroupExpr for something which is not a method. Fixes #38291.
11995 2003-02-25 Miguel de Icaza <miguel@ximian.com>
11997 * class.cs (MemberBase.CheckParameters): Also check that the type
11998 is unmanaged if it is a pointer.
12000 * expression.cs (SizeOf.Resolve): Add location information.
12002 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12003 a managed type is declared.
12005 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12006 parameter modifiers as well. Fixes bug 38606
12008 * class.cs: Very sad. Am backing out the speed up changes
12009 introduced by the ArrayList -> Array in the TypeContainer, as they
12010 were not actually that much faster, and introduced a bug (no error
12011 reports on duplicated methods).
12013 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12014 source first, this will guarantee that we have a valid expression
12015 before calling in lower levels functions that will require a
12016 resolved object. Then use this original_source in the
12017 target.ResolveLValue instead of the original source that was
12020 Another change. Use target.Resolve instead of LValueResolve.
12021 Although we are resolving for LValues, we will let the Assign code
12022 take care of that (it will be called again from Resolve). This
12023 basically allows code like this:
12025 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12026 class Y { void A (X x) { x [0] += o; }
12028 The problem was that the indexer was trying to resolve for
12029 set_Item (idx, object o) and never finding one. The real set_Item
12030 was set_Item (idx, X). By delaying the process we get the right
12035 2003-02-23 Martin Baulig <martin@ximian.com>
12037 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12038 while calling DoEmit ().
12040 * codegen.cs (EmitContext.Mark): Don't mark locations in other
12041 source files; if you use the #line directive inside a method, the
12042 compiler stops emitting line numbers for the debugger until it
12043 reaches the end of the method or another #line directive which
12044 restores the original file.
12046 2003-02-23 Martin Baulig <martin@ximian.com>
12048 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12050 2003-02-23 Martin Baulig <martin@ximian.com>
12052 * statement.cs (Block.AddChildVariableNames): We need to call this
12053 recursively, not just for our immediate children.
12055 2003-02-23 Martin Baulig <martin@ximian.com>
12057 * class.cs (Event.Define): Always make the field private, like csc does.
12059 * typemanager.cs (TypeManager.RealMemberLookup): Make events
12060 actually work, fixes bug #37521.
12062 2003-02-23 Miguel de Icaza <miguel@ximian.com>
12064 * delegate.cs: When creating the various temporary "Parameters"
12065 classes, make sure that we call the ComputeAndDefineParameterTypes
12066 on those new parameters (just like we do with the formal ones), to
12067 allow them to be resolved in the context of the DeclSpace.
12069 This fixes the bug that Dick observed in Bugzilla #38530.
12071 2003-02-22 Miguel de Icaza <miguel@ximian.com>
12073 * expression.cs (ResolveMemberAccess): When resolving a constant,
12074 do not attempt to pull a constant if the value was not able to
12075 generate a valid constant.
12077 * const.cs (LookupConstantValue): Do not report more errors than required.
12079 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12081 * expression.cs: fixes bug #38328.
12083 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12085 * class.cs: Changed all the various members that can be part of a
12086 class from being an ArrayList to be an Array of the right type.
12087 During the DefineType type_list, interface_list, delegate_list and
12088 enum_list are turned into types, interfaces, delegates and enums
12091 And during the member population, indexer_list, event_list,
12092 constant_list, field_list, instance_constructor_list, method_list,
12093 operator_list and property_list are turned into their real arrays.
12095 Although we could probably perform this operation earlier, for
12096 good error reporting we need to keep the lists and remove the
12097 lists for longer than required.
12099 This optimization was triggered by Paolo profiling the compiler
12100 speed on the output of `gen-sample-program.pl' perl script.
12102 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12103 not crash in methods like MemberLookupFailed that use this field.
12105 This problem arises when the compiler fails to resolve a type
12106 during interface type definition for example.
12108 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12110 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12111 inherit from System.Object, so we have to stop at null, not only
12112 when reaching System.Object.
12114 2003-02-17 Miguel de Icaza <miguel@ximian.com>
12116 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12117 DeclaredOnly because the parent indexer might have had a different
12118 name, but did not loop until the top of the hierarchy was reached.
12120 The problem this one fixes is 35492: when a class implemented an
12121 indexer from an interface, we were getting the interface method
12122 (which was abstract) and we were flagging an error (can not invoke
12125 This also keeps bug 33089 functioning, and test-148 functioning.
12127 * typemanager.cs (IsSpecialMethod): The correct way of figuring
12128 out if a method is special is to see if it is declared in a
12129 property or event, or whether it is one of the predefined operator
12130 names. This should fix correctly #36804.
12132 2003-02-15 Miguel de Icaza <miguel@ximian.com>
12134 The goal here is to remove the dependency on EmptyCast.Peel ().
12135 Killing it completely.
12137 The problem is that currently in a number of places where
12138 constants are expected, we have to "probe" for an EmptyCast, and
12139 Peel, which is not the correct thing to do, as this will be
12140 repetitive and will likely lead to errors.
12142 The idea is to remove any EmptyCasts that are used in casts that
12143 can be reduced to constants, so we only have to cope with
12146 This bug hunt was triggered by Bug 37363 and the desire to remove
12147 the duplicate pattern where we were "peeling" emptycasts to check
12148 whether they were constants. Now constants will always be
12151 * ecore.cs: Use an enumconstant here instead of wrapping with
12154 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12155 throwing me off. By handling this we can get rid of a few hacks.
12157 * statement.cs (Switch): Removed Peel() code.
12159 2003-02-14 Miguel de Icaza <miguel@ximian.com>
12161 * class.cs: Location information for error 508
12163 * expression.cs (New.DoResolve): Add a guard against double
12164 resolution of an expression.
12166 The New DoResolve might be called twice when initializing field
12167 expressions (see EmitFieldInitializers, the call to
12168 GetInitializerExpression will perform a resolve on the expression,
12169 and later the assign will trigger another resolution
12171 This leads to bugs (#37014)
12173 * delegate.cs: The signature for EndInvoke should contain any ref
12174 or out parameters as well. We were not doing this in the past.
12176 * class.cs (Field.Define): Do not overwrite the type definition
12177 inside the `volatile' group. Turns out that volatile enumerations
12178 were changing the type here to perform a validity test, which
12181 2003-02-12 Miguel de Icaza <miguel@ximian.com>
12183 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12184 and structs, we do not want to load the instance variable
12186 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12187 enum_type has to be handled like an object reference (implicit
12188 conversions exists from this to object), but the regular IsClass
12189 and IsValueType tests will never return true for this one.
12191 Also we use TypeManager.IsValueType instead of type.IsValueType,
12192 just for consistency with the rest of the code (this is only
12193 needed if we ever use the construct exposed by test-180.cs inside
12194 corlib, which we dont today).
12196 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
12198 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12201 2003-02-09 Martin Baulig <martin@ximian.com>
12203 * namespace.cs (Namespace..ctor): Added SourceFile argument.
12204 (Namespace.DefineNamespaces): New static public method; this is
12205 called when we're compiling with debugging to add all namespaces
12206 to the symbol file.
12208 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12209 pass it to the Namespace's .ctor.
12211 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12212 and MethodBase arguments; pass the namespace ID to the symwriter;
12213 pass the MethodBase instead of the token to the symwriter.
12214 (SymbolWriter.DefineNamespace): New method to add a namespace to
12217 2003-02-09 Martin Baulig <martin@ximian.com>
12219 * symbolwriter.cs: New file. This is a wrapper around
12220 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
12221 methods here in near future.
12223 2003-02-09 Martin Baulig <martin@ximian.com>
12225 * codegen.cs (EmitContext.Mark): Just pass the arguments to
12226 ILGenerator.MarkSequencePoint() which are actually used by the
12229 2003-02-09 Martin Baulig <martin@ximian.com>
12231 * location.cs (SourceFile): New public sealed class. This
12232 contains the name and an index which is used in the location's token.
12233 (Location): Reserve an appropriate number of bits in the token for
12234 the source file instead of walking over that list, this gives us a
12235 really huge performance improvement when compiling with debugging.
12237 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12238 `SourceFile' argument instead of a string.
12239 (Driver.ProcessFile): Add all the files via Location.AddFile(),
12240 but don't parse/tokenize here, we need to generate the list of all
12241 source files before we do that.
12242 (Driver.ProcessFiles): New static function. Parses/tokenizes all
12245 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12246 instead of a string.
12248 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12251 2003-02-09 Martin Baulig <martin@ximian.com>
12253 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12254 filename on `#line default'.
12256 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12258 * statement.cs: don't clear the pinned var when the fixed statement
12259 returns from the method (fixes bug#37752).
12261 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12263 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
12266 2003-02-07 Martin Baulig <martin@ximian.com>
12268 * driver.cs: Removed the `--debug-args' command line argument.
12270 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12271 automatically by the AsssemblyBuilder.
12272 (CodeGen.InitializeSymbolWriter): We don't need to call any
12273 initialization function on the symbol writer anymore. This method
12274 doesn't take any arguments.
12276 2003-02-03 Miguel de Icaza <miguel@ximian.com>
12278 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12279 from referenced assemblies as well.
12281 2003-02-02 Martin Baulig <martin@ximian.com>
12283 * class.cs (MethodData.Emit): Generate debugging info for external methods.
12285 2003-02-02 Martin Baulig <martin@ximian.com>
12287 * class.cs (Constructor.Emit): Open the symbol writer before
12288 emitting the constructor initializer.
12289 (ConstructorInitializer.Emit): Call ec.Mark() to allow
12290 single-stepping through constructor initializers.
12292 2003-01-30 Miguel de Icaza <miguel@ximian.com>
12294 * class.cs: Handle error 549: do not allow virtual methods in
12297 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12299 * decl.cs: Check access levels when resolving types
12301 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12303 * statement.cs: Add parameters and locals set in catch blocks that might
12304 return to set vector
12306 2003-01-29 Miguel de Icaza <miguel@ximian.com>
12308 * class.cs (Operator): Set the SpecialName flags for operators.
12310 * expression.cs (Invocation.DoResolve): Only block calls to
12311 accessors and operators on SpecialName methods.
12313 (Cast.TryReduce): Handle conversions from char constants.
12316 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12318 * statement.cs: small memory and time optimization in FlowBranching.
12320 2003-01-28 Pedro Mart <yoros@wanadoo.es>
12322 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12323 problem that the last fix but in the other sid (Set).
12325 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12326 access when there is no indexer in the hierarchy.
12328 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12330 * class.cs: Combine some if statements.
12332 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12334 * driver.cs: fixed bug #37187.
12336 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
12338 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12339 any indexer, it's needed to build a list with all the indexers in the
12340 hierarchy (AllGetters), else we have problems. Fixes #35653.
12342 2003-01-23 Miguel de Icaza <miguel@ximian.com>
12344 * class.cs (MethodData.Define): It is wrong for an interface
12345 implementation to be static in both cases: explicit and implicit.
12346 We were only handling this in one case.
12348 Improve the if situation there to not have negations.
12350 * class.cs (Field.Define): Turns out that we do not need to check
12351 the unsafe bit on field definition, only on usage. Remove the test.
12353 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12355 * driver.cs: use assembly.Location instead of Codebase (the latest
12356 patch made mcs fail when using MS assemblies).
12358 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
12360 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12361 get the path to *corlib.dll.
12363 2003-01-21 Nick Drochak <ndrochak@gol.com>
12367 * typemanager.cs: Remove compiler warnings
12369 2003-01-20 Duncan Mak <duncan@ximian.com>
12371 * AssemblyInfo.cs: Bump the version number to 0.19.
12373 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12375 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12377 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
12379 * class.cs (Constructor::Emit): Emit debugging info for constructors.
12381 2003-01-17 Miguel de Icaza <miguel@ximian.com>
12383 * cs-parser.jay: Small fix: we were not comparing the constructor
12384 name correctly. Thanks to Zoltan for the initial pointer.
12386 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12388 * cs-tokenizer.cs: Set file name when specified with #line
12390 2003-01-15 Miguel de Icaza <miguel@ximian.com>
12392 * cs-parser.jay: Only perform the constructor checks here if we
12393 are named like the class; This will help provider a better
12394 error. The constructor path is taken when a type definition is
12395 not found, but most likely the user forgot to add the type, so
12396 report that rather than the constructor error.
12398 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12400 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12403 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12405 * cs-parser.jay: Add cleanup call.
12407 2003-01-13 Duncan Mak <duncan@ximian.com>
12409 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12410 consistent with other methods.
12412 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12414 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12416 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12418 * attribute.cs: only set GuidAttr to true when we have a
12421 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12425 * typemanager.cs: fixes to allow mcs compile corlib with the new
12426 Type.IsSubclassOf fix.
12428 2003-01-08 Miguel de Icaza <miguel@ximian.com>
12430 * expression.cs (LocalVariableReference.DoResolve): Classify a
12431 constant as a value, not as a variable. Also, set the type for
12434 * cs-parser.jay (fixed_statement): take a type instead of a
12435 pointer_type, so we can produce a better error message later.
12437 * statement.cs (Fixed.Resolve): Flag types that are not pointers
12440 (For.DoEmit): Make inifinite loops have a
12441 non-conditional branch back.
12443 (Fixed.DoEmit): First populate the pinned variables, then emit the
12444 statement, then clear the variables. Before I was emitting the
12445 code once for each fixed piece.
12448 2003-01-08 Martin Baulig <martin@ximian.com>
12450 * statement.cs (FlowBranching.MergeChild): A break in a
12451 SWITCH_SECTION does not leave a loop. Fixes #36155.
12453 2003-01-08 Martin Baulig <martin@ximian.com>
12455 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12456 lives in the same number space than `param_map'. Fixes #36154.
12458 2003-01-07 Miguel de Icaza <miguel@ximian.com>
12460 * cs-parser.jay (constructor_declaration): Set the
12461 Constructor.ModFlags before probing for it. This makes the
12462 compiler report 514, 515 and 132 (the code was there, but got
12465 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12466 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12467 (GotoCase.Resolve): Set `Returns' to ALWAYS.
12469 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12471 * enum.cs: create the enum static fields using the enum type.
12473 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12475 * class.cs: don't try to create the ParamBuilder for the return
12476 type if it's not needed (and handle it breaking for the ms runtime
12479 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12481 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12483 2002-12-29 Miguel de Icaza <miguel@ximian.com>
12485 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12486 the command. This showed up while compiling the JANET source
12487 code, which used \r as its only newline separator.
12489 2002-12-28 Miguel de Icaza <miguel@ximian.com>
12491 * class.cs (Method.Define): If we are an operator (because it
12492 reuses our code), then set the SpecialName and HideBySig. #36128
12494 2002-12-22 Miguel de Icaza <miguel@ximian.com>
12496 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12497 exception, report error 120 `object reference required'.
12499 * driver.cs: Add --pause option, used during to measure the size
12500 of the process as it goes with --timestamp.
12502 * expression.cs (Invocation.DoResolve): Do not allow methods with
12503 SpecialName to be invoked.
12505 2002-12-21 Miguel de Icaza <miguel@ximian.com>
12507 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
12508 number before adding it.
12510 2002-12-21 Ravi Pratap <ravi@ximian.com>
12512 * ecore.cs (StandardImplicitConversion): When in an unsafe
12513 context, we allow conversion between void * to any other pointer
12514 type. This fixes bug #35973.
12516 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
12518 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
12519 is not thrown when extensionless outputs are used
12521 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12523 * rootcontext.cs: fixed compilation of corlib.
12525 2002-12-19 Miguel de Icaza <miguel@ximian.com>
12527 * attribute.cs (Attributes.Contains): Add new method.
12529 * class.cs (MethodCore.LabelParameters): if the parameter is an
12530 `out' parameter, check that no attribute `[In]' has been passed.
12532 * enum.cs: Handle the `value__' name in an enumeration.
12534 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
12536 * decl.cs: Added special case to allow overrides on "protected
12539 2002-12-18 Ravi Pratap <ravi@ximian.com>
12541 * attribute.cs (Attributes.AddAttributeSection): Rename to this
12542 since it makes much more sense.
12544 (Attributes.ctor): Don't require a Location parameter.
12546 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
12548 * attribute.cs (ApplyAttributes): Remove extra Location parameters
12549 since we already have that information per attribute.
12551 * everywhere : make appropriate changes.
12553 * class.cs (LabelParameters): Write the code which actually
12554 applies attributes to the return type. We can't do this on the MS
12555 .NET runtime so we flag a warning in the case an exception is
12558 2002-12-18 Miguel de Icaza <miguel@ximian.com>
12560 * const.cs: Handle implicit null conversions here too.
12562 2002-12-17 Ravi Pratap <ravi@ximian.com>
12564 * class.cs (MethodCore.LabelParameters): Remove the extra
12565 Type [] parameter since it is completely unnecessary. Instead
12566 pass in the method's attributes so that we can extract
12567 the "return" attribute.
12569 2002-12-17 Miguel de Icaza <miguel@ximian.com>
12571 * cs-parser.jay (parse): Use Report.Error to flag errors instead
12572 of ignoring it and letting the compile continue.
12574 * typemanager.cs (ChangeType): use an extra argument to return an
12575 error condition instead of throwing an exception.
12577 2002-12-15 Miguel de Icaza <miguel@ximian.com>
12579 * expression.cs (Unary.TryReduce): mimic the code for the regular
12580 code path. Perform an implicit cast in the cases where we can
12581 implicitly convert to one of the integral types, and then reduce
12582 based on that constant. This fixes bug #35483.
12584 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12586 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
12588 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12590 * namespace.cs: fixed bug #35489.
12592 2002-12-12 Miguel de Icaza <miguel@ximian.com>
12594 * class.cs: Remove some dead code.
12596 * cs-parser.jay: Estimate the number of methods needed
12597 (RootContext.MethodCount);
12599 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12600 numbers instead of StringBuilders.
12602 * support.cs (PtrHashtable): Add constructor with initial size;
12603 We can now reduce reallocations of the method table.
12605 2002-12-10 Ravi Pratap <ravi@ximian.com>
12607 * attribute.cs (ApplyAttributes): Keep track of the emitted
12608 attributes on a per-target basis. This fixes bug #35413.
12610 2002-12-10 Miguel de Icaza <miguel@ximian.com>
12612 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12613 default to the Windows 1252 encoding.
12615 (UnixParseOption): Support version, thanks to Alp for the missing
12618 * AssemblyInfo.cs: Add nice assembly information.
12620 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12623 * cs-parser.jay: Allow a trailing comma before the close bracked
12624 in the attribute_section production.
12626 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12627 address of the instance was being taken, I will take this out,
12628 because we take the address of the object immediately here.
12630 2002-12-09 Ravi Pratap <ravi@ximian.com>
12632 * typemanager.cs (AreMultipleAllowed): Take care of the most
12633 obvious case where attribute type is not in the current assembly -
12636 2002-12-08 Miguel de Icaza <miguel@ximian.com>
12638 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12639 definitions, instead of doing that afterwards.
12641 Also we use a nice little hack, depending on the constructor, we
12642 know if we are a "composed" name or a simple name. Hence, we
12643 avoid the IndexOf test, and we avoid
12645 * codegen.cs: Add code to assist in a bug reporter to track down
12646 the source of a compiler crash.
12648 2002-12-07 Ravi Pratap <ravi@ximian.com>
12650 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12651 types have been emitted for a given element and flag an error
12652 if something which does not have AllowMultiple set is used more
12655 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12656 attribute types and their corresponding AllowMultiple properties
12658 (AreMultipleAllowed): Check the property for a given type.
12660 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12661 property in the case we have a TypeContainer.
12663 (Attributes.AddAttribute): Detect duplicates and just skip on
12664 adding them. This trivial fix catches a pretty gross error in our
12665 attribute emission - global attributes were being emitted twice!
12667 Bugzilla bug #33187 is now fixed.
12669 2002-12-06 Miguel de Icaza <miguel@ximian.com>
12671 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12672 instead of pp_and).
12674 * expression.cs (Binary.ResolveOperator): I can only use the
12675 Concat (string, string, string) and Concat (string, string,
12676 string, string) if the child is actually a concatenation of
12679 2002-12-04 Miguel de Icaza <miguel@ximian.com>
12681 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12682 context where we need a 2-character lookahead.
12684 * pending.cs (PendingImplementation): Rework so we can keep track
12685 of interface types all the time, and flag those which were
12686 implemented by parents as optional.
12688 2002-12-03 Miguel de Icaza <miguel@ximian.com>
12690 * expression.cs (Binary.ResolveOperator): Use
12691 String.Concat(string,string,string) or
12692 String.Concat(string,string,string,string) when possible.
12694 * typemanager: More helper methods.
12697 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12699 * pending.cs: remove the bogus return from GetMissingInterfaces()
12700 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12702 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12704 * namespace.cs: avoid duplicated 'using xxx' being added to
12705 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12706 when we get more than one 'using' statement for the same namespace.
12707 Report a CS0105 warning for it.
12709 2002-11-30 Miguel de Icaza <miguel@ximian.com>
12711 * cs-tokenizer.cs (consume_identifier): use read directly, instead
12712 of calling getChar/putback, uses internal knowledge of it.
12714 (xtoken): Reorder tokenizer so most common patterns are checked
12715 first. This reduces the compilation time in another 5% (from 8.11s
12716 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12718 The parsing time is 22% of the compilation in mcs, and from that
12719 64% is spent on the tokenization process.
12721 I tried using a binary search for keywords, but this is slower
12722 than the hashtable. Another option would be to do a couple of
12725 * Not use a StringBuilder, instead use an array of chars,
12726 with a set value. Notice that this way we could catch
12727 the 645 error without having to do it *afterwards*.
12729 * We could write a hand-parser to avoid the hashtable
12730 compares altogether.
12732 The identifier consumption process takes 37% of the tokenization
12733 time. Another 15% is spent on is_number. 56% of the time spent
12734 on is_number is spent on Int64.Parse:
12736 * We could probably choose based on the string length to
12737 use Int32.Parse or Int64.Parse and avoid all the 64-bit
12740 Another 3% is spend on wrapping `xtoken' in the `token' function.
12742 Handle 0xa0 as whitespace (#34752)
12744 2002-11-26 Miguel de Icaza <miguel@ximian.com>
12746 * typemanager.cs (IsCLRType): New routine to tell whether a type
12747 is one of the builtin types.
12749 Maybe it needs to use TypeCodes to be faster. Maybe we could use
12750 typecode in more places instead of doing pointer comparissions.
12751 We could leverage some knowledge about the way the typecodes are
12754 New code to cache namespaces in assemblies, it is currently not
12755 invoked, to be used soon.
12757 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12759 * expression.cs (Binary.ResolveOperator): specially handle
12760 strings, and do not perform user-defined operator overloading for
12763 2002-11-24 Miguel de Icaza <miguel@ximian.com>
12765 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12766 internalcall as it is a pretty simple operation; Avoid whenever
12767 possible to call Char.IsLetter.
12769 (consume_identifier): Cut by half the number of
12770 hashtable calls by merging the is_keyword and GetKeyword behavior.
12772 Do not short-circuit, because if we do, we
12773 report errors (ie, #if false && true would produce an invalid
12777 2002-11-24 Martin Baulig <martin@ximian.com>
12779 * expression.cs (Cast.TryReduce): If we're in checked syntax,
12780 check constant ranges and report a CS0221. Fixes #33186.
12782 2002-11-24 Martin Baulig <martin@ximian.com>
12784 * cs-parser.jay: Make this work for uninitialized variable
12785 declarations in the `for' initializer. Fixes #32416.
12787 2002-11-24 Martin Baulig <martin@ximian.com>
12789 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12790 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
12792 2002-11-24 Martin Baulig <martin@ximian.com>
12794 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12795 argument; if true, we also check for user-defined conversions.
12796 This is only needed if both arguments are of a user-defined type.
12797 Fixes #30443, added test-175.cs.
12798 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12800 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12802 2002-11-24 Martin Baulig <martin@ximian.com>
12804 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12805 function to get the store opcode.
12806 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12807 only emit the Ldelema if the store opcode is Stobj. You must run
12808 both test-34 and test-167 to test this. Fixes #34529.
12810 2002-11-23 Martin Baulig <martin@ximian.com>
12812 * ecore.cs (Expression.MemberLookup): Added additional
12813 `qualifier_type' argument which is used when we're being called
12814 from MemberAccess.DoResolve() and null if we're called from a
12816 (Expression.MemberLookupFailed): New method to report errors; this
12817 does the CS1540 check and reports the correct error message.
12819 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12820 argument for the CS1540 check and redone the way how we're dealing
12821 with private members. See the comment in the source code for details.
12822 (FilterWithClosure): Reverted this back to revision 1.197; renamed
12823 `closure_start_type' to `closure_qualifier_type' and check whether
12824 it's not null. It was not this filter being broken, it was just
12825 being called with the wrong arguments.
12827 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12828 and pass it the correct `qualifier_type'; this also does the error
12831 2002-11-22 Miguel de Icaza <miguel@ximian.com>
12833 * expression.cs (Invocation.EmitParams): If the we are dealing
12834 with a non-built-in value type, load its address as well.
12836 (ArrayCreation): Use a a pretty constant instead
12837 of the hardcoded value 2. Use 6 instead of 2 for the number of
12838 static initializers.
12840 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12841 because they are not really value types, just glorified integers.
12843 * driver.cs: Do not append .exe, the CSC compiler does not do it.
12845 * ecore.cs: Remove redundant code for enumerations, make them use
12846 the same code path as everything else, fixes the casting issue
12847 with enumerations in Windows.Forms.
12849 * attribute.cs: Do only cast to string if it is a string, the
12850 validation happens later.
12852 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12853 people upgrade their corlibs.
12855 * ecore.cs: Oops, enumerations were not following the entire code path
12857 2002-11-21 Miguel de Icaza <miguel@ximian.com>
12859 * typemanager.cs (FilterWithClosure): Commented out the test for
12860 1540 in typemanager.cs, as it has problems when accessing
12861 protected methods from a parent class (see test-174.cs).
12863 * attribute.cs (Attribute.ValidateGuid): new method.
12864 (Attribute.Resolve): Use above.
12866 2002-11-19 Miguel de Icaza <miguel@ximian.com>
12868 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12870 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12871 handling for enumerations, as we only needed the TypeContainer
12872 functionality to begin with (this is required for the fix below to
12873 work for enums that reference constants in a container class for
12876 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12878 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12879 a valid TypeBuilder to perform lookups on.o
12881 * class.cs (InheritableMemberSignatureCompare): Use true in the
12882 call to GetGetMethod and GetSetMethod, because we are comparing
12883 the signature, and we need to get the methods *even* if they are
12886 (PropertyBase.CheckBase): ditto.
12888 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12889 GotoCase.Resolve): Use Peel on EmpytCasts.
12891 * ecore.cs (EmptyCast): drop child, add Peel method.
12893 2002-11-17 Martin Baulig <martin@ximian.com>
12895 * ecore.cs (EmptyCast.Child): New public property.
12897 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12898 label resolved to an EmptyCast. Fixes #34162.
12899 (GotoCase.Resolve): Likewise.
12900 (Block.EmitMeta): Likewise.
12902 2002-11-17 Martin Baulig <martin@ximian.com>
12904 * expression.cs (Invocation.BetterConversion): Prefer int over
12905 uint; short over ushort; long over ulong for integer literals.
12906 Use ImplicitConversionExists instead of StandardConversionExists
12907 since we also need to check for user-defined implicit conversions.
12908 Fixes #34165. Added test-173.cs.
12910 2002-11-16 Martin Baulig <martin@ximian.com>
12912 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12913 with the `true' and `false' literals. Fixes #33151.
12915 2002-11-16 Martin Baulig <martin@ximian.com>
12917 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12918 October 22nd; don't do the cs1540 check for static members.
12920 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12921 now using our own filter here and doing the cs1540 check again.
12923 2002-11-16 Martin Baulig <martin@ximian.com>
12925 * support.cs (InternalParameters): Don't crash if we don't have
12926 any fixed parameters. Fixes #33532.
12928 2002-11-16 Martin Baulig <martin@ximian.com>
12930 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12931 when looking up static methods to make this work on Windows.
12934 2002-11-16 Martin Baulig <martin@ximian.com>
12936 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12937 a setter rather than using PropertyInfo.CanWrite.
12939 2002-11-15 Nick Drochak <ndrochak@gol.com>
12941 * class.cs: Allow acces to block member by subclasses. Fixes build
12944 2002-11-14 Martin Baulig <martin@ximian.com>
12946 * class.cs (Constructor.Emit): Added the extern/block check.
12949 2002-11-14 Martin Baulig <martin@ximian.com>
12951 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12952 iteration while looking for indexers, this is needed because the
12953 indexer may have a different name in our base classes. Fixed the
12954 error reporting (no indexers at all, not get accessor, no
12955 overloaded match). Fixes bug #33089.
12956 (IndexerAccess.DoResolveLValue): Likewise.
12958 2002-11-14 Martin Baulig <martin@ximian.com>
12960 * class.cs (PropertyBase.CheckBase): Make this work for multiple
12961 indexers. Fixes the first part of bug #33089.
12962 (MethodSignature.InheritableMemberSignatureCompare): Added support
12965 2002-11-13 Ravi Pratap <ravi@ximian.com>
12967 * attribute.cs (Attribute.Resolve): Catch the
12968 NullReferenceException and report it since it isn't supposed to
12971 2002-11-12 Miguel de Icaza <miguel@ximian.com>
12973 * expression.cs (Binary.EmitBranchable): Also handle the cases for
12974 LogicalOr and LogicalAnd that can benefit from recursively
12975 handling EmitBranchable. The code now should be nice for Paolo.
12977 2002-11-08 Miguel de Icaza <miguel@ximian.com>
12979 * typemanager.cs (LookupType): Added a negative-hit hashtable for
12980 the Type lookups, as we perform quite a number of lookups on
12981 non-Types. This can be removed once we can deterministically tell
12982 whether we have a type or a namespace in advance.
12984 But this might require special hacks from our corlib.
12988 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12989 and double which avoids a conversion from an integer to a double.
12991 * expression.cs: tiny optimization, avoid calling IsConstant,
12992 because it effectively performs the lookup twice.
12994 2002-11-06 Miguel de Icaza <miguel@ximian.com>
12996 But a bogus return here to keep the semantics of the old code
12997 until the Mono runtime is fixed.
12999 * pending.cs (GetMissingInterfaces): New method used to remove all
13000 the interfaces that are already implemented by our parent
13001 classes from the list of pending methods.
13003 * interface.cs: Add checks for calls after ResolveTypeExpr.
13005 2002-11-05 Miguel de Icaza <miguel@ximian.com>
13007 * class.cs (Class.Emit): Report warning 67: event not used if the
13008 warning level is beyond 3.
13010 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13011 being a NullLiteral.
13013 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13016 * class.cs (TypeContainer.GetClassBases): Cover a missing code
13017 path that might fail if a type can not be resolved.
13019 * expression.cs (Binary.Emit): Emit unsigned versions of the
13022 * driver.cs: use error 5.
13024 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13026 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13028 2002-11-01 Miguel de Icaza <miguel@ximian.com>
13030 * cs-parser.jay (switch_section): A beautiful patch from Martin
13031 Baulig that fixed 33094.
13033 2002-10-31 Miguel de Icaza <miguel@ximian.com>
13035 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13036 Check whether the base is abstract and report an error if so.
13038 * expression.cs (IndexerAccess.DoResolveLValue,
13039 IndexerAccess.DoResolve): ditto.
13041 (Invocation.DoResolve): ditto.
13043 (Invocation.FullMethodDesc): Improve the report string.
13045 * statement.cs (Block): Eliminate IsVariableDefined as it is
13046 basically just a wrapper for GetVariableInfo.
13048 * ecore.cs (SimpleName): Use new
13050 * support.cs (ReflectionParamter.ParameterType): We unwrap the
13051 type, as we return the actual parameter ref/unref state on a
13054 2002-10-30 Miguel de Icaza <miguel@ximian.com>
13056 * support.cs: Return proper flags REF/OUT fixing the previous
13059 * expression.cs: Reverted last patch, that was wrong. Is_ref is
13060 not used to mean `ref' but `ref or out' in ParameterReference
13062 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13063 full type signature instead of calling TypeManger.CSharpName
13066 * support.cs (InternalParameters.ParameterDesc): Do not compare
13067 directly to the modflags, because REF/OUT will actually be bitsets
13070 * delegate.cs (VerifyMethod): Check also the modifiers.
13072 * cs-tokenizer.cs: Fix bug where floating point values with an
13073 exponent where a sign was missing was ignored.
13075 * driver.cs: Allow multiple assemblies to be specified in a single
13078 2002-10-28 Miguel de Icaza <miguel@ximian.com>
13080 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
13081 because identifiers after a parenthesis would end up in this kind
13082 of production, and we needed to desamiguate it for having casts
13085 (UserDefinedType *) xxx
13087 2002-10-24 Miguel de Icaza <miguel@ximian.com>
13089 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13090 we should set on the Bindingflags.NonPublic, but not turn on
13091 private_ok. private_ok controls whether a Private member is
13092 returned (this is chekced on the filter routine), while the
13093 BindingFlags.NonPublic just controls whether private/protected
13094 will be allowed. This fixes the problem part of the problem of
13095 private properties being allowed to be used in derived classes.
13097 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13098 so we can call the children DoResolveLValue method (this will
13099 properly signal errors on lvalue assignments to base properties)
13101 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13102 getter are null, and we have a property info, we know that this
13103 happened because the lookup failed, so we report an error 122 for
13104 protection level violation.
13106 We also silently return if setter and getter are null in the
13107 resolve functions, this condition only happens if we have flagged
13108 the error before. This is the other half of the problem.
13110 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13111 not have accessibility information, that is why we were returning
13112 true in the filter function in typemanager.cs.
13114 To properly report 122 (property is inaccessible because of its
13115 protection level) correctly, we report this error in ResolveAccess
13116 by failing if both the setter and the getter are lacking (ie, the
13119 DoResolve and DoLResolve have been modified to check for both
13120 setter/getter being null and returning silently, the reason being
13121 that I did not want to put the knowledge about this error in upper
13124 int old = Report.Errors;
13125 x = new PropertyExpr (...);
13126 if (old != Report.Errors)
13131 So the property expr is returned, but it is invalid, so the error
13132 will be flagged during the resolve process.
13134 * class.cs: Remove InheritablePropertySignatureCompare from the
13135 class, as we no longer depend on the property signature to compute
13136 whether it is possible to implement a method or not.
13138 The reason is that calling PropertyInfo.GetGetMethod will return
13139 null (in .NET, in Mono it works, and we should change this), in
13140 cases where the Get Method does not exist in that particular
13145 class X { public virtual int A { get { return 1; } } }
13147 class Z : Y { public override int A { get { return 2; } } }
13149 Would fail in Z because the parent (Y) would not have the property
13150 defined. So we avoid this completely now (because the alternative
13151 fix was ugly and slow), and we now depend exclusively on the
13154 (PropertyBase.CheckBase): Use a method-base mechanism to find our
13155 reference method, instead of using the property.
13157 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13158 routines are gone now.
13160 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13161 names, they were incorrectly named.
13163 * cs-tokenizer.cs: Return are more gentle token on failure.
13165 * pending.cs (PendingImplementation.InterfaceMethod): This routine
13166 had an out-of-sync index variable, which caused it to remove from
13167 the list of pending methods the wrong method sometimes.
13169 2002-10-22 Miguel de Icaza <miguel@ximian.com>
13171 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13172 CanWrite, because those refer to this particular instance of the
13173 property, and do not take into account the fact that we can
13174 override single members of a property.
13176 Constructor requires an EmitContext. The resolution process does
13177 not happen here, but we need to compute the accessors before,
13178 because the resolution does not always happen for properties.
13180 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13181 subclass, before we did not update this flag, but we did update
13184 (GetAccessors): Drop this routine, as it did not work in the
13185 presence of partially overwritten set/get methods.
13187 Notice that this broke the cs1540 detection, but that will require
13190 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13194 * driver.cs: issue a warning instead of an error if we don't support
13195 debugging for the platform. Also ignore a couple of errors that may
13196 arise when trying to write the symbols. Undo my previous patch.
13198 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13200 * driver.cs: ignore /debug switch except for Unix platforms.
13202 2002-10-23 Nick Drochak <ndrochak@gol.com>
13204 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13206 2002-10-21 Miguel de Icaza <miguel@ximian.com>
13208 * driver.cs: Do not make mcs-debug conditional, so we do not break
13209 builds that use it.
13211 * statement.cs (UsageVector.MergeChildren): I would like Martin to
13212 review this patch. But basically after all the children variables
13213 have been merged, the value of "Breaks" was not being set to
13214 new_breaks for Switch blocks. I think that it should be set after
13215 it has executed. Currently I set this to the value of new_breaks,
13216 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13217 conservative, but I do not understand this code very well.
13219 I did not break anything in the build, so that is good ;-)
13221 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13223 2002-10-20 Mark Crichton <crichton@gimp.org>
13225 * cfold.cs: Fixed compile blocker. Really fixed it this time.
13227 2002-10-20 Nick Drochak <ndrochak@gol.com>
13229 * cfold.cs: Fixed compile blocker.
13231 2002-10-20 Miguel de Icaza <miguel@ximian.com>
13233 * driver.cs: I was chekcing the key, not the file.
13235 2002-10-19 Ravi Pratap <ravi@ximian.com>
13237 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13238 message that we were generating - we just need to silently return
13241 2002-10-19 Miguel de Icaza <miguel@ximian.com>
13243 * class.cs (Event.Define): Change my previous commit, as this
13244 breaks the debugger. This is a temporary hack, as it seems like
13245 the compiler is generating events incorrectly to begin with.
13247 * expression.cs (Binary.ResolveOperator): Added support for
13248 "U operator - (E x, E y)"
13250 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13253 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13254 init-only variables, but this path did not take into account that
13255 there might be also instance readonly variables. Correct this
13258 This fixes bug 32253
13260 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13263 * driver.cs: Change the extension for modules to `netmodule'
13265 * cs-parser.jay: Improved slightly the location tracking for
13266 the debugger symbols.
13268 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13269 modifiers that were specified instead of the hardcoded value
13270 (FamAndAssem). This was basically ignoring the static modifier,
13271 and others. Fixes 32429.
13273 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13274 fixed a bug in the process (32476)
13276 * expression.cs (ArrayAccess.EmitAssign): Patch from
13277 hwang_rob@yahoo.ca that fixes bug 31834.3
13279 2002-10-18 Miguel de Icaza <miguel@ximian.com>
13281 * driver.cs: Make the module extension .netmodule.
13283 2002-10-16 Miguel de Icaza <miguel@ximian.com>
13285 * driver.cs: Report an error if the resource file is not found
13286 instead of crashing.
13288 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13289 false, like Emit does.
13291 2002-10-16 Nick Drochak <ndrochak@gol.com>
13293 * typemanager.cs: Remove unused private member. Also reported mcs
13294 bug to report this as a warning like csc.
13296 2002-10-15 Martin Baulig <martin@gnome.org>
13298 * statement.cs (Statement.Emit): Made this a virtual method; emits
13299 the line number info and calls DoEmit().
13300 (Statement.DoEmit): New protected abstract method, formerly knows
13301 as Statement.Emit().
13303 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13305 2002-10-11 Miguel de Icaza <miguel@ximian.com>
13307 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13308 have fixed a remaining problem: not every AddXXXX was adding a
13309 fully qualified name.
13311 Now everyone registers a fully qualified name in the DeclSpace as
13312 being defined instead of the partial name.
13314 Downsides: we are slower than we need to be due to the excess
13315 copies and the names being registered this way.
13317 The reason for this is that we currently depend (on the corlib
13318 bootstrap for instance) that types are fully qualified, because
13319 we dump all the types in the namespace, and we should really have
13320 types inserted into the proper namespace, so we can only store the
13321 basenames in the defined_names array.
13323 2002-10-10 Martin Baulig <martin@gnome.org>
13325 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13326 from bug #31834, see the bug report for a testcase which is
13329 2002-10-10 Martin Baulig <martin@gnome.org>
13331 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13332 flow analysis code for this.
13334 * statement.cs (Do, While, For): Tell the flow analysis code about
13336 (FlowBranching.UsageVector): Added support for infinite loops.
13337 (Block.Resolve): Moved the dead code elimination here and use flow
13340 2002-10-09 Miguel de Icaza <miguel@ximian.com>
13342 * class.cs (Field.Define): Catch cycles on struct type
13345 * typemanager.cs (IsUnmanagedtype): Do not recursively check
13346 fields if the fields are static. We only need to check instance
13349 * expression.cs (As.DoResolve): Test for reference type.
13351 * statement.cs (Using.ResolveExpression): Use
13352 ConvertImplicitRequired, not ConvertImplicit which reports an
13354 (Using.ResolveLocalVariableDecls): ditto.
13356 * expression.cs (Binary.ResolveOperator): Report errors in a few
13357 places where we had to.
13359 * typemanager.cs (IsUnmanagedtype): Finish implementation.
13361 2002-10-08 Miguel de Icaza <miguel@ximian.com>
13363 * expression.cs: Use StoreFromPtr instead of extracting the type
13364 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
13366 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13367 an enumeration value to a System.Enum, but System.Enum is not a
13368 value type, but an class type, so we need to box.
13370 (Expression.ConvertExplicit): One codepath could return
13371 errors but not flag them. Fix this. Fixes #31853
13373 * parameter.cs (Resolve): Do not allow void as a parameter type.
13375 2002-10-06 Martin Baulig <martin@gnome.org>
13377 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13378 if it's a class type and not a struct. Fixes #31815.
13380 2002-10-06 Martin Baulig <martin@gnome.org>
13382 * statement.cs: Reworked the flow analysis code a bit to make it
13383 usable for dead code elimination.
13385 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13387 * cs-parser.jay: allow empty source files. Fixes bug #31781.
13389 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13391 * expression.cs (ComposedCast.DoResolveType): A quick workaround
13392 to fix the test 165, will investigate deeper.
13394 2002-10-04 Martin Baulig <martin@gnome.org>
13396 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13397 finally blocks actually work.
13398 (Try.Resolve): We don't need to create a sibling for `finally' if
13399 there is no finally block.
13401 2002-10-04 Martin Baulig <martin@gnome.org>
13403 * class.cs (Constructor.Define): The default accessibility for a
13404 non-default constructor is private, not public.
13406 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13408 * class.cs (Constructor): Make AllowedModifiers public, add
13411 * cs-parser.jay: Perform the modifiers test here, as the
13412 constructor for the Constructor class usually receives a zero
13413 because of the way we create it (first we create, later we
13414 customize, and we were never checking the modifiers).
13416 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13417 is a version of LookupTypeReflection that includes the type-name
13418 cache. This can be used as a fast path for functions that know
13419 the fully qualified name and are only calling into *.GetType() to
13420 obtain a composed type.
13422 This is also used by TypeManager.LookupType during its type
13425 (LookupType): We now also track the real type name, as sometimes
13426 we can get a quey for the real type name from things like
13427 ComposedCast. This fixes bug 31422.
13429 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13430 complete type fullname, it does not have to go through the type
13431 resolution system to obtain the composed version of the type (for
13432 obtaining arrays or pointers).
13434 (Conditional.Emit): Use the EmitBoolExpression to
13435 generate nicer code, as requested by Paolo.
13437 (ArrayCreation.CheckIndices): Use the patch from
13438 hwang_rob@yahoo.ca to validate the array initializers.
13440 2002-10-03 Miguel de Icaza <miguel@ximian.com>
13442 * class.cs (ConstructorInitializer.Emit): simplify code by using
13443 Invocation.EmitCall, and at the same time, fix the bugs in calling
13444 parent constructors that took variable arguments.
13446 * ecore.cs (Expression.ConvertNumericExplicit,
13447 Expression.ImplicitNumericConversion): Remove the code that
13448 manually wrapped decimal (InternalTypeConstructor call is now gone
13451 * expression.cs (Cast.TryReduce): Also handle decimal types when
13452 trying to perform a constant fold on the type.
13454 * typemanager.cs (IsUnmanagedtype): Partially implemented.
13456 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13457 that only turned off an error report, and did nothing else.
13459 2002-10-02 Miguel de Icaza <miguel@ximian.com>
13461 * driver.cs: Handle and ignore /fullpaths
13463 2002-10-01 Miguel de Icaza <miguel@ximian.com>
13465 * expression.cs (Binary.ResolveOperator): Catch the case where
13466 DoNumericPromotions returns true,
13468 (Binary.DoNumericPromotions): Simplify the code, and the tests.
13470 2002-09-27 Miguel de Icaza <miguel@ximian.com>
13472 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13475 2002-09-26 Miguel de Icaza <miguel@ximian.com>
13477 * ecore.cs (ConvertNumericExplicit): It is not enough that the
13478 conversion exists, but it is also required that the conversion be
13479 performed. This manifested in "(Type64Enum) 2".
13481 * class.cs (TypeManager.AddMethod): The fix is not to change
13482 AddEnum, because that one was using a fully qualified name (every
13483 DeclSpace derivative does), but to change the AddMethod routine
13484 that was using an un-namespaced name. This now correctly reports
13485 the duplicated name.
13487 Revert patch until I can properly fix it. The issue
13488 is that we have a shared Type space across all namespaces
13489 currently, which is wrong.
13491 Options include making the Namespace a DeclSpace, and merge
13492 current_namespace/current_container in the parser.
13494 2002-09-25 Miguel de Icaza <miguel@ximian.com>
13496 * cs-parser.jay: Improve error reporting when we get a different
13497 kind of expression in local_variable_type and
13498 local_variable_pointer_type.
13500 Propagate this to avoid missleading errors being reported.
13502 * ecore.cs (ImplicitReferenceConversion): treat
13503 TypeManager.value_type as a target just like object_type. As
13508 Is valid, and needs to result in the int 1 being boxed before it
13509 is assigned to the value type v.
13511 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
13512 to validate the enumeration name.
13514 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
13515 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
13516 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
13518 * ecore.cs (TryImplicitIntConversion): When doing an
13519 implicit-enumeration-conversion, check if the type is 64-bits and
13520 perform a conversion before passing to EnumConstant.
13522 2002-09-23 Miguel de Icaza <miguel@ximian.com>
13524 * decl.cs (Error_AmbiguousTypeReference); New routine used to
13525 report ambiguous type references. Unlike the MS version, we
13526 report what the ambiguity is. Innovation at work ;-)
13528 (DeclSpace.FindType): Require a location argument to
13529 display when we display an ambiguous error.
13531 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
13533 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
13535 * expression.cs (EmitDynamicInitializers): Apply patch from
13536 hwang_rob@yahoo.ca that fixes the order in which we emit our
13539 2002-09-21 Martin Baulig <martin@gnome.org>
13541 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
13542 delegate takes no arguments.
13544 2002-09-20 Miguel de Icaza <miguel@ximian.com>
13546 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
13549 * expression.cs: Extract the underlying type.
13551 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
13553 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
13555 2002-09-19 Miguel de Icaza <miguel@ximian.com>
13557 * class.cs (TypeContainer.DefineType): We can not use the nice
13558 PackingSize with the size set to 1 DefineType method, because it
13559 will not allow us to define the interfaces that the struct
13562 This completes the fixing of bug 27287
13564 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
13565 means also structs. This fixes part of the problem.
13566 (Expresion.ImplicitReferenceConversionExists): ditto.
13568 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
13569 error if there were no errors reported during the type lookup
13570 process, to avoid duplicates or redundant errors. Without this
13571 you would get an ambiguous errors plus a type not found. We have
13572 beaten the user enough with the first error.
13574 (DeclSparce.FindType): Emit a warning if we have an ambiguous
13577 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
13578 during the resolution process, stop the lookup, this avoids
13579 repeated error reports (same error twice).
13581 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
13583 * typemanager.cs (LookupType): Redo the type lookup code to match
13584 the needs of System.Reflection.
13586 The issue is that System.Reflection requires references to nested
13587 types to begin with a "+" sign instead of a dot. So toplevel
13588 types look like: "NameSpace.TopLevelClass", and nested ones look
13589 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
13592 2002-09-19 Martin Baulig <martin@gnome.org>
13594 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
13595 says that a method always returns or always throws an exception,
13596 don't report the CS0161.
13598 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13599 set `Returns = new_returns'.
13601 2002-09-19 Martin Baulig <martin@gnome.org>
13603 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13604 to an enum constant, check for a CS0176.
13606 2002-09-18 Miguel de Icaza <miguel@ximian.com>
13608 * class.cs (TypeContainer.CheckPairedOperators): Now we check
13609 for operators that must be in pairs and report errors.
13611 * ecore.cs (SimpleName.DoResolveType): During the initial type
13612 resolution process, when we define types recursively, we must
13613 check first for types in our current scope before we perform
13614 lookups in the enclosing scopes.
13616 * expression.cs (MakeByteBlob): Handle Decimal blobs.
13618 (Invocation.VerifyArgumentsCompat): Call
13619 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13620 I thought we were supposed to always call this, but there are a
13621 few places in the code where we dont do it.
13623 2002-09-17 Miguel de Icaza <miguel@ximian.com>
13625 * driver.cs: Add support in -linkres and -resource to specify the
13626 name of the identifier.
13628 2002-09-16 Miguel de Icaza <miguel@ximian.com>
13630 * ecore.cs (StandardConversionExists): Sync with the conversion
13631 code: allow anything-* to void* conversions.
13633 (FindMostSpecificSource): Use an Expression argument
13634 instead of a Type, because we might be handed over a Literal which
13635 gets a few more implicit conversions that plain types do not. So
13636 this information was being lost.
13638 Also, we drop the temporary type-holder expression when not
13641 2002-09-17 Martin Baulig <martin@gnome.org>
13643 * class.cs (PropertyBase.CheckBase): Don't check the base class if
13644 this is an explicit interface implementation.
13646 2002-09-17 Martin Baulig <martin@gnome.org>
13648 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13649 different `IndexerName' attributes.
13651 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13652 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13653 virtual CommonResolve().
13655 2002-09-16 Miguel de Icaza <miguel@ximian.com>
13657 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13658 and convert that to the UnderlyingType.
13660 * statement.cs (Foreach.Resolve): Indexers are just like variables
13661 or PropertyAccesses.
13663 * cs-tokenizer.cs (consume_string): Track line numbers and columns
13664 inside quoted strings, we were not doing this before.
13666 2002-09-16 Martin Baulig <martin@gnome.org>
13668 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13669 resolve it. This is needed for the definite assignment check of the
13670 instance expression, fixes bug #29846.
13671 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13673 2002-09-16 Nick Drochak <ndrochak@gol.com>
13675 * parameter.cs: Fix compile error. Cannot reference static member
13676 from an instance object. Is this an mcs bug?
13678 2002-09-14 Martin Baulig <martin@gnome.org>
13680 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13681 multiple times. Fixes bug #30295, added test-166.cs.
13683 2002-09-14 Martin Baulig <martin@gnome.org>
13685 * statement.cs (Block.Emit): Don't emit unreachable code.
13686 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13687 `break' statements.
13688 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13690 2002-09-14 Martin Baulig <martin@gnome.org>
13692 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13695 2002-09-14 Martin Baulig <martin@gnome.org>
13697 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13698 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13699 be false on the ms runtime.
13701 2002-09-13 Martin Baulig <martin@gnome.org>
13703 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13704 the CS0038 error message.
13706 2002-09-12 Miguel de Icaza <miguel@ximian.com>
13708 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13709 constant inside, return it.
13711 2002-09-12 Martin Baulig <martin@gnome.org>
13713 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13714 implicit conversion can be done between enum types.
13716 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13717 check whether an implicit conversion to the current enum's UnderlyingType
13718 exists and report an error if not.
13720 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13721 without debugging support.
13723 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13724 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
13726 2002-09-12 Martin Baulig <martin@gnome.org>
13728 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13730 * ecore.cs (IMemberExpr.DeclaringType): New property.
13731 (SimpleName.SimpleNameResolve): Check whether we're accessing a
13732 nonstatic member of an outer type (CS0038).
13734 2002-09-11 Miguel de Icaza <miguel@ximian.com>
13736 * driver.cs: Activate the using-error detector at warning level
13737 4 (at least for MS-compatible APIs).
13739 * namespace.cs (VerifyUsing): Small buglett fix.
13741 * pending.cs (PendingImplementation): pass the container pointer.
13743 * interface.cs (GetMethods): Allow for recursive definition. Long
13744 term, I would like to move every type to support recursive
13745 definitions, not the current ordering mechanism that we have right
13748 The situation is this: Attributes are handled before interfaces,
13749 so we can apply attributes to interfaces. But some attributes
13750 implement interfaces, we will now handle the simple cases
13751 (recursive definitions will just get an error).
13753 * parameter.cs: Only invalidate types at the end if we fail to
13756 2002-09-09 Martin Baulig <martin@gnome.org>
13758 * ecore.cs (PropertyExpr.Emit): Also check for
13759 TypeManager.system_int_array_get_length so this'll also work when
13760 compiling corlib. Fixes #30003.
13762 2002-09-09 Martin Baulig <martin@gnome.org>
13764 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13765 and throw an exception if we can't get the type's size. Fixed #30040,
13768 2002-09-09 Martin Baulig <martin@gnome.org>
13770 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13772 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13773 context. Fixes bug #30027.
13775 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13776 virtual functions. Fixes bug #30043, added test-164.cs.
13778 2002-09-08 Ravi Pratap <ravi@ximian.com>
13780 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13782 2002-09-08 Nick Drochak <ndrochak@gol.com>
13784 * driver.cs: Use an object to get the windows codepage since it's not a
13787 2002-09-08 Miguel de Icaza <miguel@ximian.com>
13789 * statement.cs (For.Emit): for infinite loops (test == null)
13790 return whether there is a break inside, not always "true".
13792 * namespace.cs (UsingEntry): New struct to hold the name of the
13793 using definition, the location where it is defined, and whether it
13794 has been used in a successful type lookup.
13796 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13801 2002-09-06 Ravi Pratap <ravi@ximian.com>
13803 * attribute.cs : Fix incorrect code which relied on catching
13804 a NullReferenceException to detect a null being passed in
13805 where an object was expected.
13807 2002-09-06 Miguel de Icaza <miguel@ximian.com>
13809 * statement.cs (Try): flag the catch variable as assigned
13811 * expression.cs (Cast): Simplified by using ResolveType instead of
13812 manually resolving.
13814 * statement.cs (Catch): Fix bug by using ResolveType.
13816 2002-09-06 Ravi Pratap <ravi@ximian.com>
13818 * expression.cs (BetterConversion): Special case for when we have
13819 a NullLiteral as the argument and we have to choose between string
13820 and object types - we choose string the way csc does.
13822 * attribute.cs (Attribute.Resolve): Catch the
13823 NullReferenceException and report error #182 since the Mono
13824 runtime no more has the bug and having this exception raised means
13825 we tried to select a constructor which takes an object and is
13828 2002-09-05 Ravi Pratap <ravi@ximian.com>
13830 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13831 message (1502, 1503) when we can't locate a method after overload
13832 resolution. This is much more informative and closes the bug
13835 * interface.cs (PopulateMethod): Return if there are no argument
13836 types. Fixes a NullReferenceException bug.
13838 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13839 expressions too. Previously we were checking only in one place for
13840 positional arguments leaving out named arguments.
13842 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13843 type to the enum type is not allowed. Remove code corresponding to
13846 (ConvertNumericExplicit): Allow explicit conversions from
13847 the underlying type to enum type. This precisely follows the spec
13848 and closes a bug filed by Gonzalo.
13850 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13853 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13855 2002-09-03 Miguel de Icaza <miguel@ximian.com>
13857 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13858 it was important that we stored the right value after the
13859 reduction in `converted'.
13861 2002-09-04 Martin Baulig <martin@gnome.org>
13863 * location.cs (Location.SymbolDocument): Use full pathnames for the
13866 2002-08-30 Miguel de Icaza <miguel@ximian.com>
13868 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13869 of the expression resolve mechanism, because that will catch the
13870 SimpleName error failures.
13872 (Conditional): If we can not resolve the
13873 expression, return, do not crash.
13875 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13878 (location): display token name instead of its number.
13880 2002-08-28 Martin Baulig <martin@gnome.org>
13882 * expression.cs (Binary.ResolveOperator): Don't silently return
13883 but return an error if an operator cannot be applied between two
13886 2002-08-28 Martin Baulig <martin@gnome.org>
13888 * class.cs (Constructor.Define): Set the permission attributes
13889 correctly instead of making all constructors public.
13891 2002-08-28 Martin Baulig <martin@gnome.org>
13893 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13894 for private members before reporting a CS0103; if we find anything,
13897 2002-08-28 Martin Baulig <martin@gnome.org>
13899 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13900 to check whether `closure_start_type == closure_invocation_type',
13901 we also need to check whether `m.DeclaringType == closure_invocation_type'
13902 before bypassing the permission checks. We might be accessing
13903 protected/private members from the base class.
13904 (TypeManager.RealMemberLookup): Only set private_ok if private
13905 members were requested via BindingFlags.NonPublic.
13907 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13909 * expression.cs (MemberAccess.ResolveMemberAccess): Set
13910 MethodGroupExpr.IsExplicitImpl if appropriate.
13911 (Invocation.DoResolve): Don't report the CS0120 for explicit
13912 interface implementations.
13914 2002-08-27 Martin Baulig <martin@gnome.org>
13916 * expression.cs (Invocation.DoResolve): If this is a static
13917 method and we don't have an InstanceExpression, we must report
13920 2002-08-25 Martin Baulig <martin@gnome.org>
13922 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13923 `==' between a valuetype and an object.
13925 2002-08-25 Miguel de Icaza <miguel@ximian.com>
13927 * ecore.cs (TypeExpr): Provide a ToString method.
13929 2002-08-24 Martin Baulig <martin@gnome.org>
13931 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13932 now called proggie.dbg and it's a binary file.
13934 2002-08-23 Martin Baulig <martin@gnome.org>
13936 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13938 2002-08-23 Martin Baulig <martin@gnome.org>
13940 * struct.cs (MyStructInfo.ctor): Make this work with empty
13941 structs; it's not allowed to use foreach() on null.
13943 2002-08-23 Martin Baulig <martin@gnome.org>
13945 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13946 writer the full pathname of the generated assembly.
13948 2002-08-23 Martin Baulig <martin@gnome.org>
13950 * statements.cs (FlowBranching.UsageVector.MergeChildren):
13951 A `finally' block never returns or breaks; improved handling of
13954 2002-08-23 Martin Baulig <martin@gnome.org>
13956 * statement.cs (Throw.Resolve): Allow `throw null'.
13958 2002-08-23 Martin Baulig <martin@gnome.org>
13960 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13961 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13962 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
13963 MemberLookup would return a wrong event if this is an explicit
13964 interface implementation and the class has an event with the same
13967 2002-08-23 Martin Baulig <martin@gnome.org>
13969 * statement.cs (Block.AddChildVariableNames): New public method.
13970 (Block.AddChildVariableName): Likewise.
13971 (Block.IsVariableNameUsedInChildBlock): Likewise.
13972 (Block.AddVariable): Check whether a variable name has already
13973 been used in a child block.
13975 * cs-parser.jay (declare_local_variables): Mark all variable names
13976 from the current block as being used in a child block in the
13979 2002-08-23 Martin Baulig <martin@gnome.org>
13981 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13982 find the symbol writer.
13984 * driver.cs: csc also allows the arguments to /define being
13985 separated by commas, not only by semicolons.
13987 2002-08-23 Martin Baulig <martin@gnome.org>
13989 * interface.cs (Interface.GetMembers): Added static check for events.
13991 2002-08-15 Martin Baulig <martin@gnome.org>
13993 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13994 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13996 * ecore.cs (Expression.MemberLookup): Added documentation and explained
13997 why the MethodData.EmitDestructor() change was necessary.
13999 2002-08-20 Martin Baulig <martin@gnome.org>
14001 * class.cs (TypeContainer.FindMembers): Added static check for events.
14003 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14005 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14006 use Type.GetEvents(), not Type.FindMembers().
14008 2002-08-20 Martin Baulig <martin@gnome.org>
14010 * decl.cs (MemberCache): Added a special method cache which will
14011 be used for method-only searched. This ensures that a method
14012 search will return a MethodInfo with the correct ReflectedType for
14015 2002-08-20 Martin Baulig <martin@gnome.org>
14017 * decl.cs (DeclSpace.FindMembers): Made this public.
14019 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14021 * delegate.cs: fixed build on windows.
14022 [FIXME: Filed as bug #29150: MCS must report these errors.]
14024 2002-08-19 Ravi Pratap <ravi@ximian.com>
14026 * ecore.cs (StandardConversionExists): Return a false
14027 if we are trying to convert the void type to anything else
14028 since that is not allowed.
14030 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14031 we flag error 70 in the event an event is trying to be accessed
14032 directly from outside the declaring type.
14034 2002-08-20 Martin Baulig <martin@gnome.org>
14036 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14037 MemberCache from typemanager.cs to decl.cs.
14039 2002-08-19 Martin Baulig <martin@gnome.org>
14041 * class.cs (TypeContainer): Implement IMemberContainer.
14042 (TypeContainer.DefineMembers): Create the MemberCache.
14043 (TypeContainer.FindMembers): Do better BindingFlags checking; only
14044 return public members if BindingFlags.Public was given, check
14045 whether members are static.
14047 2002-08-16 Martin Baulig <martin@gnome.org>
14049 * decl.cs (DeclSpace.Define): Splitted this in Define and
14050 DefineMembers. DefineMembers is called first and initializes the
14053 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
14054 DefineMembers() on all our DeclSpaces.
14056 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14057 but call DefineMembers() on all nested interfaces. We call their
14058 Define() in our new Define() function.
14060 * interface.cs (Interface): Implement IMemberContainer.
14061 (Interface.Define): Moved all code except the attribute stuf to
14063 (Interface.DefineMembers): Initialize the member cache.
14065 * typemanager.cs (IMemberFinder): Removed this interface, we don't
14066 need this anymore since we can use MemberCache.FindMembers directly.
14068 2002-08-19 Martin Baulig <martin@gnome.org>
14070 * typemanager.cs (MemberCache): When creating the cache for an
14071 interface type, add all inherited members.
14072 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14073 to `out bool used_cache' and documented it.
14074 (TypeManager.MemberLookup): If we already used the cache in the first
14075 iteration, we don't need to do the interfaces check.
14077 2002-08-19 Martin Baulig <martin@gnome.org>
14079 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
14080 here from IMemberFinder and don't implement this interface anymore.
14081 (DeclSpace.MemberCache): Moved here from IMemberFinder.
14083 * typemanager.cs (IMemberFinder): This interface is now only used by
14084 classes which actually support the member cache.
14085 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14086 since we only put DeclSpaces into this Hashtable.
14087 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14088 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14090 2002-08-16 Martin Baulig <martin@gnome.org>
14092 * typemanager.cs (ICachingMemberFinder): Removed.
14093 (IMemberFinder.MemberCache): New property.
14094 (TypeManager.FindMembers): Merged this with RealFindMembers().
14095 This function will never be called from TypeManager.MemberLookup()
14096 so we can't use the cache here, just the IMemberFinder.
14097 (TypeManager.MemberLookup_FindMembers): Check whether the
14098 IMemberFinder has a MemberCache and call the cache's FindMembers
14100 (MemberCache): Rewrote larger parts of this yet another time and
14101 cleaned it up a bit.
14103 2002-08-15 Miguel de Icaza <miguel@ximian.com>
14105 * driver.cs (LoadArgs): Support quoting.
14107 (Usage): Show the CSC-like command line arguments.
14109 Improved a few error messages.
14111 2002-08-15 Martin Baulig <martin@gnome.org>
14113 * typemanager.cs (IMemberContainer.Type): New property.
14114 (IMemberContainer.IsInterface): New property.
14116 The following changes are conditional to BROKEN_RUNTIME, which is
14117 defined at the top of the file.
14119 * typemanager.cs (MemberCache.MemberCache): Don't add the base
14120 class'es members, but add all members from TypeHandle.ObjectType
14121 if we're an interface.
14122 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14123 is the current type.
14124 (MemberCache.CacheEntry.Container): Removed this field.
14125 (TypeHandle.GetMembers): Include inherited members.
14127 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14129 * typemanager.cs: fixed compilation and added a comment on a field that
14132 2002-08-15 Martin Baulig <martin@gnome.org>
14134 * class.cs (ConstructorInitializer.Resolve): In the
14135 Expression.MemberLookup call, use the queried_type as
14138 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14139 declared' attribute, it's always true.
14140 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14141 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14142 temporary wrapper for FindMembers which tells MemberLookup whether
14143 members from the base classes are included in the return value.
14144 This will go away soon.
14145 (TypeManager.MemberLookup): Use this temporary hack here; once the
14146 new MemberCache is completed, we don't need to do the DeclaredOnly
14147 looping here anymore since the MemberCache will take care of this.
14148 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14149 (MemberCache): When creating the MemberCache for a class, get
14150 members from the current class and all its base classes.
14151 (MemberCache.CacheEntry.Container): New field. This is a
14152 temporary hack until the Mono runtime is fixed to distinguish
14153 between ReflectedType and DeclaringType. It allows us to use MCS
14154 with both the MS runtime and the unfixed Mono runtime without
14155 problems and without accecting performance.
14156 (MemberCache.SearchMembers): The DeclaredOnly looping from
14157 TypeManager.MemberLookup is now done here.
14159 2002-08-14 Martin Baulig <martin@gnome.org>
14161 * statement.cs (MyStructInfo.MyStructInfo): Don't call
14162 Type.GetFields on dynamic types but get the fields from the
14163 corresponding TypeContainer.
14164 (MyStructInfo.GetStructInfo): Added check for enum types.
14166 * typemanager.cs (MemberList.IsSynchronized): Implemented.
14167 (MemberList.SyncRoot): Implemented.
14168 (TypeManager.FilterWithClosure): No need to check permissions if
14169 closure_start_type == closure_invocation_type, don't crash if
14170 closure_invocation_type is null.
14172 2002-08-13 Martin Baulig <martin@gnome.org>
14174 Rewrote TypeContainer.FindMembers to use a member cache. This
14175 gives us a speed increase of about 35% for the self-hosting MCS
14176 build and of about 15-20% for the class libs (both on GNU/Linux).
14178 * report.cs (Timer): New class to get enhanced profiling. This
14179 whole class is "TIMER" conditional since it remarkably slows down
14182 * class.cs (MemberList): New class. This is an IList wrapper
14183 which we're now using instead of passing MemberInfo[]'s around to
14184 avoid copying this array unnecessarily.
14185 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14186 (ICachingMemberFinder, IMemberContainer): New interface.
14187 (TypeManager.FilterWithClosure): If `criteria' is null, the name
14188 has already been checked, otherwise use it for the name comparision.
14189 (TypeManager.FindMembers): Renamed to RealMemberFinder and
14190 provided wrapper which tries to use ICachingMemberFinder.FindMembers
14191 if possible. Returns a MemberList, not a MemberInfo [].
14192 (TypeHandle): New class, implements IMemberContainer. We create
14193 one instance of this class per type, it contains a MemberCache
14194 which is used to do the member lookups.
14195 (MemberCache): New class. Each instance of this class contains
14196 all members of a type and a name-based hash table.
14197 (MemberCache.FindMembers): This is our new member lookup
14198 function. First, it looks up all members of the requested name in
14199 the hash table. Then, it walks this list and sorts out all
14200 applicable members and returns them.
14202 2002-08-13 Martin Baulig <martin@gnome.org>
14204 In addition to a nice code cleanup, this gives us a performance
14205 increase of about 1.4% on GNU/Linux - not much, but it's already
14206 half a second for the self-hosting MCS compilation.
14208 * typemanager.cs (IMemberFinder): New interface. It is used by
14209 TypeManager.FindMembers to call FindMembers on a TypeContainer,
14210 Enum, Delegate or Interface.
14211 (TypeManager.finder_to_member_finder): New PtrHashtable.
14212 (TypeManager.finder_to_container): Removed.
14213 (TypeManager.finder_to_delegate): Removed.
14214 (TypeManager.finder_to_interface): Removed.
14215 (TypeManager.finder_to_enum): Removed.
14217 * interface.cs (Interface): Implement IMemberFinder.
14219 * delegate.cs (Delegate): Implement IMemberFinder.
14221 * enum.cs (Enum): Implement IMemberFinder.
14223 * class.cs (TypeContainer): Implement IMemberFinder.
14225 2002-08-12 Martin Baulig <martin@gnome.org>
14227 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14229 2002-08-12 Martin Baulig <martin@gnome.org>
14231 * ecore.cs (ITypeExpression): New interface for expressions which
14233 (TypeExpression): Renamed to TypeLookupExpression.
14234 (Expression.DoResolve): If we're doing a types-only lookup, the
14235 expression must implement the ITypeExpression interface and we
14236 call DoResolveType() on it.
14237 (SimpleName): Implement the new ITypeExpression interface.
14238 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14239 hack, the situation that we're only looking up types can't happen
14240 anymore when this method is called. Moved the type lookup code to
14241 DoResolveType() and call it.
14242 (SimpleName.DoResolveType): This ITypeExpression interface method
14243 is now doing the types-only lookup.
14244 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14245 (ResolveFlags): Added MaskExprClass.
14247 * expression.cs (MemberAccess): Implement the ITypeExpression
14249 (MemberAccess.DoResolve): Added support for a types-only lookup
14250 when we're called via ITypeExpression.DoResolveType().
14251 (ComposedCast): Implement the ITypeExpression interface.
14253 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
14254 Expression.Resolve() with ResolveFlags.Type instead.
14256 2002-08-12 Martin Baulig <martin@gnome.org>
14258 * interface.cs (Interface.Define): Apply attributes.
14260 * attribute.cs (Attribute.ApplyAttributes): Added support for
14261 interface attributes.
14263 2002-08-11 Martin Baulig <martin@gnome.org>
14265 * statement.cs (Block.Emit): Only check the "this" variable if we
14266 do not always throw an exception.
14268 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14269 whether the property has a set accessor.
14271 2002-08-11 Martin Baulig <martin@gnome.org>
14273 Added control flow analysis support for structs.
14275 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14276 with control flow analysis turned off.
14277 (IVariable): New interface.
14278 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14279 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14280 (FieldExpr.DoResolve): Resolve the instance expression with flow
14281 analysis turned off and do the definite assignment check after the
14282 resolving when we know what the expression will resolve to.
14284 * expression.cs (LocalVariableReference, ParameterReference):
14285 Implement the new IVariable interface, only call the flow analysis
14286 code if ec.DoFlowAnalysis is true.
14287 (This): Added constructor which takes a Block argument. Implement
14288 the new IVariable interface.
14289 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14290 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14291 This does the definite assignment checks for struct members.
14293 * class.cs (Constructor.Emit): If this is a non-static `struct'
14294 constructor which doesn't have any initializer, call
14295 Block.AddThisVariable() to tell the flow analysis code that all
14296 struct elements must be initialized before control returns from
14299 * statement.cs (MyStructInfo): New public class.
14300 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14301 argument to this indexer. If non-zero, check an individual struct
14302 member, not the whole struct.
14303 (FlowBranching.CheckOutParameters): Check struct members.
14304 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14305 overloaded versions of these methods which take an additional
14306 `int field_idx' argument to check struct members.
14307 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14308 overloaded versions of these methods which take an additional
14309 `string field_name' argument to check struct member.s
14310 (VariableInfo): Implement the IVariable interface.
14311 (VariableInfo.StructInfo): New public property. Returns the
14312 MyStructInfo instance of the variable if it's a struct or null.
14313 (Block.AddThisVariable): New public method. This is called from
14314 Constructor.Emit() for non-static `struct' constructor which do
14315 not have any initializer. It creates a special variable for the
14316 "this" instance variable which will be checked by the flow
14317 analysis code to ensure that all of the struct's fields are
14318 initialized before control returns from the constructor.
14319 (UsageVector): Added support for struct members. If a
14320 variable/parameter is a struct with N members, we reserve a slot
14321 in the usage vector for each member. A struct is considered fully
14322 initialized if either the struct itself (slot 0) or all its
14323 members are initialized.
14325 2002-08-08 Martin Baulig <martin@gnome.org>
14327 * driver.cs (Driver.MainDriver): Only report an error CS5001
14328 if there were no compilation errors.
14330 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14331 `UnsafeContext' property to determine whether the parent is in
14332 unsafe context rather than checking the parent's ModFlags:
14333 classes nested in an unsafe class are unsafe as well.
14335 2002-08-08 Martin Baulig <martin@gnome.org>
14337 * statement.cs (UsageVector.MergeChildren): Distinguish between
14338 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14339 we return. Added test17() and test18() to test-154.cs.
14341 2002-08-08 Martin Baulig <martin@gnome.org>
14343 * typemanager.cs (TypeManager.FilterWithClosure): If we have
14344 Family access, make sure the invoking type isn't a subclass of the
14345 queried type (that'd be a CS1540).
14347 * ecore.cs (Expression.MemberLookup): Added overloaded version of
14348 this method which takes an additional `Type invocation_type'.
14350 * expression.cs (BaseAccess.DoResolve): Use the base type as
14351 invocation and query type.
14352 (MemberAccess.DoResolve): If the lookup failed and we're about to
14353 report a CS0122, try a lookup with the ec.ContainerType - if this
14354 succeeds, we must report a CS1540.
14356 2002-08-08 Martin Baulig <martin@gnome.org>
14358 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14359 (MethodGroupExpr): Implement the IMemberExpr interface.
14361 * expression (MemberAccess.ResolveMemberAccess): No need to have
14362 any special code for MethodGroupExprs anymore, they're now
14365 2002-08-08 Martin Baulig <martin@gnome.org>
14367 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14368 Family, FamANDAssem and FamORAssem permissions.
14369 (TypeManager.IsSubclassOrNestedChildOf): New public method.
14371 2002-08-08 Martin Baulig <martin@gnome.org>
14373 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14374 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14377 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14379 * driver.cs: implemented /resource option to embed managed resources.
14381 2002-08-07 Martin Baulig <martin@gnome.org>
14383 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14384 (FieldBase.HasFieldInitializer): New public property.
14385 (FieldBase.GetInitializerExpression): New public method. Resolves and
14386 returns the field initializer and makes sure it is only resolved once.
14387 (TypeContainer.EmitFieldInitializers): Call
14388 FieldBase.GetInitializerExpression to get the initializer, this ensures
14389 that it isn't resolved multiple times.
14391 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
14392 the resolving process (SimpleName/MemberLookup) that we're currently
14393 emitting a field initializer (which must not access any instance members,
14394 this is an error CS0236).
14396 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14397 argument, if the `IsFieldInitializer' flag is set, we must report and
14398 error CS0236 and not an error CS0120.
14400 2002-08-07 Martin Baulig <martin@gnome.org>
14402 * ecore.cs (IMemberExpr): New public interface.
14403 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14404 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14405 if the expression is an IMemberExpr.
14407 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14408 to be null, implicitly default to `this' if we're non-static in
14409 this case. Simplified the code a lot by using the new IMemberExpr
14410 interface. Also fixed bug #28176 here.
14412 2002-08-06 Martin Baulig <martin@gnome.org>
14414 * cs-parser.jay (SimpleLookup): Removed. We need to create
14415 ParameterReferences during semantic analysis so that we can do a
14416 type-only search when resolving Cast, TypeOf and SizeOf.
14417 (block): Pass the `current_local_parameters' to the Block's
14420 * class.cs (ConstructorInitializer): Added `Parameters parameters'
14421 argument to the constructor.
14422 (ConstructorInitializer.Resolve): Create a temporary implicit
14423 block with the parameters.
14425 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14426 references here if we aren't doing a type-only search.
14428 * statement.cs (Block): Added constructor which takes a
14429 `Parameters parameters' argument.
14430 (Block.Parameters): New public property.
14432 * support.cs (InternalParameters.Parameters): Renamed `parameters'
14433 to `Parameters' and made it public readonly.
14435 2002-08-06 Martin Baulig <martin@gnome.org>
14437 * ecore.cs (Expression.Warning): Made this public as well.
14439 * report.cs (Report.Debug): Print the contents of collections.
14441 2002-08-06 Martin Baulig <martin@gnome.org>
14443 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
14444 used to tell Resolve() which kinds of expressions it may return.
14445 (Expression.Resolve): Added overloaded version of this method which
14446 takes a `ResolveFlags flags' argument. This can be used to tell
14447 Resolve() which kinds of expressions it may return. Reports a
14449 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14450 ResolveFlags.SimpleName.
14451 (Expression.Error118): Added overloaded version of this method which
14452 takes a `ResolveFlags flags' argument. It uses the flags to determine
14453 which kinds of expressions are allowed.
14455 * expression.cs (Argument.ResolveMethodGroup): New public method.
14456 Resolves an argument, but allows a MethodGroup to be returned.
14457 This is used when invoking a delegate.
14459 * TODO: Updated a bit.
14461 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14463 Fixed compilation with csc.
14465 * ecore.cs: Expression.Error made public. Is this correct? Should
14466 Warning be made public too?
14468 * expression.cs: use ea.Location instead of ea.loc.
14469 [FIXME: Filed as bug #28607: MCS must report these errors.]
14471 2002-08-06 Martin Baulig <martin@gnome.org>
14473 * ecore.cs (Expression.loc): Moved the location here instead of
14474 duplicating it in all derived classes.
14475 (Expression.Location): New public property.
14476 (Expression.Error, Expression.Warning): Made them non-static and
14477 removed the location argument.
14478 (Expression.Warning): Added overloaded version which takes an
14479 `int level' argument.
14480 (Expression.Error118): Make this non-static and removed the
14481 expression and location arguments.
14482 (TypeExpr): Added location argument to the constructor.
14484 * expression.cs (StaticCallExpr): Added location argument to
14486 (Indirection, PointerArithmetic): Likewise.
14487 (CheckedExpr, UnCheckedExpr): Likewise.
14488 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14489 (StringPtr): Likewise.
14492 2002-08-05 Martin Baulig <martin@gnome.org>
14494 * expression.cs (BaseAccess.DoResolve): Actually report errors.
14496 * assign.cs (Assign.DoResolve): Check whether the source
14497 expression is a value or variable.
14499 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14500 while resolving the corresponding blocks.
14502 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
14503 an error, don't silently return null.
14505 * statement.cs (Block.AddVariable): Do the error reporting here
14506 and distinguish between CS0128 and CS0136.
14507 (Block.DoResolve): Report all unused labels (warning CS0164).
14508 (LabeledStatement): Pass the location to the constructor.
14509 (LabeledStatement.HasBeenReferenced): New property.
14510 (LabeledStatement.Resolve): Set it to true here.
14512 * statement.cs (Return.Emit): Return success even after reporting
14513 a type mismatch error (CS0126 or CS0127), this is what csc does and
14514 it avoids confusing the users with any consecutive errors.
14516 2002-08-05 Martin Baulig <martin@gnome.org>
14518 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
14520 * const.cs (Const.LookupConstantValue): Catch circular definitions.
14522 * expression.cs (MemberAccess.DoResolve): Silently return if an
14523 error has already been reported.
14525 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
14526 error has already been reported.
14528 2002-08-05 Martin Baulig <martin@gnome.org>
14530 * statement.cs (UsageVector): Only initialize the `parameters'
14531 vector if we actually have any "out" parameters.
14533 2002-08-05 Martin Baulig <martin@gnome.org>
14535 * expression.cs (Binary.ResolveOperator): When combining delegates,
14536 they must have the same type.
14538 2002-08-05 Martin Baulig <martin@gnome.org>
14540 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
14541 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
14542 work with the ms runtime and we also don't need it: if we're a
14543 PropertyBuilder and not in the `indexer_arguments' hash, then we
14544 are a property and not an indexer.
14546 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
14547 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
14548 since the latter one doesn't work with the ms runtime.
14550 2002-08-03 Martin Baulig <martin@gnome.org>
14552 Fixed bugs #27998 and #22735.
14554 * class.cs (Method.IsOperator): New public field.
14555 (Method.CheckBase): Report CS0111 if there's already a method
14556 with the same parameters in the current class. Report CS0508 when
14557 attempting to change the return type of an inherited method.
14558 (MethodData.Emit): Report CS0179 if a method doesn't have a body
14559 and it's not marked abstract or extern.
14560 (PropertyBase): New abstract base class for Property and Indexer.
14561 (PropertyBase.CheckBase): Moved here from Property and made it work
14563 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
14564 the same so we can reuse it there.
14565 (Property, Indexer): Derive from PropertyBase.
14566 (MethodSignature.inheritable_property_signature_filter): New delegate
14567 to find properties and indexers.
14569 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
14570 argument and improved error reporting.
14572 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
14573 EmptyReadOnlyParameters and made it a property.
14575 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
14576 version of this method which takes a `PropertyInfo indexer'.
14577 (TypeManager.RegisterIndexer): New method.
14579 * class.cs: Added myself as author of this file :-)
14581 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14583 * class.cs: fixed compilation on windoze.
14585 2002-08-03 Martin Baulig <martin@gnome.org>
14587 * interface.cs (Interface.GetInterfaceBases): Check whether all
14588 base interfaces are at least as accessible than the current one.
14590 * class.cs (TypeContainer.GetClassBases): Check whether base types
14591 are at least as accessible than the current type.
14592 (TypeContainer.AsAccessible): Implemented and made non-static.
14593 (MemberBase.CheckParameters): Report errors if the accessibility
14596 * delegate.cs (Delegate.Delegate): The default visibility is
14597 internal for top-level types and private for nested types.
14598 (Delegate.Define): Report errors if the accessibility checks fail.
14600 * enum.cs (Enum.Enum): The default visibility is internal for
14601 top-level types and private for nested types.
14602 (Enum.DefineType): Compute the correct visibility.
14604 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14605 function which takes a `bool is_toplevel' instead of a TypeContainer.
14607 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14610 2002-08-02 Martin Baulig <martin@gnome.org>
14612 * expression.cs (LocalVariableReferenc): Added constructor which
14613 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14614 (LocalVariableReference.IsReadOnly): New property.
14615 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14616 variable is readonly, use our own readonly flag to do this; you can
14617 use the new constructor to get a writable reference to a read-only
14620 * cs-parser.jay (foreach_statement, using_statement): Get a writable
14621 reference to the local variable.
14623 2002-08-01 Miguel de Icaza <miguel@ximian.com>
14625 * rootcontext.cs (ResolveCore): Also include System.Exception
14627 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14628 we reach an EmptyStatement.
14630 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14633 * expression.cs (Binary.ResolveOperator): Check error result in
14636 use brtrue/brfalse directly and avoid compares to null.
14638 2002-08-02 Martin Baulig <martin@gnome.org>
14640 * class.cs (TypeContainer.Define): Define all nested interfaces here.
14641 Fixes bug #28407, added test-155.cs.
14643 2002-08-01 Martin Baulig <martin@gnome.org>
14645 * class.cs (Event.EmitDefaultMethod): Make this work with static
14646 events. Fixes #28311, added verify-3.cs.
14648 2002-08-01 Martin Baulig <martin@gnome.org>
14650 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14651 `is_disposable' fields.
14652 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14653 `hm.is_disposable' if we're using the collection pattern.
14654 (Foreach.EmitCollectionForeach): Use the correct type for the
14655 enumerator's local variable, only emit the try/finally block if
14656 necessary (fixes #27713).
14658 2002-08-01 Martin Baulig <martin@gnome.org>
14660 * ecore.cs (Expression.report118): Renamed to Error118 and made
14663 * statement.cs (Throw.Resolve): Check whether the expression is of
14664 the correct type (CS0118) and whether the type derives from
14665 System.Exception (CS0155).
14666 (Catch.Resolve): New method. Do the type lookup here and check
14667 whether it derives from System.Exception (CS0155).
14668 (Catch.CatchType, Catch.IsGeneral): New public properties.
14670 * typemanager.cs (TypeManager.exception_type): Added.
14672 2002-07-31 Miguel de Icaza <miguel@ximian.com>
14674 * driver.cs: Updated About function.
14676 2002-07-31 Martin Baulig <martin@gnome.org>
14678 Implemented Control Flow Analysis.
14680 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14681 (EmitContext.CurrentBranching): Added.
14682 (EmitContext.StartFlowBranching): Added.
14683 (EmitContext.EndFlowBranching): Added.
14684 (EmitContext.KillFlowBranching): Added.
14685 (EmitContext.IsVariableAssigned): Added.
14686 (EmitContext.SetVariableAssigned): Added.
14687 (EmitContext.IsParameterAssigned): Added.
14688 (EmitContext.SetParameterAssigned): Added.
14689 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14690 Added control flow analysis stuff here.
14692 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14693 resolve the expression as lvalue.
14694 (LocalVariableReference.DoResolve): Check whether the variable has
14695 already been assigned.
14696 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14697 the parameter as assigned here.
14698 (ParameterReference.DoResolve): Check whether the parameter has already
14700 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14701 expression as lvalue.
14703 * statement.cs (FlowBranching): New class for the flow analysis code.
14704 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14705 (LabeledStatement.IsDefined): New public property.
14706 (LabeledStatement.AddUsageVector): New public method to tell flow
14707 analyis that the label may be reached via a forward jump.
14708 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14710 (VariableInfo.Number): New public field. This is used by flow analysis
14711 to number all locals of a block.
14712 (Block.CountVariables): New public property. This is the number of
14713 local variables in this block (including the locals from all parent
14715 (Block.EmitMeta): Number all the variables.
14717 * statement.cs: Added flow analysis support to all classes.
14719 2002-07-31 Martin Baulig <martin@gnome.org>
14721 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14722 To get debugging messages, compile mcs with /define:MCS_DEBUG and
14723 then use this argument.
14725 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14727 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14728 use this to specify /define options.
14730 2002-07-29 Martin Baulig <martin@gnome.org>
14732 * statement.cs (Fixed): Moved all code that does variable lookups
14733 and resolvings from Emit to Resolve.
14735 * statement.cs (For): Moved all code that does variable lookups
14736 and resolvings from Emit to Resolve.
14738 * statement.cs (Using): Moved all code that does variable lookups
14739 and resolvings from Emit to Resolve.
14741 2002-07-29 Martin Baulig <martin@gnome.org>
14743 * attribute.cs (Attribute.Resolve): Explicitly catch a
14744 System.NullReferenceException when creating the
14745 CustromAttributeBuilder and report a different warning message.
14747 2002-07-29 Martin Baulig <martin@gnome.org>
14749 * support.cs (ParameterData.ParameterName): Added method to
14750 get the name of a parameter.
14752 * typemanager.cs (TypeManager.IsValueType): New public method.
14754 2002-07-29 Martin Baulig <martin@gnome.org>
14756 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
14757 is a flag which specifies that it's either ref or out.
14758 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14759 the out parameter to `out Parameter.Modifier mod', also set the
14760 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14762 * support.cs (InternalParameters.ParameterModifier): Distinguish
14763 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14764 Parameter.Modifier.ISBYREF flag if it's either ref or out.
14766 * expression.cs (Argument.GetParameterModifier): Distinguish
14767 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14768 Parameter.Modifier.ISBYREF flag if it's either ref or out.
14770 2002-07-29 Martin Baulig <martin@gnome.org>
14772 * expression.cs (ParameterReference.ParameterReference): Added
14773 `Location loc' argument to the constructor.
14775 * cs-parser.jay: Pass location to ParameterReference.
14777 2002-07-28 Miguel de Icaza <miguel@ximian.com>
14779 * statement.cs (Try): Initialize the location.
14781 * cs-parser.jay: pass location to Try.
14783 * expression.cs (Unary.Reduce): Change the prototype to return
14784 whether a constant fold could be performed or not. The result is
14785 returned in an out parameters. In the case of Indirection and
14786 AddressOf, we want to perform the full tests.
14788 2002-07-26 Miguel de Icaza <miguel@ximian.com>
14790 * statement.cs (Statement.Emit): Flag dead code.
14792 2002-07-27 Andrew Birkett <andy@nobugs.org>
14794 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14796 2002-07-27 Martin Baulig <martin@gnome.org>
14798 * class.cs (MethodData.Define): Put back call to
14799 TypeManager.AddMethod(), accidentally commented this out.
14801 * report.cs (Debug): New public method to print debugging information,
14802 this is `[Conditional ("DEBUG")]'.
14804 2002-07-26 Martin Baulig <martin@gnome.org>
14806 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14807 (switch_statement): Push the current_block to the switch_stack and
14808 pop it again when we're done with the switch.
14809 (switch_section): The new block is a child of the current_block.
14810 Fixes bug #24007, added test-152.cs.
14812 2002-07-27 Martin Baulig <martin@gnome.org>
14814 * expression.cs (Invocation.EmitArguments): When calling a varargs
14815 function with only its fixed arguments, we need to pass an empty
14818 2002-07-27 Martin Baulig <martin@gnome.org>
14820 Mono 0.13 has been released.
14822 2002-07-25 Miguel de Icaza <miguel@ximian.com>
14824 * driver.cs: Rename --resource to --linkres, because that is what
14825 we do currently, we dont support --resource yet.
14827 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14829 2002-07-25 Martin Baulig <martin@gnome.org>
14831 * class.cs (MethodData): New public class. This is a `method builder'
14832 class for a method or one accessor of a Property/Indexer/Event.
14833 (MethodData.GetMethodFlags): Moved here from MemberBase.
14834 (MethodData.ApplyAttributes): Likewise.
14835 (MethodData.ApplyObsoleteAttribute): Likewise.
14836 (MethodData.ApplyConditionalAttribute): Likewise.
14837 (MethodData.ApplyDllImportAttribute): Likewise.
14838 (MethodData.CheckAbstractAndExternal): Likewise.
14839 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14840 (MethodData.Emit): Formerly known as Method.Emit().
14841 (MemberBase): Moved everything which was specific to a single
14842 accessor/method to MethodData.
14843 (Method): Create a new MethodData and call Define() and Emit() on it.
14844 (Property, Indexer, Event): Create a new MethodData objects for each
14845 accessor and call Define() and Emit() on them.
14847 2002-07-25 Martin Baulig <martin@gnome.org>
14849 Made MethodCore derive from MemberBase to reuse the code from there.
14850 MemberBase now also checks for attributes.
14852 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14853 (MemberBase.GetMethodFlags): Moved here from class Method and marked
14855 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14856 `CallingConventions cc' and `Attributes opt_attrs' arguments.
14857 (MemberBase.ApplyAttributes): New virtual method; applies the
14858 attributes to a method or accessor.
14859 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14860 (MemberBase.ApplyConditionalAttribute): Likewise.
14861 (MemberBase.ApplyDllImportAttribute): Likewise.
14862 (MemberBase.CheckAbstractAndExternal): Likewise.
14863 (MethodCore.ParameterTypes): This is now a property instead of a
14864 method, it's initialized from DoDefineParameters().
14865 (MethodCore.ParameterInfo): Removed the set accessor.
14866 (MethodCore.DoDefineParameters): New protected virtual method to
14867 initialize ParameterTypes and ParameterInfo.
14868 (Method.GetReturnType): We can now simply return the MemberType.
14869 (Method.GetMethodFlags): Override the MemberBase version and add
14870 the conditional flags.
14871 (Method.CheckBase): Moved some code from Define() here, call
14872 DoDefineParameters() here.
14873 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14874 here to avoid some larger code duplication.
14875 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14876 ensure that abstract and external accessors don't declare a body.
14878 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14879 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14880 lookup in the attribute's parent classes, so we need to abort as soon
14881 as we found the first match.
14882 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14883 the attribute has no arguments.
14885 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14888 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14890 * cs-parser.jay: reverted previous patch.
14892 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14894 * cs-parser.jay: fixed bug #22119.
14896 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14898 * attribute.cs: fixed compilation. The error was:
14899 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
14900 be assigned to before control leaves the current method."
14901 [FIXME: Filed as bug #28186: MCS must report this error.]
14903 2002-07-25 Martin Baulig <martin@gnome.org>
14905 * attribute.cs (Attribute.Conditional_GetConditionName): New static
14906 method to pull the condition name ouf of a Conditional attribute.
14907 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14908 the obsolete message and error flag out of an Obsolete attribute.
14910 * class.cs (Method.GetMethodFlags): New public method to get the
14911 TypeManager.MethodFlags for this method.
14912 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14914 (Method.Define): Get and apply the Obsolete and Conditional attributes;
14915 if we're overriding a virtual function, set the new private variable
14916 `parent_method'; call the new TypeManager.AddMethod().
14918 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
14919 the MethodBuilder and the Method in a PtrHashtable.
14920 (TypeManager.builder_to_method): Added for this purpose.
14921 (TypeManager.MethodFlags): Added IsObsoleteError.
14922 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
14923 Obsolete and Conditional arguments in MethodBuilders. If we discover
14924 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14925 the message from the attribute.
14927 2002-07-24 Martin Baulig <martin@gnome.org>
14929 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14930 preprocessor directives, ensure that the argument to #define/#undef is
14931 exactly one identifier and that it's actually an identifier.
14933 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14936 2002-07-24 Martin Baulig <martin@gnome.org>
14938 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14939 initialize it to TypeManager.object_type in the constructor.
14940 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14941 of the `hm.get_current' method if we're using the collection pattern.
14942 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14943 for the explicit conversion to make it work when we're using the collection
14944 pattern and the `Current' property has a different return type than `object'.
14947 2002-07-24 Martin Baulig <martin@gnome.org>
14949 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14950 does not match, but don't report any errors. This method is called in
14951 order for all methods in a MethodGroupExpr until a matching method is
14952 found, so we don't want to bail out if the first method doesn't match.
14953 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14954 matches, report the 123. Fixes #28070.
14956 2002-07-24 Martin Baulig <martin@gnome.org>
14958 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14959 TypeManager.TypeToCoreType() to the top of the method so the
14960 following equality checks will work. Fixes #28107.
14962 2002-07-24 Martin Baulig <martin@gnome.org>
14964 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14965 operand is of type uint, and the other operand is of type sbyte,
14966 short or int, the operands are converted to type long." -
14967 Actually do what this comment already told us. Fixes bug #28106,
14970 2002-07-24 Martin Baulig <martin@gnome.org>
14972 * class.cs (MethodBase): New abstract class. This is now a base
14973 class for Property, Indexer and Event to avoid some code duplication
14974 in their Define() and DefineMethods() methods.
14975 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14976 generic methods for Define() and DefineMethods().
14977 (FieldBase): Derive from MemberBase, not MemberCore.
14978 (Property): Derive from MemberBase, not MemberCore.
14979 (Property.DefineMethod): Moved all the code from this method to the
14980 new MethodBase.DefineAccessor(), just call it with appropriate
14982 (Property.Define): Call the new Property.DoDefine(), this does some
14983 sanity checks and we don't need to duplicate the code everywhere.
14984 (Event): Derive from MemberBase, not MemberCore.
14985 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14986 accessors, this will also make them work with interface events.
14987 (Indexer): Derive from MemberBase, not MemberCore.
14988 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14989 (Indexer.Define): Use the new MethodBase functions.
14991 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14992 argument to the constructor.
14993 (Interface.FindMembers): Added support for interface events.
14994 (Interface.PopluateEvent): Implemented.
14996 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
14998 2002-07-22 Miguel de Icaza <miguel@ximian.com>
15000 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15001 but this is required to check for a method name being the same as
15002 the containing class.
15006 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15008 * interface.cs: initialize variable.
15010 2002-07-23 Martin Baulig <martin@gnome.org>
15012 Implemented the IndexerName attribute in interfaces.
15014 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15015 name if this is an explicit interface implementation.
15016 (Indexer.InterfaceIndexerName): New public variable. If we're
15017 implementing an interface indexer, this is the IndexerName in that
15018 interface. Otherwise, it's the IndexerName.
15019 (Indexer.DefineMethod): If we're implementing interface indexer,
15020 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
15021 and Pending.ImplementIndexer methods.
15022 (Indexer.Define): Also define the PropertyBuilder if we're
15023 implementing an interface indexer and this is neither an explicit
15024 interface implementation nor do the IndexerName match the one in
15027 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15028 If a method is defined here, then we always need to create a proxy
15029 for it. This is used when implementing interface indexers.
15030 (Pending.IsInterfaceIndexer): New public method.
15031 (Pending.ImplementIndexer): New public method.
15032 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15033 This is used when implementing interface indexers to define a proxy
15035 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15036 define a proxy if necessary.
15038 * interface.cs (Interface.IndexerName): New public variable.
15039 (Interface.PopulateIndexer): Set the IndexerName.
15040 (Interface.DefineIndexers): New private method. Populate all the
15041 indexers and make sure their IndexerNames match.
15043 * typemanager.cs (IndexerPropertyName): Added support for interface
15046 2002-07-22 Martin Baulig <martin@gnome.org>
15048 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15049 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15050 ret if HasReturnLabel.
15051 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15054 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15055 and set the ec.LoopBeginTryCatchLevel.
15056 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15057 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15058 the current ec.TryCatchLevel, the branch goes out of an exception
15059 block. In this case, we need to use Leave and not Br.
15061 2002-07-22 Martin Baulig <martin@gnome.org>
15063 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15064 block unless the block does not always return or it is contained in
15065 another try { ... } catch { ... } block. Fixes bug #26506.
15066 Added verify-1.cs to the test suite.
15068 2002-07-22 Martin Baulig <martin@gnome.org>
15070 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15071 then we do not always return. Fixes bug #24985.
15073 2002-07-22 Martin Baulig <martin@gnome.org>
15075 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15076 lookup on a per-class level; ie. walk up the class hierarchy until we
15077 found at least one applicable method, then choose the best among them.
15078 Fixes bug #24463 and test-29.cs.
15080 2002-07-22 Martin Baulig <martin@gnome.org>
15082 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15083 return types of the methods. The return type is not part of the
15084 signature and we must not check it to make the `new' modifier work.
15085 Fixes bug #27999, also added test-147.cs.
15086 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15088 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15089 on the method's return type.
15091 2002-07-21 Martin Baulig <martin@gnome.org>
15093 * assign.cs: Make this work if the rightmost source is a constant and
15094 we need to do an implicit type conversion. Also adding a few more tests
15095 to test-38.cs which should have caught this.
15097 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15098 target in the makefile for this. The makefile.gnu is primarily intended
15099 for end-users who don't want to debug the compiler.
15101 2002-07-21 Martin Baulig <martin@gnome.org>
15103 * assign.cs: Improved the Assign class so it can now handle embedded
15104 assignments (X = Y = Z = something). As a side-effect this'll now also
15105 consume less local variables. test-38.cs now passes with MCS, added
15106 a few new test cases to that test.
15108 2002-07-20 Martin Baulig <martin@gnome.org>
15110 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15111 instructions. Fixes bug #27977, also added test-146.cs.
15113 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15115 * cs-tokenizer.cs: fixed getHex ().
15117 2002-07-19 Martin Baulig <martin@gnome.org>
15119 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15120 not Type.GetType() to lookup the array type. This is needed when
15121 we're constructing an array of a user-defined type.
15122 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15123 single-dimensional arrays, but also for single-dimensial arrays of
15126 2002-07-19 Martin Baulig <martin@gnome.org>
15128 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15129 this function is called, it's not allowed to share LocalBuilders
15130 among ILGenerators.
15132 2002-07-19 Martin Baulig <martin@gnome.org>
15134 * expression.cs (Argument.Resolve): Report an error 118 when trying
15135 to pass a type as argument.
15137 2002-07-18 Martin Baulig <martin@gnome.org>
15139 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15140 Conv_R_Un for the signed `long' type.
15142 2002-07-15 Miguel de Icaza <miguel@ximian.com>
15144 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15145 `expr' for the temporary result, as that will fail if we do
15146 multiple resolves on the same expression.
15148 2002-07-05 Miguel de Icaza <miguel@ximian.com>
15150 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15151 ec.TypeContainer for looking up aliases.
15153 * class.cs (TypeContainer): Remove LookupAlias from here.
15155 * decl.cs (DeclSpace); Move here.
15157 2002-07-01 Miguel de Icaza <miguel@ximian.com>
15159 * class.cs (FindMembers): Only call filter if the constructor
15160 bulider is not null.
15162 Also handle delegates in `NestedTypes' now. Now we will perform
15163 type lookups using the standard resolution process. This also
15166 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15167 This uses Expressions (the limited kind that can be parsed by the
15168 tree) instead of strings.
15170 * expression.cs (ComposedCast.ToString): Implement, used to flag
15171 errors since now we have to render expressions.
15173 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
15176 * ecore.cs (SimpleName.ToString): ditto.
15178 * cs-parser.jay: Instead of using strings to assemble types, use
15179 Expressions to assemble the type (using SimpleName, ComposedCast,
15180 MemberAccess). This should fix the type lookups in declarations,
15181 because we were using a different code path for this.
15183 * statement.cs (Block.Resolve): Continue processing statements
15184 even when there is an error.
15186 2002-07-17 Miguel de Icaza <miguel@ximian.com>
15188 * class.cs (Event.Define): Also remove the `remove' method from
15189 the list of pending items.
15191 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15192 generate more compact code.
15194 2002-07-17 Martin Baulig <martin@gnome.org>
15196 * const.cs (Const.LookupConstantValue): Add support for constant
15197 `unchecked' and `checked' expressions.
15198 Also adding test case test-140.cs for this.
15200 2002-07-17 Martin Baulig <martin@gnome.org>
15202 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15203 check whether mi.ReturnType implements the IEnumerator interface; the
15204 `==' and the IsAssignableFrom() will fail in this situation.
15206 2002-07-16 Ravi Pratap <ravi@ximian.com>
15208 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
15211 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15213 * expression.cs: fixed bug #27811.
15215 2002-07-14 Miguel de Icaza <miguel@ximian.com>
15217 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15218 Molaro: when we are a ref, the value already contains a pointer
15219 value, do not take the address of it.
15221 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15222 * removed mb-parser.jay and mb-tokenizer.cs
15224 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15226 * expression.cs: check against the building corlib void type.
15228 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15230 * ecore.cs: fix for valuetype static readonly fields: when
15231 initializing them, we need their address, not the address of a copy.
15233 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15235 * typemanager.cs: register also enum_type in corlib.
15237 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15239 * class.cs: allow calling this (but not base) initializers in structs.
15241 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15243 * ecore.cs: make sure we compare against the building base types
15246 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15248 * typemanager.cs: fix TypeToCoreType() to handle void and object
15249 (corlib gets no more typerefs after this change).
15251 2002-07-12 Miguel de Icaza <miguel@ximian.com>
15253 * expression.cs (ArrayCreation.EmitArrayArguments): use
15254 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15256 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15257 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
15258 array indexes, the runtime actually forbids them.
15260 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15261 for array arguments here.
15263 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15264 instead of the default for ValueTypes.
15266 (New.DoEmit): Use IsValueType instead of
15267 IsSubclassOf (value_type)
15268 (New.DoResolve): ditto.
15269 (Invocation.EmitCall): ditto.
15271 * assign.cs (Assign): ditto.
15273 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15274 Statements *are* currently doing part of their resolution during
15277 Expressions do always resolve during resolve, but statements are
15278 only required to propagate resolution to their children.
15280 2002-07-11 Miguel de Icaza <miguel@ximian.com>
15282 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15284 (LoadAssembly): Do not add the dll if it is already specified
15286 (MainDriver): Add the System directory to the link path at the end,
15287 after all the other -L arguments.
15289 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15290 wrong opcode for loading bytes and bools (ldelem.i1 instead of
15291 ldelem.u1) and using the opposite for sbytes.
15293 This fixes Digger, and we can finally run it.
15295 * driver.cs (UnixParseOption): Move the option parsing here.
15296 (CSCParseOption): Implement CSC-like parsing of options.
15298 We now support both modes of operation, the old Unix way, and the
15299 new CSC-like way. This should help those who wanted to make cross
15300 platform makefiles.
15302 The only thing broken is that /r:, /reference: and /lib: are not
15303 implemented, because I want to make those have the same semantics
15304 as the CSC compiler has, and kill once and for all the confussion
15305 around this. Will be doing this tomorrow.
15307 * statement.cs (Unsafe.Resolve): The state is checked during
15308 resolve, not emit, so we have to set the flags for IsUnsfe here.
15310 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15312 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15313 not catch the Error_ObjectRefRequired in SimpleName (as it is
15314 possible to have a class/instance variable name that later gets
15315 deambiguated), we have to check this here.
15317 2002-07-10 Ravi Pratap <ravi@ximian.com>
15319 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15320 make static and put into Expression.
15322 (Event.Define): Register the private field of the event with the
15323 TypeManager so that GetFieldFromEvent can get at it.
15325 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15326 keep track of the private field associated with an event which
15329 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15332 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15334 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15336 * expression.cs (Binary.EmitBranchable): this routine emits the
15337 Binary expression in a branchable context. This basically means:
15338 we need to branch somewhere, not just get the value on the stack.
15340 This works together with Statement.EmitBoolExpression.
15342 * statement.cs (Statement.EmitBoolExpression): Use
15345 2002-07-09 Miguel de Icaza <miguel@ximian.com>
15347 * statement.cs (For): Reduce the number of jumps in loops.
15349 (For): Implement loop inversion for the For statement.
15351 (Break): We can be breaking out of a Try/Catch controlled section
15352 (foreach might have an implicit try/catch clause), so we need to
15353 use Leave instead of Br.
15355 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15356 now). If the instace expression supports IMemoryLocation, we use
15357 the AddressOf method from the IMemoryLocation to extract the
15358 address instead of emitting the instance.
15360 This showed up with `This', as we were emitting the instance
15361 always (Emit) instead of the Address of This. Particularly
15362 interesting when This is a value type, as we dont want the Emit
15363 effect (which was to load the object).
15365 2002-07-08 Miguel de Icaza <miguel@ximian.com>
15367 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15369 * statement.cs (Checked): Set the CheckedState during the resolve
15370 process too, as the ConvCast operations track the checked state on
15371 the resolve process, and not emit.
15373 * cs-parser.jay (namespace_member_declaration): Flag that we have
15374 found a declaration when we do. This is used to flag error 1529
15376 * driver.cs: Report ok when we display the help only.
15378 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
15380 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15382 2002-07-04 Miguel de Icaza <miguel@ximian.com>
15384 * cs-tokenizer.cs (define): We also have to track locally the
15385 defines. AllDefines is just used for the Conditional Attribute,
15386 but we also need the local defines for the current source code.
15388 2002-07-03 Miguel de Icaza <miguel@ximian.com>
15390 * statement.cs (While, For, Do): These loops can exit through a
15391 Break statement, use this information to tell whether the
15392 statement is the last piece of code.
15394 (Break): Flag that we break.
15396 * codegen.cs (EmitContexts): New `Breaks' state variable.
15398 2002-07-03 Martin Baulig <martin@gnome.org>
15400 * class.cs (TypeContainer.MethodModifiersValid): Allow override
15401 modifiers in method declarations in structs. Otherwise, you won't
15402 be able to override things like Object.Equals().
15404 2002-07-02 Miguel de Icaza <miguel@ximian.com>
15406 * class.cs (Method, Property, Indexer): Do not allow the public
15407 modifier to be used in explicit interface implementations.
15409 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15410 override modifiers in method declarations in structs
15412 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
15414 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15415 integer or real overflow, report an error
15417 2002-07-02 Martin Baulig <martin@gnome.org>
15419 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15420 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15421 to tell the runtime about our newly created System.Object and
15422 System.ValueType types.
15424 2002-07-02 Miguel de Icaza <miguel@ximian.com>
15426 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15427 struct instead of Ldarg/Starg.
15429 2002-07-02 Martin Baulig <martin@gnome.org>
15431 * expression.cs (Indirection.Indirection): Call
15432 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15434 2002-07-02 Martin Baulig <martin@gnome.org>
15436 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15437 ValueType, call TypeManager.TypeToCoreType() on it.
15438 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15439 the OpCodes.Newarr argument.
15441 2002-07-02 Martin Baulig <martin@gnome.org>
15443 * expression.cs (Invocation.EmitCall): When compiling corlib,
15444 replace all calls to the system's System.Array type to calls to
15445 the newly created one.
15447 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15448 System.Array methods.
15449 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15450 from the system's System.Array type which must be replaced.
15452 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15454 * typemanager.cs: load unverifiable_code_ctor so we can build
15455 corlib using the correct type. Avoid using GetTypeCode() with
15457 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15458 TypeManager.object_type to allow building corlib.
15460 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15462 * ecore.cs: handle System.Enum separately in LoadFromPtr().
15464 2002-07-01 Martin Baulig <martin@gnome.org>
15466 * class.cs: Make the last change actually work, we need to check
15467 whether `ifaces != null' to avoid a crash.
15469 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15471 * class.cs: when we build structs without fields that implement
15472 interfaces, we need to add the interfaces separately, since there is
15473 no API to both set the size and add the interfaces at type creation
15476 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15478 * expression.cs: the dimension arguments to the array constructors
15479 need to be converted if they are a long.
15481 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15483 * class.cs: don't emit ldarg.0 if there is no parent constructor
15484 (fixes showstopper for corlib).
15486 2002-06-29 Martin Baulig <martin@gnome.org>
15488 MCS now compiles corlib on GNU/Linux :-)
15490 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15491 ie. check for MethodImplOptions.InternalCall.
15493 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15494 and TypeManager.attribute_type are null, so we must explicitly check
15495 whether parent is not null to find out whether it's an attribute type.
15496 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15497 and SetBuilder, not only if the property is neither abstract nor external.
15498 This is necessary to set the MethodImplOptions on the accessor methods.
15499 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15500 SetBuilder, see Property.Emit().
15502 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
15503 populate "System.Object", "System.ValueType" and "System.Attribute" since
15504 they've already been populated from BootCorlib_PopulateCoreTypes().
15506 2002-06-29 Martin Baulig <martin@gnome.org>
15508 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
15509 is the NullLiteral, we also need to make sure that target_type is not
15512 2002-06-29 Martin Baulig <martin@gnome.org>
15514 * rootcontext.cs (RootContext.ResolveCore): We must initialize
15515 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
15516 before calling BootstrapCorlib_ResolveDelegate ().
15518 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15520 * statement.cs: fixed build-breaker. All tests passed ok.
15522 2002-06-27 Martin Baulig <martin@gnome.org>
15524 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
15525 for System.Decimal when compiling corlib.
15527 2002-06-27 Martin Baulig <martin@gnome.org>
15529 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
15530 switch blocks which contain nothing but a default clause.
15532 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
15534 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
15536 2002-06-27 Martin Baulig <martin@gnome.org>
15538 * ecore.cs (PropertyExpr.PropertyExpr): Call
15539 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
15541 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
15542 is already a TypeBuilder.
15544 2002-06-27 Martin Baulig <martin@gnome.org>
15546 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
15547 `target_type == TypeManager.array_type', not IsAssignableFrom() in
15548 the "from an array-type to System.Array" case. This makes it work
15549 when compiling corlib.
15551 2002-06-27 Martin Baulig <martin@gnome.org>
15553 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
15554 non-static PropertyExpr, set its InstanceExpression. This makes
15555 the `ICollection.Count' property work in System/Array.cs.
15557 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
15559 * driver.cs: Made error handling more consistent. Errors now
15560 tracked by Report class, so many methods which used to return int
15561 now return void. Main() now prints success/failure and
15562 errors/warnings message.
15564 Renamed '--probe' compiler argument to '--expect-error'. Removed
15565 the magic number return values (123 and 124). Now, if the
15566 expected error occurs, the compiler exits with success (exit value
15567 0). If the compilation completes without seeing that particular
15568 error, the compiler exits with failure (exit value 1). The
15569 makefile in mcs/errors has been changed to handle the new behaviour.
15571 * report.cs: Made 'expected error' number a property and renamed
15572 it from 'Probe' to 'ExpectedError'.
15574 * genericparser.cs: Removed error handling support, since it is
15575 now all done by Report class.
15577 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
15578 class, so parse() no longer returns an int.
15580 * namespace.cs: Use Report.Error instead of GenericParser.error
15582 2002-06-22 Miguel de Icaza <miguel@ximian.com>
15584 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
15585 TypeContainer.AddOperator): At the front of the list put the
15586 explicit implementations, so they get resolved/defined first.
15588 2002-06-21 Miguel de Icaza <miguel@ximian.com>
15590 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
15591 interface type is implemented by this TypeContainer. Used during
15592 explicit interface implementation.
15594 (Property.Define, Indexer.Define, Method.Define): Validate that
15595 the given interface in the explicit implementation is one of the
15596 base classes for the containing type.
15598 Also if we are explicitly implementing an interface, but there is
15599 no match in the pending implementation table, report an error.
15601 (Property.Define): Only define the property if we are
15602 not explicitly implementing a property from an interface. Use the
15603 correct name also for those properties (the same CSC uses,
15604 although that is really not needed).
15606 (Property.Emit): Do not emit attributes for explicitly implemented
15607 properties, as there is no TypeBuilder.
15609 (Indexer.Emit): ditto.
15611 Hiding then means that we do not really *implement* a pending
15612 implementation, which makes code fail.
15614 2002-06-22 Martin Baulig <martin@gnome.org>
15616 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15617 the return value of Object.GetType(). [FIXME: we need to do this whenever
15618 we get a type back from the reflection library].
15620 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15622 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15624 2002-06-20 Miguel de Icaza <miguel@ximian.com>
15626 * attribute.cs: Return null if we can not look up the type.
15628 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15629 the interface types found.
15631 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15632 interface types found.
15634 * typemanager.cs (GetInterfaces): Make this routine returns alll
15635 the interfaces and work around the lame differences between
15636 System.Type and System.Reflection.Emit.TypeBuilder in the results
15637 result for GetInterfaces.
15639 (ExpandInterfaces): Given an array of interface types, expand and
15640 eliminate repeated ocurrences of an interface. This expands in
15641 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15644 2002-06-21 Martin Baulig <martin@gnome.org>
15646 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15649 2002-06-21 Martin Baulig <martin@gnome.org>
15651 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
15652 and called with one of the core types, return the corresponding typebuilder for
15655 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15658 2002-06-21 Martin Baulig <martin@gnome.org>
15660 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15661 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15662 (Expression.ConvertReferenceExplicit): Likewise.
15664 * expression.cs (ElementAccess.DoResolve): Likewise.
15665 (ElementAccess.DoResolveLValue): Likewise.
15667 2002-06-10 Martin Baulig <martin@gnome.org>
15669 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15670 add the "value" parameter to the parameter list.
15672 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15675 2002-06-19 Miguel de Icaza <miguel@ximian.com>
15677 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15678 the argument to an int, uint, long or ulong, per the spec. Also
15679 catch negative constants in array creation.
15681 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15683 * class.cs: do not allow the same interface to appear twice in
15684 the definition list.
15686 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15688 * ecore.cs: don't use ldlen with System.Array.
15690 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15692 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15694 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15696 * modifiers.cs: produce correct field attributes for protected
15697 internal. Easy fix so miguel can work on ther harder stuff:-)
15699 2002-06-18 Miguel de Icaza <miguel@ximian.com>
15701 * pending.cs: New file. Move the code from class.cs here.
15702 Support clearning the pending flag for all methods (when not doing
15703 explicit interface implementation).
15705 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15707 * rootcontext.cs: added a couple more types needed to bootstrap.
15709 2002-06-17 Miguel de Icaza <miguel@ximian.com>
15711 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15712 constructor in the type, instead of any constructor in the type
15713 hierarchy. Thanks to Paolo for finding this bug (it showed up as
15714 a bug in the Mono runtime when applying the params attribute).
15716 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15717 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15719 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
15721 * expression.cs (Unary.ResolveOperator): Use TypeManager
15722 to resolve the type.
15724 2002-06-13 Ravi Pratap <ravi@ximian.com>
15726 * cs-parser.jay (enum_member_declaration): Pass in the attributes
15729 * enum.cs (AddEnumMember): Add support to store the attributes associated
15730 with each member too.
15732 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15733 field builders too - this takes care of the enum member case.
15735 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
15737 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15738 address-of operator on both value types and pointers.
15740 2002-06-10 Martin Baulig <martin@gnome.org>
15742 * interface.cs (Interface.PopulateIndexer): Add the indexer's
15743 PropertyBuilder to the `property_builders' list.
15745 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15746 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15747 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
15748 find any indexers which are inherited from an interface.
15750 2002-06-09 Martin Baulig <martin@gnome.org>
15752 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15753 the same type as the constant if necessary. There's also a test-130.cs
15756 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15758 * typemanager.cs (TypeManager.ChangeType): Previously known as
15759 Enum.ChangeEnumType().
15761 2002-06-09 Martin Baulig <martin@gnome.org>
15763 * expression.cs (Cast.TryReduce): Added support for consts.
15765 2002-06-08 Ravi Pratap <ravi@ximian.com>
15767 * class.cs (Accessor): Hold attributes information so we can pass
15770 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15771 Modify to pass in attributes attached to the methods.
15773 (add_accessor_declaration, remove_accessor_declaration): Ditto.
15775 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15776 to handle the Accessor kind :-)
15778 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15780 2002-06-08 Martin Baulig <martin@gnome.org>
15782 * expression.cs (Unary.TryReduceNegative): Added support for
15785 2002-06-08 Martin Baulig <martin@gnome.org>
15787 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15788 name can't be found in the `defined_names' - the caller will do a
15789 MemberLookup in this case and thus find methods in System.Enum
15790 such as Enum.IsDefined().
15792 2002-06-08 Martin Baulig <martin@gnome.org>
15794 * enum.cs (Enum.ChangeEnumType): This is a custom version of
15795 Convert.ChangeType() which works with TypeBuilder created types.
15796 (Enum.LookupEnumValue, Enum.Define): Use it here.
15798 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15799 `TypeBuilder.BaseType != null' check.
15800 (TypeContainer.FindMembers): Only lookup parent members if we
15801 actually have a parent.
15802 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15803 (ConstructorInitializer.Resolve): Likewise.
15805 * interface.cs (Interface.FindMembers): Added
15806 `TypeBuilder.BaseType != null' check.
15808 * rootcontext.cs (RootContext.ResolveCore): Added
15809 "System.Runtime.CompilerServices.IndexerNameAttribute" to
15810 classes_second_stage.
15812 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15813 debug_type and trace_type when compiling with --nostdlib.
15815 2002-06-07 Martin Baulig <martin@gnome.org>
15817 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15818 (AddField): Set it to true when adding a non-static field.
15819 (DefineType): Use `have_nonstatic_fields' to find out whether we
15820 have non-static fields, not `Fields != null'.
15822 2002-06-02 Miguel de Icaza <miguel@ximian.com>
15824 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15825 dereferencing a null on the static-field code path)
15827 2002-05-30 Martin Baulig <martin@gnome.org>
15829 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15830 to take command line arguments. Use reflection to call the new
15831 custom `Initialize' function on the symbol writer and pass it the
15832 command line arguments.
15834 * driver.cs (--debug-args): New command line argument to pass command
15835 line arguments to the symbol writer.
15837 2002-05-28 Miguel de Icaza <miguel@ximian.com>
15839 * assign.cs (DoResolve): Forgot to do the implicit conversion to
15840 the target type for indexers and properties. Thanks to Joe for
15843 2002-05-27 Miguel de Icaza <miguel@ximian.com>
15845 * typemanager.cs (MethodFlags): returns the method flags
15846 (Obsolete/ShouldIgnore) that control warning emission and whether
15847 the invocation should be made, or ignored.
15849 * expression.cs (Invocation.Emit): Remove previous hack, we should
15850 not do this on matching a base type, we should do this based on an attribute
15852 Only emit calls to System.Diagnostics.Debug and
15853 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15854 on the command line.
15856 * rootcontext.cs: Global settings for tracing and debugging.
15858 * cs-tokenizer.cs (define): New utility function to track
15859 defines. Set the global settings for TRACE and DEBUG if found.
15861 2002-05-25 Ravi Pratap <ravi@ximian.com>
15863 * interface.cs (Populate*): Pass in the TypeContainer as well as
15864 the DeclSpace as parameters so that we can create EmitContexts and
15865 then use that to apply attributes etc.
15867 (PopulateMethod, PopulateEvent, PopulateProperty)
15868 (PopulateIndexer): Apply attributes everywhere.
15870 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15873 (ApplyAttributes): Update accordingly.
15875 We now apply interface attributes for all members too.
15877 2002-05-26 Miguel de Icaza <miguel@ximian.com>
15879 * class.cs (Indexer.Define); Correctly check if we are explicit
15880 implementation (instead of checking the Name for a ".", we
15881 directly look up if the InterfaceType was specified).
15883 Delay the creation of the PropertyBuilder.
15885 Only create the PropertyBuilder if we are not an explicit
15886 interface implementation. This means that explicit interface
15887 implementation members do not participate in regular function
15888 lookups, and hence fixes another major ambiguity problem in
15889 overload resolution (that was the visible effect).
15891 (DefineMethod): Return whether we are doing an interface
15894 * typemanager.cs: Temporary hack until we get attributes in
15895 interfaces (Ravi is working on that) and we get IndexerName
15896 support in interfaces.
15898 * interface.cs: Register the indexers as properties.
15900 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15901 warning, I have verified that this is a bug in the .NET runtime
15902 (JavaScript suffers of the same problem).
15904 * typemanager.cs (MemberLookup): When looking up members for
15905 interfaces, the parent of an interface is the implicit
15906 System.Object (so we succeed in searches of Object methods in an
15907 interface method invocation. Example: IEnumerable x; x.ToString
15910 2002-05-25 Miguel de Icaza <miguel@ximian.com>
15912 * class.cs (Event): Events should also register if they do
15913 implement the methods that an interface requires.
15915 * typemanager.cs (MemberLookup); use the new GetInterfaces
15918 (GetInterfaces): The code used to lookup interfaces for a type is
15919 used in more than one place, factor it here.
15921 * driver.cs: Track the errors at the bottom of the file, we kept
15924 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15925 instance if the method we are calling is static!
15927 2002-05-24 Miguel de Icaza <miguel@ximian.com>
15929 * attribute.cs (ApplyAttributes): Make this function filter out
15930 the IndexerName attribute (as that attribute in reality is never
15931 applied) and return the string constant for the IndexerName
15934 * class.cs (TypeContainer.Emit): Validate that all the indexers
15935 have the same IndexerName attribute, and if so, set the
15936 DefaultName attribute on the class.
15938 * typemanager.cs: The return value might contain other stuff (not
15939 only methods). For instance, consider a method with an "Item"
15940 property and an Item method.
15942 * class.cs: If there is a problem with the parameter types,
15945 2002-05-24 Ravi Pratap <ravi@ximian.com>
15947 * ecore.cs (ImplicitConversionExists): Wrapper function which also
15948 looks at user defined conversion after making a call to
15949 StandardConversionExists - we need this for overload resolution.
15951 * expression.cs : Update accordingly the various method calls.
15953 This fixes 2 bugs filed against implicit user defined conversions
15955 2002-05-22 Miguel de Icaza <miguel@ximian.com>
15957 * statement.cs: Track the result of the assignment.
15959 2002-05-21 Miguel de Icaza <miguel@ximian.com>
15961 * expression.cs (MemberAccess): Improved error reporting for
15962 inaccessible members.
15964 2002-05-22 Martin Baulig <martin@gnome.org>
15966 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
15967 itself with debugging support.
15969 2002-05-22 Martin Baulig <martin@gnome.org>
15971 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15972 Removed, this isn't needed anymore.
15974 2002-05-20 Martin Baulig <martin@gnome.org>
15976 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15977 be underlying type for an enum.
15979 2002-05-20 Miguel de Icaza <miguel@ximian.com>
15981 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15982 that splits out the loading of just the core types.
15984 * rootcontext.cs (ResolveCore): Split the struct resolution in
15985 two, so we can load the enumeration underlying types before any
15988 * expression.cs (Is): Bandaid until we fix properly Switch (see
15989 bug #24985 for details).
15991 * typemanager.cs (ImplementsInterface): The hashtable will contain
15992 a null if there are no interfaces implemented.
15994 2002-05-18 Miguel de Icaza <miguel@ximian.com>
15996 * cs-parser.jay (indexer_declarator): It is fine to have array
15999 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16001 * typemanager.cs: (RegisterBuilder): New function used to register
16002 TypeBuilders that implement interfaces. Since
16003 TypeBuilder.GetInterfaces (as usual) does not work with lame
16005 (AddUserType): register interfaces.
16007 (ImplementsInterface): Use the builder_to_ifaces hash if we are
16008 dealing with TypeBuilder. Also, arrays are showing up as
16009 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16010 methods can not be invoked on them!
16012 * ecore.cs (ExplicitReferenceConversionExists): Made public.
16013 (ImplicitReferenceConversionExists): Split out from
16014 StandardConversionExists.
16016 * expression.cs (As): We were only implementing one of the three
16017 cases for the as operator. We now implement them all.
16018 (Is): Implement the various other cases for Is as well.
16020 * typemanager.cs (CACHE): New define used to control if we want or
16021 not the FindMembers cache. Seems to have a negative impact on
16022 performance currently
16024 (MemberLookup): Nested types have full acess to
16025 enclosing type members
16027 Remove code that coped with instance/static returns for events, we
16028 now catch this in RealFindMembers.
16030 (RealFindMembers): only perform static lookup if the instance
16031 lookup did not return a type or an event.
16033 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16035 * assign.cs (CompoundAssign): We pass more semantic information
16036 now to Compound Assignments than we did before: now we have all
16037 the information at hand, and now we resolve the target *before* we
16038 do the expression expansion, which allows the "CacheValue" method
16039 to have the effect we intended (before, a [x] += 1 would generate
16040 two differen ArrayAccess expressions from the ElementAccess,
16041 during the resolution process).
16043 (CompoundAssign.DoResolve): Resolve target and original_source here.
16045 2002-05-16 Miguel de Icaza <miguel@ximian.com>
16047 * expression.cs (ArrayAccess): dropped debugging information.
16049 * typemanager.cs: Small bug fix: I was always returning i_members,
16050 instead of one of i_members or s_members (depending on which had
16053 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
16054 method is invoked before any code generation takes place, and it
16055 is a mechanism to inform that the expression will be invoked more
16056 than once, and that the method should use temporary values to
16057 avoid having side effects
16059 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16061 * ecore.cs (Expression.CacheTemporaries): Provide empty default
16064 * expression.cs (Indirection, ArrayAccess): Add support for
16065 CacheTemporaries in these two bad boys.
16067 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16068 ldobj or ldind_ref.
16069 (StoreFromPtr): Handle stobj as well.
16071 * expression.cs (UnaryMutator): Share more code.
16073 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16074 down: I was not tracking the Filter function as well, which
16075 was affecting the results of the cache.
16077 2002-05-15 Miguel de Icaza <miguel@ximian.com>
16079 * attribute.cs: Remove the hack to handle the CharSet property on
16082 2002-05-14 Miguel de Icaza <miguel@ximian.com>
16084 * attribute.cs (DoResolve): More uglyness, we now only try to
16085 resolve the attribute partially, to extract the CharSet
16086 information (only if we are a StructLayout attribute). Otherwise
16088 (GetExtraTypeInfo): Add some code to conditionally kill in the
16089 future this. I am more and more convinced that the .NET
16090 framework has special code to handle the attribute setting on
16093 * expression.cs (IsParamsMethodApplicable): Revert my previous
16094 foreach change here, it was wrong.
16096 2002-05-13 Miguel de Icaza <miguel@ximian.com>
16098 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16099 (pp_expr): do not abort on unknown input, just return.
16100 (eval): abort if there are pending chars.
16102 * attribute.cs (Attribute.Resolve): Positional parameters are
16103 optional. Deal with that case.
16105 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16106 the Ansi/Unicode/Auto information for the type.
16108 (TypeContainer.DefineType): instantiate the EmitContext here, as
16109 we will be using it during the type definition (to resolve
16110 attributes) and during the emit phase.
16112 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16113 to pull type information out of the attributes
16115 (Attribute.Resolve): track the constructor builder, and allow for
16116 multiple invocations (structs and classes will use this).
16118 * ecore.cs (MemberLookupFinal): new version with all the
16119 parameters customizable.
16121 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16122 constructors. Return if the result value is null (as the error
16123 would have been flagged already by MemberLookupFinal)
16125 Do not allow instances of abstract classes or interfaces to be
16128 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16129 We have to compare the assembly property here when dealing with
16130 FamANDAssem and Assembly access modifiers, because we might be
16131 creating an assembly from *modules* (that means that we are not
16132 getting TypeBuilders for types defined in other modules that are
16133 part of this assembly).
16135 (Method.Emit): If the method is marked abstract and has a body,
16138 (TypeContainer.DefineMembers): If both the defined member and the
16139 parent name match are methods, then do not emit any warnings: let
16140 the Method.Define routine take care of flagging warnings. But if
16141 there is a mismatch (method overrides something else, or method is
16142 overriwritten by something, then emit warning).
16144 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16145 set to null, this means `do not check for the return type on the
16148 (Method.Define): set the return type for the method signature to
16149 null, so that we get methods with the same name and parameters and
16150 different return types. This is used to flag warning 114 (you are
16151 hiding a method, and you probably want to use the new/override
16154 * typemanager.cs (MemberLookup): Implemented proper access
16155 control, closing a long standing set of bug reports. The problem
16156 was that the Framework only has two bits: Public and NonPublic,
16157 and NonPublic includes private and protected methods, but we need
16158 to enforce the FamANDAssem, FamOrAssem and Family.
16160 2002-05-11 Miguel de Icaza <miguel@ximian.com>
16162 * statement.cs (GotoCase): Return true: Ammounts to giving up
16163 knowledge on whether we return or not, and letting the other case
16164 be responsible for it.
16166 2002-05-10 Miguel de Icaza <miguel@ximian.com>
16168 * driver.cs: Do not load directories for each file processed, only
16169 do it if there is a pattern.
16171 * ecore.cs: Report readonly assigns here as well, as we might have
16172 been resolved only by MemberAccess.
16174 (SimpleName.SimpleNameResolve): Also be useful for LValue
16175 resolution. We need this to propagate assign to local readonly variables
16177 * typemanager.cs: Use a ptrhashtable for the criteria, because we
16178 do not want to reuse potential criteria memory.
16180 * class.cs (MyEventBuilder): Set reflected_type;
16182 * ecore.cs (Constantify): Added support for constifying bools.
16184 (RootContext.LookupType): Added a cache for values looked up in
16185 the declaration space.
16187 * typemanager.cs (FindMembers): Now is a front-end to
16188 RealFindMembers, and provides a two-level hashtable-based cache to
16191 15% performance improvement: from 22.5 to 19.2 seconds.
16193 * expression.cs (IsParamsMethodApplicable): use foreach.
16194 (Invocation.DoResolve): ditto.
16195 (New.DoResolve): ditto.
16196 (ArrayCreation.DoResolve): ditto.
16198 * ecore.cs (FindMostEncompassingType): use foreach.
16200 * delegate.cs (NewDelegate.DoResolve): Use foreach
16202 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16203 (RemoveMethods): use foreach.
16205 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16206 nested foreach statements instead of for, and also break out of
16207 the inner loop once a match is found.
16209 (Invocation.OverloadResolve): Use foreach, simplify the code.
16211 2002-05-08 Miguel de Icaza <miguel@ximian.com>
16213 * cfold.cs (BinaryFold): During an enumeration evaluation context,
16214 we actually unwrap the expression to allow for extra information
16217 * expression.cs: Use Shr_Un on unsigned operations.
16219 2002-05-08 Ravi Pratap <ravi@ximian.com>
16221 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
16222 applicable operators was not being considered correctly. This closes
16223 the bug Miguel reported.
16225 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16227 * attribute.cs: check that the type derives from System.Attribute
16228 and report the correct error in that case (moved the duplicate code to
16229 its own method, too).
16231 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16233 * attribute.cs: lookup attribute type name as the spec says: first the
16234 bare attribute name and then name + "Attribute" (nant compiles with
16235 mcs after this fix).
16237 2002-05-07 Miguel de Icaza <miguel@ximian.com>
16239 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
16240 Because of the way we parse things, we should try to see if a
16241 UIntConstant can fit in an integer.
16243 2002-05-07 Ravi Pratap <ravi@ximian.com>
16245 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16246 when we are in an explicit context.
16248 (ConvertReferenceExplicit): When converting from Iface type S to Class
16249 T make sure the rules are implemented as an OR.
16251 * parameter.cs (ParameterType): Make it a property for now although the
16252 purpose really isn't anything immediate.
16254 * expression.cs (Is*Applicable): Do better checking on the parameter type
16255 of a ref/out parameter. The ones from the system assemblies are already
16256 marked with the correct type so we don't need to do any correction.
16258 * ecore.cs (StandardConversionExists): Conversion from Interface types to
16259 the object type is standard too so include that.
16261 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16263 * ecore.cs (StandardConversionExists): Augment with missing code:
16264 deal with IntConstant, LongConstants and Enumerations.
16266 * assign.cs: Report the error, instead of failing silently
16268 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16269 typecontainer that they are declared, because the
16270 typecontainer/namespace will have the list of using clauses that
16271 need to be applied.
16273 Assembly Attributes were escaping the normal registration
16276 (EmitCode): Apply attributes within an EmitContext that represents
16277 the container they were declared on.
16279 * cs-parser.jay: Track bases for structs. How did I get this wrong?
16281 2002-05-06 Ravi Pratap <ravi@ximian.com>
16283 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16284 Revamp completely - make much cleaner as we now operate only
16287 (FindMostSpecificSource, FindMostSpecificTarget): New methods
16288 to implement the logic detailed in the spec more correctly.
16290 (UserDefinedConversion): Update accordingly.
16292 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16294 * statement.cs: Return flow analysis information up.
16296 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16299 (token): Do not consume an extra character before calling
16302 2002-05-06 Piers Haken <piersh@friskit.com>
16304 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16306 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16308 * class.cs (Constructor.Emit): Set the IsStatic flag in the
16309 EmitContext during the instance constructor initializer
16310 resolution, to stop access to instance variables.
16312 This is mandated by the spec, last paragraph of the `constructor
16313 initializers' section.
16315 2002-05-05 Miguel de Icaza <miguel@ximian.com>
16317 * cs-parser.jay, class.cs (Accessor): new class used to represent
16318 an accessor (get or set). In the past we used `null' to represent
16319 a missing accessor. But this is ambiguous because there was no
16320 way to tell in abstract indexers/properties if one of them was
16323 Now there is a way of addressing that.
16325 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16326 instead of FindMembers.
16328 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16329 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16331 * attribute.cs: Treat indexers and properties as the same in terms
16332 of applying attributes
16334 * ecore.cs (FindMostEncompassedType): Use statically initialized
16335 EmptyExpressions()s like we do elsewhere to avoid creating useless
16336 objects (and we take this out of the tight loop).
16338 (GetConversionOperators): Move the code to extract the actual
16339 operators to a separate routine to clean things up.
16341 2002-05-04 Miguel de Icaza <miguel@ximian.com>
16343 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16344 events are always registered FieldBuilders.
16346 * class.cs (FieldBase): New class shared by Fields
16348 * delegate.cs: If we are a toplevel delegate, use our full name.
16349 If we are a nested delegate, then only use our tail name.
16351 2002-05-02 Ravi Pratap <ravi@ximian.com>
16353 * expression.cs (IsApplicable): Ensure that we add the "&" to
16354 ref/out types before comparing it with the type of the argument.
16356 (IsParamsMethodApplicable): Ditto.
16358 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
16361 * delegate.cs : Handle the case when we have more than one applicable
16362 method. Flag an error only when we finish checking all.
16364 2002-05-02 Miguel de Icaza <miguel@ximian.com>
16366 * expression.cs: Add support for boolean static initializers.
16368 2002-05-01 Miguel de Icaza <miguel@ximian.com>
16370 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16372 * parameter.cs (ComputeParameterTypes,
16373 ComputeAndDefineParameterTypes): Better error handling: now we
16374 clear the `types' cache if we fail during any of the type lookups.
16375 We also return the status code correctly to our caller
16377 * delegate.cs: If we fail to define a delegate, abort the extra
16380 * expression.cs (Binary.ResolveOperator): for
16381 operator==(object,object) and operator !=(object, object) we also
16382 have to verify that there is an implicit conversion from one to
16385 (ArrayAccess.DoResolve): Array Access can operate on
16388 2002-04-30 Miguel de Icaza <miguel@ximian.com>
16390 * assign.cs (CompoundAssign): A new class used as a "flag" that
16391 the assignment actually is happening as part of a compound
16392 assignment operator.
16394 During compound assignment, a few new rules exist to enable things
16401 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16402 to the type of x) if y is implicitly convertible to the type of x,
16403 and the operator is a builtin operator and the return type of the
16404 operator is explicitly convertible to the type of x.
16406 * rootcontext.cs: Reset warning level to 2. 4 catches various
16407 "interesting" features in mcs, we must clean this up at some
16408 point, but currently am trying to kill other bugs ;-)
16410 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16411 in container classes as well.
16413 * expression.cs (Binary.ResolveOperator): Handle string case
16414 before anything else (as operator overloading does emit an error
16415 before doing anything else).
16417 This code could go away when we move to a table driven model, but
16418 i could not come up with a good plan last night.
16420 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
16422 * typemanager.cs (CSharpName): reimplementation using regex.
16423 * class.cs: added null check for fields in Emit
16424 * rootcontext.cs: set warninglevel to 4
16426 2002-04-29 Miguel de Icaza <miguel@ximian.com>
16428 * typemanager.cs (CSharpName): reimplemented with Lupus
16431 2002-04-28 Miguel de Icaza <miguel@ximian.com>
16433 * statement.cs (If): correclty implement Resolve, because we were
16434 not catching sem errors in there. The same process is needed
16436 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16439 (Statement.Warning_DeadCodeFound): Factorize code.
16440 (While): Report dead code here too.
16442 (Statement): Added Resolve virtual method to allow
16443 for resolution split from the emit code.
16445 2002-04-26 Miguel de Icaza <miguel@ximian.com>
16447 * statement.cs (EmitBoolExpression): No longer try to resolve the
16449 (MakeBoolean): New utility function that resolve, implicitly
16450 converts to boolean and tags the expression.
16453 (If, Do): Implement dead code elimination.
16454 (While): Implement loop inversion
16456 (Do, While, For, If): Resolve the expression prior to calling our
16459 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
16462 - added method Report28 (warning: program has more than one entry point)
16463 - added method IsEntryPoint, implements paragraph 10.1 of the spec
16464 - modified method Method.Define, the part at the end of the method
16466 * rootcontext.cs: added static public Location EntryPointLocation;
16468 * ../errors/cs0028.cs : Add test case for the above warning.
16471 - modified method CSharpName to allow arrays of primitive type to
16472 be printed nicely (e.g. instead of System.Int32[][] it now prints
16474 - added method CSharpSignature: returns the signature of a method
16475 in string format to be used in reporting errors, warnings, etc.
16477 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16480 2002-04-26 Ravi Pratap <ravi@ximian.com>
16482 * delegate.cs (Define): Fix extremely silly bug where I was
16483 setting the type of the 'object' parameter of the BeginInvoke
16484 method to System.IAsyncResult instead of System.Object ;-)
16486 2002-04-26 Miguel de Icaza <miguel@ximian.com>
16488 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16491 (Constructor.Emit): return if we fail to initialize the
16492 constructor. Another door closed!
16494 * expression.cs (New.DoResolve): Improve error message (from -6 to
16495 1501). Use DeclaredOnly lookup to find the exact constructor.
16497 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16498 loop. This is useful.
16500 * cs-parser.jay: Adjust the default parameters so that destructors
16501 have the proper signature.
16503 2002-04-26 Martin Baulig <martin@gnome.org>
16505 * driver.cs (LoadAssembly): If `assembly' contains any characters
16506 which are only valid in path names and not in assembly names
16507 (currently slash, backslash and point), use Assembly.LoadFrom ()
16508 instead of Assembly.Load () on the `assembly' (before iteration
16509 over the link_paths).
16511 2002-04-26 Martin Baulig <martin@gnome.org>
16513 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
16515 2002-04-25 Miguel de Icaza <miguel@ximian.com>
16517 * class.cs (Property): use the new typemanager.MemberLookup
16519 (TypeContainer.MemberLookup): Implement using the
16520 TypeManager.MemberLookup now.
16522 * typemanager.cs: Make MemberLookup a function of the TypeManager,
16523 and return MemberInfos, so that these can be used without an
16524 EmitContext (what we had before).
16526 2002-04-24 Miguel de Icaza <miguel@ximian.com>
16528 * expression.cs: Fix the case where the argument to params if the
16529 type of the params. I omitted handling this before. Fixed
16531 2002-04-22 Miguel de Icaza <miguel@ximian.com>
16533 * driver.cs: Call BootCorlib_PopulateCoreType
16535 * class.cs (Property.CheckBase): Check for properties only, not
16538 * interface.cs: Temporary hack: try/catch around the
16539 CustomAttributeBuilder, because I am getting an exception that I
16542 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
16543 types whose definitions are required to be there (attributes are
16544 defined before standard types).
16546 Compute definitions as we boot the various types, as they are used
16547 immediately (value_type class will need object_type, but if we do
16548 not initialize object_type, we will pass a null, which will let
16549 the runtime pick the System.Object from the existing corlib, which
16550 is not what we want).
16552 2002-04-22 Patrik Torstensson <totte@labs2.com>
16554 * cs-tokenizer.cs: fixed a number of trim() issues.
16556 2002-04-22 Ravi Pratap <ravi@ximian.com>
16558 * expression.cs (Argument.Type): Ensure that we return the correct
16559 type when we have out or ref parameters [in which case we
16562 2002-04-22 Miguel de Icaza <miguel@ximian.com>
16564 * class.cs (Property, Indexer): Allow extern modifier in there.
16566 * typemanager.cs (InitBaseTypes): Initializes object_type and
16567 value_type, since those will be used early on during the bootstrap
16568 process to compile corlib.
16570 (InitCoreTypes): Move code from here to InitBaseTypes.
16572 2002-04-21 Miguel de Icaza <miguel@ximian.com>
16574 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
16575 single-dimension arrays as using the ldlen opcode.
16577 Daniel Lewis discovered this optimization.
16579 * typemanager.cs: Add signature for System.Array::get_Length
16581 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16583 * statement.cs: report the error when the foreach does not apply to an
16584 array nor a collection.
16586 2002-04-19 Miguel de Icaza <miguel@ximian.com>
16588 * expression.cs: Add implicit conversions to the operator ~.
16590 * constant.cs (DecimalConstant.Emit): Emit decimal value.
16592 * typemanager.cs: Locate the decimal constructor.
16594 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16596 * attribute.cs: use the new property of TypeOf.
16597 * expression.cs: added 'get' property around typearg.
16599 These changes fix a build breaker reported by NickD. Is this the
16600 correct way to fix? If not, please, revert my changes and make it
16603 2002-04-17 Miguel de Icaza <miguel@ximian.com>
16605 * attribute.cs: Add support for typeof in attribute invocations.
16606 I am not sure that this is right though.
16608 2002-04-14 Duncan Mak <duncan@ximian.com>
16610 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16611 Binary.Operator.Division case.
16613 2002-04-13 Ravi Pratap <ravi@ximian.com>
16615 * class.cs (DefineType): Ensure that we do a proper check on
16616 attribute types and also register it with the TypeManager.
16618 (TypeContainer.Targets): The default for attribute types is
16619 AttributeTargets.All.
16621 * attribute.cs (ApplyAttributes): Registering the attribute type
16622 is done elsewhere, not when we discover we have a Usage attribute.
16624 2002-04-12 Ravi Pratap <ravi@ximian.com>
16626 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16627 and get rid of is_delegate parameter.
16629 * everywhere : update.
16631 2002-04-12 Ravi Pratap <ravi@ximian.com>
16633 * cs-parser.jay (compilation_unit): Revamp completely to use
16634 some new ideas that I got from Rhys' grammar to solve the problems
16635 with assembly level attributes.
16637 (outer_declaration): New grammar production.
16639 (attribute_sections): Add.
16641 (opt_attributes): Base on attribute_sections
16643 (namespace_declaration): Allow opt_attributes to tackle the case
16644 when we have assembly level attributes - we are clever in this
16647 * attribute.cs (ApplyAttributes): Do not worry about assembly
16648 attributes in the non-global context.
16650 * rootcontext.cs (AddGlobalAttributes): Go back to using this
16651 instead of SetGlobalAttributes.
16653 * class.cs, rootcontext.cs : Ensure we define and generate
16654 attribute types before anything else.
16656 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16657 and flag the new error -20 for the case when the attribute type
16658 does not have valid targets specified. csc does not catch this.
16660 * ../errors/errors.txt : update for error # -20
16662 2002-04-11 Ravi Pratap <ravi@ximian.com>
16664 * support.cs (InternalParameters.ParameterModifier): Do some null
16665 checking and return sane values.
16667 * class.cs (Method.Define): If we are a PInvoke method, ensure
16668 that we are static and extern. Report error # 601
16670 * ../errors/cs0601.cs : Add test case for the above error.
16672 2002-04-07 Ravi Pratap <ravi@ximian.com>
16674 * rootcontext.cs (attribute_types): We need to keep type of
16675 all attribute types separately and emit code for them first.
16677 (RegisterAttribute) : Implement.
16679 * class.cs (DefineType): Check if the current Type is a custom
16680 attribute type and register it accordingly.
16682 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16683 adding the first attribute twice and rename to
16685 (SetGlobalAttributes): this.
16687 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16690 * attribute.cs (ApplyAttributes): Take an additional argument telling us
16691 if we are processing global arguments. Hmm, I am unsure of this.
16693 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16695 * expression.cs: added static array of strings to avoid calling
16696 Enum.ToString () for Operator in Binary. Significant recover of
16699 2002-04-10 Miguel de Icaza <miguel@ximian.com>
16701 * class.cs (FindMembers): Allow the Builders of the various
16702 members to be null. If they are skip them. This only happens
16703 during the PInvoke declaration.
16705 2002-04-09 Miguel de Icaza <miguel@ximian.com>
16707 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16708 failure, so we do not keep going afterwards.
16710 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16711 wanted to pass `false' as the `is_delegate' argument. If this is
16712 the case, why not use delegate_type == null to mean `is_delegate =
16713 false' and anything else as is_delegate = true.
16715 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
16717 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16718 code for the section, not the beginning of the tests.
16720 2002-04-08 Miguel de Icaza <miguel@ximian.com>
16722 * cfold.cs: Handle operator + (Enum x, Underlying x)
16724 * expression.cs (Binary): same. Warn about errors where we have
16725 Enum/Enum in operator + as well.
16727 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
16730 - added support for switch(bool)
16731 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16732 - add TableSwitchEmit() to handle table-based switch statements
16734 2002-04-05 Ravi Pratap <ravi@ximian.com>
16736 * expression.cs (Invocation.OverloadResolve): Factor out code which
16737 does parameter compatibility checking with arguments so that we can
16738 re-use the code even from Delegate.VerifyApplicability
16740 (VerifyArgumentsCompat): Move above code here.
16742 * delegate.cs (VerifyApplicability): Get rid of duplicate code
16743 and instead make a call to the above method.
16745 2002-03-31 Ravi Pratap <ravi@ximian.com>
16747 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16748 We use it to keep track of classes which are attribute types.
16750 2002-04-02 Miguel de Icaza <miguel@ximian.com>
16752 * delegate.cs (Delegate.Define): Correctly define the types in the
16753 presence of fixed and array parameters.
16755 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16758 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16759 include NonPublic after the first iteration.
16761 * class.cs (Indexer.CheckBase): Only check if both parents are
16764 * cs-parser.jay (accessor_body): If empty, set to null.
16766 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16767 same code path here to resolve constants names that we did have in
16768 MemberAccess.DoResolve. There is too much code duplicated here.
16770 2002-04-01 Miguel de Icaza <miguel@ximian.com>
16772 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16774 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16777 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16778 tokens, numbers and strings.
16780 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16783 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16784 asyncronous parameters and the regular parameters.
16786 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16787 specify the target directory.
16789 * expression.cs: (This.DoResolve): Simplify
16790 (As.Emit): Optimize, do not generate IsInst if the expression is
16791 always of the given type.
16793 (Is.DoResolve): Bug fix, we were reporting both always/never for
16796 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16797 creating too many unnecessary arrays.
16799 2002-03-31 Miguel de Icaza <miguel@ximian.com>
16801 * class.cs (EmitFieldInitializer): Use Assign expression to assign
16802 fields instead of rolling our own initializer. Takes care of all
16803 implicit conversions, and drops unnecessary static checks/argument.
16805 2002-03-31 Dick Porter <dick@ximian.com>
16807 * driver.cs: use the GetDirectories() return values properly, and
16808 use "/" as path separator.
16810 2002-03-30 Miguel de Icaza <miguel@ximian.com>
16812 * expression.cs (Unary): Optimize - - expr into expr.
16813 (Binary): Optimize a + (-b) into a -b.
16815 * codegen.cs (CodeGen): Made all methods static.
16817 2002-03-29 Miguel de Icaza <miguel@ximian.com>
16821 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16822 TypeBuilder property.
16824 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16827 * tree.cs: Removed the various RecordXXXX, and replaced with a
16828 single RecordDecl. Removed all the accessor methods, and just
16829 left a single access point Type
16831 * enum.cs: Rename DefineEnum to DefineType.
16833 * decl.cs: New abstract method `DefineType' used to unify the
16834 Defines for Enumerations, Interfaces, TypeContainers and
16837 (FindType): Moved LookupInterfaceOrClass here. Moved the
16838 LookupBaseClasses method that used to live in class.cs and
16839 interface.cs here, and renamed to FindType.
16841 * delegate.cs: Implement DefineType. Take advantage of the
16842 refactored pattern for locating the parent builder without taking
16843 the parent_builder argument (which we know does not work if we are
16844 nested, and triggering a toplevel definition).
16846 2002-03-28 Miguel de Icaza <miguel@ximian.com>
16848 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16849 accessibility of a member has changed during override and report
16852 * class.cs (Method.Define, Property.Define): Only complain on
16853 overrides if the method is private, any other accessibility is
16854 fine (and since we just checked the permission is the same, we are
16857 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16858 and elif are processed always. The other pre-processing
16859 directives are only processed if we are "taking" the path
16861 2002-03-29 Martin Baulig <martin@gnome.org>
16863 * class.cs (Method.Emit): Only emit symbolic debugging info if the
16864 current location is not Null.
16866 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16867 a separate method so we can profile it.
16869 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16870 `span.Seconds' are just seconds, but no minutes or hours.
16871 (MainDriver): Profile the CodeGen.SaveSymbols calls.
16873 2002-03-28 Miguel de Icaza <miguel@ximian.com>
16875 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16876 Remove the gratuitous set of Final:
16878 // If an interface implementation, then we can set Final.
16879 if (((flags & MethodAttributes.Abstract) == 0) &&
16880 implementing.DeclaringType.IsInterface)
16881 flags |= MethodAttributes.Final;
16883 I do not know what I was smoking when I used that.
16886 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16887 step into fixing the name resolution issues for delegates and
16888 unifying the toplevel name resolution.
16890 2002-03-28 Martin Baulig <martin@gnome.org>
16892 * class.cs (Method.Emit): If we have a symbol writer, call its
16893 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16894 tell it about the current method.
16896 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16897 writer that we're going to emit the first byte of IL code for a new
16898 statement (a new source line).
16899 (EmitContext.EmitTopBlock): If we have a symbol writer, call
16900 EmitContext.Mark() before emitting any code.
16902 * location.cs (SymbolDocument): Return null when we're Null.
16904 * statement.cs (Statement): Moved the `Location loc' variable here.
16905 (Statement.EmitBoolExpression): If we have a symbol writer, call
16906 ec.Mark() before emitting any code to tell it that we're at the
16907 beginning of a new statement.
16908 (StatementExpression): Added `Location' argument to the constructor.
16909 (Block): Added public readonly variable `StartLocation' and public
16910 variable `EndLocation'. The latter is to be set using SetEndLocation().
16911 (Block): Added constructor which takes a start and end location.
16912 (Block.SetEndLocation): New method. This sets the end location.
16913 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16914 local variables we create.
16915 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16916 each statement and do also mark the begin and end of the block.
16918 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16919 tell it the current lexer.Location, use Location.Null for the end of the
16921 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16922 current block, set its end location using SetEndLocation().
16923 (statement_expression): StatementExpression constructor now takes the
16924 lexer.Location as additional argument.
16925 (for_statement, declare_local_variables): Likewise.
16926 (declare_local_variables): When creating a new implicit block, use the
16927 new Block constructor and pass it the lexer.Location.
16929 2002-03-28 Miguel de Icaza <miguel@ximian.com>
16931 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16932 members also on the parent interfaces recursively.
16934 2002-03-27 Miguel de Icaza <miguel@ximian.com>
16936 * report.cs: Use new formats, since Gonzalo finished the missing
16939 * expression.cs (Binary.ResolveOperator): added missing operator|
16940 operator& and operator^ for bool/bool.
16942 * cs-parser.jay: CheckDef now takes a Location argument that is
16943 used to report errors more precisly (instead of reporting the end
16944 of a definition, we try to track something which is a lot closer
16945 to the source of the problem).
16947 * cs-tokenizer.cs: Track global token use, so we can properly flag
16948 the use of #define/#undef after the first token has been seen.
16950 Also, rename the reportXXXX to Error_DescriptiveName
16952 * decl.cs (DeclSpace.IsTopLevel): Move property here from
16953 TypeContainer, so that Enum and Interface can use this too.
16955 * class.cs (TypeContainer.LookupInterfaceOrClass,
16956 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16957 `builder' argument. Typically this was used to pass the parent
16958 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16961 The problem is that a nested class could trigger the definition of
16962 a toplevel class, and the builder would be obviously wrong in that
16965 So we drop this argument, and we compute dynamically the
16966 TypeBuilder/ModuleBuilder (the correct information was available
16967 to us anyways from DeclSpace.Parent)
16969 * interface.cs (Interface.DefineInterface): Drop builder
16970 parameter cleanup like class.cs
16972 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
16975 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16978 (Try.Emit): Propagate the returns value from the statement.
16980 (Return.Emit): Even if we are leavning
16982 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16984 * modifiers.cs: Fix the computation of MethodAttributes flags.
16986 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16988 * driver.cs: allow compilation of files that start with '/'.
16989 Add a default case when checking the argument of --target.
16991 2002-03-25 Miguel de Icaza <miguel@ximian.com>
16993 * interface.cs: Implement the same search algorithm for types in
16994 the interface code.
16996 * delegate.cs: Do not allow multiple definition.
16998 * Recovered ChangeLog that got accidentally amputated
17000 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17002 * rootcontext.cs: Load manually enum to allow core classes to
17003 contain enumerations.
17005 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17006 Update to new static methods in TypeManager.
17008 * typemanager.cs (GetMethod, GetConstructor): Use our
17009 implementation of FindMembers to find the members, since during
17010 corlib compilation, the types are TypeBuilders and GetMethod and
17011 GetConstructor do not work.
17013 Make all methods in TypeManager static.
17015 (InitCodeHelpers): Split the functionality from
17016 the InitCodeTypes function.
17018 * driver.cs: Call InitCodeHelpers after we have populated the
17021 * cs-parser.jay (delegate_declaration): we did not used to compute
17022 the delegate name correctly for void delegates.
17024 2002-03-24 Miguel de Icaza <miguel@ximian.com>
17026 * rootcontext.cs (RootContext): Init the interface_resolve_order
17027 and type_container_resolve_order always.
17029 (ResolveCore, BootstrapCorlib_ResolveClass,
17030 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17031 compiler when compiling with --nostdlib
17033 * class.cs (TypeContainer.DefineType): Check that our parent is
17034 not null. This test is most important when we are bootstraping
17037 * codegen.cs: Split out the symbol writing code.
17039 2002-03-25 Martin Baulig <martin@gnome.org>
17041 * driver.cs (-g): Made -g an alias for --debug.
17043 2002-03-24 Martin Baulig <martin@gnome.org>
17045 * codegen.cs (SymbolWriter): New public variable. Returns the
17046 current symbol writer.
17047 (CodeGen): Added `bool want_debugging_support' argument to the
17048 constructor. If true, tell the ModuleBuild that we want debugging
17049 support and ask it for the ISymbolWriter.
17050 (Save): If we have a symbol writer, call it's Close() method after
17051 saving the assembly.
17053 * driver.c (--debug): New command line argument to create a
17054 debugger information file.
17056 * location.cs (SymbolDocument): New public property. Returns an
17057 ISymbolDocumentWriter object for the current source file or null
17058 if we don't have a symbol writer.
17060 2002-03-21 Miguel de Icaza <miguel@ximian.com>
17062 * driver.cs (LoadAssembly): Correctly return when all the paths
17063 have been tried and not before.
17065 * statement.cs (Switch.Emit): return the actual coverage for this
17066 statement (returns/not-returns)
17068 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17069 switch of the statement if we are the last switch section. That
17070 kills two problems: try/catch problems (we used to emit an empty
17071 nop at the end) and switch statements where all branches would
17074 2002-03-19 Miguel de Icaza <miguel@ximian.com>
17076 * driver.cs: Add default assemblies (the equivalent to the
17077 Microsoft CSC.RSP file)
17079 * cs-tokenizer.cs: When updating `cols and setting it to zero,
17080 also update tokens_seen and set it to false.
17082 * driver.cs: Implement --recurse for Mike.
17084 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17085 correctly splitting out the paths.
17087 2002-03-18 Miguel de Icaza <miguel@ximian.com>
17089 * interface.cs (Interface.PopulateProperty): Instead of using
17090 `parent' as the declaration space for the set parameters, use
17093 * support.cs (InternalParameters): InternalParameters constructor
17094 takes a DeclSpace instead of a TypeContainer.
17096 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17097 types are being initialized, load the address of it before calling
17100 (New): Provide a mechanism to disable the generation of local
17101 value type temporaries when the caller will be providing us with
17102 an address to store it.
17104 (ArrayCreation.EmitDynamicInitializers): Use it.
17106 2002-03-17 Miguel de Icaza <miguel@ximian.com>
17108 * expression.cs (Invocation.EmitArguments): Only probe for array
17109 property if there is more than one argument. Sorry about that.
17111 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17112 empty param arrays.
17114 * class.cs (Method.LabelParameters): Fix incorrect code path that
17115 prevented the `ParamArrayAttribute' from being applied to the
17118 2002-03-16 Miguel de Icaza <miguel@ximian.com>
17120 * support.cs (ReflectionParameters): Correctly compute whether the
17121 last argument is a params array. Fixes the problem with
17124 * typemanager.cs: Make the assemblies array always be non-null
17125 (empty, but non-null)
17127 * tree.cs (RecordDecl): New function that abstracts the recording
17128 of names. This reports error 101, and provides a pointer to the
17129 previous declaration. Fixes a crash in the compiler.
17131 * cs-parser.jay (constructor_declaration): Update to new grammar,
17132 and provide a constructor_body that can be empty.
17134 2002-03-15 Miguel de Icaza <miguel@ximian.com>
17136 * driver.cs: Add support for --resources.
17138 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17139 Make all types for the various array helper methods be integer.
17141 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17142 CheckState to ConvCast.
17144 (ConvCast): Now it takes a `checked' state argument, to avoid
17145 depending on the emit context for the conversion, and just using
17146 the resolve time setting.
17148 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17149 instead of Invocation.EmitArguments. We do not emit the original
17150 arguments, instead we emit those which have been converted to
17151 unsigned int expressions.
17153 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17155 * codegen.cs: ditto.
17157 * expression.cs (LocalVariableReference): Drop the use of the
17158 Store function that depended on the variable index.
17160 * statement.cs (VariableInfo): Drop the `Idx' property from this
17161 class, as this is not taking into account the indexes for
17162 temporaries tat we generate during the execution, getting the
17165 * class.cs: First emit class initializers, then call the parent
17168 * expression.cs (Binary): Fix opcode emision.
17169 (UnaryMutator.EmitCode): Support checked code generation
17171 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17172 matches for events for both the Static and Instance scans,
17173 pointing to the same element. Fix that.
17175 2002-03-14 Miguel de Icaza <miguel@ximian.com>
17177 * rootcontext.cs (ResolveTree): Always set the
17178 interface_resolve_order, because nested interfaces will be calling
17181 * class.cs (GetInterfaceOrClass): Track the same resolution
17182 process used by TypeManager.LookupType. This fixes the nested
17183 type lookups in class declarations (separate path from
17186 (TypeContainer.DefineType): Also define nested interfaces.
17187 (TypeContainer.RegisterOrder): New public function used to
17188 register the order in which child interfaces need to be closed.
17190 Nested interfaces need to be closed after their parents have been
17193 * interface.cs (InterfaceAttr): Put all the logic for computing
17194 the interface attribute here.
17196 (DefineInterface): Register our interface order with the
17197 RootContext or with the TypeContainer depending on the case.
17199 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17201 * cs-parser.jay: rework foreach statement to work with the new
17202 changes to the policy on SimpleNames.
17204 * report.cs: support Stacktrace on warnings as well.
17206 * makefile: drop --unsafe and /unsafe from the compile.
17208 2002-03-13 Ravi Pratap <ravi@ximian.com>
17210 * ecore.cs (StandardConversionExists): Modify to take an Expression
17211 as the first parameter. Ensure we do null -> reference type conversion
17214 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17215 temporary Expression objects.
17217 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17219 * interface.cs: workaround bug in method overloading resolution
17220 (there is already a bugzilla bug for it).
17222 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17224 We could also solve this problem by having a separate path for
17225 performing type lookups, instead of DoResolve, we could have a
17226 ResolveType entry point, and only participating pieces of the
17227 production (simplename, deref, array) would implement this.
17229 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17230 signal SimpleName to only resolve type names and not attempt to
17231 resolve anything else.
17233 * expression.cs (Cast): Set the flag.
17235 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17237 * class.cs: Only report 108 if there is no `new' modifier.
17239 * cs-parser.jay: rework foreach statement to work with the new
17240 changes to the policy on SimpleNames.
17242 * report.cs: support Stacktrace on warnings as well.
17244 * makefile: drop --unsafe and /unsafe from the compile.
17246 2002-03-11 Miguel de Icaza <miguel@ximian.com>
17248 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17249 lookups here, instead of doing that at parse time. This means
17250 that our grammar will not introduce `LocalVariableReferences' as
17251 expressions at this point. That solves the problem of code like
17255 static void Main ()
17259 This is only half the fix. The full fix requires parameters to
17260 also be handled in this way.
17262 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17263 makes the use more obvious of the DeclSpace. The
17264 ec.TypeContainer.TypeBuilder is now only used to pull the
17265 TypeBuilder for it.
17267 My theory is that I can get rid of the TypeBuilder completely from
17268 the EmitContext, and have typecasts where it is used (from
17269 DeclSpace to where it matters).
17271 The only pending problem is that the code that implements Aliases
17272 is on TypeContainer, and probably should go in DeclSpace.
17274 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17275 lookups here, instead of doing that at parse time. This means
17276 that our grammar will not introduce `LocalVariableReferences' as
17277 expressions at this point. That solves the problem of code like
17281 static void Main ()
17285 This is only half the fix. The full fix requires parameters to
17286 also be handled in this way.
17288 * class.cs (Property.DefineMethod): When implementing an interface
17289 method, set newslot, when implementing an abstract method, do not
17290 set the flag (before we tried never setting it, or always setting
17291 it, which is the difference).
17292 (Indexer.DefineMethod): same.
17293 (Method.DefineMethod): same.
17295 * ecore.cs: Only set the status used flag if we get back a Field.
17297 * attribute.cs: Temporary hack, so Paolo can keep working.
17299 2002-03-08 Ravi Pratap <ravi@ximian.com>
17301 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17302 the unmanaged type in the case we have a MarshalAs attribute.
17304 (Resolve): Handle the case when we are parsing the special MarshalAs
17305 attribute [we need to store the unmanaged type to use later]
17307 * typemanager.cs (marshal_as_attr_type): Built in type for the
17308 MarshalAs Attribute.
17310 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
17311 on parameters and accordingly set the marshalling info.
17313 2002-03-09 Miguel de Icaza <miguel@ximian.com>
17315 * class.cs: Optimizing slightly by removing redundant code after
17316 we switched to the `NoTypes' return value.
17317 (Property.DefineMethod): use NoTypes here too.
17319 This fixes the bug I introduced in my last batch of changes.
17321 2002-03-05 Ravi Pratap <ravi@ximian.com>
17323 * tree.cs (RecordEnum): Add. We now keep track of enums too.
17325 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17326 Enums since those are types too.
17328 * cs-parser.jay (enum_declaration): Record enums as we parse them.
17330 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
17331 thanks to a call during the lookup process.
17333 2002-03-07 Miguel de Icaza <miguel@ximian.com>
17335 * statement.cs (Foreach): Lots of work to accomodate a particular
17336 kind of foreach statement that I had not kept in mind. It is
17337 possible to have foreachs on classes that provide a GetEnumerator
17338 method that return objects that implement the "pattern" for using
17339 a foreach, there is no need to support GetEnumerator
17342 This is needed to compile nant.
17344 * decl.cs: Only report 114 if the member is not `Finalize' and if
17345 the warning level is at least 2.
17347 * class.cs: Moved the compare function from Method to
17350 (MethodSignature.InheritableMemberSignatureCompare): Add new
17351 filter function that is used to extract inheritable methods from a
17354 (Method.Define): Use the new `inheritable_method_signature_filter'
17357 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17360 2002-03-06 Miguel de Icaza <miguel@ximian.com>
17362 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17364 * cs-parser.jay: Add opt_semicolon to the interface declaration.
17366 * expression.cs: Pass location information to
17367 ConvertImplicitStandard.
17369 * class.cs: Added debugging code to track return values from
17372 2002-03-05 Miguel de Icaza <miguel@ximian.com>
17374 * expression.cs (Is.DoResolve): If either side of the `is' is an
17375 interface, do not flag the warning.
17377 * ecore.cs (ImplicitReferenceConversion): We need a separate test
17380 * report.cs: Allow for --fatal to be used with --probe.
17382 * typemanager.cs (NoTypes): Move the definition for the empty Type
17385 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17387 (TypeContainer.DefineProxy): New function used to proxy to parent
17388 implementations when implementing interfaces.
17389 (TypeContainer.ParentImplements): used to lookup if our parent
17390 implements a public function that is required by an interface.
17391 (TypeContainer.VerifyPendingMethods): Hook this up.
17393 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17394 `modules' and `assemblies' arraylists into arrays. We only grow
17395 these are the very early start up of the program, so this improves
17396 the speedof LookupType (nicely measured).
17398 * expression.cs (MakeByteBlob): Replaced unsafe code with
17399 BitConverter, as suggested by Paolo.
17401 * cfold.cs (ConstantFold.Binary): Special case: perform constant
17402 folding of string concatenation, but if either side is a string,
17403 and the other is not, then return null, and let the runtime use
17404 the concatenation on the string plus the object (using
17405 `Object.ToString').
17407 2002-03-04 Miguel de Icaza <miguel@ximian.com>
17409 Constant Folding has been implemented now.
17411 * expression.cs (Unary.Reduce): Do not throw an exception, catch
17412 the error instead on types that are not supported in one's
17415 * constant.cs (Constant and all children): New set of functions to
17416 perform implict and explicit conversions.
17418 * ecore.cs (EnumConstant): Implement the new functions to perform
17419 conversion by proxying to the child expression.
17421 * codegen.cs: (ConstantCheckState): Constant evaluation has its
17422 own separate setting that can not be turned off from the command
17423 line using --unchecked or --checked and is only controlled using
17424 the checked/unchecked statements and expressions. This setting is
17425 used by the constant folder to flag errors.
17427 * expression.cs (CheckedExpr, UncheckedExpr): Set the
17428 ConstantCheckState as well.
17430 During Resolve, they also have to flag the state, because the
17431 constant folder runs completely in the Resolve phase.
17433 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17436 2002-03-01 Miguel de Icaza <miguel@ximian.com>
17438 * cfold.cs: New file, this file contains the constant folder.
17440 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17441 argument to track whether we are using the resulting address to
17442 load or store a value and provide better error messages.
17444 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17445 new AddressOf arguments.
17447 * statement.cs (Foreach.EmitCollectionForeach): Update
17449 * expression.cs (Argument.Emit): Call AddressOf with proper
17450 arguments to track usage.
17452 (New.DoEmit): Call AddressOf with new arguments.
17454 (Unary.Emit): Adjust AddressOf call.
17456 2002-03-01 Ravi Pratap <ravi@ximian.com>
17458 * cs-parser.jay (member_access): Change the case for pre-defined types
17459 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
17462 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17465 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17466 essentially like methods and apply attributes like MethodImplOptions to them too.
17468 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17471 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17472 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17475 * Update code everywhere accordingly.
17477 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17479 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17481 2002-02-28 Ravi Pratap <ravi@ximian.com>
17483 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17484 try performing lookups against those instead of jumping straight into using
17485 the 'using' clauses.
17487 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17489 (LookupType): Perform lookups in implicit parents too.
17491 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17492 sequence as RootContext.LookupType.
17494 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
17495 the various cases of namespace lookups into this method.
17497 2002-03-01 Miguel de Icaza <miguel@ximian.com>
17499 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17500 in positional arguments)
17502 * class.cs (Operator): Update the AllowedModifiers to contain
17505 * cs-parser.jay: Update operator declaration to allow for the
17506 operator body to be empty.
17508 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
17511 2002-02-27 Miguel de Icaza <miguel@ximian.com>
17513 * class.cs (Method.Emit): Label parameters.
17515 * driver.cs: Return 1 or 0 as the program exit code.
17517 2002-02-26 Miguel de Icaza <miguel@ximian.com>
17519 * expression.cs: Special case the `null' object when trying to
17520 auto-compute the type, as anything can be explicitly converted to
17523 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
17524 spotting this Paolo.
17526 (Expression.ImplicitNumericConversion): Perform comparissions of
17527 the type using the underlying type in the case of an enumeration
17528 rather than using the enumeration type for the compare.
17530 Cope with the underlying == type case, which is not possible to
17533 (Expression.ConvertNumericExplicit): Perform comparissions of
17534 the type using the underlying type in the case of an enumeration
17535 rather than using the enumeration type for the compare.
17537 * driver.cs: If the user does not supply an extension, assume .exe
17539 * cs-parser.jay (if_statement): Rewrote so that we can track the
17540 location for the if statement.
17542 * expression.cs (Binary.ConstantFold): Only concat strings when
17543 the operation is "+", not everything ;-)
17545 * statement.cs (Statement.EmitBoolExpression): Take a location
17547 (If, While, Do): Track location.
17549 * expression.cs (Binary.ResolveOperator): In the object + string
17550 case, I was missing a call to ConvertImplicit
17552 2002-02-25 Ravi Pratap <ravi@ximian.com>
17554 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
17555 Location arguments. Ensure we use RootContext.LookupType to do our work
17556 and not try to do a direct Type.GetType and ModuleBuilder.GetType
17558 * interface.cs (PopulateMethod): Handle the type of the parameter being
17561 * expression.cs (Invocation.BetterFunction): Handle the case when we
17562 have a params method with no fixed arguments and a call is made with no
17565 2002-02-25 Miguel de Icaza <miguel@ximian.com>
17567 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
17568 the verbatim-string-literal
17570 * support.cs (InternalParameters.ParameterModifier): handle null
17572 (InternalParameters.ParameterType): ditto.
17574 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
17575 duplicating the name of the variable parameter.
17576 (GetParameterByName): Fix bug where we were not looking up array
17577 paramters if they were the only present (thanks Paolo!).
17578 (GetParameterInfo): We only have an empty set of types if both
17579 fixed and array are set to null.
17580 (GetParameterInfo-idx): Handle FixedParameter == null
17582 * cs-parser.jay: Handle the case where there is no catch
17583 statements (missing null test).
17585 2002-02-22 Miguel de Icaza <miguel@ximian.com>
17587 * driver.cs (MainDriver): Be conservative on our command line
17590 Catch DirectoryNotFoundException when calling GetFiles.
17592 (SplitPathAndPattern): Used to split the input specification into
17593 a path and a pattern that we can feed to Directory.GetFiles.
17595 2002-02-21 Miguel de Icaza <miguel@ximian.com>
17597 * statement.cs (Fixed): Implement the last case of the Fixed
17598 statement (string handling).
17600 * expression.cs (StringPtr): New class used to return a char * to
17601 a string; Used by the Fixed statement.
17603 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
17605 * expression.cs (Binary.ResolveOperator): Remove redundant
17606 MemberLookup pn parent type.
17607 Optimize union call, we do not need a union if the types are the same.
17608 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17611 Specialize the use of MemberLookup everywhere, instead of using
17612 the default settings.
17614 (StackAlloc): Implement stackalloc keyword.
17616 * cs-parser.jay: Add rule to parse stackalloc.
17618 * driver.cs: Handle /h, /help, /?
17620 * expression.cs (MakeByteBlob): Removed the hacks we had in place
17621 before we supported unsafe code.
17623 * makefile: add --unsafe to the self compilation of mcs.
17625 2002-02-20 Miguel de Icaza <miguel@ximian.com>
17627 * expression.cs (PointerArithmetic): New class that is used to
17628 perform pointer arithmetic.
17629 (Binary.Resolve): Handle pointer arithmetic
17630 Handle pointer comparission.
17631 (ArrayPtr): Utility expression class that is used to take the
17632 address of an array.
17634 (ElementAccess): Implement array access for pointers
17636 * statement.cs (Fixed): Implement fixed statement for arrays, we
17637 are missing one more case before we are done.
17639 * expression.cs (Indirection): Implement EmitAssign and set the
17640 ExprClass to Variable. This allows pointer dereferences to be
17641 treated as variables, and to have values assigned to them.
17643 * ecore.cs (Expression.StoreFromPtr): New utility function to
17644 store values dereferencing.
17646 2002-02-20 Ravi Pratap <ravi@ximian.com>
17648 * expression.cs (Binary.ResolveOperator): Ensure that we are
17649 not trying to operate on a void type - this fixes the reported
17652 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17653 the parent implementation is sealed.
17655 * ../errors/cs0239.cs : Add.
17657 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17659 * typemanager.cs (unverifiable_code_type): Corresponds to
17660 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17661 which have unsafe code in them.
17663 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
17666 2002-02-19 Miguel de Icaza <miguel@ximian.com>
17668 * cs-tokenizer.cs: Add support for @"litreal strings"
17670 Make tokenizer accept pre-processor directives
17671 on any column (remove the old C-like limitation).
17673 * rootcontext.cs (EmitCode): Emit any global attributes.
17674 (AddGlobalAttributes): Used to keep track of assembly attributes.
17676 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17678 * cs-parser.jay: Add support for global attributes.
17680 2002-02-17 Miguel de Icaza <miguel@ximian.com>
17682 * expression.cs (Indirection): New helper class. Unary will
17683 create Indirection classes to be able to implement the
17684 IMemoryLocation interface on it.
17686 2002-02-16 Miguel de Icaza <miguel@ximian.com>
17688 * cs-parser.jay (fixed_statement): reference the right statement.
17690 * statement.cs (Fixed.Emit): Finish implementing the fixed
17691 statement for the &x case.
17693 2002-02-14 Miguel de Icaza <miguel@ximian.com>
17695 * class.cs (Property.Define, Method.Define): Remove newslot when
17698 * modifiers.cs: My use of NewSlot when `Abstract' was set was
17699 wrong. NewSlot should only be used if the `new' keyword is present.
17701 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17702 locating our system dir. Sorry about this.
17704 2002-02-13 Miguel de Icaza <miguel@ximian.com>
17706 * driver.cs (GetSystemDir): Compute correctly the location of our
17707 system assemblies. I was using the compiler directory instead of
17708 the library directory.
17710 2002-02-13 Ravi Pratap <ravi@ximian.com>
17712 * expression.cs (BetterFunction): Put back in what Miguel commented out
17713 since it is the correct fix. The problem is elsewhere ;-)
17715 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17716 parameters of the parms method are themselves compatible or not !
17718 (StandardConversionExists): Fix very dangerous bug where we were forgetting
17719 to check that a class implements an interface before saying that an implicit
17720 conversion was allowed. Use ImplementsInterface to do the checking.
17722 2002-02-13 Miguel de Icaza <miguel@ximian.com>
17724 * class.cs (Method.Define): Track whether we are an explicit
17725 implementation or not. And only call DefineMethodOverride if we
17726 are an explicit implementation.
17728 (Property.DefineMethod): Ditto.
17730 2002-02-11 Ravi Pratap <ravi@ximian.com>
17732 * expression.cs (BetterFunction): Catch hideous bug which was
17733 preventing us from detecting ambiguous calls due to implicit casts i.e
17736 2002-01-29 Miguel de Icaza <miguel@ximian.com>
17738 * support.cs (Pair): Remove un-needed method. I figured why I was
17739 getting the error in cs-parser.jay, the variable in a foreach loop
17740 is readonly, and the compiler does not really treat this as a variable.
17742 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
17743 instead of EQUALS in grammar.
17745 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17747 * expression.cs (Unary.DoResolve): Check whether the argument is
17750 2002-01-28 Miguel de Icaza <miguel@ximian.com>
17752 * support.cs: Api for Pair to set a value. Despite the fact that
17753 the variables are public the MS C# compiler refuses to compile
17754 code that accesses the field if the variable is part of a foreach
17757 * statement.cs (Fixed): Begin implementation of the fixed
17760 (Block.AddVariable): Return the VariableInfo on success and null
17761 on failure instead of true/false.
17763 * cs-parser.jay (foreach): Catch errors on variables already
17764 defined (we were ignoring this value before) and properly unwind
17765 the block hierarchy
17767 (fixed_statement): grammar for the fixed statement.
17769 2002-01-25 Miguel de Icaza <miguel@ximian.com>
17771 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17772 pointer types to be incretemented.
17774 (SizeOf): Implement.
17776 * cs-parser.jay (pointer_member_access): Implement
17777 expr->IDENTIFIER production.
17779 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17780 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17783 (Unary): Implement indirection.
17785 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17786 use in non-unsafe context).
17788 (SimpleName.DoResolve): Check for pointers in field access on safe
17791 (Expression.LoadFromPtr): Factor the load-indirect code in this
17792 function. This was duplicated in UnboxCast and ParameterReference
17794 2002-01-24 Miguel de Icaza <miguel@ximian.com>
17796 * expression.cs (ComposedCast): report an error if a pointer cast
17797 is used in a safe region.
17799 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17800 pointer type casts in unsafe context.
17802 * codegen.cs (EmitContext): Set up IsUnsafe.
17804 * cs-parser.jay (non_expression_type): Add productions for pointer
17807 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17808 code. We should not use force into static mode if the method is
17809 not virtual. Fixes bug in MIS
17811 * statement.cs (Do.Emit, While.Emit, For.Emit,
17812 Statement.EmitBoolExpression): Add support to Do and While to
17813 propagate infinite loop as `I do return' semantics.
17815 Improve the For case to also test for boolean constants.
17817 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17818 to the list of attributes we can add.
17820 Remove `EmitContext' argument.
17822 * class.cs (Method.Define): Apply parameter attributes.
17823 (Constructor.Define): Apply parameter attributes.
17824 (MethodCore.LabelParameters): Move here the core of labeling
17827 * support.cs (ReflectionParameters.ParameterModifier,
17828 InternalParameters.ParameterModifier): Use IsByRef on the type and
17829 only return the OUT bit for these parameters instead of in/out/ref
17832 This is because I miss-understood things. The ParameterInfo.IsIn
17833 and IsOut represent whether the parameter has the [In] and [Out]
17836 2002-01-22 Miguel de Icaza <miguel@ximian.com>
17838 * ecore.cs (FieldExpr.Emit): Release temporaries.
17840 * assign.cs (LocalTemporary.Release): new function.
17842 * codegen.cs (EmitContext.GetTemporaryStorage,
17843 EmitContext.FreeTemporaryStorage): Rework the way we deal with
17844 temporary storage. Now we can "put back" localbuilders when we
17847 2002-01-21 Miguel de Icaza <miguel@ximian.com>
17849 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17850 need to make a copy of the variable to generate verifiable code.
17852 2002-01-19 Miguel de Icaza <miguel@ximian.com>
17854 * driver.cs: Compute dynamically the system directory.
17856 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17857 Slower, but more generally useful. Used by the abstract
17858 registering implementation.
17860 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17861 the rules for the special rule on Type/instances. First check if
17862 we have the same name, and if so, try that special static path
17863 rather than the instance path.
17865 2002-01-18 Miguel de Icaza <miguel@ximian.com>
17867 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17870 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17871 Enum, ValueType, Delegate or Array for non-corlib compiles.
17873 * cs-tokenizer.cs: Catch long identifiers (645)
17875 * typemanager.cs (IndexerPropetyName): Ravi never tested this
17878 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17879 fix, we were returning too early, so we were not registering
17880 pending methods from abstract classes.
17882 Do not register pending methods if the class is abstract.
17884 * expression.cs (Conditional.DoResolve): Report circular implicit
17885 conversions when we neecd to compute it for conditional
17888 (Is.DoResolve): If the expression is always of the provided type,
17889 flag warning 183. If the expression can not ever be of the
17890 provided type flag warning 184.
17892 * class.cs: Catch 169 as well.
17894 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17897 2002-01-18 Nick Drochak <ndrochak@gol.com>
17899 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
17901 2002-01-17 Miguel de Icaza <miguel@ximian.com>
17903 * interface.cs: (PopulateMethod): Check for pointers being defined
17904 only if the unsafe context is active.
17905 (PopulateProperty): ditto.
17906 (PopulateIndexer): ditto.
17908 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17909 specified. If pointers are present, make sure that they are
17910 present in an unsafe context.
17911 (Constructor, Constructor.Define): ditto.
17912 (Field, Field.Define): ditto.
17913 (Property, Property.Define): ditto.
17914 (Event, Event.Define): ditto.
17916 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17917 hashtable if there are classes or structs defined.
17919 * expression.cs (LocalVariableReference.DoResolve): Simplify this
17920 code, as the constant resolution moved.
17922 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17923 the metadata, so we can flag error 133.
17925 * decl.cs (MemberCore.UnsafeOK): New function to test that a
17926 pointer is being declared in an unsafe context.
17928 2002-01-16 Miguel de Icaza <miguel@ximian.com>
17930 * modifiers.cs (Modifiers.Check): Require a Location argument.
17931 Report error 227 for Unsafe use.
17933 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17935 * statement.cs (For.Emit): If the test is null, then report that
17936 we do `return', as we wont reach anything afterwards.
17938 (Switch.SwitchGoverningType): Track the expression that matched
17941 * driver.cs: Allow negative numbers as an error code to flag.
17943 * cs-parser.jay: Handle 1551.
17945 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17947 2002-01-15 Miguel de Icaza <miguel@ximian.com>
17949 * cs-parser.jay: Report 1518 (type declaration can only contain
17950 class, struct, interface, enum or delegate)
17952 (switch_label): Report 1523 (keywords `case' or `default' must
17955 (opt_switch_sections): Report 1522 (empty switch)
17957 * driver.cs: Report 1515 (response file specified multiple times)
17958 Report 1516 (Source file specified multiple times).
17960 * expression.cs (Argument.Resolve): Signal 1510
17962 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17963 access not allowed in static code)
17965 2002-01-11 Ravi Pratap <ravi@ximian.com>
17967 * typemanager.cs (IsPointerType): Utility method which we are going
17970 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17971 the object type, so we take care of that.
17973 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17975 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17976 added to non-params parameters :-)
17978 * typemanager.cs (CSharpName): Include 'void' type too.
17980 (void_ptr_type): Include in the set of core types.
17982 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
17985 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
17988 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
17989 completely forgotten about it.
17991 2002-01-10 Ravi Pratap <ravi@ximian.com>
17993 * cs-parser.jay (pointer_type): Add. This begins our implementation
17994 of parsing rules for unsafe code.
17996 (unsafe_statement): Implement.
17998 (embedded_statement): Modify to include the above.
18000 * statement.cs (Unsafe): Implement new class for unsafe blocks.
18002 * codegen.cs (EmitContext.InUnsafe): Add. This determines
18003 if the current context is an unsafe one.
18005 * cs-parser.jay (local_variable_pointer_type): Since local variable types
18006 are handled differently, we need separate rules for them.
18008 (local_variable_declaration): Update to use local_variable_pointer_type
18009 to allow variable declarations of unmanaged pointer types.
18011 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18012 in unsafe contexts.
18014 * ../errors/cs0214.cs : Add.
18016 2002-01-16 Nick Drochak <ndrochak@gol.com>
18018 * makefile: remove 'response' file when cleaning.
18020 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18022 * cs-parser.jay: Report 1524.
18024 2002-01-14 Miguel de Icaza <miguel@ximian.com>
18026 * typemanager.cs (RegisterMethod): drop checking if we have
18027 registered this from here
18029 2002-01-12 Miguel de Icaza <miguel@ximian.com>
18031 * class.cs (Method.EmitDestructor): Implement calling our base
18034 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18035 value of InFinally.
18037 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18038 this routine and will wrap the call in a try/catch block. Deal
18041 2002-01-11 Miguel de Icaza <miguel@ximian.com>
18043 * ecore.cs (Expression.MemberLookup): instead of taking a
18044 parameter `same_type' that was used to tell whether we could
18045 access private members we compute our containing type from the
18048 (FieldExpr): Added partial support for volatile fields. This does
18049 not work for volatile fields exposed from assemblies, as I can not
18050 figure out how to extract the modreq from it.
18052 Updated all the source files to use this.
18054 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18055 because it is referenced by MemberLookup very often.
18057 2002-01-09 Ravi Pratap <ravi@ximian.com>
18059 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18060 TypeBuilder.GetCustomAttributes to retrieve what we need.
18062 Get rid of redundant default_member_attr_type as this is the same as
18063 default_member_type which already exists.
18065 * interface.cs, attribute.cs : Update accordingly.
18067 2002-01-08 Miguel de Icaza <miguel@ximian.com>
18069 * typemanager.cs: Enable IndexerPropertyName again. It does not
18070 work for TYpeBuilders though. Ravi, can you please fix this?
18072 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18074 * expression.cs (Argument.Emit): Handle the case of ref objects
18075 being passed to ref functions;
18077 (ParameterReference.EmitLoad): Loads the content of the pointer
18078 without dereferencing.
18080 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18082 * cs-tokenizer.cs: Implemented the pre-processing expressions.
18084 2002-01-08 Ravi Pratap <ravi@ximian.com>
18086 * class.cs (Indexer.DefineMethod): Incorporate the interface
18087 type in the name of the method if we are doing explicit interface
18090 * expression.cs (ConversionExists): Remove as it is completely obsolete.
18092 (BetterConversion): Fix extremely trivial bug where we were referring to
18093 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18096 * ../errors/bug16.cs : Add although we have fixed it.
18098 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18100 * expression.cs (BaseIndexer): Begin implementation.
18102 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18104 * cs-parser.jay (indexer_declarator): Use qualified_identifier
18105 production directly to remove a shift/reduce, and implement
18106 explicit interface implementation.
18108 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18109 after a floating point suffix.
18111 * expression.cs (DoNumericPromotions): Improved the conversion for
18112 uint/uint. If we have a constant, we avoid doing a typecast to a
18115 * class.cs (Indexer): Implement explicit interface implementation
18118 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18120 * class.cs: make the default instance constructor public and hidebysig.
18122 2001-01-03 Ravi Pratap <ravi@ximian.com>
18124 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18125 so we can call it from elsewhere.
18127 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18128 we emit it internally if the class has a defined indexer; otherwise the user
18129 emits it by decorating the class definition with the DefaultMemberAttribute.
18131 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18132 attribute is not used on a type which defines an indexer.
18134 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18135 character when we skip whitespace.
18137 * ../errors/cs0646.cs : Add.
18139 2002-01-03 Miguel de Icaza <miguel@ximian.com>
18141 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18144 * makefile: Add practical target `mcs3.exe' which builds the third
18145 generation compiler.
18147 * expression.cs (New): Fix structures constructor calling.
18149 * class.cs (Property, Method, Indexer): Emit Final flag on the
18150 method if we are an interface implementation and we are not
18153 * ecore.cs (PropertyExpr): New public field `IsBase', tells
18154 whether this property is referencing a `base' method.
18156 * expression.cs (Invocation.EmitCall): take an extra argument:
18157 is_base, this is used to determine whether the `call' or
18158 `callvirt' opcode should be used.
18161 * delegate.cs: update EmitCall.
18163 * class.cs (Method.Define): Set NewSlot for the cases where we are
18164 not implementing an interface method.
18166 (Property.Define): ditto.
18168 2002-01-02 Miguel de Icaza <miguel@ximian.com>
18170 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18171 'r'. Allows mcs to parse itself fully.
18173 2002-01-02 Ravi Pratap <ravi@ximian.com>
18175 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18176 of the number of initializers that require the InitializeArray method.
18178 (CheckIndices): Store the Expression in all cases - not the plain value. Also
18179 update the above field where necessary.
18181 (MakeByteBlob): Update accordingly.
18183 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
18186 (EmitDynamicInitializers): Update in accordance with the new optimization.
18188 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18189 same OpCode applies.
18191 * cs-parser.jay : Fix some glaring errors I introduced.
18193 2002-01-01 Ravi Pratap <ravi@ximian.com>
18195 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18196 so that we can check for name clashes there too.
18198 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18199 for interface indexers.
18201 * interfaces.cs (Define): Emit the default member attribute.
18203 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18204 variable was being referred to while setting the value ;-)
18206 2002-01-01 Miguel de Icaza <miguel@ximian.com>
18208 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18209 byte-by-byte information when we know the data is zero.
18211 Make the block always a multiple of 4, because
18212 DefineInitializedData has a bug.
18214 * assign.cs: Fix, we should assign from the temporary, not from
18217 * expression.cs (MakeByteBlob): Fix my incorrect code.
18219 2001-12-31 Miguel de Icaza <miguel@ximian.com>
18221 * typemanager.cs (EnumToUnderlying): This function is used to get
18222 the underlying type from an enumeration, because it does not
18225 * constant.cs: Use the I4_S form for values between -128 and 127.
18227 * statement.cs (Block.LookupLabel): Looks up a label.
18228 (Block): Drop support for labeled blocks.
18230 (LabeledStatement): New kind of statement that represents a label
18233 (Goto): Finally implement this bad boy.
18235 * cs-parser.jay: Update to reflect new mechanism to implement
18238 2001-12-30 Miguel de Icaza <miguel@ximian.com>
18240 * codegen.cs (EmitContext.This): a codegen property that keeps the
18241 a single instance of this instead of creating many different this
18244 * delegate.cs (Delegate.DoResolve): Update to use the property;
18246 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18248 * expression.cs (BaseAccess.DoResolve): Ditto.
18250 2001-12-29 Ravi Pratap <ravi@ximian.com>
18252 * typemanager.cs (methodimpl_attr_type): Add to hold the type
18253 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18255 (InitCoreTypes): Update accordingly.
18257 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18258 so we can quickly store the state.
18260 (ApplyAttributes): Set the correct implementation flags
18261 for InternalCall methods.
18263 2001-12-29 Miguel de Icaza <miguel@ximian.com>
18265 * expression.cs (EmitCall): if a method is not virtual, then do
18266 not use callvirt on it.
18268 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18269 user defined stuff) requires the use of stobj, which takes an
18270 address on the stack instead of an array and an index. So emit
18271 the Ldelema operation for it.
18273 (EmitStoreOpcode): Use stobj for valuetypes.
18275 (UnaryMutator.EmitCode): Use the right 1 value depending on
18276 whether we are dealing with int64/uint64, float or doubles.
18278 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18279 constructors that I implemented last night.
18281 (Constructor.IsDefault): Fix to work properly for static
18284 * cs-parser.jay (CheckDef): report method signature errors.
18285 Update error number 103 to be 132.
18287 * decl.cs: New AdditionResult enumeration value: MethodExists.
18288 Although we do this check for methods later on in the semantic
18289 analysis, catching repeated default constructors is so easy that
18290 we catch these here.
18292 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18295 (ParameterReference.EmitAssign, Emit): handle
18298 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18299 (ArrayAccess.EmitStoreOpcode): ditto.
18301 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18303 * expression.cs (MakeByteBlob): Complete all the missing types
18304 (uint, short, ushort, byte, sbyte)
18306 * class.cs: Only init instance field initializers on instance
18309 Rename `constructors' to instance_constructors.
18311 (TypeContainer.AddConstructor): Only add constructors to the list
18312 if it is not static.
18314 Make sure that we handle default_static_constructor independently
18315 everywhere where we handle instance_constructors
18317 2001-12-28 Miguel de Icaza <miguel@ximian.com>
18319 * class.cs: Do not lookup or create a base initializer for a
18320 static constructor.
18322 (ConstructorInitializer.Resolve): use the proper type to lookup
18325 * cs-parser.jay: Report error 1585 (modifiers between type and name).
18327 * enum.cs, interface.cs: Remove CloseType, this is taken care by
18330 * decl.cs: CloseType is now an virtual method, the default
18331 implementation just closes this type.
18333 2001-12-28 Ravi Pratap <ravi@ximian.com>
18335 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18336 to PreserveSig by default. Also emit HideBySig on such methods.
18338 Basically, set the defaults to standard values.
18340 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18341 argument, if candidate is better, it can't be worse than the best !
18343 (Invocation): Re-write bits to differentiate between methods being
18344 applicable in their expanded form and their normal form - for params
18347 Get rid of use_standard everywhere as only standard conversions are allowed
18348 in overload resolution.
18350 More spec conformance.
18352 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18354 * driver.cs: Add --timestamp, to see where the compiler spends
18357 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18358 `this' in static code.
18360 (SimpleName.DoResolve): Implement in terms of a helper function
18361 that allows static-references to be passed upstream to
18364 (Expression.ResolveWithSimpleName): Resolve specially simple
18365 names when called by MemberAccess to implement the special
18368 (Expression.ImplicitReferenceConversion): Handle conversions from
18369 Null to reference types before others, as Null's type is
18372 * expression.cs (Invocation.EmitCall): Handle the special case of
18373 calling methods declared on a reference type from a ValueType
18374 (Base classes System.Object and System.Enum)
18376 (MemberAccess.Resolve): Only perform lookups on Enumerations if
18377 the left hand side is a TypeExpr, not on every enumeration.
18379 (Binary.Resolve): If types are reference types, then do a cast to
18380 object on operators != and == of both arguments.
18382 * typemanager.cs (FindMembers): Extract instance and static
18383 members if requested.
18385 * interface.cs (PopulateProperty): Use void_type instead of null
18386 as the return type for the setter method.
18388 (PopulateIndexer): ditto.
18390 2001-12-27 Ravi Pratap <ravi@ximian.com>
18392 * support.cs (ReflectionParameters): Fix minor bug where we
18393 were examining the wrong parameter for the ParamArray attribute.
18395 Cope with requests for the type of the parameter at position
18396 greater than the params parameter's. We now return the element
18397 type of the params array as that makes more sense.
18399 * expression.cs (Invocation.IsParamsMethodApplicable): Update
18400 accordingly as we no longer have to extract the element type
18403 (Invocation.OverloadResolve): Update.
18405 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18407 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18408 against IEnumerator, test whether the return value is a descendant
18409 of the IEnumerator interface.
18411 * class.cs (Indexer.Define): Use an auxiliary method to implement
18412 the other bits of the method definition. Begin support for
18413 explicit interface implementation.
18415 (Property.DefineMethod): Use TypeManager.void_type instead of null
18416 for an empty return value.
18418 2001-12-26 Miguel de Icaza <miguel@ximian.com>
18420 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18421 dealing with a FieldExpr which is composed of a FieldBuilder, in
18422 the code path we did extract the constant, but we should have
18423 obtained the underlying value to be able to cast it (otherwise we
18424 end up in an infinite loop, this is what Ravi was running into).
18426 (ArrayCreation.UpdateIndices): Arrays might be empty.
18428 (MemberAccess.ResolveMemberAccess): Add support for section
18429 14.5.4.1 that deals with the special case of E.I when E is a type
18430 and something else, that I can be a reference to a static member.
18432 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18433 handle a particular array type to create byte blobs, it is just
18434 something we dont generate byteblobs for.
18436 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18439 * location.cs (Push): remove the key from the hashtable that we
18440 are about to add. This happens for empty files.
18442 * driver.cs: Dispose files after we have parsed them.
18444 (tokenize): new function that only runs the tokenizer on its
18445 input, for speed testing.
18447 2001-12-26 Ravi Pratap <ravi@ximian.com>
18449 * class.cs (Event.Define): Define the private field only if there
18450 are no accessors defined.
18452 * expression.cs (ResolveMemberAccess): If there is no associated
18453 field with the event, that means we have an event defined with its
18454 own accessors and we should flag error cs0070 since transforming
18455 ourselves into a field is not valid in that case.
18457 * ecore.cs (SimpleName.DoResolve): Same as above.
18459 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18460 and charset to sane values.
18462 2001-12-25 Ravi Pratap <ravi@ximian.com>
18464 * assign.cs (DoResolve): Perform check on events only if they
18465 are being accessed outside the declaring type.
18467 * cs-parser.jay (event_declarations): Update rules to correctly
18468 set the type of the implicit parameter etc.
18470 (add_accessor, remove_accessor): Set current local parameters.
18472 * expression.cs (Binary): For delegate addition and subtraction,
18473 cast the return value from the method into the appropriate delegate
18476 2001-12-24 Ravi Pratap <ravi@ximian.com>
18478 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18479 of these as the workaround is unnecessary.
18481 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18482 delegate data - none of that is needed at all.
18484 Re-write bits to extract the instance expression and the delegate method
18487 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
18490 * attribute.cs (ApplyAttributes): New method to take care of common tasks
18491 of attaching attributes instead of duplicating code everywhere.
18493 * everywhere : Update code to do attribute emission using the above method.
18495 2001-12-23 Miguel de Icaza <miguel@ximian.com>
18497 * expression.cs (IsParamsMethodApplicable): if there are not
18498 parameters, return immediately.
18500 * ecore.cs: The 0 literal can be implicity converted to an enum
18503 (SimpleName.DoResolve): First lookup the type, then lookup the
18506 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
18507 want to get its address. If the InstanceExpression is not
18508 addressable, store the result in a temporary variable, then get
18511 * codegen.cs: Only display 219 errors on warning level or above.
18513 * expression.cs (ArrayAccess): Make it implement the
18514 IMemoryLocation interface.
18516 (Binary.DoResolve): handle the operator == (object a, object b)
18517 and operator != (object a, object b) without incurring into a
18518 BoxedCast (because 5 != o should never be performed).
18520 Handle binary enumerator operators.
18522 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
18523 value type, otherwise use Ldelem_ref.
18525 Use precomputed names;
18527 (AddressOf): Implement address of
18529 * cs-parser.jay (labeled_statement): Fix recursive block
18530 addition by reworking the production.
18532 * expression.cs (New.DoEmit): New has a special case:
18534 If we are dealing with a ValueType, we have a few
18535 situations to deal with:
18537 * The target of New is a ValueType variable, that is
18538 easy, we just pass this as the variable reference
18540 * The target of New is being passed as an argument,
18541 to a boxing operation or a function that takes a
18544 In this case, we need to create a temporary variable
18545 that is the argument of New.
18548 2001-12-23 Ravi Pratap <ravi@ximian.com>
18550 * rootcontext.cs (LookupType): Check that current_type is not null before
18551 going about looking at nested types.
18553 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
18554 not implement the IAssignMethod interface any more.
18556 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
18557 where we tranform them into FieldExprs if they are being resolved from within
18558 the declaring type.
18560 * ecore.cs (SimpleName.DoResolve): Do the same here.
18562 * assign.cs (DoResolve, Emit): Clean up code considerably.
18564 * ../errors/bug10.cs : Add.
18566 * ../errors/cs0070.cs : Add.
18568 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
18570 * assign.cs : Get rid of EventIsLocal everywhere.
18572 2001-12-23 Miguel de Icaza <miguel@ximian.com>
18574 * ecore.cs (ConvertIntLiteral): finished the implementation.
18576 * statement.cs (SwitchLabel): Convert the value we are using as a
18577 key before looking up the table.
18579 2001-12-22 Miguel de Icaza <miguel@ximian.com>
18581 * codegen.cs (EmitTopBlock): Require a Location argument now.
18583 * cs-parser.jay (constructor_declarator): We need to setup
18584 current_local_parameters before we parse the
18585 opt_constructor_initializer, to allow the variables to be bound
18586 to the constructor arguments.
18588 * rootcontext.cs (LookupType): First lookup nested classes in our
18589 class and our parents before we go looking outside our class.
18591 * expression.cs (ConstantFold): Extract/debox the values at the
18594 * rootcontext.cs (EmitCode): Resolve the constants first before we
18595 resolve the types. This is not really needed, but it helps debugging.
18597 * statement.cs: report location.
18599 * cs-parser.jay: pass location to throw statement.
18601 * driver.cs: Small bug fix.
18603 * report.cs: Updated format to be 4-zero filled digits.
18605 2001-12-22 Ravi Pratap <ravi@ximian.com>
18607 * expression.cs (CheckIndices): Fix minor bug where the wrong
18608 variable was being referred to ;-)
18610 (DoEmit): Do not call EmitStaticInitializers when the
18611 underlying type is System.Object.
18613 2001-12-21 Ravi Pratap <ravi@ximian.com>
18615 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18616 and do the usual workaround for SRE.
18618 * class.cs (MyEventBuilder.EventType): New member to get at the type
18619 of the event, quickly.
18621 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18623 * assign.cs (Assign.DoResolve): Handle the case when the target
18624 is an EventExpr and perform the necessary checks.
18626 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18629 (SimpleName.MemberStaticCheck): Include check for EventExpr.
18631 (EventExpr): Set the type in the constructor itself since we
18632 are meant to be born fully resolved.
18634 (EventExpr.Define): Revert code I wrote earlier.
18636 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18637 instance expression is null. The instance expression is a This in that case
18638 or a null, depending on whether it is a static method or not.
18640 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18641 refers to more than one method.
18643 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18644 and accordingly flag errors.
18646 2001-12-21 Miguel de Icaza <miguel@ximian.com>
18648 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18650 2001-12-22 Miguel de Icaza <miguel@ximian.com>
18652 * location.cs (ToString): Provide useful rutine.
18654 2001-12-21 Miguel de Icaza <miguel@ximian.com>
18656 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18657 objects, return the actual integral boxed.
18659 * statement.cs (SwitchLabel): define an ILLabel for each
18662 (Switch.CheckSwitch): If the value is a Literal, extract
18663 the underlying literal.
18665 Also in the unused hashtable we had, add the SwitchLabel so we can
18666 quickly look this value up.
18668 * constant.cs: Implement a bunch of new constants. Rewrite
18669 Literal based on this. Made changes everywhere to adapt to this.
18671 * expression.cs (Expression.MakeByteBlob): Optimize routine by
18672 dereferencing array only once, and also copes with enumrations.
18674 bytes are two bytes wide, not one.
18676 (Cast): Perform constant conversions.
18678 * ecore.cs (TryImplicitIntConversion): Return literals instead of
18679 wrappers to the literals here.
18681 * expression.cs (DoNumericPromotions): long literals can converted
18682 to ulong implicity (this is taken care of elsewhere, but I was
18683 missing this spot).
18685 * ecore.cs (Expression.Literalize): Make the return type Literal,
18686 to improve type checking.
18688 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18690 2001-12-20 Miguel de Icaza <miguel@ximian.com>
18692 * literal.cs: Revert code from ravi that checked the bounds. The
18693 bounds are sane by the definition of the type itself.
18695 * typemanager.cs: Fix implementation of ImplementsInterface. We
18696 need to actually look up in our parent hierarchy for interfaces
18699 * const.cs: Use the underlying type for enumerations
18701 * delegate.cs: Compute the basename for the delegate creation,
18702 that should fix the delegate test case, and restore the correct
18703 Type Lookup semantics in rootcontext
18705 * rootcontext.cs: Revert Ravi's last patch. The correct way of
18706 referencing a nested type with the Reflection API is using the "+"
18709 * cs-parser.jay: Do not require EOF token at the end.
18711 2001-12-20 Ravi Pratap <ravi@ximian.com>
18713 * rootcontext.cs (LookupType): Concatenate type names with
18714 a '.' instead of a '+' The test suite passes again.
18716 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18717 field of the enumeration.
18719 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18720 the case when the member is an EventExpr.
18722 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18723 static has an associated instance expression.
18725 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18727 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18729 * class.cs (Event.Define): Register event and perform appropriate checks
18732 We define the Add and Remove methods even if the use provides none because
18733 in that case, we provide default implementations ourselves.
18735 Define a private field of the type of the event. This is done by the CSC compiler
18736 and we should be doing it too ;-)
18738 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18739 More methods we use in code we generate.
18741 (multicast_delegate_type, delegate_type): Two separate types since the distinction
18744 (InitCoreTypes): Update accordingly for the above.
18746 * class.cs (Event.Emit): Generate code for default accessors that we provide
18748 (EmitDefaultMethod): Do the job in the above.
18750 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
18753 2001-12-20 Miguel de Icaza <miguel@ximian.com>
18755 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18756 builders even if we were missing one.
18758 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18759 pass the Basename as our class name instead of the Name. The
18760 basename will be correctly composed for us.
18762 * parameter.cs (Paramters): Now takes a Location argument.
18764 * decl.cs (DeclSpace.LookupType): Removed convenience function and
18765 make all the code call directly LookupType in RootContext and take
18766 this chance to pass the Location information everywhere.
18768 * Everywhere: pass Location information.
18770 2001-12-19 Miguel de Icaza <miguel@ximian.com>
18772 * class.cs (Constructor.Define): Updated way of detecting the
18773 length of the parameters.
18775 (TypeContainer.DefineType): Use basename as the type name for
18778 (TypeContainer.Define): Do not recursively define types here, as
18779 definition is taken care in order by the RootContext.
18781 * tree.cs: Keep track of namespaces in a per-file basis.
18783 * parameter.cs (Parameter.ComputeSignature): Update to use
18786 (Parameters.GetSignature): ditto.
18788 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18789 instead of a TypeContainer.
18791 (Interface.SemanticAnalysis): Use `this' instead of our parent to
18792 resolve names. Because we need to be resolve in our context, not
18795 * driver.cs: Implement response files.
18797 * class.cs (TypeContainer.DefineType): If we are defined, do not
18798 redefine ourselves.
18800 (Event.Emit): Emit the code for add/remove handlers.
18801 (Event.Define): Save the MethodBuilders for add/remove.
18803 * typemanager.cs: Use pair here too.
18805 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18806 DictionaryEntry requires the first argument to be non-null.
18808 (enum_declaration): Compute full name for registering the
18811 (delegate_declaration): Instead of using
18812 formal_parameter_list, use opt_formal_parameter_list as the list
18815 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18816 (EventParsing): New property that controls whether `add' and
18817 `remove' are returned as tokens or identifiers (for events);
18819 2001-12-19 Ravi Pratap <ravi@ximian.com>
18821 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18822 use MyEventBuilder only and let it wrap the real builder for us.
18824 (MyEventBuilder): Revamp constructor etc.
18826 Implement all operations that we perform on EventBuilder in precisely the same
18829 (FindMembers): Update to use the EventBuilder member.
18831 (Event.Emit): Update accordingly.
18833 2001-12-18 Ravi Pratap <ravi@ximian.com>
18835 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18836 by calling the appropriate methods.
18838 (GetCustomAttributes): Make stubs as they cannot possibly do anything
18841 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18843 2001-12-17 Ravi Pratap <ravi@ximian.com>
18845 * delegate.cs (Delegate.Populate): Check that the return type
18846 and various parameters types are indeed accessible.
18848 * class.cs (Constructor.Define): Same here.
18850 (Field.Define): Ditto.
18852 (Event.Define): Ditto.
18854 (Operator.Define): Check that the underlying Method defined itself
18855 correctly - so it's MethodBuilder should not be null.
18857 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18858 expression happens to be null.
18860 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18861 members but as of now we don't seem to be able to do anything really useful with it.
18863 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18864 not the EventBuilder.
18866 2001-12-18 Miguel de Icaza <miguel@ximian.com>
18868 * cs-tokenizer.cs: Add support for defines.
18869 Add support for #if, #elif, #else, #endif
18871 (eval_var): evaluates a variable.
18872 (eval): stubbed for evaluating functions.
18874 * cs-parser.jay: Pass the defines information
18876 * driver.cs: Add --define command line option.
18878 * decl.cs: Move MemberCore here.
18880 Make it the base class for DeclSpace. This allows us to catch and
18881 report 108 and 109 for everything now.
18883 * class.cs (TypeContainer.Define): Extract all the members
18884 before populating and emit the warning 108 (new keyword required
18885 to override) instead of having each member implement this.
18887 (MemberCore.Define): New abstract method, we will be using this in
18888 the warning reporting engine in Populate.
18890 (Operator.Define): Adjust to new MemberCore protocol.
18892 * const.cs (Const): This does not derive from Expression, it is a
18893 temporary object we use to create fields, it is a MemberCore.
18895 * class.cs (Method.Define): Allow the entry point to be in a
18898 * driver.cs: Rewrite the argument handler to clean it up a bit.
18900 * rootcontext.cs: Made it just an auxiliary namespace feature by
18901 making everything static.
18903 * driver.cs: Adapt code to use RootContext type name instead of
18906 * delegate.cs: Remove RootContext argument.
18908 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18911 * class.cs (Event.Define): The lookup can fail.
18913 * cs-tokenizer.cs: Begin implementation of pre-procesor.
18915 * expression.cs: Resolve the this instance before invoking the code.
18917 2001-12-17 Miguel de Icaza <miguel@ximian.com>
18919 * cs-parser.jay: Add a production in element_access that allows
18920 the thing to become a "type" reference. This way we can parse
18921 things like "(string [])" as a type.
18923 Note that this still does not handle the more complex rules of
18927 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
18929 * ecore.cs: (CopyNewMethods): new utility function used to
18930 assemble the list of methods from running FindMembers.
18932 (MemberLookup): Rework FindMembers so that
18934 2001-12-16 Miguel de Icaza <miguel@ximian.com>
18936 * class.cs (TypeContainer): Remove Delegates who fail to be
18939 * delegate.cs (Populate): Verify that we dont get null return
18940 values. TODO: Check for AsAccessible.
18942 * cs-parser.jay: Use basename to emit error 574 (destructor should
18943 have the same name as container class), not the full name.
18945 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18946 possible representation.
18948 Also implements integer type suffixes U and L.
18950 2001-12-15 Miguel de Icaza <miguel@ximian.com>
18952 * expression.cs (ArrayCreation.DoResolve): We need to do the
18953 argument resolution *always*.
18955 * decl.cs: Make this hold the namespace. Hold the root context as
18957 (LookupType): Move here.
18959 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18961 * location.cs (Row, Name): Fixed the code, it was always returning
18962 references to the first file.
18964 * interface.cs: Register properties defined through interfaces.
18966 * driver.cs: Add support for globbing on the command line
18968 * class.cs (Field): Make it derive from MemberCore as well.
18971 2001-12-15 Ravi Pratap <ravi@ximian.com>
18973 * class.cs (Event::Define): Check that the type of the event is a delegate
18974 type else flag error #66.
18976 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18979 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18980 values of EntryPoint, CharSet etc etc.
18982 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18984 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18985 be null and we should ignore this. I am not sure if this is really clean. Apparently,
18986 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18987 which needs this to do its work.
18989 * ../errors/cs0066.cs : Add.
18991 2001-12-14 Miguel de Icaza <miguel@ximian.com>
18993 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18996 * class.cs: (MethodSignature.MethodSignature): Removed hack that
18997 clears out the parameters field.
18998 (MemberSignatureCompare): Cleanup
19000 (MemberCore): New base class used to share code between MethodCore
19003 (RegisterRequiredImplementations) BindingFlags.Public requires
19004 either BindingFlags.Instace or Static. Use instance here.
19006 (Property): Refactored code to cope better with the full spec.
19008 * parameter.cs (GetParameterInfo): Return an empty array instead
19011 * class.cs (Property): Abstract or extern properties have no bodies.
19013 * parameter.cs (GetParameterInfo): return a zero-sized array.
19015 * class.cs (TypeContainer.MethodModifiersValid): Move all the
19016 method modifier validation to the typecontainer so we can reuse
19017 this on properties.
19019 (MethodCore.ParameterTypes): return an empty sized array of types.
19021 (Property.Define): Test property modifier validity.
19023 Add tests for sealed/override too.
19025 (Method.Emit): abstract or extern methods have no bodies.
19027 2001-12-14 Ravi Pratap <ravi@ximian.com>
19029 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19032 (Method::Define, ::Emit): Modify accordingly.
19034 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19036 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19038 * makefile: Pass in /unsafe.
19040 2001-12-13 Miguel de Icaza <miguel@ximian.com>
19042 * class.cs (MakeKey): Kill routine.
19044 * class.cs (TypeContainer.Define): Correctly define explicit
19045 method implementations (they require the full interface name plus
19048 * typemanager.cs: Deply the PtrHashtable here and stop using the
19049 lame keys. Things work so much better.
19051 This of course broke everyone who depended on `RegisterMethod' to
19052 do the `test for existance' test. This has to be done elsewhere.
19054 * support.cs (PtrHashtable): A hashtable that avoid comparing with
19055 the object stupid Equals method (because, that like fails all over
19056 the place). We still do not use it.
19058 * class.cs (TypeContainer.SetRequiredInterface,
19059 TypeContainer.RequireMethods): Killed these two routines and moved
19060 all the functionality to RegisterRequiredImplementations.
19062 (TypeContainer.RegisterRequiredImplementations): This routine now
19063 registers all the implementations required in an array for the
19064 interfaces and abstract methods. We use an array of structures
19065 which can be computed ahead of time to reduce memory usage and we
19066 also assume that lookups are cheap as most classes will not
19067 implement too many interfaces.
19069 We also avoid creating too many MethodSignatures.
19071 (TypeContainer.IsInterfaceMethod): Update and optionally does not
19072 clear the "pending" bit if we find that there are problems with
19075 (TypeContainer.VerifyPendingMethods): Update to report errors of
19076 methods that look like implementations but are not.
19078 (TypeContainer.Define): Add support for explicit interface method
19081 2001-12-12 Miguel de Icaza <miguel@ximian.com>
19083 * typemanager.cs: Keep track of the parameters here instead of
19084 being a feature of the TypeContainer.
19086 * class.cs: Drop the registration of parameters here, as
19087 InterfaceMethods are also interface declarations.
19089 * delegate.cs: Register methods with the TypeManager not only with
19090 the TypeContainer. This code was buggy.
19092 * interface.cs: Full registation here.
19094 2001-12-11 Miguel de Icaza <miguel@ximian.com>
19096 * expression.cs: Remove reducer for binary expressions, it can not
19099 * const.cs: Put here the code that used to go into constant.cs
19101 * constant.cs: Put here the code for constants, this is a new base
19102 class for Literals.
19104 * literal.cs: Make Literal derive from Constant.
19106 2001-12-09 Miguel de Icaza <miguel@ximian.com>
19108 * statement.cs (Return.Emit): Report error 157 if the user
19109 attempts to return from a finally block.
19111 (Return.Emit): Instead of emitting a return, jump to the end of
19114 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19115 LocalBuilder to store the result of the function. ReturnLabel is
19116 the target where we jump.
19119 2001-12-09 Radek Doulik <rodo@ximian.com>
19121 * cs-parser.jay: remember alias in current namespace
19123 * ecore.cs (SimpleName::DoResolve): use aliases for types or
19126 * class.cs (LookupAlias): lookup alias in my_namespace
19128 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19130 (LookupAlias): lookup alias in this and if needed in parent
19133 2001-12-08 Miguel de Icaza <miguel@ximian.com>
19137 * rootcontext.cs: (ModuleBuilder) Made static, first step into
19138 making things static. I need this to avoid passing the
19139 TypeContainer when calling ParameterType.
19141 * support.cs (InternalParameters.ParameterType): Remove ugly hack
19142 that did string manipulation to compute the type and then call
19143 GetType. Use Parameter.ParameterType instead.
19145 * cs-tokenizer.cs: Consume the suffix for floating values.
19147 * expression.cs (ParameterReference): figure out whether this is a
19148 reference parameter or not. Kill an extra variable by computing
19149 the arg_idx during emission.
19151 * parameter.cs (Parameters.GetParameterInfo): New overloaded
19152 function that returns whether a parameter is an out/ref value or not.
19154 (Parameter.ParameterType): The type of the parameter (base,
19155 without ref/out applied).
19157 (Parameter.Resolve): Perform resolution here.
19158 (Parameter.ExternalType): The full type (with ref/out applied).
19160 * statement.cs (Using.Emit, Using.EmitExpression): Implement
19161 support for expressions on the using statement.
19163 2001-12-07 Miguel de Icaza <miguel@ximian.com>
19165 * statement.cs (Using.EmitLocalVariableDecls): Split the
19166 localvariable handling of the using statement.
19168 (Block.EmitMeta): Keep track of variable count across blocks. We
19169 were reusing slots on separate branches of blocks.
19171 (Try.Emit): Emit the general code block, we were not emitting it.
19173 Check the type of the declaration to be an IDisposable or
19174 something that can be implicity converted to it.
19176 Emit conversions if required.
19178 * ecore.cs (EmptyExpression): New utility class.
19179 (Expression.ImplicitConversionExists): New utility function.
19181 2001-12-06 Miguel de Icaza <miguel@ximian.com>
19183 * statement.cs (Using): Implement.
19185 * expression.cs (LocalVariableReference): Support read only variables.
19187 * statement.cs: Remove the explicit emit for the Leave opcode.
19188 (VariableInfo): Add a readonly field.
19190 2001-12-05 Miguel de Icaza <miguel@ximian.com>
19192 * ecore.cs (ConvCast): new class used to encapsulate the various
19193 explicit integer conversions that works in both checked and
19194 unchecked contexts.
19196 (Expression.ConvertNumericExplicit): Use new ConvCast class to
19197 properly generate the overflow opcodes.
19199 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19201 * statement.cs: The correct type for the EmptyExpression is the
19202 element_type, not the variable type. Ravi pointed this out.
19204 2001-12-04 Ravi Pratap <ravi@ximian.com>
19206 * class.cs (Method::Define): Handle PInvoke methods specially
19207 by using DefinePInvokeMethod instead of the usual one.
19209 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19210 above to do the task of extracting information and defining the method.
19212 2001-12-04 Ravi Pratap <ravi@ximian.com>
19214 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19215 of the condition for string type.
19217 (Emit): Move that here.
19219 (ArrayCreation::CheckIndices): Keep string literals in their expression
19222 (EmitDynamicInitializers): Handle strings appropriately.
19224 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19226 * codegen.cs (EmitContext): Replace multiple variables with a
19227 single pointer to the current Switch statement.
19229 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19232 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19236 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19239 (Foreach.Emit): Foreach on arrays was not setting
19240 up the loop variables (for break/continue).
19242 (GotoCase): Semi-implented.
19244 2001-12-03 Ravi Pratap <ravi@ximian.com>
19246 * attribute.cs (CheckAttribute): Handle system attributes by using
19247 Attribute.GetAttributes to examine information we need.
19249 (GetValidPlaces): Same here.
19251 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19253 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19255 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19257 (Method::Define): Set appropriate flags if we have a DllImport attribute.
19259 (Method::Emit): Handle the case when we are a PInvoke method.
19261 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19263 * expression.cs: Use ResolveWithSimpleName on compound names.
19265 2001-12-02 Ravi Pratap <ravi@ximian.com>
19267 * constant.cs (EmitConstant): Make sure we resolve the associated expression
19268 before trying to reduce it.
19270 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19272 * constant.cs (LookupConstantValue): Implement.
19274 (EmitConstant): Use the above in emitting the constant.
19276 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19277 that are user-defined by doing a LookupConstantValue on them.
19279 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19282 2001-11-29 Miguel de Icaza <miguel@ximian.com>
19284 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19286 (BaseAccess.DoResolve): Implement.
19288 (MemberAccess.DoResolve): Split this routine into a
19289 ResolveMemberAccess routine that can be used independently
19291 2001-11-28 Miguel de Icaza <miguel@ximian.com>
19293 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19294 As that share bits of the implementation. Is returns a boolean,
19295 while As returns the Type that is being probed.
19297 2001-12-01 Ravi Pratap <ravi@ximian.com>
19299 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19300 instead of a Literal - much easier.
19302 (EnumInTransit): Remove - utterly useless :-)
19304 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19306 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19308 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19309 chain when we have no associated expression.
19311 2001-11-30 Ravi Pratap <ravi@ximian.com>
19313 * constant.cs (Define): Use Location while reporting the errror.
19315 Also emit a warning when 'new' is used and there is no inherited
19318 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
19321 (LookupEnumValue): Implement to lookup an enum member's value and define it
19324 (Populate): Re-write accordingly to use the above routine.
19326 2001-11-27 Miguel de Icaza <miguel@ximian.com>
19328 * expression.cs (This): Fix prototype for DoResolveLValue to
19329 override the base class DoResolveLValue.
19331 * cs-parser.cs: Report errors cs574 and cs575 (destructor
19334 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19335 (we need to load the address of the field here). This fixes
19338 (FieldExpr.DoResolveLValue): Call the DoResolve
19339 function to initialize the Instance expression.
19341 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19342 correctly the GetEnumerator operation on a value type.
19344 * cs-parser.jay: Add more simple parsing error catches.
19346 * statement.cs (Switch): Add support for string switches.
19347 Handle null specially.
19349 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
19351 2001-11-28 Ravi Pratap <ravi@ximian.com>
19353 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19355 (declare_local_constant): New helper function.
19357 * statement.cs (AddConstant): Keep a separate record of constants
19359 (IsConstant): Implement to determine if a variable is a constant.
19361 (GetConstantExpression): Implement.
19363 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19365 * statement.cs (IsVariableDefined): Re-write.
19367 2001-11-27 Ravi Pratap <ravi@ximian.com>
19369 * class.cs (TypeContainer::FindMembers): Look for constants
19370 in the case when we are looking for MemberTypes.Field
19372 * expression.cs (MemberAccess::DoResolve): Check that in the
19373 case we are a FieldExpr and a Literal, we are not being accessed
19374 by an instance reference.
19376 * cs-parser.jay (local_constant_declaration): Implement.
19378 (declaration_statement): Implement for constant declarations.
19380 2001-11-26 Miguel de Icaza <miguel@ximian.com>
19382 * statement.cs (Switch): Catch double defaults.
19384 (Switch): More work on the switch() statement
19385 implementation. It works for integral values now, need to finish
19389 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19391 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19392 integer literals into other integer literals. To be used by
19395 2001-11-24 Ravi Pratap <ravi@ximian.com>
19397 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19400 (EmitDynamicInitializers): Cope with the above since we extract data
19401 directly from ArrayData now.
19403 (ExpectInitializers): Keep track of whether initializers are mandatory
19406 (Bounds): Make it a hashtable to prevent the same dimension being
19407 recorded for every element in that dimension.
19409 (EmitDynamicInitializers): Fix bug which prevented the Set array method
19412 Also fix bug which was causing the indices to be emitted in the reverse
19415 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19417 * expression.cs (ArrayCreation): Implement the bits that Ravi left
19418 unfinished. They do not work, because the underlying code is
19421 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19423 * cs-parser.jay: Remove bogus fixme.
19425 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19426 on Switch statement.
19428 2001-11-23 Ravi Pratap <ravi@ximian.com>
19430 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19433 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19434 parameter. Apparently, any expression is allowed.
19436 (ValidateInitializers): Update accordingly.
19438 (CheckIndices): Fix some tricky bugs thanks to recursion.
19440 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
19441 I was being completely brain-dead.
19443 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19444 and re-write acordingly.
19446 (DelegateInvocation): Re-write accordingly.
19448 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19450 (MakeByteBlob): Handle types more correctly.
19452 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19453 initialization from expressions but it is incomplete because I am a complete
19456 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19458 * statement.cs (If.Emit): Fix a bug that generated incorrect code
19459 on If. Basically, we have to return `true' (ie, we do return to
19460 our caller) only if both branches of the if return.
19462 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19463 short-circuit operators, handle them as short circuit operators.
19465 (Cast.DoResolve): Resolve type.
19466 (Cast.Cast): Take an expression as the target type.
19468 * cs-parser.jay (cast_expression): Remove old hack that only
19469 allowed a limited set of types to be handled. Now we take a
19470 unary_expression and we resolve to a type during semantic
19473 Use the grammar productions from Rhys to handle casts (this is
19474 not complete like Rhys syntax yet, we fail to handle that corner
19475 case that C# has regarding (-x), but we will get there.
19477 2001-11-22 Ravi Pratap <ravi@ximian.com>
19479 * class.cs (EmitFieldInitializer): Take care of the case when we have a
19480 field which is an array type.
19482 * cs-parser.jay (declare_local_variables): Support array initialization too.
19484 * typemanager.cs (MakeKey): Implement.
19486 (everywhere): Use the above appropriately.
19488 * cs-parser.jay (for_statement): Update for array initialization while
19489 declaring variables.
19491 * ecore.cs : The error message was correct, it's the variable's names that
19492 were misleading ;-) Make the code more readable.
19494 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19495 the correct type etc.
19497 (ConvertExplicit): Handle Enum types by examining the underlying type.
19499 2001-11-21 Ravi Pratap <ravi@ximian.com>
19501 * parameter.cs (GetCallingConvention): Always return
19502 CallingConventions.Standard for now.
19504 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19506 * expression.cs (Binary.ResolveOperator): Update the values of `l'
19507 and `r' after calling DoNumericPromotions.
19509 * ecore.cs: Fix error message (the types were in the wrong order).
19511 * statement.cs (Foreach.ProbeCollectionType): Need to pass
19512 BindingFlags.Instance as well
19514 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
19515 implicit int literal conversion in an empty cast so that we
19516 propagate the right type upstream.
19518 (UnboxCast): new class used to unbox value types.
19519 (Expression.ConvertExplicit): Add explicit type conversions done
19522 (Expression.ImplicitNumericConversion): Oops, forgot to test for
19523 the target type before applying the implicit LongLiterals to ULong
19526 2001-11-21 Miguel de Icaza <miguel@ximian.com>
19528 * cs-parser.jay (for_statement): Reworked the way For works: now
19529 we declare manually any variables that are introduced in
19530 for_initializer to solve the problem of having out-of-band code
19531 emition (that is what got for broken).
19533 (declaration_statement): Perform the actual variable declaration
19534 that used to be done in local_variable_declaration here.
19536 (local_variable_declaration): Do not declare anything, just pass
19537 the information on a DictionaryEntry
19539 2001-11-20 Ravi Pratap <ravi@ximian.com>
19541 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
19542 re-write of the logic to now make it recursive.
19544 (UpdateIndices): Re-write accordingly.
19546 Store element data in a separate ArrayData list in the above methods.
19548 (MakeByteBlob): Implement to dump the array data into a byte array.
19550 2001-11-19 Ravi Pratap <ravi@ximian.com>
19552 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
19555 * constant.cs (Define): Implement.
19557 (EmitConstant): Re-write fully.
19559 Pass in location info.
19561 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
19564 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
19565 DictionaryEntry since we need location info too.
19567 (constant_declaration): Update accordingly.
19569 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
19570 code into another method : UpdateIndices.
19572 2001-11-18 Ravi Pratap <ravi@ximian.com>
19574 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
19575 some type checking etc.
19577 2001-11-17 Ravi Pratap <ravi@ximian.com>
19579 * expression.cs (ArrayCreation::ValidateInitializers): Implement
19580 bits to provide dimension info if the user skips doing that.
19582 Update second constructor to store the rank correctly.
19584 2001-11-16 Ravi Pratap <ravi@ximian.com>
19586 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
19587 and try to implement.
19589 * ../errors/cs0150.cs : Add.
19591 * ../errors/cs0178.cs : Add.
19593 2001-11-16 Miguel de Icaza <miguel@ximian.com>
19595 * statement.cs: Implement foreach on multi-dimensional arrays.
19597 * parameter.cs (Parameters.GetParameterByName): Also lookup the
19598 name of the params argument.
19600 * expression.cs: Use EmitStoreOpcode to get the right opcode while
19601 initializing the array.
19603 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19604 we can use this elsewhere.
19606 * statement.cs: Finish implementation of foreach for single
19609 * cs-parser.jay: Use an out-of-band stack to pass information
19610 around, I wonder why I need this.
19612 foreach_block: Make the new foreach_block the current_block.
19614 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19615 function used to return a static Parameters structure. Used for
19616 empty parameters, as those are created very frequently.
19618 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19620 2001-11-15 Ravi Pratap <ravi@ximian.com>
19622 * interface.cs : Default modifier is private, not public. The
19623 make verify test passes again.
19625 2001-11-15 Ravi Pratap <ravi@ximian.com>
19627 * support.cs (ReflectionParameters): Fix logic to determine
19628 whether the last parameter is a params one. Test 9 passes again.
19630 * delegate.cs (Populate): Register the builders we define with
19631 RegisterParameterForBuilder. Test 19 passes again.
19633 * cs-parser.jay (property_declaration): Reference $6 instead
19634 of $$ to get at the location.
19636 (indexer_declaration): Similar stuff.
19638 (attribute): Ditto.
19640 * class.cs (Property): Register parameters for the Get and Set methods
19641 if they exist. Test 23 passes again.
19643 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19644 call to EmitArguments as we are sure there aren't any params arguments.
19645 Test 32 passes again.
19647 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19648 IndexOutOfRangeException.
19650 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19651 Test 33 now passes again.
19653 2001-11-15 Miguel de Icaza <miguel@ximian.com>
19655 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19656 broke a bunch of things. Will have to come up with a better way
19657 of tracking locations.
19659 * statement.cs: Implemented foreach for single dimension arrays.
19661 2001-11-09 Miguel de Icaza <miguel@ximian.com>
19663 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19664 an error. This removes the lookup from the critical path.
19666 * cs-parser.jay: Removed use of temporary_loc, which is completely
19669 2001-11-14 Miguel de Icaza <miguel@ximian.com>
19671 * support.cs (ReflectionParameters.ParameterModifier): Report
19672 whether the argument is a PARAMS argument or not.
19674 * class.cs: Set the attribute `ParamArrayAttribute' on the
19675 parameter argument.
19677 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19678 and cons_param_array_attribute (ConstructorInfo for
19679 ParamArrayAttribute).,
19681 * codegen.cs: Emit the return using the `Return' statement, that
19682 way we can report the error correctly for missing return values.
19684 * class.cs (Method.Emit): Clean up.
19686 * expression.cs (Argument.Resolve): Take another argument: the
19687 location where this argument is used. Notice that this is not
19688 part of the "Argument" class as to reduce the size of the
19689 structure (we know the approximate location anyways).
19691 Test if the argument is a variable-reference, if not, then
19692 complain with a 206.
19694 (Argument.Emit): Emit addresses of variables.
19696 (Argument.FullDesc): Simplify.
19698 (Invocation.DoResolve): Update for Argument.Resolve.
19700 (ElementAccess.DoResolve): ditto.
19702 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19703 method should be virtual, as this method is always virtual.
19705 (NewDelegate.DoResolve): Update for Argument.Resolve.
19707 * class.cs (ConstructorInitializer.DoResolve): ditto.
19709 * attribute.cs (Attribute.Resolve): ditto.
19711 2001-11-13 Miguel de Icaza <miguel@ximian.com>
19713 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19715 * expression.cs (ParameterReference): Drop IStackStorage and implement
19716 IAssignMethod instead.
19718 (LocalVariableReference): ditto.
19720 * ecore.cs (FieldExpr): Drop IStackStorage and implement
19721 IAssignMethod instead.
19723 2001-11-13 Miguel de Icaza <miguel@ximian.com>
19725 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19726 enumerations that are used in heavily used structures derive from
19727 byte in a laughable and pathetic attempt to reduce memory usage.
19728 This is the kind of pre-optimzations that you should not do at
19729 home without adult supervision.
19731 * expression.cs (UnaryMutator): New class, used to handle ++ and
19732 -- separatedly from the other unary operators. Cleans up the
19733 code, and kills the ExpressionStatement dependency in Unary.
19735 (Unary): Removed `method' and `Arguments' from this class, making
19736 it smaller, and moving it all to SimpleCall, so I can reuse this
19737 code in other locations and avoid creating a lot of transient data
19738 strucutres when not required.
19740 * cs-parser.jay: Adjust for new changes.
19742 2001-11-11 Miguel de Icaza <miguel@ximian.com>
19744 * enum.cs (Enum.Populate): If there is a failure during
19747 * cs-parser.jay (opt_enum_base): we used to catch type errors
19748 here, but this is really incorrect. The type error should be
19749 catched during semantic analysis.
19751 2001-12-11 Ravi Pratap <ravi@ximian.com>
19753 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19754 current_local_parameters as expected since I, in my stupidity, had forgotten
19757 * attribute.cs (GetValidPlaces): Fix stupid bug.
19759 * class.cs (Method::Emit): Perform check on applicability of attributes.
19761 (Constructor::Emit): Ditto.
19763 (Field::Emit): Ditto.
19765 (Field.Location): Store location information.
19767 (Property, Event, Indexer, Operator): Ditto.
19769 * cs-parser.jay (field_declaration): Pass in location for each field.
19771 * ../errors/cs0592.cs : Add.
19773 2001-11-12 Ravi Pratap <ravi@ximian.com>
19775 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19777 (InitCoreTypes): Update accordingly.
19779 (RegisterAttrType, LookupAttr): Implement.
19781 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19782 info about the same.
19784 (Resolve): Update to populate the above as necessary.
19786 (Error592): Helper.
19788 (GetValidPlaces): Helper to the above.
19790 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19792 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19794 2001-11-12 Ravi Pratap <ravi@ximian.com>
19796 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19798 * ../errors/cs0617.cs : Add.
19800 2001-11-11 Ravi Pratap <ravi@ximian.com>
19802 * enum.cs (Emit): Rename to Populate to be more consistent with what
19803 we expect it to do and when exactly it is called.
19805 * class.cs, rootcontext.cs : Update accordingly.
19807 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19808 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19810 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19812 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19813 of a fieldinfo using the above, when dealing with a FieldBuilder.
19815 2001-11-10 Ravi Pratap <ravi@ximian.com>
19817 * ../errors/cs0031.cs : Add.
19819 * ../errors/cs1008.cs : Add.
19821 * ../errrors/cs0543.cs : Add.
19823 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19826 (FindMembers): Implement.
19828 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19829 enums and delegates too.
19831 (enum_types): Rename to builder_to_enum.
19833 (delegate_types): Rename to builder_to_delegate.
19835 * delegate.cs (FindMembers): Implement.
19837 2001-11-09 Ravi Pratap <ravi@ximian.com>
19839 * typemanager.cs (IsEnumType): Implement.
19841 * enum.cs (Emit): Re-write parts to account for the underlying type
19842 better and perform checking etc.
19844 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19845 of the underlying type.
19847 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19850 * enum.cs (error31): Helper to report error #31.
19852 * cs-parser.jay (enum_declaration): Store location of each member too.
19854 * enum.cs (member_to_location): New hashtable.
19856 (AddEnumMember): Update location hashtable.
19858 (Emit): Use the location of each member while reporting errors.
19860 2001-11-09 Miguel de Icaza <miguel@ximian.com>
19862 * cs-parser.jay: A for_initializer if is a
19863 local_variable_declaration really ammount to have an implicit
19864 block with the variable declaration and no initializer for for.
19866 * statement.cs (For.Emit): Cope with null initializers.
19868 This fixes the infinite loop on for initializers.
19870 2001-11-08 Miguel de Icaza <miguel@ximian.com>
19872 * enum.cs: More cleanup.
19874 * ecore.cs: Remove dead code.
19876 * class.cs (Property.Emit): More simplification.
19877 (Event.Emit): ditto.
19879 Reworked to have less levels of indentation.
19881 2001-11-08 Ravi Pratap <ravi@ximian.com>
19883 * class.cs (Property): Emit attributes.
19893 * enum.cs (Emit): Ditto.
19895 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19898 * class.cs (Field, Event, etc.): Move attribute generation into the
19899 Emit method everywhere.
19901 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19902 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19903 as we had no way of defining nested enums !
19905 * rootcontext.cs : Adjust code accordingly.
19907 * typemanager.cs (AddEnumType): To keep track of enum types separately.
19909 2001-11-07 Ravi Pratap <ravi@ximian.com>
19911 * expression.cs (EvalConstantExpression): Move into ecore.cs
19913 * enum.cs (Enum): Rename some members and make them public and readonly
19914 according to our convention.
19916 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19919 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19921 (Enum::Emit): Write a simple version for now which doesn't try to compute
19922 expressions. I shall modify this to be more robust in just a while.
19924 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19926 (TypeContainer::CloseType): Create the Enum types too.
19928 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19930 * expression.cs (EvalConstantExpression): Get rid of completely.
19932 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19933 user-defined values and other cases.
19935 (IsValidEnumLiteral): Helper function.
19937 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
19938 out there in the case we had a literal FieldExpr.
19940 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19942 (Literalize): Revamp a bit to take two arguments.
19944 (EnumLiteral): New class which derives from Literal to wrap enum literals.
19946 2001-11-06 Ravi Pratap <ravi@ximian.com>
19948 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19950 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19952 (Resolve): Use the above to ensure we have proper initializers.
19954 2001-11-05 Ravi Pratap <ravi@ximian.com>
19956 * expression.cs (Expression::EvalConstantExpression): New method to
19957 evaluate constant expressions.
19959 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19961 2001-11-07 Miguel de Icaza <miguel@ximian.com>
19963 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19966 (Binary.ResolveOperator): Handle operator != (object a, object b)
19967 and operator == (object a, object b);
19969 (Binary.DoNumericPromotions): Indicate whether the numeric
19970 promotion was possible.
19972 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19975 Made the ArrayAccess implement interface IAssignMethod instead of
19976 IStackStore as the order in which arguments are passed reflects
19979 * assign.cs: Instead of using expr.ExprClass to select the way of
19980 assinging, probe for the IStackStore/IAssignMethod interfaces.
19982 * typemanager.cs: Load InitializeArray definition.
19984 * rootcontext.cs (RootContext.MakeStaticData): Used to define
19985 static data that can be used to initialize arrays.
19987 2001-11-05 Miguel de Icaza <miguel@ximian.com>
19989 * expression.cs: Handle operator== and operator!= for booleans.
19991 (Conditioal.Reduce): Implement reducer for the ?: operator.
19993 (Conditional.Resolve): Implement dead code elimination.
19995 (Binary.Resolve): Catch string literals and return a new
19996 concatenated string.
19998 (Unary.Reduce): Implement reduction of unary expressions.
20000 * ecore.cs: Split out the expression core handling here.
20002 (Expression.Reduce): New method used to perform constant folding
20003 and CSE. This is needed to support constant-expressions.
20005 * statement.cs (Statement.EmitBoolExpression): Pass true and false
20006 targets, and optimize for !x.
20008 2001-11-04 Ravi Pratap <ravi@ximian.com>
20010 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20011 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20012 set custom atttributes.
20014 * literal.cs (Literal::GetValue): New abstract method to return the actual
20015 value of the literal, cast as an object.
20017 (*Literal): Implement GetValue method.
20019 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20020 expressions to the arraylist but objects of type Argument.
20022 * class.cs (TypeContainer::Emit): Emit our attributes too.
20024 (Method::Emit, Constructor::Emit): Ditto.
20026 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20027 to be ignoring earlier.
20029 2001-11-03 Ravi Pratap <ravi@ximian.com>
20031 * attribute.cs (AttributeSection::Define): Implement to do the business
20032 of constructing a CustomAttributeBuilder.
20034 (Attribute): New trivial class. Increases readability of code.
20036 * cs-parser.jay : Update accordingly.
20038 (positional_argument_list, named_argument_list, named_argument): New rules
20040 (attribute_arguments): Use the above so that we are more correct.
20042 2001-11-02 Ravi Pratap <ravi@ximian.com>
20044 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20045 to perform all checks for a method with a params parameter.
20047 (Invocation::OverloadResolve): Update to use the above method and therefore
20048 cope correctly with params method invocations.
20050 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
20053 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20054 constructors in our parent too because we can't afford to miss out on
20057 * attribute.cs (AttributeSection): New name for the class Attribute
20059 Other trivial changes to improve readability.
20061 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20062 use the new class names.
20064 2001-11-01 Ravi Pratap <ravi@ximian.com>
20066 * class.cs (Method::Define): Complete definition for params types too
20068 (Indexer::Define): Ditto.
20070 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20071 Cope everywhere with a request for info about the array parameter.
20073 2001-11-01 Ravi Pratap <ravi@ximian.com>
20075 * tree.cs (RecordNamespace): Fix up to check for the correct key.
20077 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
20078 local_variable_type to extract the string corresponding to the type.
20080 (local_variable_type): Fixup the action to use the new helper method.
20082 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
20085 * expression.cs : Clean out code which uses the above.
20087 2001-10-31 Ravi Pratap <ravi@ximian.com>
20089 * typemanager.cs (RegisterMethod): Check if we already have an existing key
20090 and bale out if necessary by returning a false.
20092 (RegisterProperty): Ditto.
20094 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20095 and print out appropriate error messages.
20097 * interface.cs (everywhere): Ditto.
20099 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20100 location to constructor.
20102 * class.cs (Property, Event, Indexer): Update accordingly.
20104 * ../errors/cs111.cs : Added.
20106 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20107 of a method, as laid down by the spec.
20109 (Invocation::OverloadResolve): Use the above method.
20111 2001-10-31 Ravi Pratap <ravi@ximian.com>
20113 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20114 now take a TypeContainer and a Parameters object.
20116 (ParameterData): Modify return type of ParameterModifier method to be
20117 Parameter.Modifier and not a string.
20119 (ReflectionParameters, InternalParameters): Update accordingly.
20121 * expression.cs (Argument::GetParameterModifier): Same here.
20123 * support.cs (InternalParameters::ParameterType): Find a better way of determining
20124 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20125 symbol in it at all so maybe this is only for now.
20127 2001-10-30 Ravi Pratap <ravi@ximian.com>
20129 * support.cs (InternalParameters): Constructor now takes an extra argument
20130 which is the actual Parameters class.
20132 (ParameterDesc): Update to provide info on ref/out modifiers.
20134 * class.cs (everywhere): Update call to InternalParameters to pass in
20135 the second argument too.
20137 * support.cs (ParameterData): Add ParameterModifier, which is a method
20138 to return the modifier info [ref/out etc]
20140 (InternalParameters, ReflectionParameters): Implement the above.
20142 * expression.cs (Argument::ParameterModifier): Similar function to return
20143 info about the argument's modifiers.
20145 (Invocation::OverloadResolve): Update to take into account matching modifiers
20148 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20149 a new SetFormalParameters object which we pass to InternalParameters.
20151 2001-10-30 Ravi Pratap <ravi@ximian.com>
20153 * expression.cs (NewArray): Merge into the ArrayCreation class.
20155 2001-10-29 Ravi Pratap <ravi@ximian.com>
20157 * expression.cs (NewArray): Merge classes NewBuiltinArray and
20158 NewUserdefinedArray into one as there wasn't much of a use in having
20161 * expression.cs (Argument): Change field's name to ArgType from Type.
20163 (Type): New readonly property which returns the proper type, taking into
20164 account ref/out modifiers.
20166 (everywhere): Adjust code accordingly for the above.
20168 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20169 whether we are emitting for a ref or out parameter.
20171 * expression.cs (Argument::Emit): Use the above field to set the state.
20173 (LocalVariableReference::Emit): Update to honour the flag and emit the
20176 * parameter.cs (Attributes): Set the correct flags for ref parameters.
20178 * expression.cs (Argument::FullDesc): New function to provide a full desc.
20180 * support.cs (ParameterData): Add method ParameterDesc to the interface.
20182 (ReflectionParameters, InternalParameters): Implement the above method.
20184 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20187 (Invocation::FullMethodDesc): Ditto.
20189 2001-10-29 Miguel de Icaza <miguel@ximian.com>
20191 * cs-parser.jay: Add extra production for the second form of array
20194 * expression.cs (ArrayCreation): Update to reflect the above
20197 * Small changes to prepare for Array initialization.
20199 2001-10-28 Miguel de Icaza <miguel@ximian.com>
20201 * typemanager.cs (ImplementsInterface): interface might be null;
20202 Deal with this problem;
20204 Also, we do store negative hits on the cache (null values), so use
20205 this instead of calling t.GetInterfaces on the type everytime.
20207 2001-10-28 Ravi Pratap <ravi@ximian.com>
20209 * typemanager.cs (IsBuiltinType): New method to help determine the same.
20211 * expression.cs (New::DoResolve): Get rid of array creation code and instead
20212 split functionality out into different classes.
20214 (New::FormArrayType): Move into NewBuiltinArray.
20216 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20219 (NewBuiltinArray): New class to handle creation of built-in arrays.
20221 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20222 account creation of one-dimensional arrays.
20224 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20226 (NewUserdefinedArray::DoResolve): Implement.
20228 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20230 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20231 we maintain inside the TypeManager. This is necessary to perform lookups on the
20234 (LookupType): Update to perform GetType on the module builders too.
20236 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20238 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20240 2001-10-23 Ravi Pratap <ravi@ximian.com>
20242 * expression.cs (New::DoResolve): Implement guts of array creation.
20244 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20246 2001-10-27 Miguel de Icaza <miguel@ximian.com>
20248 * expression.cs: Fix bug I introduced lsat night that broke
20251 (Expression.Resolve): Report a 246 error (can not resolve name)
20252 if we find a SimpleName in the stream.
20254 (Expression.ResolveLValue): Ditto.
20256 (Expression.ResolveWithSimpleName): This function is a variant of
20257 ResolveName, this one allows SimpleNames to be returned without a
20258 warning. The only consumer of SimpleNames is MemberAccess
20260 2001-10-26 Miguel de Icaza <miguel@ximian.com>
20262 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20263 might arrive here. I have my doubts that this is correct.
20265 * statement.cs (Lock): Implement lock statement.
20267 * cs-parser.jay: Small fixes to support `lock' and `using'
20269 * cs-tokenizer.cs: Remove extra space
20271 * driver.cs: New flag --checked, allows to turn on integer math
20274 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20275 Threading.Monitor.Exit
20277 2001-10-23 Miguel de Icaza <miguel@ximian.com>
20279 * expression.cs (IndexerAccess::DoResolveLValue): Set the
20280 Expression Class to be IndexerAccess.
20282 Notice that Indexer::DoResolve sets the eclass to Value.
20284 2001-10-22 Miguel de Icaza <miguel@ximian.com>
20286 * class.cs (TypeContainer::Emit): Emit code for indexers.
20288 * assign.cs (IAssignMethod): New interface implemented by Indexers
20289 and Properties for handling assignment.
20291 (Assign::Emit): Simplify and reuse code.
20293 * expression.cs (IndexerAccess, PropertyExpr): Implement
20294 IAssignMethod, clean up old code.
20296 2001-10-22 Ravi Pratap <ravi@ximian.com>
20298 * typemanager.cs (ImplementsInterface): New method to determine if a type
20299 implements a given interface. Provides a nice cache too.
20301 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20304 (ConvertReferenceExplicit): Ditto.
20306 * delegate.cs (Delegate::Populate): Update to define the parameters on the
20307 various methods, with correct names etc.
20309 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
20310 Operator.UnaryNegation.
20312 * cs-parser.jay (operator_declarator): Be a little clever in the case where
20313 we have a unary plus or minus operator.
20315 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
20318 * everywhere : update accordingly.
20320 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20323 * class.cs (Method::Define): For the case where we are implementing a method
20324 inherited from an interface, we need to set the MethodAttributes.Final flag too.
20325 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20327 2001-10-21 Ravi Pratap <ravi@ximian.com>
20329 * interface.cs (FindMembers): Implement to work around S.R.E
20332 * typemanager.cs (IsInterfaceType): Implement.
20334 (FindMembers): Update to handle interface types too.
20336 * expression.cs (ImplicitReferenceConversion): Re-write bits which
20337 use IsAssignableFrom as that is not correct - it doesn't work.
20339 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20340 and accordingly override EmitStatement.
20342 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20343 using the correct logic :-)
20345 2001-10-19 Ravi Pratap <ravi@ximian.com>
20347 * ../errors/cs-11.cs : Add to demonstrate error -11
20349 2001-10-17 Miguel de Icaza <miguel@ximian.com>
20351 * assign.cs (Assign::Resolve): Resolve right hand side first, and
20352 then pass this as a hint to ResolveLValue.
20354 * expression.cs (FieldExpr): Add Location information
20356 (FieldExpr::LValueResolve): Report assignment to readonly
20359 (Expression::ExprClassFromMemberInfo): Pass location information.
20361 (Expression::ResolveLValue): Add new method that resolves an
20364 (Expression::DoResolveLValue): Default invocation calls
20367 (Indexers): New class used to keep track of indexers in a given
20370 (IStackStore): Renamed from LValue, as it did not really describe
20371 what this did. Also ResolveLValue is gone from this interface and
20372 now is part of Expression.
20374 (ElementAccess): Depending on the element access type
20376 * typemanager.cs: Add `indexer_name_type' as a Core type
20377 (System.Runtime.CompilerServices.IndexerNameAttribute)
20379 * statement.cs (Goto): Take a location.
20381 2001-10-18 Ravi Pratap <ravi@ximian.com>
20383 * delegate.cs (Delegate::VerifyDelegate): New method to verify
20384 if two delegates are compatible.
20386 (NewDelegate::DoResolve): Update to take care of the case when
20387 we instantiate a delegate from another delegate.
20389 * typemanager.cs (FindMembers): Don't even try to look up members
20390 of Delegate types for now.
20392 2001-10-18 Ravi Pratap <ravi@ximian.com>
20394 * delegate.cs (NewDelegate): New class to take care of delegate
20397 * expression.cs (New): Split the delegate related code out into
20398 the NewDelegate class.
20400 * delegate.cs (DelegateInvocation): New class to handle delegate
20403 * expression.cs (Invocation): Split out delegate related code into
20404 the DelegateInvocation class.
20406 2001-10-17 Ravi Pratap <ravi@ximian.com>
20408 * expression.cs (New::DoResolve): Implement delegate creation fully
20409 and according to the spec.
20411 (New::DoEmit): Update to handle delegates differently.
20413 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20414 because of which we were printing out arguments in reverse order !
20416 * delegate.cs (VerifyMethod): Implement to check if the given method
20417 matches the delegate.
20419 (FullDelegateDesc): Implement.
20421 (VerifyApplicability): Implement.
20423 * expression.cs (Invocation::DoResolve): Update to accordingly handle
20424 delegate invocations too.
20426 (Invocation::Emit): Ditto.
20428 * ../errors/cs1593.cs : Added.
20430 * ../errors/cs1594.cs : Added.
20432 * delegate.cs (InstanceExpression, TargetMethod): New properties.
20434 2001-10-16 Ravi Pratap <ravi@ximian.com>
20436 * typemanager.cs (intptr_type): Core type for System.IntPtr
20438 (InitCoreTypes): Update for the same.
20440 (iasyncresult_type, asynccallback_type): Ditto.
20442 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20445 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20448 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20449 the builders for the 4 members of a delegate type :-)
20451 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20454 * expression.cs (New::DoResolve): Implement guts for delegate creation.
20456 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20458 2001-10-15 Miguel de Icaza <miguel@ximian.com>
20460 * statement.cs (Break::Emit): Implement.
20461 (Continue::Emit): Implement.
20463 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
20464 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
20465 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
20466 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
20469 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20470 properties that track the label for the current loop (begin of the
20471 loop and end of the loop).
20473 2001-10-15 Ravi Pratap <ravi@ximian.com>
20475 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20476 use of emitting anything at all.
20478 * class.cs, rootcontext.cs : Get rid of calls to the same.
20480 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20482 (Populate): Define the constructor correctly and set the implementation
20485 * typemanager.cs (delegate_types): New hashtable to hold delegates that
20488 (AddDelegateType): Implement.
20490 (IsDelegateType): Implement helper method.
20492 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20494 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20495 and accordingly handle it.
20497 * delegate.cs (Populate): Take TypeContainer argument.
20498 Implement bits to define the Invoke method. However, I still haven't figured out
20499 how to take care of the native int bit :-(
20501 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
20502 Qualify the name of the delegate, not its return type !
20504 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
20507 (StandardConversionExists): Checking for array types turns out to be recursive.
20509 (ConvertReferenceExplicit): Implement array conversion.
20511 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
20513 2001-10-12 Ravi Pratap <ravi@ximian.com>
20515 * cs-parser.jay (delegate_declaration): Store the fully qualified
20516 name as it is a type declaration.
20518 * delegate.cs (ReturnType, Name): Rename members to these. Make them
20521 (DefineDelegate): Renamed from Define. Does the same thing essentially,
20522 as TypeContainer::DefineType.
20524 (Populate): Method in which all the definition of the various methods (Invoke)
20527 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
20530 (CloseDelegate): Finally creates the delegate.
20532 * class.cs (TypeContainer::DefineType): Update to define delegates.
20533 (Populate, Emit and CloseType): Do the same thing here too.
20535 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
20536 delegates in all these operations.
20538 2001-10-14 Miguel de Icaza <miguel@ximian.com>
20540 * expression.cs: LocalTemporary: a new expression used to
20541 reference a temporary that has been created.
20543 * assign.cs: Handle PropertyAccess back here, so that we can
20544 provide the proper semantic access to properties.
20546 * expression.cs (Expression::ConvertReferenceExplicit): Implement
20547 a few more explicit conversions.
20549 * modifiers.cs: `NEW' modifier maps to HideBySig.
20551 * expression.cs (PropertyExpr): Make this into an
20552 ExpressionStatement, and support the EmitStatement code path.
20554 Perform get/set error checking, clean up the interface.
20556 * assign.cs: recognize PropertyExprs as targets, and if so, turn
20557 them into toplevel access objects.
20559 2001-10-12 Miguel de Icaza <miguel@ximian.com>
20561 * expression.cs: PropertyExpr::PropertyExpr: use work around the
20564 * typemanager.cs: Keep track here of our PropertyBuilders again to
20565 work around lameness in SRE.
20567 2001-10-11 Miguel de Icaza <miguel@ximian.com>
20569 * expression.cs (LValue::LValueResolve): New method in the
20570 interface, used to perform a second resolution pass for LValues.
20572 (This::DoResolve): Catch the use of this in static methods.
20574 (This::LValueResolve): Implement.
20576 (This::Store): Remove warning, assigning to `this' in structures
20579 (Invocation::Emit): Deal with invocation of
20580 methods on value types. We need to pass the address to structure
20581 methods rather than the object itself. (The equivalent code to
20582 emit "this" for structures leaves the entire structure on the
20583 stack instead of a pointer to it).
20585 (ParameterReference::DoResolve): Compute the real index for the
20586 argument based on whether the method takes or not a `this' pointer
20587 (ie, the method is static).
20589 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
20590 value types returned from functions when we need to invoke a
20591 method on the sturcture.
20594 2001-10-11 Ravi Pratap <ravi@ximian.com>
20596 * class.cs (TypeContainer::DefineType): Method to actually do the business of
20597 defining the type in the Modulebuilder or Typebuilder. This is to take
20598 care of nested types which need to be defined on the TypeBuilder using
20599 DefineNestedMethod.
20601 (TypeContainer::GetClassBases): Implement. Essentially the code from the
20602 methods in RootContext, only ported to be part of TypeContainer.
20604 (TypeContainer::GetInterfaceOrClass): Ditto.
20606 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20608 * interface.cs (Interface::DefineInterface): New method. Does exactly
20609 what RootContext.CreateInterface did earlier, only it takes care of nested types
20612 (Interface::GetInterfaces): Move from RootContext here and port.
20614 (Interface::GetInterfaceByName): Same here.
20616 * rootcontext.cs (ResolveTree): Re-write.
20618 (PopulateTypes): Re-write.
20620 * class.cs (TypeContainer::Populate): Populate nested types too.
20621 (TypeContainer::Emit): Emit nested members too.
20623 * typemanager.cs (AddUserType): Do not make use of the FullName property,
20624 instead just use the name argument passed in as it is already fully
20627 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20628 to TypeContainer mapping to see if a type is user-defined.
20630 * class.cs (TypeContainer::CloseType): Implement.
20632 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20633 the default constructor.
20635 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20638 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20640 * interface.cs (CloseType): Create the type here.
20642 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20645 Remove all the methods which are now in TypeContainer.
20647 2001-10-10 Ravi Pratap <ravi@ximian.com>
20649 * delegate.cs (Define): Re-write bits to define the delegate
20652 2001-10-10 Miguel de Icaza <miguel@ximian.com>
20654 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20656 * expression.cs (ImplicitReferenceConversion): handle null as well
20657 as a source to convert to any reference type.
20659 * statement.cs (Return): Perform any implicit conversions to
20660 expected return type.
20662 Validate use of return statement.
20664 * codegen.cs (EmitContext): Pass the expected return type here.
20666 * class.cs (Method, Constructor, Property): Pass expected return
20667 type to EmitContext.
20669 2001-10-09 Miguel de Icaza <miguel@ximian.com>
20671 * expression.cs: Make DoResolve take an EmitContext instead of a
20674 Replaced `l' and `location' for `loc', for consistency.
20676 (Error, Warning): Remove unneeded Tc argument.
20678 * assign.cs, literal.cs, constant.cs: Update to new calling
20681 * codegen.cs: EmitContext now contains a flag indicating whether
20682 code is being generated in a static method or not.
20684 * cs-parser.jay: DecomposeQI, new function that replaces the old
20685 QualifiedIdentifier. Now we always decompose the assembled
20686 strings from qualified_identifier productions into a group of
20689 2001-10-08 Miguel de Icaza <miguel@ximian.com>
20691 * rootcontext.cs: Deal with field-less struct types correctly now
20692 by passing the size option to Define Type.
20694 * class.cs: Removed hack that created one static field.
20696 2001-10-07 Miguel de Icaza <miguel@ximian.com>
20698 * statement.cs: Moved most of the code generation here.
20700 2001-10-09 Ravi Pratap <ravi@ximian.com>
20702 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20705 (ElementAccess): Remove useless bits for now - keep checks as the spec
20708 2001-10-08 Ravi Pratap <ravi@ximian.com>
20710 * expression.cs (ElementAccess::DoResolve): Remove my crap code
20711 and start performing checks according to the spec.
20713 2001-10-07 Ravi Pratap <ravi@ximian.com>
20715 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20716 rank_specifiers instead.
20718 (rank_specifiers): Change the order in which the rank specifiers are stored
20720 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20722 * expression.cs (ElementAccess): Implement the LValue interface too.
20724 2001-10-06 Ravi Pratap <ravi@ximian.com>
20726 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20727 except that user defined conversions are not included.
20729 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
20730 perform the conversion of the return type, if necessary.
20732 (New::DoResolve): Check whether we are creating an array or an object
20733 and accordingly do the needful.
20735 (New::Emit): Same here.
20737 (New::DoResolve): Implement guts of array creation.
20739 (New::FormLookupType): Helper function.
20741 2001-10-07 Miguel de Icaza <miguel@ximian.com>
20743 * codegen.cs: Removed most of the code generation here, and move the
20744 corresponding code generation bits to the statement classes.
20746 Added support for try/catch/finalize and throw.
20748 * cs-parser.jay: Added support for try/catch/finalize.
20750 * class.cs: Catch static methods having the flags override,
20751 virtual or abstract.
20753 * expression.cs (UserCast): This user cast was not really doing
20754 what it was supposed to do. Which is to be born in fully resolved
20755 state. Parts of the resolution were being performed at Emit time!
20759 2001-10-05 Miguel de Icaza <miguel@ximian.com>
20761 * expression.cs: Implicity convert the result from UserCast.
20763 2001-10-05 Ravi Pratap <ravi@ximian.com>
20765 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20766 prevented it from working correctly.
20768 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20769 merely ConvertImplicit.
20771 2001-10-05 Miguel de Icaza <miguel@ximian.com>
20773 * typemanager.cs: Make the LookupTypeContainer function static,
20774 and not per-instance.
20776 * class.cs: Make static FindMembers (the one that takes a Type
20779 * codegen.cs: Add EmitForeach here.
20781 * cs-parser.jay: Make foreach a toplevel object instead of the
20782 inline expansion, as we need to perform semantic analysis on it.
20784 2001-10-05 Ravi Pratap <ravi@ximian.com>
20786 * expression.cs (Expression::ImplicitUserConversion): Rename to
20787 UserDefinedConversion.
20789 (Expression::UserDefinedConversion): Take an extra argument specifying
20790 whether we look for explicit user conversions too.
20792 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20794 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20796 (ExplicitUserConversion): Make it a call to UserDefinedConversion
20797 with the appropriate arguments.
20799 * cs-parser.jay (cast_expression): Record location too.
20801 * expression.cs (Cast): Record location info.
20803 (Expression::ConvertExplicit): Take location argument.
20805 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20806 to determine if we are doing explicit conversions.
20808 (UserCast::Emit): Update accordingly.
20810 (Expression::ConvertExplicit): Report an error if everything fails.
20812 * ../errors/cs0030.cs : Add.
20814 2001-10-04 Miguel de Icaza <miguel@ximian.com>
20816 * modifiers.cs: If the ABSTRACT keyword is present, also set the
20817 virtual and newslot bits.
20819 * class.cs (TypeContainer::RegisterRequiredImplementations):
20820 Record methods we need.
20822 (TypeContainer::MakeKey): Helper function to make keys for
20823 MethodBases, since the Methodbase key is useless.
20825 (TypeContainer::Populate): Call RegisterRequiredImplementations
20826 before defining the methods.
20828 Create a mapping for method_builders_to_methods ahead of time
20829 instead of inside a tight loop.
20831 (::RequireMethods): Accept an object as the data to set into the
20832 hashtable so we can report interface vs abstract method mismatch.
20834 2001-10-03 Miguel de Icaza <miguel@ximian.com>
20836 * report.cs: Make all of it static.
20838 * rootcontext.cs: Drop object_type and value_type computations, as
20839 we have those in the TypeManager anyways.
20841 Drop report instance variable too, now it is a global.
20843 * driver.cs: Use try/catch on command line handling.
20845 Add --probe option to debug the error reporting system with a test
20848 * report.cs: Add support for exiting program when a probe
20849 condition is reached.
20851 2001-10-03 Ravi Pratap <ravi@ximian.com>
20853 * expression.cs (Binary::DoNumericPromotions): Fix the case when
20854 we do a forcible conversion regardless of type, to check if
20855 ForceConversion returns a null.
20857 (Binary::error19): Use location to report error.
20859 (Unary::error23): Use location here too.
20861 * ../errors/cs0019.cs : Check in.
20863 * ../errors/cs0023.cs : Check in.
20865 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20866 case of a non-null MethodInfo object with a length of 0 !
20868 (Binary::ResolveOperator): Flag error if overload resolution fails to find
20869 an applicable member - according to the spec :-)
20870 Also fix logic to find members in base types.
20872 (Unary::ResolveOperator): Same here.
20874 (Unary::report23): Change name to error23 and make first argument a TypeContainer
20875 as I was getting thoroughly confused between this and error19 :-)
20877 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20878 (::FindMostEncompassedType): Implement.
20879 (::FindMostEncompassingType): Implement.
20880 (::StandardConversionExists): Implement.
20882 (UserImplicitCast): Re-vamp. We now need info about most specific
20883 source and target types so that we can do the necessary conversions.
20885 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20886 mathematical union with no duplicates.
20888 2001-10-03 Miguel de Icaza <miguel@ximian.com>
20890 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20891 in order from base classes to child classes, so that we can in
20892 child classes look up in our parent for method names and
20893 attributes (required for handling abstract, virtual, new, override
20894 constructs: we need to instrospect our base class, and if we dont
20895 populate the classes in order, the introspection might be
20896 incorrect. For example, a method could query its parent before
20897 the parent has any methods and would determine that the parent has
20898 no abstract methods (while it could have had them)).
20900 (RootContext::CreateType): Record the order in which we define the
20903 2001-10-02 Miguel de Icaza <miguel@ximian.com>
20905 * class.cs (TypeContainer::Populate): Also method definitions can
20906 fail now, keep track of this.
20908 (TypeContainer::FindMembers): Implement support for
20909 DeclaredOnly/noDeclaredOnly flag.
20911 (Constructor::Emit) Return the ConstructorBuilder.
20913 (Method::Emit) Return the MethodBuilder.
20914 Check for abstract or virtual methods to be public.
20916 * rootcontext.cs (RootContext::CreateType): Register all the
20917 abstract methods required for the class to be complete and the
20918 interface methods that must be implemented.
20920 * cs-parser.jay: Report error 501 (method requires body if it is
20921 not marked abstract or extern).
20923 * expression.cs (TypeOf::Emit): Implement.
20925 * typemanager.cs: runtime_handle_type, new global type.
20927 * class.cs (Property::Emit): Generate code for properties.
20929 2001-10-02 Ravi Pratap <ravi@ximian.com>
20931 * expression.cs (Unary::ResolveOperator): Find operators on base type
20932 too - we now conform exactly to the spec.
20934 (Binary::ResolveOperator): Same here.
20936 * class.cs (Operator::Define): Fix minor quirk in the tests.
20938 * ../errors/cs0215.cs : Added.
20940 * ../errors/cs0556.cs : Added.
20942 * ../errors/cs0555.cs : Added.
20944 2001-10-01 Miguel de Icaza <miguel@ximian.com>
20946 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20947 single integer which is really efficient
20949 2001-10-01 Ravi Pratap <ravi@ximian.com>
20951 * expression.cs (Expression::ImplicitUserConversion): Use location
20952 even in the case when we are examining True operators.
20954 * class.cs (Operator::Define): Perform extensive checks to conform
20955 with the rules for operator overloading in the spec.
20957 * expression.cs (Expression::ImplicitReferenceConversion): Implement
20958 some of the other conversions mentioned in the spec.
20960 * typemanager.cs (array_type): New static member for the System.Array built-in
20963 (cloneable_interface): For System.ICloneable interface.
20965 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20966 we start resolving the tree and populating types.
20968 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20970 2001-10-01 Miguel de Icaza <miguel@ximian.com>
20972 * expression.cs (Expression::ExprClassFromMemberInfo,
20973 Expression::Literalize): Create literal expressions from
20974 FieldInfos which are literals.
20976 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20977 type casts, because they were wrong. The test suite in tests
20980 (ImplicitNumericConversion): ushort to ulong requires a widening
20983 Int32 constant to long requires widening cast as well.
20985 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20986 for integers because the type on the stack is not i4.
20988 2001-09-30 Miguel de Icaza <miguel@ximian.com>
20990 * expression.cs (report118): require location argument.
20992 * parameter.cs: Do not dereference potential null value.
20994 * class.cs: Catch methods that lack the `new' keyword when
20995 overriding a name. Report warnings when `new' is used without
20996 anything being there to override.
20998 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21000 * class.cs: Only add constructor to hashtable if it is non-null
21001 (as now constructors can fail on define).
21003 (TypeManager, Class, Struct): Take location arguments.
21005 Catch field instance initialization in structs as errors.
21007 accepting_filter: a new filter for FindMembers that is static so
21008 that we dont create an instance per invocation.
21010 (Constructor::Define): Catch errors where a struct constructor is
21013 * cs-parser.jay: Pass location information for various new
21016 * delegate.cs (Delegate): take a location argument.
21018 * driver.cs: Do not call EmitCode if there were problesm in the
21019 Definition of the types, as many Builders wont be there.
21021 * decl.cs (Decl::Decl): Require a location argument.
21023 * cs-tokenizer.cs: Handle properly hex constants that can not fit
21024 into integers, and find the most appropiate integer for it.
21026 * literal.cs: Implement ULongLiteral.
21028 * rootcontext.cs: Provide better information about the location of
21029 failure when CreateType fails.
21031 2001-09-29 Miguel de Icaza <miguel@ximian.com>
21033 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21036 * expression.cs (Binary::CheckShiftArguments): Add missing type
21038 (Binary::ResolveOperator): Add type to the logical and and logical
21039 or, Bitwise And/Or and Exclusive Or code paths, it was missing
21042 (Binary::DoNumericPromotions): In the case where either argument
21043 is ulong (and most signed types combined with ulong cause an
21044 error) perform implicit integer constant conversions as well.
21046 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21048 * expression.cs (UserImplicitCast): Method should always be
21050 (Invocation::BetterConversion): Simplified test for IntLiteral.
21052 (Expression::ImplicitNumericConversion): Split this routine out.
21053 Put the code that performs implicit constant integer conversions
21056 (Expression::Resolve): Become a wrapper around DoResolve so we can
21057 check eclass and type being set after resolve.
21059 (Invocation::Badness): Remove this dead function
21061 (Binary::ResolveOperator): Do not compute the expensive argumnets
21062 unless we have a union for it.
21064 (Probe::Emit): Is needs to do an isinst and then
21065 compare against null.
21067 (::CanConvert): Added Location argument. If the Location argument
21068 is null (Location.Null), then we do not report errors. This is
21069 used by the `probe' mechanism of the Explicit conversion. We do
21070 not want to generate an error for something that the user
21071 explicitly requested to be casted. But the pipeline for an
21072 explicit cast first tests for potential implicit casts.
21074 So for now, if the Location is null, it means `Probe only' to
21075 avoid adding another argument. Might have to revise this
21078 (ClassCast): New class used to type cast objects into arbitrary
21079 classes (used in Explicit Reference Conversions).
21081 Implement `as' as well.
21083 Reverted all the patches from Ravi below: they were broken:
21085 * The use of `level' as a mechanism to stop recursive
21086 invocations is wrong. That was there just to catch the
21087 bug with a strack trace but not as a way of addressing
21090 To fix the problem we have to *understand* what is going
21091 on and the interactions and come up with a plan, not
21092 just get things going.
21094 * The use of the type conversion cache that I proposed
21095 last night had an open topic: How does this work across
21096 protection domains. A user defined conversion might not
21097 be public in the location where we are applying the
21098 conversion, a different conversion might be selected
21099 (ie, private A->B (better) but public B->A (worse),
21100 inside A, A->B applies, but outside it, B->A will
21103 * On top of that (ie, even if the above is solved),
21104 conversions in a cache need to be abstract. Ie, `To
21105 convert from an Int to a Short use an OpcodeCast', not
21106 `To convert from an Int to a Short use the OpcodeCast on
21107 the variable 5' (which is what this patch was doing).
21109 2001-09-28 Ravi Pratap <ravi@ximian.com>
21111 * expression.cs (Invocation::ConversionExists): Re-write to use
21112 the conversion cache
21114 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21115 cache all conversions done, not just user-defined ones.
21117 (Invocation::BetterConversion): The real culprit. Use ConversionExists
21118 to determine if a conversion exists instead of acutually trying to
21119 perform the conversion. It's faster too.
21121 (Expression::ConvertExplicit): Modify to use ConversionExists to check
21122 and only then attempt the implicit conversion.
21124 2001-09-28 Ravi Pratap <ravi@ximian.com>
21126 * expression.cs (ConvertImplicit): Use a cache for conversions
21127 already found. Check level of recursion and bail out if necessary.
21129 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21131 * typemanager.cs (string_concat_string_string, string_concat_object_object):
21132 Export standard methods that we expect for string operations.
21134 * statement.cs (Block::UsageWarning): Track usage of variables and
21135 report the errors for not used variables.
21137 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21140 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21142 * codegen.cs: remove unnneded code
21144 * expression.cs: Removed BuiltinTypeAccess class
21146 Fix the order in which implicit conversions are
21149 The previous fixed dropped support for boxed conversions (adding a
21150 test to the test suite now)
21152 (UserImplicitCast::CanConvert): Remove test for source being null,
21153 that code is broken. We should not feed a null to begin with, if
21154 we do, then we should track the bug where the problem originates
21155 and not try to cover it up here.
21157 Return a resolved expression of type UserImplicitCast on success
21158 rather than true/false. Ravi: this is what I was talking about,
21159 the pattern is to use a static method as a "constructor" for
21162 Also, do not create arguments until the very last minute,
21163 otherwise we always create the arguments even for lookups that
21164 will never be performed.
21166 (UserImplicitCast::Resolve): Eliminate, objects of type
21167 UserImplicitCast are born in a fully resolved state.
21169 * typemanager.cs (InitCoreTypes): Init also value_type
21170 (System.ValueType).
21172 * expression.cs (Cast::Resolve): First resolve the child expression.
21174 (LValue): Add new method AddressOf to be used by
21177 Change the argument of Store to take an EmitContext instead of an
21178 ILGenerator, because things like FieldExpr need to be able to call
21179 their children expression to generate the instance code.
21181 (Expression::Error, Expression::Warning): Sugar functions for
21184 (Expression::MemberLookup): Accept a TypeContainer instead of a
21185 Report as the first argument.
21187 (Expression::ResolvePrimary): Killed. I still want to improve
21188 this as currently the code is just not right.
21190 (Expression::ResolveMemberAccess): Simplify, but it is still
21193 (Unary::Resolve): Catch errors in AddressOf operators.
21195 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21196 index to a byte for the short-version, or the compiler will choose
21197 the wrong Emit call, which generates the wrong data.
21199 (ParameterReference::Emit, ::Store): same.
21201 (FieldExpr::AddressOf): Implement.
21203 * typemanager.cs: TypeManager: made public variable instead of
21206 * driver.cs: document --fatal.
21208 * report.cs (ErrorMessage, WarningMessage): new names for the old
21209 Error and Warning classes.
21211 * cs-parser.jay (member_access): Turn built-in access to types
21212 into a normal simplename
21214 2001-09-27 Ravi Pratap <ravi@ximian.com>
21216 * expression.cs (Invocation::BetterConversion): Fix to cope
21217 with q being null, since this was introducing a bug.
21219 * expression.cs (ConvertImplicit): Do built-in conversions first.
21221 2001-09-27 Ravi Pratap <ravi@ximian.com>
21223 * expression.cs (UserImplicitCast::Resolve): Fix bug.
21225 2001-09-27 Ravi Pratap <ravi@ximian.com>
21227 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21228 I had introduced long ago (what's new ?).
21230 * expression.cs (UserImplicitCast::CanConvert): Static method to do
21231 the work of all the checking.
21232 (ConvertImplicit): Call CanConvert and only then create object if necessary.
21233 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21235 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21236 that is the right way.
21238 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
21239 overloading resolution. Use everywhere instead of cutting and pasting code.
21241 (Binary::ResolveOperator): Use MakeUnionSet.
21243 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
21244 we have to convert to bool types. Not complete yet.
21246 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21248 * typemanager.cs (TypeManager::CSharpName): support ushort.
21250 * expression.cs (Expression::TryImplicitIntConversion): Attempts
21251 to provide an expression that performsn an implicit constant int
21252 conversion (section 6.1.6).
21253 (Expression::ConvertImplicitRequired): Reworked to include
21254 implicit constant expression conversions.
21256 (Expression::ConvertNumericExplicit): Finished.
21258 (Invocation::Emit): If InstanceExpression is null, then it means
21259 that we perform a call on this.
21261 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21263 * expression.cs (Unary::Emit): Remove some dead code.
21264 (Probe): Implement Resolve and Emit for `is'.
21265 (Expression::ConvertImplicitRequired): Attempt to do constant
21266 expression conversions here. Maybe should be moved to
21267 ConvertImplicit, but I am not sure.
21268 (Expression::ImplicitLongConstantConversionPossible,
21269 Expression::ImplicitIntConstantConversionPossible): New functions
21270 that tell whether is it possible to apply an implicit constant
21271 expression conversion.
21273 (ConvertNumericExplicit): Started work on explicit numeric
21276 * cs-parser.jay: Update operator constants.
21278 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21279 (Parameters::GetSignature): Hook up VerifyArgs here.
21280 (Parameters::VerifyArgs): Verifies that no two arguments have the
21283 * class.cs (Operator): Update the operator names to reflect the
21284 ones that the spec expects (as we are just stringizing the
21287 * expression.cs (Unary::ResolveOperator): Fix bug: Use
21288 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21289 previous usage did only work for our methods.
21290 (Expression::ConvertImplicit): Handle decimal implicit numeric
21291 conversions as well.
21292 (Expression::InternalTypeConstructor): Used to invoke constructors
21293 on internal types for default promotions.
21295 (Unary::Emit): Implement special handling for the pre/post
21296 increment/decrement for overloaded operators, as they need to have
21297 the same semantics as the other operators.
21299 (Binary::ResolveOperator): ditto.
21300 (Invocation::ConversionExists): ditto.
21301 (UserImplicitCast::Resolve): ditto.
21303 2001-09-26 Ravi Pratap <ravi@ximian.com>
21305 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21306 operator, return after emitting body. Regression tests pass again !
21308 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21309 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21310 (Invocation::OverloadResolve): Ditto.
21311 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21313 * everywhere : update calls to the above methods accordingly.
21315 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21317 * assign.cs (Assign): Make it inherit from ExpressionStatement.
21319 * expression.cs (ExpressionStatement): New base class used for
21320 expressions that can appear in statements, so that we can provide
21321 an alternate path to generate expression that do not leave a value
21324 (Expression::Emit, and all the derivatives): We no longer return
21325 whether a value is left on the stack or not. Every expression
21326 after being emitted leaves a single value on the stack.
21328 * codegen.cs (EmitContext::EmitStatementExpression): Use the
21329 facilties of ExpressionStatement if possible.
21331 * cs-parser.jay: Update statement_expression.
21333 2001-09-25 Miguel de Icaza <miguel@ximian.com>
21335 * driver.cs: Change the wording of message
21337 2001-09-25 Ravi Pratap <ravi@ximian.com>
21339 * expression.cs (Binary::ResolveOperator): Had forgottten to set
21340 the type of the expression to the return type of the method if
21341 we have an overloaded operator match ! The regression tests pass again !
21342 (Unary::ResolveOperator): Ditto.
21344 * expression.cs (Invocation::ConversionExists): Correct the member lookup
21345 to find "op_Implicit", not "implicit" ;-)
21346 (UserImplicitCast): New class to take care of user-defined implicit conversions.
21347 (ConvertImplicit, ForceConversion): Take TypeContainer argument
21349 * everywhere : Correct calls to the above accordingly.
21351 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21352 (ConvertImplicit): Do user-defined conversion if it exists.
21354 2001-09-24 Miguel de Icaza <miguel@ximian.com>
21356 * assign.cs: track location.
21357 (Resolve): Use implicit conversions on assignment.
21359 * literal.cs: Oops. Not good, Emit of short access values should
21360 pass (Bytes) or the wrong argument will be selected.
21362 * expression.cs (Unary::Emit): Emit code for -expr.
21364 (Unary::ResolveOperator): Handle `Substract' for non-constants
21365 (substract from zero from the non-constants).
21366 Deal with Doubles as well.
21368 (Expression::ConvertImplicitRequired): New routine that reports an
21369 error if no implicit conversion exists.
21371 (Invocation::OverloadResolve): Store the converted implicit
21372 expressions if we make them
21374 2001-09-24 Ravi Pratap <ravi@ximian.com>
21376 * class.cs (ConstructorInitializer): Take a Location argument.
21377 (ConstructorBaseInitializer): Same here.
21378 (ConstructorThisInitializer): Same here.
21380 * cs-parser.jay : Update all calls accordingly.
21382 * expression.cs (Unary, Binary, New): Take location argument.
21383 Update accordingly everywhere.
21385 * cs-parser.jay : Update all calls to the above to take a location
21388 * class.cs : Ditto.
21390 2001-09-24 Ravi Pratap <ravi@ximian.com>
21392 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21393 (Invocation::BetterConversion): Same here
21394 (Invocation::ConversionExists): Ditto.
21396 (Invocation::ConversionExists): Implement.
21398 2001-09-22 Ravi Pratap <ravi@ximian.com>
21400 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21401 Also take an additional TypeContainer argument.
21403 * All over : Pass in TypeContainer as argument to OverloadResolve.
21405 * typemanager.cs (CSharpName): Update to check for the string type and return
21408 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21411 2001-09-21 Ravi Pratap <ravi@ximian.com>
21413 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21414 (Invocation::BetterFunction): Implement.
21415 (Invocation::BetterConversion): Implement.
21416 (Invocation::ConversionExists): Skeleton, no implementation yet.
21418 Okay, things work fine !
21420 2001-09-21 Miguel de Icaza <miguel@ximian.com>
21422 * typemanager.cs: declare and load enum_type, delegate_type and
21425 * expression.cs (Expression::Emit): Now emit returns a value that
21426 tells whether a value is left on the stack or not. This strategy
21427 might be reveted tomorrow with a mechanism that would address
21428 multiple assignments.
21429 (Expression::report118): Utility routine to report mismatches on
21432 (Unary::Report23): Report impossible type/operator combination
21435 (Unary::IsIncrementableNumber): Whether the type can be
21436 incremented or decremented with add.
21437 (Unary::ResolveOperator): Also allow enumerations to be bitwise
21439 (Unary::ResolveOperator): Implement ++, !, ~,
21441 (Invocation::Emit): Deal with new Emit convetion.
21443 * All Expression derivatives: Updated their Emit method to return
21444 whether they leave values on the stack or not.
21446 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21447 stack for expressions that are statements.
21449 2001-09-20 Miguel de Icaza <miguel@ximian.com>
21451 * expression.cs (LValue): New interface. Must be implemented by
21453 (LocalVariableReference, ParameterReference, FieldExpr): Implement
21456 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21457 interface for generating code, simplifies the code.
21459 2001-09-20 Ravi Pratap <ravi@ximian.com>
21461 * expression.cs (everywhere): Comment out return statements in ::Resolve
21462 methods to avoid the warnings.
21464 2001-09-20 Miguel de Icaza <miguel@ximian.com>
21466 * driver.cs (parse): Report error 2001 if we can not open the
21469 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21472 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21475 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21476 otherwise nested blocks end up with the same index.
21478 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21480 * expression.cs: Instead of having FIXMEs in the Resolve
21481 functions, throw exceptions so it is obvious that we are facing a
21484 * cs-parser.jay (invocation_expression): Pass Location information.
21486 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21487 Use a basename for those routines because .NET does not like paths
21490 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21493 2001-09-19 Miguel de Icaza <miguel@ximian.com>
21495 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21496 are loading the correct data types (throws an exception if not).
21497 (TypeManager::InitCoreTypes): Use CoreLookupType
21499 * expression.cs (Unary::ResolveOperator): return the child
21500 expression for expressions which are just +expr.
21501 (Unary::ResolveOperator): Return negative literals for -LITERAL
21502 expressions (otherwise they are Unary {Literal}).
21503 (Invocation::Badness): Take into account `Implicit constant
21504 expression conversions'.
21506 * literal.cs (LongLiteral): Implement long literal class.
21507 (IntLiteral): export the `Value' of the intliteral.
21509 2001-09-19 Ravi Pratap <ravi@ximian.com>
21511 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
21513 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
21514 instead of 'Operator'
21516 * expression.cs (Binary::ResolveOperator): Update accordingly.
21517 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
21520 * cs-parser.jay (unary_expression): Update to use the new names.
21522 * gen-treedump.cs (GetUnary): Same here.
21524 * expression.cs (Unary::Resolve): Implement.
21525 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
21526 operators are found instead of making noise ;-)
21527 (Unary::ResolveOperator): New method to do precisely the same thing which
21528 Binary::ResolveOperator does for Binary expressions.
21529 (Unary.method, .Arguments): Add.
21530 (Unary::OperName): Implement.
21531 (Unary::ForceConversion): Copy and Paste !
21533 * class.cs (Operator::Define): Fix a small bug for the case when we have
21536 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
21537 for the inbuilt operators. Only overloading works for now ;-)
21539 2001-09-18 Miguel de Icaza <miguel@ximian.com>
21541 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
21542 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
21544 * expression.cs (This::Emit): Implement.
21545 (This::Resolve): Implement.
21546 (TypeOf:Resolve): Implement.
21547 (Expression::ResolveSimpleName): Add an implicit this to instance
21549 (MemberAccess::Resolve): Deal with Parameters and Fields.
21550 Bind instance variable to Field expressions.
21551 (FieldExpr::Instance): New field used to track the expression that
21552 represents the object instance.
21553 (FieldExpr::Resolve): Track potential errors from MemberLookup not
21555 (FieldExpr::Emit): Implement.
21557 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
21558 the last instruction contains a return opcode to avoid generating
21559 the last `ret' instruction (this generates correct code, and it is
21560 nice to pass the peverify output).
21562 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
21563 initializer for static and instance variables.
21564 (Constructor::Emit): Allow initializer to be null in the case of
21565 static constructors. Only emit initializer for instance
21568 (TypeContainer::FindMembers): Return a null array if there are no
21571 Also fix the code for the MemberTypes.Method branch, as it was not
21572 scanning that for operators (or tried to access null variables before).
21574 * assign.cs (Assign::Emit): Handle instance and static fields.
21578 * driver.cs: Stop compilation if there are parse errors.
21580 * cs-parser.jay (constructor_declaration): Provide default base
21581 initializer for non-static constructors.
21582 (constructor_declarator): Do not provide a default base
21583 initializers if none was specified.
21584 Catch the fact that constructors should not have parameters.
21586 * class.cs: Do not emit parent class initializers for static
21587 constructors, that should be flagged as an error.
21589 2001-09-18 Ravi Pratap <ravi@ximian.com>
21591 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
21592 Move back code into TypeContainer::Populate.
21594 2001-09-18 Ravi Pratap <ravi@ximian.com>
21596 * class.cs (TypeContainer::AddConstructor): Fix the check to
21597 compare against Name, not Basename.
21598 (Operator::OpType): Change Plus and Minus to Add and Subtract.
21600 * cs-parser.jay : Update accordingly.
21602 * class.cs (TypeContainer::FindMembers): For the case where we are searching
21603 for methods, don't forget to look into the operators too.
21604 (RegisterMethodBuilder): Helper method to take care of this for
21605 methods, constructors and operators.
21606 (Operator::Define): Completely revamp.
21607 (Operator.OperatorMethod, MethodName): New fields.
21608 (TypeContainer::Populate): Move the registering of builders into
21609 RegisterMethodBuilder.
21610 (Operator::Emit): Re-write.
21612 * expression.cs (Binary::Emit): Comment out code path to emit method
21613 invocation stuff for the case when we have a user defined operator. I am
21614 just not able to get it right !
21616 2001-09-17 Miguel de Icaza <miguel@ximian.com>
21618 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21621 (Expression::MemberLookup): Provide a version that allows to
21622 specify the MemberTypes and BindingFlags.
21624 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21625 so it was not fetching variable information from outer blocks.
21627 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21628 Beforefieldinit as it was buggy.
21630 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21631 that Ravi put here.
21633 * class.cs (Constructor::Emit): Only emit if block is not null.
21634 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21635 deal with this by semantically definining it as if the user had
21638 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21639 constructors as we now "emit" them at a higher level.
21641 (TypeContainer::DefineDefaultConstructor): Used to define the
21642 default constructors if none was provided.
21644 (ConstructorInitializer): Add methods Resolve and Emit.
21646 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21648 2001-09-17 Ravi Pratap <ravi@ximian.com>
21650 * class.cs (TypeContainer::EmitDefaultConstructor): Register
21651 the default constructor builder with our hashtable for methodbuilders
21654 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21655 and argument_count is 0 in which case we have a match.
21656 (Binary::ResolveOperator): More null checking and miscellaneous coding
21659 2001-09-17 Ravi Pratap <ravi@ximian.com>
21661 * rootcontext.cs (IsNameSpace): Compare against null.
21663 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21665 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21666 and Unary::Operator.
21668 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21671 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21672 we have overloaded operators.
21673 (Binary::ResolveOperator): Implement the part which does the operator overload
21676 * class.cs (Operator::Emit): Implement.
21677 (TypeContainer::Emit): Emit the operators we have too.
21679 * expression.cs (Binary::Emit): Update to emit the appropriate code for
21680 the case when we have a user-defined operator.
21682 2001-09-17 Miguel de Icaza <miguel@ximian.com>
21684 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21686 2001-09-16 Ravi Pratap <ravi@ximian.com>
21688 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21689 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21690 (Constructor::Emit): Implement.
21691 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21692 if we have no work to do.
21693 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
21696 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21697 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21699 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21702 2001-09-15 Ravi Pratap <ravi@ximian.com>
21704 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21706 (Tree::RecordNamespace): Method to do what the name says ;-)
21707 (Tree::Namespaces): Property to get at the namespaces hashtable.
21709 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
21712 * rootcontext.cs (IsNamespace): Fixed it :-)
21714 2001-09-14 Miguel de Icaza <miguel@ximian.com>
21716 * class.cs (TypeContainer::FindMembers): Add support for
21718 (MethodCore): New class that encapsulates both the shared aspects
21719 of a Constructor and a Method.
21720 (Method, Constructor): Factored pieces into MethodCore.
21722 * driver.cs: Added --fatal which makes errors throw exceptions.
21723 Load System assembly as well as part of the standard library.
21725 * report.cs: Allow throwing exceptions on errors for debugging.
21727 * modifiers.cs: Do not use `parent', instead use the real type
21728 container to evaluate permission settings.
21730 * class.cs: Put Ravi's patch back in. He is right, and we will
21731 have to cope with the
21733 2001-09-14 Ravi Pratap <ravi@ximian.com>
21735 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21736 FamORAssem, not FamANDAssem.
21738 2001-09-14 Miguel de Icaza <miguel@ximian.com>
21740 * driver.cs: Added --parse option that only parses its input files
21743 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
21744 incorrect. IsTopLevel is not used to tell whether an object is
21745 root_types or not (that can be achieved by testing this ==
21746 root_types). But to see if this is a top-level *class* (not
21747 necessarly our "toplevel" container).
21749 2001-09-14 Ravi Pratap <ravi@ximian.com>
21751 * enum.cs (Enum::Define): Modify to call the Lookup method on the
21752 parent instead of a direct call to GetType.
21754 2001-09-14 Ravi Pratap <ravi@ximian.com>
21756 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21757 Modifiers.TypeAttr. This should just be a call to that method.
21759 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21760 object so that we can determine if we are top-level or not.
21762 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
21765 * enum.cs (Enum::Define): Ditto.
21767 * modifiers.cs (FieldAttr): Re-write.
21769 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21770 (TypeContainer::HaveStaticConstructor): New property to provide access
21771 to precisely that info.
21773 * modifiers.cs (MethodAttr): Re-write.
21774 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21776 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21777 of top-level types as claimed.
21779 2001-09-13 Miguel de Icaza <miguel@ximian.com>
21781 * expression.cs (MemberLookup): Fruitless attempt to lookup
21782 constructors. Maybe I need to emit default constructors? That
21783 might be it (currently .NET emits this for me automatically).
21784 (Invocation::OverloadResolve): Cope with Arguments == null.
21785 (Invocation::EmitArguments): new function, shared by the new
21786 constructor and us.
21787 (Invocation::Emit): Handle static and instance methods. Emit
21788 proper call instruction for virtual or non-virtual invocations.
21789 (New::Emit): Implement.
21790 (New::Resolve): Implement.
21791 (MemberAccess:Resolve): Implement.
21792 (MethodGroupExpr::InstanceExpression): used conforming to the spec
21793 to track instances.
21794 (FieldExpr::Resolve): Set type.
21796 * support.cs: Handle empty arguments.
21798 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21799 SimpleLookup): Auxiliary routines to help parse a qualifier
21802 Update qualifier_identifier rule.
21804 * codegen.cs: Removed debugging messages.
21806 * class.cs: Make this a global thing, this acts just as a "key" to
21807 objects that we might have around.
21809 (Populate): Only initialize method_builders_to_methods once.
21811 * expression.cs (PropertyExpr): Initialize type from the
21814 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21815 Resolve pattern. Attempt to implicitly convert value to boolean.
21818 * expression.cs: Set the type for the int32/int32 argument case.
21819 (Binary::ResolveOperator): Set the return type to boolean for
21820 comparission operators
21822 * typemanager.cs: Remove debugging print code.
21824 (Invocation::Resolve): resolve type.
21826 * class.cs: Allocate a MemberInfo of the correct size, as the code
21827 elsewhere depends on the test to reflect the correct contents.
21829 (Method::) Keep track of parameters, due to System.Reflection holes
21831 (TypeContainer::Populate): Keep track of MethodBuilders to Method
21834 (TypeContainer::FindMembers): Use ArrayList and then copy an array
21835 of the exact size and return that.
21837 (Class::LookupMethodByBuilder): New function that maps
21838 MethodBuilders to its methods. Required to locate the information
21839 on methods because System.Reflection bit us again.
21841 * support.cs: New file, contains an interface ParameterData and
21842 two implementations: ReflectionParameters and InternalParameters
21843 used to access Parameter information. We will need to grow this
21846 * expression.cs (Invocation::GetParameterData): implement a cache
21847 and a wrapper around the ParameterData creation for methods.
21848 (Invocation::OverloadResolve): Use new code.
21850 2001-09-13 Ravi Pratap <ravi@ximian.com>
21852 * class.cs (TypeContainer::EmitField): Remove and move into
21853 (Field::Define): here and modify accordingly.
21854 (Field.FieldBuilder): New member.
21855 (TypeContainer::Populate): Update accordingly.
21856 (TypeContainer::FindMembers): Implement.
21858 2001-09-13 Miguel de Icaza <miguel@ximian.com>
21860 * statement.cs: (VariableInfo::VariableType): New field to be
21861 initialized with the full type once it is resolved.
21863 2001-09-12 Miguel de Icaza <miguel@ximian.com>
21865 * parameter.cs (GetParameterInfo): Use a type cache to compute
21866 things only once, and to reuse this information
21868 * expression.cs (LocalVariableReference::Emit): Implement.
21869 (OpcodeCast::Emit): fix.
21871 (ParameterReference::Resolve): Implement.
21872 (ParameterReference::Emit): Implement.
21874 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21875 that are expressions need to stay as Expressions.
21877 * typemanager.cs (CSharpName): Returns the C# name of a type if
21880 * expression.cs (Expression::ConvertImplicit): New function that
21881 implements implicit type conversions.
21883 (Expression::ImplicitReferenceConversion): Implements implicit
21884 reference conversions.
21886 (EmptyCast): New type for transparent casts.
21888 (OpcodeCast): New type for casts of types that are performed with
21889 a sequence of bytecodes.
21891 (BoxedCast): New type used for casting value types into reference
21892 types. Emits a box opcode.
21894 (Binary::DoNumericPromotions): Implements numeric promotions of
21895 and computation of the Binary::Type.
21897 (Binary::EmitBranchable): Optimization.
21899 (Binary::Emit): Implement code emission for expressions.
21901 * typemanager.cs (TypeManager): Added two new core types: sbyte
21904 2001-09-12 Ravi Pratap <ravi@ximian.com>
21906 * class.cs (TypeContainer::FindMembers): Method which does exactly
21907 what Type.FindMembers does, only we don't have to use reflection. No
21908 implementation yet.
21910 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21911 typecontainer objects as we need to get at them.
21912 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21914 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21915 typecontainer object.
21917 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21918 of just a Report object.
21920 2001-09-11 Ravi Pratap <ravi@ximian.com>
21922 * class.cs (Event::Define): Go back to using the prefixes "add_" and
21924 (TypeContainer::Populate): Now define the delegates of the type too.
21925 (TypeContainer.Delegates): Property to access the list of delegates defined
21928 * delegates.cs (Delegate::Define): Implement partially.
21930 * modifiers.cs (TypeAttr): Handle more flags.
21932 2001-09-11 Ravi Pratap <ravi@ximian.com>
21934 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21936 (Operator::Define): Re-write logic to get types by using the LookupType method
21937 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21938 (Indexer::Define): Ditto.
21939 (Event::Define): Ditto.
21940 (Property::Define): Ditto.
21942 2001-09-10 Ravi Pratap <ravi@ximian.com>
21944 * class.cs (TypeContainer::Populate): Now define operators too.
21945 (TypeContainer.Operators): New property to access the list of operators
21947 (Operator.OperatorMethodBuilder): New member to hold the method builder
21948 for the operator we are defining.
21949 (Operator::Define): Implement.
21951 2001-09-10 Ravi Pratap <ravi@ximian.com>
21953 * class.cs (Event::Define): Make the prefixes of the accessor methods
21954 addOn_ and removeOn_
21956 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21957 of the location being passed in too. Ideally, this should go later since all
21958 error reporting should be done through the Report object.
21960 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21961 (Populate): Iterate thru the indexers we have and define them too.
21962 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21963 for the get and set accessors.
21964 (Indexer::Define): Implement.
21966 2001-09-09 Miguel de Icaza <miguel@ximian.com>
21968 * expression.cs (Binary::Resolve): Beginning of it. I scratched
21969 my previous implementation, did not work.
21971 * typemanager.cs: Add a couple of missing types (the longs).
21973 * literal.cs: Use TypeManager.bool_type instead of getting it.
21975 * expression.cs (EventExpr): New kind of expressions.
21976 (Expressio::ExprClassFromMemberInfo): finish
21978 2001-09-08 Miguel de Icaza <miguel@ximian.com>
21980 * assign.cs: Emit stores to static fields differently.
21982 2001-09-08 Ravi Pratap <ravi@ximian.com>
21984 * Merge in changes and adjust code to tackle conflicts. Backed out my
21985 code in Assign::Resolve ;-)
21987 2001-09-08 Ravi Pratap <ravi@ximian.com>
21989 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21990 instead Report.Error and also pass in the location.
21991 (CSharpParser::Lexer): New readonly property to return the reference
21992 to the Tokenizer object.
21993 (declare_local_variables): Use Report.Error with location instead of plain
21997 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21998 (Operator.CheckBinaryOperator): Ditto.
22000 * cs-parser.jay (operator_declarator): Update accordingly.
22002 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22003 (CheckBinaryOperator): Same here.
22005 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22006 on the name without any prefixes of namespace names etc. This is because we
22007 already might have something already fully qualified like
22008 'System.Console.WriteLine'
22010 * assign.cs (Resolve): Begin implementation. Stuck ;-)
22012 2001-09-07 Ravi Pratap <ravi@ximian.com>
22014 * cs-tokenizer.cs (location): Return a string which also contains
22017 * expression.cs (ElementAccess): New class for expressions of the
22018 type 'element access.'
22019 (BaseAccess): New class for expressions of the type 'base access.'
22020 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22023 * cs-parser.jay (element_access): Implement action.
22024 (base_access): Implement actions.
22025 (checked_expression, unchecked_expression): Implement.
22027 * cs-parser.jay (local_variable_type): Correct and implement.
22028 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22030 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22032 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22033 name and the specifiers.
22035 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22037 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
22038 making them all public ;-)
22040 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22043 2001-09-07 Miguel de Icaza <miguel@ximian.com>
22045 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22047 (FieldExpr, PropertyExprs): New resolved expressions.
22048 (SimpleName::MemberStaticCheck): Perform static checks for access
22049 to non-static fields on static methods. Maybe this should be
22050 generalized for MemberAccesses.
22051 (SimpleName::ResolveSimpleName): More work on simple name
22054 * cs-parser.jay (primary_expression/qualified_identifier): track
22055 the parameter index.
22057 * codegen.cs (CodeGen::Save): Catch save exception, report error.
22058 (EmitContext::EmitBoolExpression): Chain to expression generation
22059 instead of temporary hack.
22060 (::EmitStatementExpression): Put generic expression code generation.
22062 * assign.cs (Assign::Emit): Implement variable assignments to
22063 local variables, parameters and fields.
22065 2001-09-06 Miguel de Icaza <miguel@ximian.com>
22067 * statement.cs (Block::GetVariableInfo): New method, returns the
22068 VariableInfo for a variable name in a block.
22069 (Block::GetVariableType): Implement in terms of GetVariableInfo
22071 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22072 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22074 2001-09-06 Ravi Pratap <ravi@ximian.com>
22076 * cs-parser.jay (operator_declaration): Continue on my quest : update
22077 to take attributes argument.
22078 (event_declaration): Ditto.
22079 (enum_declaration): Ditto.
22080 (indexer_declaration): Ditto.
22082 * class.cs (Operator::Operator): Update constructor accordingly.
22083 (Event::Event): Ditto.
22085 * delegate.cs (Delegate::Delegate): Same here.
22087 * enum.cs (Enum::Enum): Same here.
22089 2001-09-05 Ravi Pratap <ravi@ximian.com>
22091 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22093 * ../tests/cs0658.cs : New file to demonstrate error 0658.
22095 * attribute.cs (Attributes): New class to encapsulate all attributes which were
22096 being passed around as an arraylist.
22097 (Attributes::AddAttribute): Method to add attribute sections.
22099 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22100 (struct_declaration): Update accordingly.
22101 (constant_declaration): Update.
22102 (field_declaration): Update.
22103 (method_header): Update.
22104 (fixed_parameter): Update.
22105 (parameter_array): Ditto.
22106 (property_declaration): Ditto.
22107 (destructor_declaration): Ditto.
22109 * class.cs (Struct::Struct): Update constructors accordingly.
22110 (Class::Class): Ditto.
22111 (Field::Field): Ditto.
22112 (Method::Method): Ditto.
22113 (Property::Property): Ditto.
22114 (TypeContainer::OptAttribute): update property's return type.
22116 * interface.cs (Interface.opt_attributes): New member.
22117 (Interface::Interface): Update to take the extra Attributes argument.
22119 * parameter.cs (Parameter::Parameter): Ditto.
22121 * constant.cs (Constant::Constant): Ditto.
22123 * interface.cs (InterfaceMemberBase): New OptAttributes field.
22124 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
22125 the attributes as a parameter.
22126 (InterfaceProperty): Update constructor call.
22127 (InterfaceEvent): Ditto.
22128 (InterfaceMethod): Ditto.
22129 (InterfaceIndexer): Ditto.
22131 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
22132 pass the attributes too.
22133 (interface_event_declaration): Ditto.
22134 (interface_property_declaration): Ditto.
22135 (interface_method_declaration): Ditto.
22136 (interface_declaration): Ditto.
22138 2001-09-05 Miguel de Icaza <miguel@ximian.com>
22140 * class.cs (Method::Define): Track the "static Main" definition to
22141 create an entry point.
22143 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22144 EntryPoint if we find it.
22146 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22147 (EmitContext::ig): Make this variable public.
22149 * driver.cs: Make the default output file be the first file name
22150 with the .exe extension.
22152 Detect empty compilations
22154 Handle various kinds of output targets. Handle --target and
22155 rename -t to --dumper.
22157 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22158 methods inherited from Expression return now an Expression. This
22159 will is used during the tree rewriting as we resolve them during
22162 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22163 the spec. Missing entirely is the information about
22164 accessability of elements of it.
22166 (Expression::ExprClassFromMemberInfo): New constructor for
22167 Expressions that creates a fully initialized Expression based on
22168 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22171 (Invocation::Resolve): Begin implementing resolution of invocations.
22173 * literal.cs (StringLiteral): Implement Emit.
22175 2001-09-05 Ravi Pratap <ravi@ximian.com>
22177 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22180 2001-09-04 Ravi Pratap <ravi@ximian.com>
22182 * cs-parser.jay (attribute_arguments): Implement actions.
22183 (attribute): Fix bug in production. Implement action.
22184 (attribute_list): Implement.
22185 (attribute_target): Implement.
22186 (attribute_target_specifier, opt_target_specifier): Implement
22187 (CheckAttributeTarget): New method to check if the attribute target
22189 (attribute_section): Implement.
22190 (opt_attributes): Implement.
22192 * attribute.cs : New file to handle attributes.
22193 (Attribute): Class to hold attribute info.
22195 * cs-parser.jay (opt_attribute_target_specifier): Remove production
22196 (attribute_section): Modify production to use 2 different rules to
22197 achieve the same thing. 1 s/r conflict down !
22198 Clean out commented, useless, non-reducing dimension_separator rules.
22200 * class.cs (TypeContainer.attributes): New member to hold list
22201 of attributes for a type.
22202 (Struct::Struct): Modify to take one more argument, the attribute list.
22203 (Class::Class): Ditto.
22204 (Field::Field): Ditto.
22205 (Method::Method): Ditto.
22206 (Property::Property): Ditto.
22208 * cs-parser.jay (struct_declaration): Update constructor call to
22209 pass in the attributes too.
22210 (class_declaration): Ditto.
22211 (constant_declaration): Ditto.
22212 (field_declaration): Ditto.
22213 (method_header): Ditto.
22214 (fixed_parameter): Ditto.
22215 (parameter_array): Ditto.
22216 (property_declaration): Ditto.
22218 * constant.cs (Constant::Constant): Update constructor similarly.
22219 Use System.Collections.
22221 * parameter.cs (Parameter::Parameter): Update as above.
22223 2001-09-02 Ravi Pratap <ravi@ximian.com>
22225 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22226 (TypeContainer.delegates): New member to hold list of delegates.
22228 * cs-parser.jay (delegate_declaration): Implement the action correctly
22229 this time as I seem to be on crack ;-)
22231 2001-09-02 Miguel de Icaza <miguel@ximian.com>
22233 * rootcontext.cs (RootContext::IsNamespace): new function, used to
22234 tell whether an identifier represents a namespace.
22236 * expression.cs (NamespaceExpr): A namespace expression, used only
22237 temporarly during expression resolution.
22238 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22239 utility functions to resolve names on expressions.
22241 2001-09-01 Miguel de Icaza <miguel@ximian.com>
22243 * codegen.cs: Add hook for StatementExpressions.
22245 * class.cs: Fix inverted test for static flag in methods.
22247 2001-09-02 Ravi Pratap <ravi@ximian.com>
22249 * class.cs (Operator::CheckUnaryOperator): Correct error number used
22250 to make it coincide with MS' number.
22251 (Operator::CheckBinaryOperator): Ditto.
22253 * ../errors/errors.txt : Remove error numbers added earlier.
22255 * ../errors/cs1019.cs : Test case for error # 1019
22257 * ../errros/cs1020.cs : Test case for error # 1020
22259 * cs-parser.jay : Clean out commented cruft.
22260 (dimension_separators, dimension_separator): Comment out. Ostensibly not
22261 used anywhere - non-reducing rule.
22262 (namespace_declarations): Non-reducing rule - comment out.
22264 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22265 with TypeContainer::AddEnum.
22267 * delegate.cs : New file for delegate handling classes.
22268 (Delegate): Class for declaring delegates.
22270 * makefile : Update.
22272 * cs-parser.jay (delegate_declaration): Implement.
22274 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
22276 * class.cs (Event::Define): Implement.
22277 (Event.EventBuilder): New member.
22279 * class.cs (TypeContainer::Populate): Update to define all enums and events
22281 (Events): New property for the events arraylist we hold. Shouldn't we move to using
22282 readonly fields for all these cases ?
22284 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22286 * class.cs (Property): Revamp to use the convention of making fields readonly.
22287 Accordingly modify code elsewhere.
22289 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22290 the Define method of the Property class.
22292 * class.cs : Clean up applied patch and update references to variables etc. Fix
22294 (TypeContainer::Populate): Update to define all the properties we have. Also
22295 define all enumerations.
22297 * enum.cs (Define): Implement.
22299 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22301 * cs-parser.jay (overloadable_operator): The semantic value is an
22302 enum of the Operator class.
22303 (operator_declarator): Implement actions.
22304 (operator_declaration): Implement.
22306 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22307 validity of definitions.
22308 (Operator::CheckBinaryOperator): Static method to check for binary operators
22309 (TypeContainer::AddOperator): New method to add an operator to a type.
22311 * cs-parser.jay (indexer_declaration): Added line to actually call the
22312 AddIndexer method so it gets added ;-)
22314 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
22315 already taken care of by the MS compiler ?
22317 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22319 * class.cs (Operator): New class for operator declarations.
22320 (Operator::OpType): Enum for the various operators.
22322 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22324 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22325 ostensibly handle this in semantic analysis.
22327 * cs-parser.jay (general_catch_clause): Comment out
22328 (specific_catch_clauses, specific_catch_clause): Ditto.
22329 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22330 (catch_args, opt_catch_args): New productions.
22331 (catch_clause): Rewrite to use the new productions above
22332 (catch_clauses): Modify accordingly.
22333 (opt_catch_clauses): New production to use in try_statement
22334 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22335 and re-write the code in the actions to extract the specific and
22336 general catch clauses by being a little smart ;-)
22338 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22339 Hooray, try and catch statements parse fine !
22341 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22343 * statement.cs (Block::GetVariableType): Fix logic to extract the type
22344 string from the hashtable of variables.
22346 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22347 I end up making that mistake ;-)
22348 (catch_clauses): Fixed gross error which made Key and Value of the
22349 DictionaryEntry the same : $1 !!
22351 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22353 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22355 * cs-parser.jay (event_declaration): Correct to remove the semicolon
22356 when the add and remove accessors are specified.
22358 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22360 * cs-parser.jay (IndexerDeclaration): New helper class to hold
22361 information about indexer_declarator.
22362 (indexer_declarator): Implement actions.
22363 (parsing_indexer): New local boolean used to keep track of whether
22364 we are parsing indexers or properties. This is necessary because
22365 implicit_parameters come into picture even for the get accessor in the
22366 case of an indexer.
22367 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22369 * class.cs (Indexer): New class for indexer declarations.
22370 (TypeContainer::AddIndexer): New method to add an indexer to a type.
22371 (TypeContainer::indexers): New member to hold list of indexers for the
22374 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22376 * cs-parser.jay (add_accessor_declaration): Implement action.
22377 (remove_accessor_declaration): Implement action.
22378 (event_accessors_declaration): Implement
22379 (variable_declarators): swap statements for first rule - trivial.
22381 * class.cs (Event): New class to hold information about event
22383 (TypeContainer::AddEvent): New method to add an event to a type
22384 (TypeContainer::events): New member to hold list of events.
22386 * cs-parser.jay (event_declaration): Implement actions.
22388 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22390 * cs-parser.jay (dim_separators): Implement. Make it a string
22391 concatenating all the commas together, just as they appear.
22392 (opt_dim_separators): Modify accordingly
22393 (rank_specifiers): Update accordingly. Basically do the same
22394 thing - instead, collect the brackets here.
22395 (opt_rank_sepcifiers): Modify accordingly.
22396 (array_type): Modify to actually return the complete type string
22397 instead of ignoring the rank_specifiers.
22398 (expression_list): Implement to collect the expressions
22399 (variable_initializer): Implement. We make it a list of expressions
22400 essentially so that we can handle the array_initializer case neatly too.
22401 (variable_initializer_list): Implement.
22402 (array_initializer): Make it a list of variable_initializers
22403 (opt_array_initializer): Modify accordingly.
22405 * expression.cs (New::NType): Add enumeration to help us
22406 keep track of whether we have an object/delegate creation
22407 or an array creation.
22408 (New:NewType, New::Rank, New::Indices, New::Initializers): New
22409 members to hold data about array creation.
22410 (New:New): Modify to update NewType
22411 (New:New): New Overloaded contructor for the array creation
22414 * cs-parser.jay (array_creation_expression): Implement to call
22415 the overloaded New constructor.
22417 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
22419 * class.cs (TypeContainer::Constructors): Return member
22420 constructors instead of returning null.
22422 2001-08-26 Miguel de Icaza <miguel@ximian.com>
22424 * typemanager.cs (InitCoreTypes): Initialize the various core
22425 types after we have populated the type manager with the user
22426 defined types (this distinction will be important later while
22427 compiling corlib.dll)
22429 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22430 on Expression Classification. Now all expressions have a method
22431 `Resolve' and a method `Emit'.
22433 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22434 generation from working. Also add some temporary debugging
22437 2001-08-24 Miguel de Icaza <miguel@ximian.com>
22439 * codegen.cs: Lots of code generation pieces. This is only the
22440 beginning, will continue tomorrow with more touches of polish. We
22441 handle the fundamentals of if, while, do, for, return. Others are
22442 trickier and I need to start working on invocations soon.
22444 * gen-treedump.cs: Bug fix, use s.Increment here instead of
22447 * codegen.cs (EmitContext): New struct, used during code
22448 emission to keep a context. Most of the code generation will be
22451 * cs-parser.jay: Add embedded blocks to the list of statements of
22452 this block. So code generation proceeds in a top down fashion.
22454 2001-08-23 Miguel de Icaza <miguel@ximian.com>
22456 * statement.cs: Add support for multiple child blocks.
22458 2001-08-22 Miguel de Icaza <miguel@ximian.com>
22460 * codegen.cs (EmitCode): New function, will emit the code for a
22461 Block of code given a TypeContainer and its ILGenerator.
22463 * statement.cs (Block): Standard public readonly optimization.
22464 (Block::Block constructors): Link children.
22465 (Block::Child): Child Linker.
22466 (Block::EmitVariables): Emits IL variable declarations.
22468 * class.cs: Drop support for MethodGroups here, delay until
22470 (Method::): Applied the same simplification that I did before, and
22471 move from Properties to public readonly fields.
22472 (Method::ParameterTypes): Returns the parameter types for the
22473 function, and implements a cache that will be useful later when I
22474 do error checking and the semantic analysis on the methods is
22476 (Constructor::GetCallingConvention): Renamed from CallingConvetion
22477 and made a method, optional argument tells whether this is a class
22478 or a structure to apply the `has-this' bit.
22479 (Method::GetCallingConvention): Implement, returns the calling
22481 (Method::Define): Defines the type, a second pass is performed
22482 later to populate the methods.
22484 (Constructor::ParameterTypes): implement a cache similar to the
22485 one on Method::ParameterTypes, useful later when we do semantic
22488 (TypeContainer::EmitMethod): New method. Emits methods.
22490 * expression.cs: Removed MethodGroup class from here.
22492 * parameter.cs (Parameters::GetCallingConvention): new method.
22494 2001-08-21 Miguel de Icaza <miguel@ximian.com>
22496 * class.cs (TypeContainer::Populate): Drop RootContext from the
22499 (Constructor::CallingConvention): Returns the calling convention.
22500 (Constructor::ParameterTypes): Returns the constructor parameter
22503 (TypeContainer::AddConstructor): Keep track of default constructor
22504 and the default static constructor.
22506 (Constructor::) Another class that starts using `public readonly'
22507 instead of properties.
22509 (Constructor::IsDefault): Whether this is a default constructor.
22511 (Field::) use readonly public fields instead of properties also.
22513 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
22514 track of static constructors; If none is used, turn on
22515 BeforeFieldInit in the TypeAttributes.
22517 * cs-parser.jay (opt_argument_list): now the return can be null
22518 for the cases where there are no arguments.
22520 (constructor_declarator): If there is no implicit `base' or
22521 `this', then invoke the default parent constructor.
22523 * modifiers.cs (MethodAttr): New static function maps a set of
22524 modifiers flags into a MethodAttributes enum
22525 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
22526 MethodAttr, TypeAttr to represent the various mappings where the
22527 modifiers are used.
22528 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
22530 2001-08-19 Miguel de Icaza <miguel@ximian.com>
22532 * parameter.cs (GetParameterInfo): Fix bug where there would be no
22535 * interface.cs (PopulateIndexer): Implemented the code generator
22536 for interface indexers.
22538 2001-08-17 Miguel de Icaza <miguel@ximian.com>
22540 * interface.cs (InterfaceMemberBase): Now we track the new status
22543 (PopulateProperty): Implement property population. Woohoo! Got
22544 Methods and Properties going today.
22546 Removed all the properties for interfaces, and replaced them with
22547 `public readonly' fields.
22549 2001-08-16 Miguel de Icaza <miguel@ximian.com>
22551 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
22552 initialize their hashtables/arraylists only when they are needed
22553 instead of doing this always.
22555 * parameter.cs: Handle refs and out parameters.
22557 * cs-parser.jay: Use an ArrayList to construct the arguments
22558 instead of the ParameterCollection, and then cast that to a
22561 * parameter.cs: Drop the use of ParameterCollection and use
22562 instead arrays of Parameters.
22564 (GetParameterInfo): Use the Type, not the Name when resolving
22567 2001-08-13 Miguel de Icaza <miguel@ximian.com>
22569 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
22570 and instead use public readonly fields.
22572 * class.cs: Put back walking code for type containers.
22574 2001-08-11 Miguel de Icaza <miguel@ximian.com>
22576 * class.cs (MakeConstant): Code to define constants.
22578 * rootcontext.cs (LookupType): New function. Used to locate types
22581 2001-08-08 Miguel de Icaza <miguel@ximian.com>
22583 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
22584 this System.Reflection code is. Kudos to Microsoft
22586 * typemanager.cs: Implement a type cache and avoid loading all
22587 types at boot time. Wrap in LookupType the internals. This made
22588 the compiler so much faster. Wow. I rule!
22590 * driver.cs: Make sure we always load mscorlib first (for
22591 debugging purposes, nothing really important).
22593 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
22594 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
22596 * rootcontext.cs: Lookup types on their namespace; Lookup types
22597 on namespaces that have been imported using the `using' keyword.
22599 * class.cs (TypeContainer::TypeAttr): Virtualize.
22600 (Class::TypeAttr): Return attributes suitable for this bad boy.
22601 (Struct::TypeAttr): ditto.
22602 Handle nested classes.
22603 (TypeContainer::) Remove all the type visiting code, it is now
22604 replaced with the rootcontext.cs code
22606 * rootcontext.cs (GetClassBases): Added support for structs.
22608 2001-08-06 Miguel de Icaza <miguel@ximian.com>
22610 * interface.cs, statement.cs, class.cs, parameter.cs,
22611 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22612 Drop use of TypeRefs, and use strings instead.
22614 2001-08-04 Miguel de Icaza <miguel@ximian.com>
22618 * class.cs (Struct::Struct): set the SEALED flags after
22619 checking the modifiers.
22620 (TypeContainer::TypeAttr): new property, returns the
22621 TypeAttributes for a class.
22623 * cs-parser.jay (type_list): Oops, list production was creating a
22624 new list of base types.
22626 * rootcontext.cs (StdLib): New property.
22627 (GetInterfaceTypeByName): returns an interface by type name, and
22628 encapsulates error handling here.
22629 (GetInterfaces): simplified.
22630 (ResolveTree): Encapsulated all the tree resolution here.
22631 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22634 * driver.cs: Add support for --nostdlib, to avoid loading the
22635 default assemblies.
22636 (Main): Do not put tree resolution here.
22638 * rootcontext.cs: Beginning of the class resolution.
22640 2001-08-03 Miguel de Icaza <miguel@ximian.com>
22642 * rootcontext.cs: Provide better error reporting.
22644 * cs-parser.jay (interface_base): set our $$ to be interfaces.
22646 * rootcontext.cs (CreateInterface): Handle the case where there
22647 are no parent interfaces.
22649 (CloseTypes): Routine to flush types at the end.
22650 (CreateInterface): Track types.
22651 (GetInterfaces): Returns an array of Types from the list of
22652 defined interfaces.
22654 * typemanager.c (AddUserType): Mechanism to track user types (puts
22655 the type on the global type hash, and allows us to close it at the
22658 2001-08-02 Miguel de Icaza <miguel@ximian.com>
22660 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22661 RecordInterface instead.
22663 * cs-parser.jay: Updated to reflect changes above.
22665 * decl.cs (Definition): Keep track of the TypeBuilder type that
22666 represents this type here. Not sure we will use it in the long
22667 run, but wont hurt for now.
22669 * driver.cs: Smaller changes to accomodate the new code.
22671 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22674 * rootcontext.cs (CreateInterface): New method, used to create
22675 the System.TypeBuilder type for interfaces.
22676 (ResolveInterfaces): new entry point to resolve the interface
22678 (CodeGen): Property, used to keep track of the code generator.
22680 2001-07-26 Miguel de Icaza <miguel@ximian.com>
22682 * cs-parser.jay: Add a second production for delegate_declaration
22685 (enum_body): Put an opt_comma here instead of putting it on
22686 enum_body or enum_member_declarations so we can handle trailing
22687 commas on enumeration members. Gets rid of a shift/reduce.
22689 (type_list): Need a COMMA in the middle.
22691 (indexer_declaration): Tell tokenizer to recognize get/set
22693 * Remove old targets.
22695 * Re-add the parser target.
22697 2001-07-13 Simon Cozens <simon@simon-cozens.org>
22699 * cs-parser.jay: Add precendence rules for a number of operators
22700 ot reduce the number of shift/reduce conflicts in the grammar.
22702 2001-07-17 Miguel de Icaza <miguel@ximian.com>
22704 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22707 Get rid of old crufty code.
22709 * rootcontext.cs: Use this to keep track of the parsed
22710 representation and the defined types available to the program.
22712 * gen-treedump.cs: adjust for new convention.
22714 * type.cs: Split out the type manager, and the assembly builder
22717 * typemanager.cs: the type manager will live here now.
22719 * cil-codegen.cs: And the code generator here.
22721 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
22723 * makefile: Fixed up for easy making.
22725 2001-07-13 Simon Cozens <simon@simon-cozens.org>
22727 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22730 (unary_expression): Expand pre_increment_expression and
22731 post_decrement_expression to reduce a shift/reduce.
22733 2001-07-11 Simon Cozens
22735 * cs-tokenizer.cs: Hex numbers should begin with a 0.
22737 Improve allow_keyword_as_indent name.
22739 2001-06-19 Miguel de Icaza <miguel@ximian.com>
22741 * Adjustments for Beta2.
22743 2001-06-13 Miguel de Icaza <miguel@ximian.com>
22745 * decl.cs: Added `Define' abstract method.
22746 (InTransit): new property, used to catch recursive definitions.
22748 * interface.cs: Implement `Define'.
22750 * modifiers.cs: Map Modifiers.constants to
22751 System.Reflection.TypeAttribute flags.
22753 * class.cs: Keep track of types and user-defined types.
22754 (BuilderInit): New method for creating an assembly
22755 (ResolveType): New function to launch the resolution process, only
22756 used by interfaces for now.
22758 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22759 that are inserted into the name space.
22761 2001-06-08 Miguel de Icaza <miguel@ximian.com>
22763 * ARGH. I have screwed up my tree so many times due to the use of
22764 rsync rather than using CVS. Going to fix this at once.
22766 * driver.cs: Objetify driver. Load assemblies, use assemblies to
22769 2001-06-07 Miguel de Icaza <miguel@ximian.com>
22771 * Experiment successful: Use System.Type rather that our own
22774 2001-05-25 Miguel de Icaza <miguel@ximian.com>
22776 * cs-parser.jay: Removed nsAliases from here.
22778 Use new namespaces, handle `using XXX;'
22780 * namespace.cs: Reimplemented namespace handling, use a recursive
22781 definition of the class. Now we can keep track of using clauses
22782 and catch invalid using clauses.
22784 2001-05-24 Miguel de Icaza <miguel@ximian.com>
22786 * gen-treedump.cs: Adapted for all the renaming.
22788 * expression.cs (Expression): this class now has a Type property
22789 which returns an expression Type.
22791 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22792 `Type', as this has a different meaning now in the base
22794 2001-05-22 Miguel de Icaza <miguel@ximian.com>
22796 * interface.cs, class.cs: Removed from all the sources the
22797 references to signature computation, as we can not do method
22798 signature computation during the parsing time, as we are not
22799 trying to solve at that point distinguishing:
22803 void a (NS.Blah x) {}
22806 Which depending on the context might be valid or not, as we do not
22807 know if Blah is the same thing as NS.Blah at that point.
22809 * Redid everything so the code uses TypeRefs now instead of
22810 Types. TypeRefs are just temporary type placeholders, that need
22811 to be resolved. They initially have a pointer to a string and the
22812 current scope in which they are used. This is used later by the
22813 compiler to resolve the reference to an actual Type.
22815 * DeclSpace is no longer a CIR.Type, and neither are
22816 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
22817 are all DeclSpaces, but no Types.
22819 * type.cs (TypeRefManager): This implements the TypeRef manager,
22820 which keeps track of all the types that need to be resolved after
22821 the parsing has finished.
22823 2001-05-13 Miguel de Icaza <miguel@ximian.com>
22825 * ARGH. We are going to have to store `foreach' as a class rather
22826 than resolving it, as we need to verify error 1579 after name
22827 resolution. *OR* we could keep a flag that says `This request to
22828 IEnumerator comes from a foreach statement' which we can then use
22829 to generate the error.
22831 2001-05-10 Miguel de Icaza <miguel@ximian.com>
22833 * class.cs (TypeContainer.AddMethod): we now add methods to the
22834 MethodGroup instead of the method hashtable.
22836 * expression.cs: Add MethodGroup abstraction, which gets us one
22837 step closer to the specification in the way we handle method
22840 * cs-parser.jay (primary_expression): qualified_identifier now
22841 tried to match up an identifier to a local variable reference or
22842 to a parameter reference.
22844 current_local_parameters is now a parser global variable that
22845 points to the current parameters for the block, used during name
22848 (property_declaration): Now creates an implicit `value' argument to
22851 2001-05-09 Miguel de Icaza <miguel@ximian.com>
22853 * parameter.cs: Do not use `param' arguments as part of the
22854 signature, per the spec.
22856 2001-05-08 Miguel de Icaza <miguel@ximian.com>
22858 * decl.cs: Base class for classes, structs and interfaces. This
22859 is the "Declaration Space"
22861 * cs-parser.jay: Use CheckDef for checking declaration errors
22862 instead of having one on each function.
22864 * class.cs: Factor out some code for handling error handling in
22865 accordance to the "Declarations" section in the "Basic Concepts"
22866 chapter in the ECMA C# spec.
22868 * interface.cs: Make all interface member classes derive from
22869 InterfaceMemberBase.
22871 2001-05-07 Miguel de Icaza <miguel@ximian.com>
22873 * Many things: all interfaces are parsed and generated in
22874 gen-treedump. Support for member variables, constructors,
22875 destructors, properties, constants is there.
22877 Beginning of the IL backend, but very little done, just there for
22880 2001-04-29 Miguel de Icaza <miguel@ximian.com>
22882 * cs-parser.jay: Fix labeled statement.
22884 * cs-tokenizer.cs (escape): Escape " and ' always.
22885 ref_line, ref_name: keep track of the line/filename as instructed
22886 by #line by the compiler.
22889 2001-04-27 Miguel de Icaza <miguel@ximian.com>
22891 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22892 to match the values in System.CodeDOM.
22894 Divid renamed to Divide.
22896 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22898 (Statements.set): remove.
22900 * System.CodeDOM/CodeCatchClause.cs: always have a valid
22903 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22904 falseStatements always have valid values.
22906 * cs-parser.jay: Use System.CodeDOM now.