1 2006-04-01 Marek Safar <marek.safar@seznam.cz>
3 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
4 in an embedded statement too.
6 2006-04-01 Raja R Harinath <rharinath@novell.com>
9 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
13 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
16 * report.cs (SymbolRelatedToPreviousError): Drop generic type
17 arguments before checking whether a type is reflected or not.
20 * expression.cs (Invocation.IsApplicable): Ensure a generic method
21 definition doesn't take part in overload resolution.
22 (Invocation.IsParamsMethodApplicable): Likewise.
23 (Invocation.OverloadResolve): When replacing a reflected override
24 method with its base definition, ensure that type arguments are
27 2006-04-01 Marek Safar <marek.safar@seznam.cz>
31 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
34 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
36 2006-03-31 Marek Safar <marek.safar@seznam.cz>
38 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
41 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
42 LocalTemporary change.
44 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
46 (ClassOrStruct.DefineFieldInitializers): Implemented static field
47 initializers optimization.
48 (ClassOrStruct.TypeAttr): Moved from modifiers.
49 (Constructor.CheckBase): Don't crash when static ctor has parameters.
50 (FieldBase.ResolveInitializer): Resolves initializer.
51 (FieldBase.HasDefaultInitializer): New property.
53 * cs-parser.jay: Removed message.
55 * expression.cs (CompilerGeneratedThis): New specialization.
57 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
59 2006-03-28 Marek Safar <marek.safar@seznam.cz>
61 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
63 2006-03-27 Marek Safar <marek.safar@seznam.cz>
65 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
66 be now EnumConstants only.
68 2006-03-27 Marek Safar <marek.safar@seznam.cz>
70 * attribute.cs, driver.cs: Reset more caches.
72 2006-03-26 Marek Safar <marek.safar@seznam.cz>
74 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
76 2006-03-26 Marek Safar <marek.safar@seznam.cz>
78 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
79 for easier reuse. Updated all overrides.
80 (IntegralConstant): New base class for all integral constants.
81 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
82 of the constant range, report custom error.
83 (UIntConstant.Reduce): Fixed uint conversion.
85 * ecore.cs, literal.cs: Reduce updates.
87 2006-03-26 Marek Safar <marek.safar@seznam.cz>
91 * class.cs (Constructor.Define): Removed extra if for default ctors.
92 A patch from Atsushi Enomoto.
94 2006-03-26 Marek Safar <marek.safar@seznam.cz>
96 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
99 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
102 * convert.cs (ImplicitConversionRequired): Error message moved to
105 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
106 automatic implicit conversion of an output value.
107 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
109 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
111 (TypeOf.GetAttributableValue): Add extra handling for object type.
113 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
114 special error message.
116 2006-03-25 Marek Safar <marek.safar@seznam.cz>
118 * class.cs (Constructor.Emit): Don't crash when struct ctor is
120 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
121 compatible with MS runtime.
123 2006-03-23 Marek Safar <marek.safar@seznam.cz>
125 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
126 attribute arguments here.
128 * class.cs (Indexer.Define): The check was moved to attribute class.
130 2006-03-21 Marek Safar <marek.safar@seznam.cz>
132 * expression.cs (StringConcat.Append): Reverted back to no warning state.
134 2006-03-21 Marek Safar <marek.safar@seznam.cz>
136 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
138 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
141 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
143 * doc-bootstrap.cs : fix build.
145 2006-03-20 Marek Safar <marek.safar@seznam.cz>
147 * expression.cs (StringConcat.Append): Issue a warning when empty string
150 2006-03-20 Marek Safar <marek.safar@seznam.cz>
152 * assign.cs (CompoundAssign.ResolveSource): Removed.
154 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
157 * class.cs (TypeContainer.FindMethods): Removed.
158 (TypeContainer.CheckMemberUsage): Made static.
160 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
162 * constant.cs (CheckRange): Removed unused type argument.
163 (CheckUnsigned): Removed unused type argument.
165 * cs-parser.jay: Updated after MemberAccess clean up.
166 Uses Length for empty string test.
168 * cs-tokenizer.cs: Uses Length for empty string test.
169 (IsCastToken): Made static.
170 (is_hex): Made static.
171 (real_type_suffix): Made static.
173 * decl.cs (SetupCache): Made static.
174 (OnGenerateDocComment): Removed unused ds argument.
176 * delegate.cs (VerifyDelegate): Removed unused argument.
178 * doc.cs: Uses Length for empty string test.
180 * driver.cs: Uses Length for empty string test.
182 * enum.cs (IsValidEnumType): Made static
184 * expression.cs (EnumLiftUp): Removed unused argument.
185 (ResolveMethodGroup): Ditto.
186 (BetterConversion): Ditto.
187 (GetVarargsTypes): Ditto.
188 (UpdateIndices): Ditto.
189 (ValidateInitializers): Ditto.
190 (MemberAccess.ctor): Ditto.
191 (GetIndexersForType): Ditto.
193 * flowanalysis.cs: (MergeFinally): Removed unused argument.
195 * iterators.cs: Updated after MemberAccess clean up.
197 * location.cs: Uses Length for empty string test.
199 * namespace.cs: Uses Length for empty string test.
201 * report.cs (CheckWarningCode): Made static.
203 * statement.cs (LabeledStatement): Removed unused argument.
205 * typemanager.cs (FilterNone): Removed.
207 2006-03-18 Marek Safar <marek.safar@seznam.cz>
209 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
214 2006-03-18 Marek Safar <marek.safar@seznam.cz>
216 * cs-parser.jay.cs: __arglist is not allowed for delegates.
218 2006-03-18 Marek Safar <marek.safar@seznam.cz>
222 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
224 (AnonymousMethod.ImplicitStandardConversionExists): New method.
225 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
226 Add more error reporting; Fixed issue with params.
228 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
230 * cs-parser.jay: AnonymousMethod requires host container.
232 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
234 2006-03-18 Raja R Harinath <harinath@gmail.com>
236 * class.cs: Change 'TypeContainer ds' constructor argument to
237 'DeclSpace parent'. Some classes were missed below due to
238 different naming convention.
240 * class.cs (MemberCore.Parent): Delete. This makes the
241 ParentContainer changes below enforceable by the compiler.
243 Treat pointers to enclosing declaration space as 'DeclSpace', not
245 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
246 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
248 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
250 (Block.AddThisVariable): Likewise.
251 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
252 (AbstractPropertyEventMethod.Emit): Likewise.
253 (AbstractPropertyEventMethod.EmitMethod): Likewise.
254 (GetMethod.Define, SetMethod.Define): Likewise.
255 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
256 (DelegateMethod.EmitMethod): Likewise.
258 Fix regression test-partial-13.cs.
259 Rationalize use of PartialContainer. Ensure that the partial
260 class semantics can be tied to type-correctness, i.e., any
261 violation will cause a compile error.
262 * class.cs, const.cs: Access all fields that belong to class
263 TypeContainer via ParentContainer. Arguments of EmitContexts and
264 Resolve()-like functions still use 'Parent'.
266 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
267 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
268 (PropertyMethod.CheckModifiers): Remove unused argument.
269 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
272 2006-03-28 Raja R Harinath <rharinath@novell.com>
274 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
276 2006-03-17 Raja R Harinath <harinath@gmail.com>
278 Make semantics of PartialContainer simpler.
279 * decl.cs (DeclSpace.IsPartial): Remove.
280 * class.cs (TypeContainer.IsPartial): Likewise.
281 (TypeContainer..ctor): Set PartialContainer to point to self.
282 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
283 (TypeContainer.FindNestedType): Likewise.
284 (MemberCore.ParentContainer): Simplify. Remove deprecation.
286 2006-03-17 Marek Safar <marek.safar@seznam.cz>
288 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
290 2006-03-15 Marek Safar <marek.safar@seznam.cz>
292 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
295 2006-03-15 Marek Safar <marek.safar@seznam.cz>
297 * class.cs (Operator.Define): An error for base conversion was not
300 2006-03-13 Marek Safar <marek.safar@seznam.cz>
302 A fix for #77593, #77574.
304 * class.cs (MethodCore.CheckBase): Another if for operator.
306 2006-03-18 Marek Safar <marek.safar@seznam.cz>
310 * expression.cs (VerifyArgumentsCompat): Reverted to double error
311 reporting, it's more tricky than I thought.
313 2006-03-09 Marek Safar <marek.safar@seznam.cz>
315 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
318 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
319 (DelegateCreation.ImplicitStandardConversionExists): New method for just
322 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
325 2006-03-04 Marek Safar <marek.safar@seznam.cz>
329 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
330 (Event.Define): ditto
331 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
333 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
334 Removed redundant code and set NewSlot for Invoke method too.
336 * parameter.cs (Parameters.ctor): Add custom, type ctor.
337 (Parameters.MergeGenerated): New method. Use this method when you merge
338 compiler generated argument with user arguments.
340 2006-03-03 Marek Safar <marek.safar@seznam.cz>
342 * attribute.cs (ResolveAsTypeTerminal): Removed.
344 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
345 specialization for predefined types; 30% speed up.
346 Finally placed obsolete check to right place.
347 (Expression.ResolveType): Removed.
349 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
350 Updated after ResolveType was removed.
352 * expression.cs (Cast.ctor): Check void cast.
353 (Binary.ResolveAsTypeTerminal): Is never type.
354 (Conditional.ResolveAsTypeTerminal): Is never type.
356 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
358 2006-03-26 Marek Safar <marek.safar@seznam.cz>
360 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
362 2006-03-23 Martin Baulig <martin@ximian.com>
364 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
365 type check if either of the types is an open generic type.
367 2006-03-23 Martin Baulig <martin@ximian.com>
370 (Convert.ExplicitTypeParameterConversion): New method; implement
371 explicit type parameter conversions.
373 2006-03-23 Martin Baulig <martin@ximian.com>
375 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
376 blindly allow all conversions if we do not have any constraints.
378 2006-02-27 Marek Safar <marek.safar@seznam.cz>
380 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
381 these two separated members to simplify the code.
382 (Attribute.Resolve): Refactored to use new fields and methods.
383 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
384 implemented obsolete attribute checking.
385 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
386 implemented obsolete checking again. It look line never ending quest ;-)
387 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
389 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
391 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
393 *class.cs (Property.Define): Add RegisterProperty call.
395 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
396 argument groups (only 2).
398 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
399 encoding expression to arguments.
400 (Expression.ExprClassToResolveFlags): Just turned to property.
402 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
403 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
404 optimized as well as implemented support for zero-length attributes.
406 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
407 Add caching of PropertyInfo's.
409 2006-02-25 Marek Safar <marek.safar@seznam.cz>
411 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
412 error multiple times.
414 2006-02-25 Marek Safar <marek.safar@seznam.cz>
416 New partial class implementation.
417 A fix for #77027, #77029, #77403
419 * attribute.cs (Attributable): Made attributes protected.
421 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
422 the replacements of ClassPart and PartialContainer.
423 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
424 (TypeContainer.AddInterface): Ditto.
425 (TypeContainer.AddPartial): The main method for partial classes. It checks
426 for errors and merges ModFlags and attributes. At the end class is added to
428 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
430 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
431 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
432 from the rest of partial classes.
433 (TypeContainer.GetClassBases): Simplified.
434 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
436 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
437 (TypeContainer.HasExplicitLayout): Uses Flags now.
438 (PartialContainer): Removed.
439 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
440 (StaticClass): Was merged with Class.
441 (Class.GetClassBases): class and static class bases are verified here.
442 (Class.TypeAttr): Added static attributes when class is static.
443 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
444 (MemberBase): In some cases we need to call parent container for partial
445 class. It should be eliminated but it's not easy now.
447 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
449 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
450 partial classed to accumulate class comments.
451 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
453 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
455 * driver.cs (MainDriver): Tree.GetDecl was removed.
457 * modifiers.cs (Modifiers): Add partial modifier.
459 * tree.cs (Tree.decl): Removed.
460 (RootTypes): Started to use this class more often for root types
463 2006-03-23 Raja R Harinath <rharinath@novell.com>
465 * generic.cs (TypeParameter.UpdateConstraints): Update
466 'constraints' if null.
468 2006-02-22 Marek Safar <marek.safar@seznam.cz>
472 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
473 external interface does not have an attribute.
475 2006-02-22 Marek Safar <marek.safar@seznam.cz>
477 Another prerequisites for new partial classs implementation.
479 * attribute.cs (Attribute.Equal): Implemented.
480 (Attribute.Emit): Changed as attributes can be applied more than twice.
481 (Attributes.Emit): Check for duplicate attributes here.
483 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
484 as a parameter, clean-up.
486 2006-02-11 Marek Safar <marek.safar@seznam.cz>
490 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
491 contains obsolete attribute check which can in some cases look for base
492 type of current class which is not initialized yet.
493 (TypeContainer.BaseType): Replacement of ptype.
495 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
497 2006-02-11 Marek Safar <marek.safar@seznam.cz>
499 First of prerequisites for new partial classs implemention.
501 * attribute.cs (Attributable): Extended by ResolveContext;
502 Attributes finally have correct context for resolving in all cases.
503 (AttachTo): Attribute owner is assigned here.
505 * codegen.cs (IResolveContext): Introduce new interface to hold
506 all information needed in resolving phase.
507 (EmitContext): Implements IResolveContext; more clean-up needed here.
509 * decl.cs (MemberCore): Implemented IResolveContext.
511 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
512 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
513 parameter.cs, statement.cs, tree.cs, typemanager.cs:
514 Refactored to use new IResolveContext instead of EmitContext; cleanup
516 2006-03-22 Raja R Harinath <rharinath@novell.com>
518 Support ParameterDefaultValueAttribute in gmcs. Also applied to
519 mcs to keep code differences small.
520 * attribute.cs (Attribute.GetParameterDefaultValue): New.
521 * typemanager.cs (parameter_default_value_attribute_type): New.
522 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
525 2006-03-22 Martin Baulig <martin@ximian.com>
528 (Nullable.NullableLiteral): Derive from `NullLiteral'.
531 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
532 instead of the normal `NullLiteral'.
534 2006-03-21 Martin Baulig <martin@ximian.com>
537 * generic.cs (TypeManager.InferType): If `pt' is a generic
538 parameter, don't check whether `pt == at'.
540 2006-03-20 Raja R Harinath <rharinath@novell.com>
543 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
544 (TypeParameter.Resolve): Update to change.
545 (ConstraintChecker.CheckConstraints): Resolve type-argument
546 constraints before use.
548 2006-03-16 Martin Baulig <martin@ximian.com>
551 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
552 and don't have any instance constructors, also lookup in the base class.
553 (TypeManager.IsNullableValueType): New public method.
555 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
556 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
557 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
559 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
560 instead of just TypeManager.IsNullableType() to determine whether
561 a lifted operator exists.
562 (UnaryMutator.DoResolve): Likewise.
563 (Conditional.DoResolve): Likewise.
564 (Binary.DoResolve): A lifted operator only exists if both operands
565 are valuetypes and at least one of them is a nullable type.
567 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
569 * iterator.cs : yield break is allowed in try statement which has
570 catch clauses. Fixed bug #77767.
572 2006-03-12 Martin Baulig <martin@ximian.com>
574 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
575 private IsSignatureEqual() to compare types; see the comment in
576 that method; fixes #77674.
578 2006-03-10 Raja R Harinath <rharinath@novell.com>
580 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
581 (Expression.ResolveAsTypeTerminal): Likewise.
582 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
583 * expression.cs, generic.cs, iterators.cs: Likewise.
584 * parameter.cs, statement.cs, typemanager.cs: Likewise.
586 2006-03-09 Martin Baulig <martin@ximian.com>
588 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
589 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
591 2006-03-09 Martin Baulig <martin@ximian.com>
593 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
594 `prepared' flag is set.
596 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
597 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
598 issues; see gtest-254.cs.
600 2006-03-07 Martin Baulig <martin@ximian.com>
602 * generic.cs (TypeManager.InferType): Allow infering
603 `IEnumerable<T>' with an array of T; see gtest-251.cs.
605 2006-03-06 Martin Baulig <martin@ximian.com>
608 (TypeManager.InferType): Fix gtest-250.cs.
611 (TypeManager.IsSubclassOf): Also check the base class.
614 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
617 2006-03-01 Raja R Harinath <rharinath@novell.com>
620 * expression.cs (ParameterReference.DoResolveBase): Change return
622 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
626 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
629 * typemanager.cs (GetFullNameSignature): Don't nullref on
632 2006-02-16 Martin Baulig <martin@ximian.com>
635 (TypeManager.GetGenericFieldDefinition): New public method; use it
636 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
638 2006-02-14 Martin Baulig <martin@ximian.com>
640 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
642 2006-02-14 Martin Baulig <martin@ximian.com>
645 (TypeManager.DropGenericMethodArguments): New public method; don't
646 use GetGenericMethodDefinition() on something which is not a
649 2006-02-14 Martin Baulig <martin@ximian.com>
652 (ConstraintChecker.CheckConstraints): If a type parameter has the
653 `struct' constraint, the type must be a non-nullable valuetype.
655 2006-02-10 Martin Baulig <martin@ximian.com>
658 (TypeManager.IsOverride): Make this work for instantiated methods
659 in a generic class; fixes #77509.
660 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
661 rather than calling it directly; fixes #77488.
663 2006-02-08 Martin Baulig <martin@ximian.com>
665 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
666 reporting into CheckConstraint() so we can use the correctly
669 2006-02-08 Martin Baulig <martin@ximian.com>
671 * expression.cs (BaseAccess): Add support for generic methods.
673 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
674 the new MethodGroupExpr.
676 2006-02-07 Martin Baulig <martin@ximian.com>
678 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
679 also reference types; fixes #77483.
681 2006-02-07 Martin Baulig <martin@ximian.com>
684 (TypeManager.IsGenericMethod): We now return whether something is
685 an instantiated generic method (and not a generic method def).
686 (TypeManager.IsGenericMethodDefinition): New public method.
689 (TypeManager.CSharpSignature): Only include type arguments for
690 "real" generic methods, not for any instantiated method.
691 (TypeManager.GetMethodName): Likewise, but also allow generic
692 method definitions here.
694 2006-02-06 Miguel de Icaza <miguel@novell.com>
696 * codegen.cs (EmitScopeInitFromBlock): check here the
697 capture_context, there is no need to make two calls to the
700 * anonymous.cs: Add some debugging messages that might help me
701 track other instances of this problem in the future (the
702 regression of test 467).
704 * cs-parser.jay: track the variable block, as we need to initalize
705 any captured variables declared in this block for the "catch"
706 portion of the "Try" statement.
708 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
709 scope initialization for captured variables.
711 Also, move the emit for the variables after the block location has
714 2006-02-06 Marek Safar <marek.safar@seznam.cz>
716 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
718 2006-02-06 Martin Baulig <martin@ximian.com>
720 * class.cs (TypeContainer.DefineType): If we're a struct, pass
721 `TypeManager.value_type' as parent type to
722 ModuleBuilder.DefineType(). Fixes #77358.
724 2006-02-02 Miguel de Icaza <miguel@novell.com>
726 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
727 commit yesterday, the initialization for the roots is necessary.
728 What is not necessary is the scope activation.
730 2006-02-02 Raja R Harinath <rharinath@novell.com>
732 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
733 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
735 (Argument.Resolve): Remove CS0206 checks.
737 2006-02-01 Miguel de Icaza <miguel@novell.com>
739 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
740 scopes for all the roots, the scopes will now be emitted when the
741 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
743 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
744 code. This reduces a lot of existing cruft.
746 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
747 that the ScopeInfo is generated as we enter the scope, not at the
748 time of use, which is what we used to do before.
750 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
751 every time a Block is about to be emitted if we have a
754 2006-02-01 Raja R Harinath <rharinath@novell.com>
756 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
757 attribute for mscorlib too.
759 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
761 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
763 * typemanager.cs (cons_param_array_attribute): Make private.
764 (Reset): Set it to null.
765 (InitCoreHelpers): Don't initialize it.
766 (ConsParamArrayAttribute): New. Initialize it as needed.
767 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
769 2006-01-31 Miguel de Icaza <miguel@novell.com>
771 * expression.cs: There might be errors reported during the
772 selection of applicable methods. If there are errors, do not
773 continue execution as it will lead the compiler to crash.
775 2006-01-30 Miguel de Icaza <miguel@novell.com>
777 * expression.cs: Member access is not allowed on anonymous
778 methods. Fixes #77402.
780 2006-01-30 Raja R Harinath <rharinath@novell.com>
783 * cs-parser.jay (VariableDeclaration): Don't set
784 current_array_type to null.
785 (field_declaration, event_declaration, declaration_statement):
788 2006-01-29 Raja R Harinath <harinath@gmail.com>
791 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
793 2006-01-28 Raja R Harinath <harinath@gmail.com>
795 * typemanager.cs (GenericParameterPosition): New.
798 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
800 * doc.cs : To process "include" elements, first we should create
801 another list than XmlNodeList, because it could result in node
802 removal, which could result in that the XmlNodeList gives up
805 2006-01-25 Miguel de Icaza <miguel@novell.com>
807 * expression.cs: Introduce an error report that we were not
808 catching before. Gonzalo ran into it.
810 2006-01-23 Miguel de Icaza <miguel@novell.com>
812 A fix for bug: #76957
814 * iterators.cs (MoveNextMethod.CreateMethodHost): call
815 ComputeMethodHost before creating the method, this is a new
818 * anonymous.cs (AnonymousContainer): Now we track all the scopes
819 that this method references (RegisterScope). The actual scope
820 where the method is hosted is computed with the ComputeMethodHost
821 before we create the method.
823 Moved the Deepest routine here.
825 (AnonymousContainer.ComputeMethodHost): New routine used to
826 compute the proper ScopeInfo that will host the anonymous method.
828 (ScopeInfo): Deal with multiple roots. The problem was that we
829 did not have a unique root where all ScopeInfos could be hanged
830 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
833 Remove AdjustMethodScope which is now computed at the end. Remove
834 LinkScope which did a partial link, instead link all ScopeInfos
835 before code generation from the new "LinkScopes" routine.
837 Simplify all the Add* routines as they no longer need to maintain
838 the tree, they just need to record that they are using variables
841 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
842 routines to produce the forest of ScopeInfo trees.
844 * class.cs (TypeContainer.AppendMethod): This is just like
845 AddMethod, but ensures that an interface implementation method
846 (IEnumerable.XXX) is not inserted at the beginning of the queue of
847 methods, but at the end.
849 We use this functionality to ensure that the generated MoveNext
850 method in the iterator class is resolved/emitted before the
851 enumerator methods created.
853 This is required because the MoveNext method computes the right
854 ScopeInfo for the method. And the other methods will eventually
855 need to resolve and fetch information computed from the anonymous
859 2006-01-23 Raja R Harinath <rharinath@novell.com>
861 Improve implementation of section 14.4.2.2 (Better function member).
862 * expression.cs (Invocation.MoreSpecific): Compare all type
863 arguments before deciding if one type is more specific than
864 another. Handle array types too. Return the more specific type.
865 (Invocation.BetterFunction): Add more tie-breaking rules from
866 section 14.4.2.2. Perform "more specific" check after
867 other tie-breaking rules. Compare all parameter types before
868 choosing the "more specific" method.
870 2006-01-21 Raja R Harinath <harinath@gmail.com>
871 Carlos Alberto Cortez <calberto.cortez@gmail.com>
874 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
876 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
877 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
879 2006-01-18 Martin Baulig <martin@ximian.com>
881 * class.cs (TypeContainer.AddToMemberContainer): Use
882 `symbol.MemberName.MethodName' instead of just `symbol.Name';
885 2006-01-18 Martin Baulig <martin@ximian.com>
887 Fix #76417: a generic class may now have methods which may unify
888 for some type parameter substitutions.
890 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
891 for methods which may unify anymore.
893 * expression.cs (Invocation.MoreSpecific): New private static
894 method; checks whether one method is more specific than another
895 according to 14.4.2.2 of the spec.
896 (Invocation.BetterFunction): Implement the tie-breaking rules from
897 14.4.2.2 of the spec: if two methods unify for some type parameter
898 substitution, we need to pick the more specific one.
900 2006-01-18 Raja R Harinath <rharinath@novell.com>
902 Fix #76656, cs0231-2.cs.
903 * cs-parser.jay (formal_parameter_list): Make error case catch
905 (parenthesized_expression_0): Add CS1026 check.
906 (invocation_expression): Remove unused { $$ = lexer.Location }.
908 2006-01-17 Raja R Harinath <rharinath@novell.com>
911 * cs-parser.jay (statement_expression): Don't list out the
912 individual statement-expressions. Convert syntax error into
915 2006-01-16 Raja R Harinath <rharinath@novell.com>
918 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
919 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
920 CheckIntermediateModification.
921 (FieldExpr.DoResolve): Add new two-argument version that
922 allows us to resolve the InstanceExpression as an lvalue.
923 The one-argument variant is now just a wrapper.
924 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
925 Resolve the lhs as an lvalue if the it has a value type.
926 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
927 from Assign.DoResolve.
928 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
929 resolved as an lvalue.
930 (PropertyExpr.DoResolve): Update.
931 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
932 has a value type. Move CS1612 check here from
933 CheckIntermediateModification.
934 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
935 * expression.cs (EmptyExpression.OutAccess): New. Used as the
936 'right_side' of a ResolveLValue on an 'out' argument.
937 (EmptyExpression.LValueMemberAccess): New. Used as the
938 'right_side' of a propagated ResolveLValue on a value type.
939 (LocalVariableReference.DoResolveBase): Recognize
940 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
942 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
943 EmptyExpression.Null.
945 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
947 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
948 Type.IsGenericParameter(). Fixed bug #77183.
949 * doc.cs : it is now identical to doc.cs in mcs.
951 2006-01-16 Martin Baulig <martin@ximian.com>
953 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
955 2006-01-16 Martin Baulig <martin@ximian.com>
957 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
960 2006-01-12 Miguel de Icaza <miguel@novell.com>
962 This fixes the problem where we used ldfld instead of ldflda to
963 load the "THIS" pointer on captured parameters, when THIS is a
964 value type. See bug #77205.
966 * iterators.cs (CapturedThisReference.Emit): Pass false to
967 EmitThis (we do not need the address).
969 * codegen.cs (EmitThis): it needs to know whether we need the
970 address of `this' or not. This is used by value types.
972 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
973 every other call passes false.
975 2006-01-12 Raja R Harinath <rharinath@novell.com>
978 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
980 * expression.cs (Invocation.OverloadResolve): Update.
981 (Invocation.DoResolve): Avoid double resolution of invocation.
983 2006-01-11 Raja R Harinath <rharinath@novell.com>
986 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
987 unary negation of floating point types as 0-expr; negation cannot
988 overflow in floating point types.
991 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
992 on operands of 'void' type.
995 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
996 and ExclusiveOr for boolean constants too.
998 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1000 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1002 2006-01-12 Miguel de Icaza <miguel@novell.com>
1004 * cs-tokenizer.cs (Position): New class used to save and restore
1005 the position state in the tokenizer. Before this patch the save
1006 and restore was not complete enough so the line and columns would
1007 start to drift and the debugger and stack traces will get the
1010 2006-01-10 Martin Baulig <martin@ximian.com>
1013 (TypeParameter.InflateConstraints): New public method.
1015 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1016 constraints; fixes #77042.
1018 2006-01-10 Martin Baulig <martin@ximian.com>
1020 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1021 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1024 2006-01-09 Raja R Harinath <rharinath@novell.com>
1027 * expression.cs (Invocation.OverloadResolve): Replace reflected
1028 override methods with their base virtual methods, rather than
1030 * typemanager.cs (TypeManager.GetOverride): New.
1032 2005-12-21 Miguel de Icaza <miguel@novell.com>
1034 * driver.cs: Report the case of no source files and no -out:
1037 2005-12-20 Raja R Harinath <rharinath@novell.com>
1040 * expression.cs (ComposedCast.GetSignatureForError): Define.
1042 2006-01-05 Jb Evain <jbevain@gmail.com>
1044 * class.cs (Property.Define, Indexer.Define): do not tag the
1045 properties as SpecialName | RTSpecialName.
1047 2006-01-04 Miguel de Icaza <miguel@novell.com>
1049 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1050 doing a low-level comparission of parameter types. It was lacking
1051 a check for __argslist.
1053 2005-12-30 Miguel de Icaza <miguel@novell.com>
1055 * expression.cs (ParameterReference.DoResolveBase): Allow
1056 reference parameters if they are local to this block.
1058 This allows the ref and out parameters of a delegate to be used in
1059 an anonymous method, for example:
1061 delegate void set (out int x);
1063 set s = delegate (out int x){
1067 This is used by functionality introduced late in the C# language.
1069 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1070 method that take ref and out parameters.
1072 Fixes #77119 which was a late change in the spec.
1074 2005-12-23 Miguel de Icaza <miguel@novell.com>
1076 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1077 parent if its the same scope. Fixes #77060.
1079 2005-12-22 Marek Safar <marek.safar@seznam.cz>
1081 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1083 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1085 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1086 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
1087 that doesn't contain the full public key. This is a update of the
1088 friend assemblies in .Net 2.0 release.
1090 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1094 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1095 ListDictionary, to contain the ExternAliasEntry entries (in
1096 addition to the NamespaceEntry.aliases hashtable). This field is
1097 shared between the original entry and its doppelganger (bodyless
1099 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1100 extern_aliases field.
1101 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1102 lookup in extern_aliases.
1104 2005-12-16 Raja R Harinath <rharinath@novell.com>
1107 * class.cs (TypeContainer.Mark_HasEquals): New.
1108 (TypeContainer.Mark_HasGetHashCode): New.
1109 (ClassPart): Override them.
1110 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1112 * generic.cs (GenericMethod.DefineMembers): Update to changes.
1113 (TypeParameter.TypeParameter): Change type of 'parent' argument to
1117 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1118 'parent' argument to the base constructor.
1120 Remove all mention of TypeContainer from decl.cs.
1121 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1122 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1123 (DeclSpace.DeclSpace): Likewise.
1124 (DeclSpace.DefineMembers): Remove unused argument.
1125 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1126 debugging check -- we don't care if the debug code throws an
1127 InvalidCastException instead of an InternalErrorException.
1128 * class.cs (TypeContainer.DefineMembers): Update to changes.
1129 (TypeContainer.DoDefineMembers): Likewise.
1130 (TypeContainer.GetMethods): Likewise.
1131 (PropertyMember.Define): Likewise.
1132 (MemberBase.Parent): New property that forwards to
1133 MemberCore.Parent, but ensures that we get a TypeContainer.
1134 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1135 (RootContext.PopulateTypes): Likewise. Remove special case code
1136 for !RootContext.StdLib: DefineMembers is idempotent.
1138 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1140 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1142 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1144 * doc.cs : The search for referenced namespace was insufficient to
1145 get global one as it used to do. Fixed bug #76965.
1147 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1149 * doc.cs : check name in cref in the last phase that whether it is
1152 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1154 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1157 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1159 * doc.cs : so it turned out that we cannot skip override check for
1160 interface members. Fixed bug #76954.
1162 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1164 * cs-tokenizer.cs : fixed bug #75984:
1165 - #warning and #error should not be handled when the source line
1167 - #line is not checked strictly when the source line is disabled.
1168 - #define and #undef is on the other hand checked strictly at any
1171 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1173 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1176 2005-12-15 Raja R Harinath <rharinath@novell.com>
1178 * generic.cs (TypeManager.IsGeneric): Remove unused method.
1180 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1183 2005-12-14 Martin Baulig <martin@ximian.com>
1185 * typemanager.cs (TypeManager.GetFullName): Make this public;
1186 `Type.Fullname' now never returns null.
1188 * class.cs (Method.Define): Use TypeManager.GetFullName() for
1189 explicit interface implementations; we're now using the same
1190 naming convention than csc does.
1192 2005-12-14 Miguel de Icaza <miguel@novell.com>
1194 * convert.cs (ExplicitConversionCore): Check the return value from
1195 ExplicitConversionCore which can return null on failure. Fixes #76914
1197 2005-12-09 Raja R Harinath <rharinath@novell.com>
1199 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1200 instead of IsGenericInstance.
1201 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
1202 code that's now covered by the more general test.
1203 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1205 * generic.cs (DropGenericTypeArguments): New. Captures the common
1206 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1207 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1208 * generic.cs, report.cs, typemanager.cs: Likewise.
1210 2005-12-08 Martin Baulig <martin@ximian.com>
1212 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1214 * typemanager.cs (TypeManager.CSharpSignature): Include type
1215 arguments in the signature of a generic method.
1217 2005-12-07 Martin Baulig <martin@ximian.com>
1219 Add support for custom attributes on type parameters.
1221 * cs-parser.jay (type_arguments): Added `opt_attributes'.
1223 * generic.cs (TypeParameterName): New public class; we use this
1224 instead of a `string' to store the name of a type parameter, so we
1225 can also have `Attributes'.
1226 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1227 array instead of a `string[]' array.
1228 (TypeParameter.ctor): We now also take an `Attributes' argument.
1229 (TypeParameter.EmitAttributes): New public method; emit our
1230 `OptAttributes' here.
1231 (GenericMethod.EmitAttributes): New public method; emit the custom
1232 attributes on all our type parameters.
1234 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1235 our type parameters.
1236 (MethodData.Define): If we're a generic method, call
1237 EmitAttributes() on it.
1239 2005-12-07 Martin Baulig <martin@ximian.com>
1242 (ConstraintChecker): New public abstract class; move the
1243 constraint checking here from `ConstructedType' and also do
1244 constraint checking for generic methods here.
1246 * expression.cs (Invocation.OverloadResolve): Use
1247 ConstraintChecker.CheckConstraints() if we resolved to a generic
1250 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1252 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1254 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1256 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1257 (FieldBase.Initializer): Initializer is now optional.
1258 (EventField.Define): Only event field can have initializer.
1260 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1262 * const.cs (Const): Reuse initializer.
1264 * cs-parser.jay: Updated after FieldBase changes.
1265 Added current_array_type to simplify array initializers.
1267 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1269 * expression.cs, iterators.cs: Updated.
1271 * namespace.cs (NamespaceEntry): Made UsingFound private.
1273 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1275 * parameterCollection.cs: Obsolete, removed.
1276 * parser.cs: Obsolete, removed.
1278 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1281 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1283 * enum.cs (Enum.Define): Set obsolete context here.
1285 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1288 - FindDocumentedMember() now expects 1) paramList as null
1289 when "we don't have to check the number of parameters" and
1290 2) Type.EmptyTypes when "there is no arguments".
1291 - Introduced FoundMember struct to hold the exact type which was
1292 used to find the documented member (the above change broke
1293 test-xml-044; it might be better just to use DeclaringType than
1294 what MS does, like this change does, but it depends on usage.)
1296 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1298 * doc.cs : documented member might be from DeclaringType for nested
1299 types. Fixed bug #76782.
1301 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1303 * anonymous.cs: Have the param code handle leaving copies on the
1304 stack etc. Allows anonymous params to take part in the assignment
1305 code (++, +=, etc). Fixes bug #76550
1307 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1308 it down to the anon code.
1310 * iterators.cs: Use dummy var here
1312 * codegen.cs: Handle new vars
1314 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1317 * class.cs (MethodData.Define): Set proper Obsolete context.
1319 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1321 (FieldExpr.DoResolve): Ditto.
1323 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1326 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1327 parent is not obsolete.
1329 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1331 * doc.cs : (FindDocumentedMember) find parameterless members first
1332 and get CS0419 in the early stage. Fixed first case of bug #76727.
1334 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1337 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1338 no error was reported.
1340 *expression.cs (Binary.DoResolve): left can be null.
1342 2005-12-06 Raja R Harinath <rharinath@novell.com>
1344 * class.cs (MethodCore.CheckGenericOverride): Delete unused
1345 abstract method and all overrides.
1346 * support.cs (ParameterData.GenericConstraints): Delete.
1347 (ReflectionParameters.type_params): Delete.
1348 (ReflectionParameters.ReflectionParameters): Make private.
1349 (ReflectionParameters.GetConstaints): New factory method.
1350 * generic.cs (TypeParameterDefineType): Use it.
1351 (TypeManager.GetTypeParameterConstraints): Likewise.
1353 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1356 * class.cs (MethodData.Emit): Parameters should be labeled first.
1358 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1361 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1363 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1365 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1367 * class.cs (MethodCore): Parameter clean up.
1368 (IMethodData): Added ParameterInfo.
1369 (MethodData): Parameter clean up.
1370 (Indexer.Define): Parameter clean up.
1382 * typemanager.cs: Parameter clean up.
1384 * delegate.cs (Define): Get rid of duplicated code.
1386 * expression.cs (ParameterReference): Removed useless parameters
1388 (Invocation): Ditto.
1390 * parameter.cs (ParamsParameter): New class, params specialization.
1391 (ArglistParameter): Attemp to separate arglist.
1392 (Parameter): Refactored to be reusable and faster.
1393 (Parameter.Modifier): Made understandable.
1394 (Parameters): Changed to be used as a class for `this' assembly
1395 parameters. Refactored to use new specialized classes.
1397 * support.cs (ParameterData): Added Types property.
1398 (InternalParameters): Deleted.
1400 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1402 * doc.cs : the previous patch does not actually fix the bug.
1403 PropertyInfo override check is now implemented and really fixed it.
1404 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1406 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1408 * doc.cs : apply "override filter" also to properties.
1411 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1413 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1414 no need to check overrides. For classes, omit those results from
1415 interfaces since they must exist in the class. Fixed bug #76726.
1417 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1419 * typemanager.cs : (GetFullNameSignature) differentiate indexers
1420 with different parameters. Fixed the second problem in #76685.
1422 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1424 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1425 get expected 'protected' access in CheckValidFamilyAccess()).
1428 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1430 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1431 Fixed bug #76705. CS1569 was incorrectly commented out.
1433 2005-11-23 Martin Baulig <martin@ximian.com>
1435 * generic.cs (Constraints.Define): Removed.
1436 (TypeParameter.DefineConstraints): Removed.
1437 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1438 on the GenericTypeParameterBuilder here.
1440 2005-11-23 Martin Baulig <martin@ximian.com>
1442 * typemanager.cs (TypeManager.GetProperty): Make this public.
1444 * generic.cs (Nullable.NullableInfo.ctor): Use
1445 TypeManager.GetProperty() rather than using reflection directly.
1447 2005-11-17 Martin Baulig <martin@ximian.com>
1449 * expression.cs (Indexers.GetIndexersForType): Added support for
1450 generic parameters; fixes #76587.
1452 2005-11-17 Martin Baulig <martin@ximian.com>
1455 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1456 inherit the scope from our parent. Fixes #76653.
1458 2005-11-15 Martin Baulig <martin@ximian.com>
1460 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1461 instead of `ScopeTypeBuilder' to refer to the "current" type.
1462 (AnonymousMethod.CreateScopeType): Correctly create the helper
1463 class if we're inside a generic type definition.
1465 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1467 * doc.cs : use Invocation.IsOverride() to do real override check.
1468 * expression.cs : made Invocation.IsOverride() internal.
1470 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1472 * doc.cs : use TypeManager.FindMembers() instead of (possible)
1473 TypeBuilder.FindMembers() and filter overriden base members out.
1476 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1478 * doc.cs : ref/out parameters are represented as '@' (instead of
1479 '&' in type FullName). Fixed bug #76630 (additionally crefs).
1481 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1483 * doc.cs : when there was no '.' in cref to methods in doc comment,
1484 then parameters were missing in the output. Fixed bug #76691.
1486 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1488 * driver.cs : don't output docs when there is an error.
1491 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1494 Now it should detect indexers. Fixed primary concern in bug #76685.
1495 Fixed CS0419 message to not show the identical member signature in
1498 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1500 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1501 instead of Type.FindMembers() since it does not handle events.
1504 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
1506 * codegen.cs: Fixed typo (speficied -> specified).
1508 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1511 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1513 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1515 * attribute.cs: Changed error message.
1517 * cs-tokenizer.cs: One more check.
1519 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1521 * statement.cs (Block.Resolve): Ignore empty statement.
1523 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1525 * report.cs: Made error/warning methods more strict to avoid
1528 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1529 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1530 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1531 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1533 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1535 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
1536 Use the more explicit AssemblyName.FullName instead of
1537 AssemblyName.Name to report errors.
1539 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1541 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1544 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1554 * report.cs: Fixed error reporting and typos.
1556 * generic.cs (TypeParameter.GetSignatureForError): New method.
1557 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1559 * typemanager.cs (GetFullName): Refactored.
1561 2005-11-08 Marek Safar <marek.safar@seznam.cz>
1563 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1564 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1566 * class.cs (TypeContainer.IsComImport): New property.
1567 (Constructor.Define): Create proper ctor for ComImport types.
1569 * expression.cs (New.CheckComImport): Fixed.
1571 2005-11-07 Miguel de Icaza <miguel@novell.com>
1573 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1574 that a parameter has been captured does not mean that we do not
1575 have to do the rest of the processing. This fixes the second part
1576 of #76592. If there was another anonymous method capturing
1577 values in the past, the Scope would never be set for the second
1578 method that captured the same parameter.
1580 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1581 properly manipulate the stack. Second part of fix for #76592.
1583 * expression.cs (New): Add support for invoking "new" on
1584 interfaces that have been flagged with the ComImport attribute and
1585 the CoClass. Fixes #76637
1587 * statement.cs (Try.DoEmit): When a variable is captured, do not
1588 try to emit the vi.LocalBuilder variable as it has been captured.
1589 Create a temporary variable and store the results on the
1590 FieldBuilder. Fixes #76642
1592 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1594 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1596 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1598 * expression.cs (Binary.DoResolve): Added && optimalization.
1600 * typemanager.cs (AddUserType): Removed useless argument.
1602 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1604 * statement.cs (Block.variables): Uses ListDictionary.
1606 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1609 * class.cs (PartialContainer.EmitType): Customized to emit
1610 security attributes.
1611 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1612 for partial classes.
1614 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1617 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1618 access has to be fixed.
1620 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1622 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1625 * ecore.cs (NullCast.Reduce): Implemented.
1627 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1630 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1632 (Foreach.Resolve): Catch null properly.
1634 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1636 * cs-tokenizer.cs: Warning text fix.
1638 * driver.cs: AllWarningNumbers exposed on public interface.
1640 * report.cs (): Reviewed warning numbers.
1641 (IsValidWarning): Use binary search.
1643 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1645 * driver.cs: Implemeted resource visibility.
1646 (Resources): New class for code sharing between /res: and
1649 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1651 decl.cs (CurrentTypeParameters): Fixed to be public.
1653 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1655 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1657 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1659 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1661 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
1663 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1665 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1667 Add friend assembly access support.
1668 * typemanager.cs: assembly_internals_vis_attrs
1669 cache for friend assembly access.
1670 (TypeManager.IsFriendAssembly): New method for
1671 checking friend assembly access.
1672 (TypeManager.Error_FriendAccessNameNotMatching): New
1674 (TypeManager.CompareKeyTokens): Likewise.
1675 (TypeManager.Filter): Handle friend accessible
1678 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1679 friend accessible types.
1681 * ecore.cs (Expression.IsAccessorAccessible): Handle
1682 friend accessible properties.
1684 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1687 2005-10-28 Marek Safar <marek.safar@seznam.cz>
1690 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1693 * convert (Convert.ImplicitReferenceConversion): NullCast holds
1696 * ecore.cs (NullCast): Child is contant only.
1698 * literal.cs (NullLiteral.Reduce): null can be converted to any
1701 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
1703 * driver.cs: Use Encoding.Default as default code page instead
1706 2005-10-27 Raja R Harinath <rharinath@novell.com>
1709 * expression.cs (Invocation.Error_InvalidArguments): Handle
1710 __arglist parameters.
1711 (Invocation.VerifyArgumentsCompat): Likewise.
1712 * support.cs (ReflectionParameters.GetSignatureForError): Print
1713 __arglist parameters.
1714 (InternalParamters.GetSignatureForError): Likewise.
1715 * parameter.cs (Parameters.GetSignatureForError): Likewise.
1717 2005-10-26 Marek Safar <marek.safar@seznam.cz>
1719 * attribute.cs (GetPropertyValue): Made public.
1721 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1723 Add new property WrapNonExceptionThrows to handle 2.0 assembly
1725 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1728 * driver.cs: Reflect method name change.
1730 * statement.cs (Try.Resolve): Warn when try has both general
1733 * typemanager.cs: runtime_compatibility_attr_type new predefined
1736 2005-10-26 Raja R Harinath <harinath@gmail.com>
1739 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1740 treat it as an empty parameter list.
1742 2005-10-26 Raja R Harinath <rharinath@novell.com>
1745 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
1746 ResolveAsTypeStep silent.
1747 * statement.cs (Block.AddConstant): Mark block as used.
1748 (Block.ResolveMeta): Avoid piling on error messages
1749 if a constant initializer resolution fails.
1751 2005-10-25 Raja R Harinath <rharinath@novell.com>
1753 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1755 (NamespaceEntry.VerifyAllUsing): New.
1756 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
1757 behaviour. Delegates actual resolution of alias to ...
1758 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
1759 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1761 * driver.cs (Driver.MainDriver): Update.
1763 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1764 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1766 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1768 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1769 RootNamespace.DefineNamespacesForAll.
1771 2005-10-24 Raja R Harinath <harinath@gmail.com>
1773 * typemanager.cs (assemblies, external_aliases, modules)
1774 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1775 (ComputeNamespaces, GetRootNamespace): Remove extra staging
1776 overhead. Move resposibility ...
1777 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
1778 * driver.cs, attribute.cs, codegen.cs: Update to changes.
1780 2005-10-23 Raja R Harinath <harinath@gmail.com>
1782 * namespace.cs (RootNamespace.all_namespaces): Renamed from
1783 cached_namespaces. Improve usage.
1784 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1785 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1786 Move from GlobalRootNamespace and simplify.
1787 (RootNamespace.Global): Make instance variable.
1788 (RootNamespace.RootNamespace): Add "alias name" parameter.
1789 (GlobalRootNamespace): Simplify drastically.
1790 (Namespace.Lookup): Don't use GetNamespace.
1791 * typemanager.cs (GetRootNamespace): Rename from
1792 ComputeNamespaceForAlias.
1793 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1795 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1797 * anonymous.cs (AnonymousContainer): Don't crash when container
1800 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1802 * expression.cs (Binary.DoResolve): Warn when comparing same
1805 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1808 * expression.cs (Binary.DoResolve): It looks like there are no
1809 convetsion rules in enum context.
1811 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1813 Add support for extern alias qualifiers.
1814 * typemanager.cs: Move some LookupTypeReflection code
1815 to namespace.cs, to have cleaner code. Added some methods
1816 to help us keep track of the extern aliased references.
1817 * driver.cs: Add suport for extern alias assemblies on command
1818 line and check for their warnings/errors. Also keep track of the
1819 extern aliased assemblies.
1820 * namespace.cs: Move the global functionality of Namespace
1821 to GlobalRootNamespace/RootNamespace. Now the global namespace
1822 is GlobalRootNamespace.Globa. Also the code moved from
1823 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
1824 Finally added LocalAliasEntry (AliasEntry before) and
1825 ExternAliasEntry, to handle alias statements.
1826 * cs-parser.jay: Add support in the grammar for extern alias
1828 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
1829 Update callings to Namespace (now in GlobalRootNamespace).
1831 2005-10-25 Martin Baulig <martin@ximian.com>
1833 * convert.cs (ImplicitTypeParameterConversion): Make base
1834 interfaces actually work; fixes #76557.
1836 2005-10-25 Martin Baulig <martin@ximian.com>
1839 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1840 all the type parameters; fixes #76551.
1842 2005-10-25 Martin Baulig <martin@ximian.com>
1847 (GenericMethod.ctor): Added `Expression return_type' and
1848 `Parameters parameters' arguments.
1849 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1850 parameter and return types to check their constraints if they're
1853 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1856 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1857 constraints of a generic type if `ec.ResolvingGenericMethod'.
1859 * class.cs (MethodCore.DoDefineParameters): Set
1860 `ec.ResolvingGenericMethod' if we're a generic method.
1861 (MemberBase.MemberType): Likewise.
1863 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1865 * typemanager.cs (TypeManager): Added
1866 TypeManager.internals_visible_attr_type to cache
1867 S.R.CompilerServices.InternalsVisibleToAttribute.
1869 * codegen.cs (AssemblyClass): Added checks for
1870 InternalsVisibleToAttribute in new method
1871 CheckInternalsVisibleAttribute () and also cache the
1872 AssemblyName in AssemblyClass.Name.
1874 2005-10-24 Martin Baulig <martin@ximian.com>
1877 (TypeManager.ExpandInterfaces): Added overloaded version which
1878 just takes a `Type[]' array.
1881 (Constraints.Resolve): Don't expand the interfaces here; ie. we
1882 just use the interfaces which were explicitly specified and not
1883 the interfaces they inherit. Fixes #76482.
1884 (TypeParameter.FindMembers): Expand the interfaces here.
1886 2005-10-21 Martin Baulig <martin@ximian.com>
1889 (Constraints.Resolve): Also resolve the actual types here.
1890 (Constraints.ResolveTypes): Just check the constraints here.
1891 Fixes #76363; see gtest-218.cs.
1893 2005-10-21 Martin Baulig <martin@ximian.com>
1896 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1897 instead of a `BoxedCast'; fixes gtest-217.cs.
1899 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
1901 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1902 1) "new()" is specified as generic parameter constraint and 2) the
1903 type is TypeBuilder and 3) the type is abstract even if it has a
1904 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1906 2005-10-20 Martin Baulig <martin@ximian.com>
1909 (GenericConstraints.TypeParameter): New public property.
1910 (TypeParameter.ctor): Also take a `DeclSpace' argument.
1911 (TypeParameter.DeclSpace): New public property.
1912 (TypeParameter.DefineType): Inflate the constraints if our
1913 `DeclSpace' is an `Iterator'.
1915 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
1917 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
1918 GenericMethod argument to compare methods' generic type arguments.
1921 2005-10-19 Martin Baulig <martin@ximian.com>
1923 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1924 not ResolveType() when resolving the base type, so we're not
1925 checking the constraints here.
1926 (TypeContainer.ResolveType): Call ResolveType() on our base_type
1929 2005-10-19 Martin Baulig <martin@ximian.com>
1931 * generic.cs (ConstructedType.CheckConstraints): Committing
1932 untested fix for #76441.
1934 2005-10-18 Raja R Harinath <rharinath@novell.com>
1937 * class.cs (TypeContainer.DefineType): Move updating of
1938 topological sort earlier in the code.
1939 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1941 2005-10-18 Marek Safar <marek.safar@seznam.cz>
1944 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1946 * constant.cs (Constant.TryReduce): Moved from Cast class.
1947 (Reduce): Made little bit more OO and fixed missing conversions.
1949 * ecore.cs (Reduce): Implemented.
1950 (Binary.EnumLiftUp): New method to upgrade values to enum values.
1952 * literal.cs (Reduce): Implemented.
1954 * class.cs: Reverted Miguel's wrong commit.
1956 2005-10-14 Miguel de Icaza <miguel@novell.com>
1958 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1960 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
1962 * cs-parser.jay, expression.cs : CS0214 was missing error location
1963 for constants. Fixed bug #76404.
1965 2005-10-10 Raja R Harinath <rharinath@novell.com>
1967 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1969 (PropertyExpr.EmitCall): Likewise.
1970 * expression.cs (Invocation.EmitArguments): Handle case where
1972 (Invocation.EmitCall): Avoid allocating temporary variable if
1973 there are no arguments.
1975 2005-10-11 Marek Safar <marek.safar@seznam.cz>
1978 * convert.cs (ExplicitConversionCore): Fixed object->enum
1981 2005-10-07 Raja R Harinath <rharinath@novell.com>
1984 * convert.cs (ImplicitConversionStandard): Move conversion of
1985 void* to arbitrary pointer types ...
1986 (ExplicitConversionStandard): .. here.
1987 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1988 error to always print typenames.
1990 2005-10-07 Raja R Harinath <rharinath@novell.com>
1992 * convert.cs (GetConversionOperator): Rename from
1993 GetConversionOperators. Move operator selection code from ...
1994 (UserDefinedConversion): ... here.
1996 2005-10-06 Marek Safar <marek.safar@seznam.cz>
1998 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2001 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2003 * assign.cs (Assign.DoResolve): Error method changed.
2005 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2007 * const.cs (ResolveValue): Reset in_transit immediately.
2009 * constant.cs: Error method changed.
2011 * convert.cs: Removed useless location parameter.
2012 (ExplicitNumericConversion): Don't do double enum check.
2013 (ExplicitConversionCore): Renamed from ExplicitConversion.
2014 (ExplicitUnsafe): Extracted from ExplicitConversion.
2015 (ExplicitConversion): Uses for error reporting.
2017 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2019 (ResolveBoolean): Uses common error method.
2020 (CastToDecimal): Get rid of ec.
2021 (CastFromDecimal): Optimized.
2022 (ConvCast): Get rid of ec.
2024 * enum.cs (ResolveValue): Reset in_transit immediately.
2025 (Emit): Return after first error.
2027 * expression.cs: Convert changes.
2029 * literal.cs: Error method changed.
2031 * statement.cs: Error method changed.
2033 2005-10-06 Raja R Harinath <rharinath@novell.com>
2035 Fix gtest-131.cs and gtest-211.cs.
2036 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2037 Only emit code for a label if it is used. Unreachable code can
2038 violate ECMA evaluation stack invariants.
2040 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2042 * anonymous.cs: Implemented ExprClassName.
2044 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2047 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2050 * class.cs (StaticClass.DefineContainerMembers): Report protected
2053 * codegen.cs: if(ed) PRODUCTION.
2055 * convert.cs (Error_CannotImplicitConversion): Better error
2058 * cs-parser.jay: More error checks.
2060 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2062 * driver.cs (CSCParseOption): Enabled wrong option check.
2064 * ecore.cs (Expression.ExprClassName): Turned to property.
2065 (MemberExpr.CheckIntermediateModification): For checking boxed
2066 value types modification.
2068 * statement.cs (Fixed.Resolve): Expression type must be
2069 convertible to fixed type.
2070 (CollectionForeach.GetEnumeratorFilter,TryType):
2071 Small refactoring for easier error checking.
2073 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2075 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2078 * class.cs (GeneratedBaseInitializer): New class for customization
2079 compiler generated initializers.
2080 (MemberBase.DoDefine): Check Obsolete attribute here.
2081 (FieldMember.DoDefine): Ditto.
2083 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2086 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2087 (MemberCore.GetObsoleteAttribute): Removed argument.
2088 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2089 (MemberCore.CheckObsoleteType): New helper.
2093 * statement.cs: Updates after MemberCore changes.
2095 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2096 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2098 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2099 obsolete attribute for compiler construct.
2100 (As.DoResolve): Cache result.
2102 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2104 2005-10-01 Miguel de Icaza <miguel@novell.com>
2106 * expression.cs (Probe): instead of having a "Type probe_type"
2107 keep the extra information as a TypeExpr probe_type_expr since the
2108 "As" operator needs to perform some type checks.
2110 * (As.DoResolve): If the type is a type parameter, ensure that it
2111 is constrained by a class.
2113 2005-09-22 Miguel de Icaza <miguel@novell.com>
2115 * statement.cs (Lock): Use the TemporaryVariable class instead of
2116 manually using local variables as those do not work when variables
2119 * ecore.cs: Moved the TemporaryVariable class from being a nested
2120 class inside Foreach to be a public class that can be employed in
2123 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2125 * cs-parser.jay: interface_accessors replaced by
2126 accessor_declarations.
2128 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2131 * statement.cs (GotoCase.Resolve): Convert null constant to
2133 (SwitchLabel.ResolveAndReduce): Ditto.
2134 (SwitchLabel.NullStringCase): Custom null stamp.
2135 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2137 typemanager.cs (CSharpSignature): Don't skip first argument
2140 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2142 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2143 expression.cs, iterators.cs, literal.cs: Store constants and
2146 * class.cs (MemberBase.ShortName): Pass location.
2148 * cs-parser.jay: Some location fixes.
2150 * ecore.cs (Expression.Location): Made virtual.
2152 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2155 * const.cs (Const.ResolveValue): Check for assigning non-null
2156 value to reference type.
2158 2005-09-26 Raja R Harinath <rharinath@novell.com>
2161 * expression.cs (This.VerifyFixed): In a value type T, the type of
2162 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2163 value type R, 'this' is treated as a value parameter.
2165 2005-09-05 Miguel de Icaza <miguel@novell.com>
2167 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2168 if the underlying types are the same, otherwise we need to produce
2169 code that will do the proper cast.
2171 This was exposed by Marek's constant rewrite which produced
2172 invalid code for the call site:
2175 void Method (X v) {}
2179 This fixes test-49.cs
2181 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2183 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2184 Type/Object should be allowed as well. Fixed bug #75968.
2186 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2188 * expression.cs : (Binary.DoResolve): when one is enum constant and
2189 another is constant 0, then return enum one *as enum type*.
2192 2005-10-04 Martin Baulig <martin@ximian.com>
2194 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2195 `SetMemberIsUsed()' work for generics, too.
2197 2005-10-04 Martin Baulig <martin@ximian.com>
2199 * expression.cs (DelegateInvocation.EmitStatement): Make this work
2200 for corlib. Fixes #75691.
2202 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2205 * driver.cs: Fix compilation files with full root path.
2207 2005-09-25 Miguel de Icaza <miguel@novell.com>
2209 * report.cs (SymbolRelatedToPreviousError): Format the output so
2210 it does not use an open parenthesis that is never closed.
2212 * driver.cs: Follow coding guidelines
2214 2005-09-18 Miguel de Icaza <miguel@novell.com>
2216 * driver.cs: Set InEmacs based on the environment variable EMACS.
2218 * location.cs (InEmacs): in this mode, do not report column
2219 location as it confuses Emacs.
2221 2005-10-03 Raja R Harinath <rharinath@novell.com>
2223 * support.cs (SeekableStreamReader.Position): Don't error out when
2224 the requested position is just beyond the end of the current
2227 2005-09-28 Raja R Harinath <rharinath@novell.com>
2229 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2230 try to keep in sync with the byte count of the underlying Stream.
2231 However, this limits us to a window size of 2048 characters: i.e.,
2232 the maximum lookahead of our lexer/parser can be 2048 characters.
2234 2005-09-22 Martin Baulig <martin@ximian.com>
2236 * driver.cs: Removed a debugging FIXME.
2238 2005-09-21 Raja R Harinath <rharinath@novell.com>
2240 * cs-parser.jay (type_arguments): Add CS1644 check.
2241 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2243 2005-09-15 Raja R Harinath <rharinath@novell.com>
2245 * Makefile (PROGRAM): Make profile specific.
2246 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2247 the current directory.
2250 * expression.cs (Invocation.EmitCall): Remove optimization on
2251 this_call since it doesn't handle 'this' being a value type.
2253 2005-09-05 Geoff Norton <gnorton@customerdna.com>
2255 * driver.cs: Ensure file handles are closed after parsing
2257 2005-09-05 Miguel de Icaza <miguel@novell.com>
2259 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2260 if the underlying types are the same, otherwise we need to produce
2261 code that will do the proper cast.
2263 This was exposed by Marek's constant rewrite which produced
2264 invalid code for the call site:
2267 void Method (X v) {}
2271 This fixes test-49.cs
2273 2005-09-05 Martin Baulig <martin@ximian.com>
2275 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2276 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2278 * cs-parser.jay (delegate_declaration): Small fix for #75852.
2280 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2282 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2283 to be a pointer type due to the spec 25.2, so check if declaring
2284 type is generic type definition. Fixed bug #75772.
2286 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2289 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2290 both types are not defined by methods.
2291 * expression.cs : (Invocation.IsApplicable): it should work when
2292 the argument type is equal to the parameter type, not only when
2293 ImplicitConversionExists() returns true.
2295 2005-09-02 Raja R Harinath <rharinath@novell.com>
2297 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2301 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2302 flow-branching for LocalVariableReferences in case we were invoked
2303 from a MemberAccess.
2304 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2306 (LocalVariableReference.DoResolveBase): ... this.
2307 (MemberAccess.Resolve): Do the check that was disabled during
2310 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2313 (PartialContainer.Create): check abstract/sealed/static strictly
2314 but abstract/sealed can exist only at one side. Fixed bug #75883.
2316 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2319 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2320 specified, don't default to UnmanagedType.I4.
2322 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2324 * expression.cs : conditional operator should check possibly
2325 incorrect assign expression. Fixed bug #75946.
2327 2005-08-30 Raja R Harinath <rharinath@novell.com>
2330 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2331 (ScopeInfo.EmitScopeType): Use it to construct field names from
2332 names of captured locals.
2335 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2336 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2337 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2338 (ExplicitConversion): Remove enum cases already handled by
2339 implicit conversion. Move implicit conversion check to the beginning.
2340 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2341 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2342 Don't treat System.Enum as a struct.
2344 2005-08-30 Jb Evain <jbevain@gmail.com>
2346 * attribute.cs: handles as expression in parameters.
2348 2005-08-30 Raja R Harinath <rharinath@novell.com>
2351 * class.cs (TypeContainer.VerifyClsName): Don't use a
2352 PartialContainer when verifying CLS compliance.
2353 (AbstractPropertyEventMethod): Set Parent here, ...
2354 (PropertyMethod): ... not here.
2356 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2358 * attribute.cs : escaped attribute name should not be allowed to be
2359 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2361 2005-08-29 Raja R Harinath <rharinath@novell.com>
2364 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2365 when converting a long constant to unsigned long.
2366 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2367 detect where IsApplicable and VerifyArgumentsCompat disagree.
2369 2005-08-29 Raja R Harinath <rharinath@novell.com>
2370 and Carlos Alberto Cortez <carlos@unixmexico.org>
2373 * class.cs (TypeContainer.CanElideInitializer): New helper.
2374 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2375 can safely emitting the initializer of a field.
2377 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2379 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2380 allowed inside a switch (without loop). Fixed bug #75433.
2382 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2384 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2385 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2387 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2389 * driver.cs : kinda reverting the default encoding changes (not exact
2390 revert since I noticed that "codepage:reset" might not work fine).
2392 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2394 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2395 Location. Now getter and setter store location correctly.
2396 (errors/cs0111-12.cs now reports the expected location.)
2398 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2400 * driver.cs : Use default encoding on the environment.
2401 Removed (now that) extra parameter for SeekableStreamReader.
2402 * support.cs : (SeekableStreamReader) third .ctor() argument for
2403 StreamReader is not required (always true). preamble size could
2404 be acquired in simpler and safe way.
2406 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2408 * cs-parser.jay: report CS0642 at warning level 3
2409 and report CS0642 for an if else statement also
2410 fixes bug #74745. Patch by John Luke (and a bit
2412 Removed extra CS0642 warning check for "while",
2414 * statement.cs: In Block.Resolve(), CS0642 check
2415 is reimplemented to check a sequence of an empty
2416 statement and a block.
2418 Both fix bug #66777.
2420 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2422 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2423 detection until I fix it.
2425 * cs-tokenizer.cs: Changed error message.
2427 * cs-parser.jay: Fixed 2 error locations.
2429 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2430 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2433 * enum.cs (GetSignatureForError): Fixed.
2435 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2439 * typemanager.cs (RegisterProperty): Removed.
2441 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2443 2005-08-24 Raja R Harinath <rharinath@novell.com>
2446 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2447 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2449 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2451 * expression.cs : tiny fix is required for not warning positive ulong.
2454 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2456 * expression.cs : add CS0652 check for constant and integral
2457 expression. Fixed bug #53974.
2459 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2461 * expression.cs : in DoNumericPromotions(), check if there is implicit
2462 conversion overload for string (to check CS0034). Fixed bug #52492.
2464 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2466 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2468 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2470 * ecore.cs : report location when it is *not* Null.
2472 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2478 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2479 correctly. Fixed bug #75721.
2481 2005-08-23 Raja R Harinath <rharinath@novell.com>
2483 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2484 loop that performs 'min (pos, char_count)'.
2487 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2488 converted value in Operator.OnesComplement.
2490 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2492 * anonymous.cs: If the anon method is pulled into a helper class,
2493 it needs to be `internal' not `private'. Fixes runtime behavior on
2496 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2499 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2502 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2504 The big constants rewrite
2505 Fix #75746, #75685 and more
2506 As a side effect saved 1MB for MWF ;-)
2508 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2509 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2510 enum based for corlib compilation.
2512 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2515 * class.cs (FixedField.Define): Use ResolveAsConstant.
2517 * const.cs (IConstant): Interface constants and enums.
2518 (Const.ResolveValue): New method for constant resolvning.
2519 (ExternalConstant): Constants from imported assemblies.
2521 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2522 conversion; like enums.
2523 (Constant.ToType): Converts this constant to different type.
2524 (Constant.Increment): Adds 1.
2526 * convert.cs (ImplicitConversionRequired): Simplified.
2528 * cs-parser.jay: Create EnumMember directly.
2530 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2532 * doc.cs (GenerateEnumDocComment): Removed.
2534 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2535 (ConvertIntLiteral): Removed.
2536 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2538 * enum.cs (EnumMember): Implement IConstant.
2539 (Enum.IsValidEnumConstant): Removed.
2540 (Enum.GetNextDefaultValue): Removed.
2541 (Enum.FindMembers): Updated.
2542 (Enum.GenerateDocComment): Iterate enum members.
2544 * expression.cs (Cast.TryReduce): Handle enums correctly.
2545 (New.Constantify): Made public.
2546 (MemberAccess.DoResolve): Removed contant specific if(s).
2548 * literal.cs (NullLiteral): Implement new abstract methods.
2550 * statement.cs (GotoCase.Resolve): Use new constant methods.
2551 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2553 * typemanager.cs (LookupEnum): Removed.
2554 (IsEnumType): Fixed to work with corlib.
2555 (RegisterConstant): Removed.
2556 (LookupConstant): Removed.
2557 (GetConstant): Changed to work with IConstant.
2559 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2561 * location.cs : Fixed overflown (>255) column number.
2563 2005-08-03 Raja R Harinath <rharinath@novell.com>
2565 First cut of the qualified-alias-member feature.
2566 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2568 * cs-parser.jay (DOUBLE_COLON): New token.
2569 (namespace_or_type_name): Add rule for recognizing
2570 qualified-alias-members.
2571 (primary_expression): Likewise.
2572 (element_access): Allow QualifiedAliasMember as a possible
2573 type-bearing expression.
2574 (local_variable_type, local_variable_pointer_type): Likewise.
2575 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2576 aliases in the current and enclosing namespace declarations.
2577 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2578 * decl.cs (MemberName.is_double_colon): New.
2579 (MemberName.MemberName): Add new constructor for alias-member.
2580 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2581 * expression.cs (QualifiedAliasMember): New expression type.
2583 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2585 * location.cs : it borked when no argument was specified.
2587 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2589 * location.cs : tiny ToString() format fix.
2591 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2593 * statement.cs : oops, it was missing.
2595 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2597 A set of fixes for precise line/column location.
2600 "token" field now holds a file/line "delta", a line number offset
2601 from the segment, and a column number. See also:
2602 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2603 December/009508.html
2604 Removed static IsNull. Use instance IsNull property instead.
2606 For some tokens it stores Location. For Identifier it stores
2607 LocatedToken which is a pair of string name and location.
2608 Column numbers are adjusted only at getChar().
2610 Use Location.ToString() for reporting (it now contains column).
2612 Largely modified to use LocatedToken instead of
2613 string (IDENTIFIER), and to acquire Location from some tokens.
2614 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2615 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2617 Now MemberName holds Location. DeclSpace.ctor() receives Location
2618 as a parameter. Removed extra parameters to all derived classes.
2619 Replaced Location.IsNull() with instance property.
2620 * assign.cs, expression.cs :
2621 Added .ctor() overload that omits Location.
2623 Added "nameEscaped" flag that indicates the identifier was escaped
2624 in the source file. This fixes bug #57047.
2626 2005-09-02 Martin Baulig <martin@ximian.com>
2628 * class.cs: Make CS3005 a warning, not an error.
2630 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2632 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2633 New method, looking for lo-case imported cls type.
2635 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2638 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2640 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2642 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2644 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2646 Optimized to save 3.5 MB for SWF compilation.
2648 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2650 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2651 (PartialContainer.Create): Moved logic AddToContainer.
2652 (PartialContainer.MarkForDuplicationCheck): Shares name.
2654 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2657 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2659 (Namespace.GetSignatureForError): New method.
2661 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2662 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2664 2005-08-01 Raja R Harinath <rharinath@novell.com>
2667 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2668 member lookup rather than qualifier_type, since qualifier_type can
2671 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2673 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2676 2005-07-31 Miguel de Icaza <miguel@novell.com>
2678 * statement.cs: Copy the local exception into the exception
2679 captured local. Fixes 75674
2681 2005-07-31 Raja R Harinath <harinath@gmail.com>
2684 * expression.cs (Invocation.OverloadResolve): Don't report error
2685 CS1501 if error CS1502 has been reported.
2686 (New.DoResolve): Delegate CS1501 reporting to
2687 Invocation.OverloadResolve.
2690 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2691 invariant-meaning-in-block property in an enclosing block if
2694 2005-07-29 Marek Safar <marek.safar@seznam.cz>
2696 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2697 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2698 (Switch.CheckSwitch): Just save 50kb for SWF.
2700 2005-07-27 Martin Baulig <martin@ximian.com>
2702 * anonymous.cs (CaptureContext.AddField): Added
2703 `AnonymousContainer am' argument; compute its toplevel scope if
2704 it's not already computed. Fixes #75649.
2706 2005-07-26 Raja R Harinath <rharinath@novell.com>
2709 * class.cs (Constructor.Emit): Reset block to null if the block
2712 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2714 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2716 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2718 * class.cs (MethodData.Define): Check whether accessor implementing
2719 interface is public.
2721 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2723 2005-07-22 Marek Safar <marek.safar@seznam.cz>
2726 * namespace.cs (LookupType): Moved same type check to...
2728 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2731 2005-07-21 Raja R Harinath <rharinath@novell.com>
2733 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2734 already found a typebuilder.
2735 * class.cs (MethodCore.IsDuplicateImplementation): Compare
2736 MemberNames, not strings.
2738 * const.cs (Error_ExpressionMustBeConst):
2739 Rename from Error_EpressionMustBeConst.
2740 * const.cs, class.cs, statement.cd: Update.
2742 2005-07-21 Marek Safar <marek.safar@seznam.cz>
2746 * const.cs (Const.LookupConstantValue): Report missing contant expression
2748 (Error_EpressionMustBeConstant): Only one error method.
2750 * class.cs, statement.c: Updated.
2752 2005-07-20 Raja R Harinath <rharinath@novell.com>
2754 * statement.cs (Block.Flags): Add back HasVarargs.
2755 (Block.flags): Make protected.
2756 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2758 * typemanager.cs (types, typecontainers, user_types): Remove.
2759 (UserTypes, TypeContainers): Likewise.
2760 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2761 (CleanUp, Reset): Update.
2762 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
2763 (GetNestedType): Use Type.GetNestedType.
2764 (CoreLookupType): Take two arguments, the namespace and the
2765 basename of the type. Update to use the Namespace.Lookup
2767 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2768 (RealMemberLookup): Use IsNestedChildOf instead of playing with
2769 string concatenation and substring matches.
2770 * class.cs, enum.cs, delegate.cs: Update to changes.
2772 2005-07-20 Marek Safar <marek.safar@seznam.cz>
2774 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2775 Expression and made virtual.
2777 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2778 (ImplicitStandardConversionExists): Fixed `byte' typo ?
2780 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2782 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2785 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2788 2005-07-18 Marek Safar <marek.safar@seznam.cz>
2791 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2792 AssemblyCultureAttribute is not used on executable.
2795 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2797 2005-07-16 Raja R Harinath <rharinath@novell.com>
2800 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2801 New. Reports CS0252/CS0253.
2802 Mostly taken from preliminary patch by Duncak Mak.
2803 (Binary.DoResolveOperator): Store results of operator lookup.
2804 Use them to detect if we need to warn about unintended reference
2807 2005-07-15 Raja R Harinath <rharinath@novell.com>
2810 * namespace.cs (Namespace.Lookup): Add back location parameter.
2811 (Namespace.LookupType): Add CS0436 report. Add location parameter.
2812 * delegate.cs, ecore.cs, expression.cs: Update to changes.
2814 * codegen.cs (EmitContext.DeclSpace): Make readonly.
2815 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2816 (Namespace.LookupType): ... this.
2817 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2819 * typemanager.cs (LookupTypeReflection): Remove buggy code that
2820 purported to handle pointers.
2821 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2824 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2826 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2829 2005-07-15 Raja R Harinath <rharinath@novell.com>
2831 * namespace.cs (Namespace.Lookup): Drop location parameter.
2832 (NamespaceEntry.LookupAlias): Remove. Merge into ...
2833 (NamespaceEntry.Lookup): ... this.
2834 (NamespaceEntry.Error_AmbiguousTypeReference):
2835 Move here from DeclSpace.
2836 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2838 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2839 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2840 Move to NamespaceEntry.
2841 * delegate.cs, expression.cs: Update to changes.
2843 2005-08-31 Martin Baulig <martin@ximian.com>
2845 Committing a patch from Atsushi Enomoto for #75850.
2847 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2848 Prefer a generic enumerator over a non-generic one.
2850 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2852 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2853 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2855 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2857 * driver.cs : reverting default encoding change as well as mcs.
2859 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2861 * driver.cs, support.cs : merged r48826.
2863 > could you integrate your mcs changes to gmcs otherwise
2864 > gmcs cannot compile some files.
2866 2005-08-20 Martin Baulig <martin@ximian.com>
2868 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2869 scope if we don't already have it.
2871 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2872 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2875 2005-07-31 Miguel de Icaza <miguel@novell.com>
2877 * statement.cs: Copy the local exception into the exception
2878 captured local. Fixes 75674
2880 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2882 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2885 2005-08-12 Martin Baulig <martin@ximian.com>
2887 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2888 for nested types here to avoid hitting the cache too early.
2890 2005-08-09 Miguel de Icaza <miguel@novell.com>
2892 * enum.cs: On the new compiler CLS error 3005 is now a warning not
2895 2005-08-03 Martin Baulig <martin@ximian.com>
2897 Make iterators in generic methods work; see gtest-191.cs.
2900 (Constraints.Resolve): Protect against being called twice.
2903 (TypeContainer.GetClassBases): Make this `protected virtual'.
2905 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2906 (Iterator.GetClassBases): Override this and compute the base
2908 (Iterator.DefineNestedTypes): If we're a generic method, all our
2909 method type parameters become class type parameters on the proxy
2913 (ToplevelBlock.Parameters): Make this a property, not a field.
2914 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2916 2005-08-03 Martin Baulig <martin@ximian.com>
2918 * typemanager.cs (TypeManager.IsSubclassOf): Use
2919 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2920 (TypeManager.GetFullName_recursed): Improved.
2922 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2925 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2926 Private accessor case, using TypeManager.IsPrivateAccessible instead of
2927 invocation_type == mi.DeclaringType, since the first one also checks
2928 other condition used by generic instances.
2930 2005-07-27 Martin Baulig <martin@ximian.com>
2932 * anonymous.cs (CaptureContext.AddField): Added
2933 `AnonymousContainer am' argument; compute its toplevel scope if
2934 it's not already computed. Fixes #75649.
2936 2005-07-14 Marek Safar <marek.safar@seznam.cz>
2938 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2939 CheckAttributeType and refactored.
2940 (Attribute.ResolvePossibleAttributeType): Changed to reuse
2941 ResolveAsTypeTerminal error handling.
2942 (ResolveAsTypeTerminal): Introduced because of global attributes extra
2944 (GetSignatureForError): Print errors in same way.
2947 * codegen.cs: Reflect attribute GetSignatureForError change.
2950 * expression.cs: Add silent parameter to ResolveAsTypeStep.
2952 * namespace.cs (UsingEntry): Refactored to make fields private.
2955 statement.cs: Error_UnexpectedKind has extra parameter.
2957 2005-07-14 Raja R Harinath <rharinath@novell.com>
2959 * ecore.cs (IAlias): Remove.
2960 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
2961 that implement the interface.
2962 * namespace.cs (Namespace): Likewise.
2963 (Namespace.declspaces): Renamed from 'defined_names'.
2964 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
2965 DeclSpace instead of an IAlias.
2966 * tree.cs (Tree.AddDecl): Update.
2968 2005-07-12 Raja R Harinath <rharinath@novell.com>
2970 * statement.cs (Block.Flags); Remove HasVarargs.
2971 (Block.HasVarargs): Move to ToplevelBlock.
2972 (Block.ThisVariable, Block.AddThisVariable): Likewise.
2973 (Block.Variables): Make protected. Initialize variable hashtable
2975 (Block.AddVariable): Update.
2976 (Block.Resolve): Update to changes.
2977 (ToplevelBlock.HasVarargs): New boolean.
2978 (ToplevelBlock.ThisVariable): Move here from Block.
2979 (ToplevelBlock.AddThisVariable): Likewise.
2980 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
2981 * expression.cs (This.ResolveBase): Update to changes.
2982 (ArglistAccess.DoResolve): Likewise.
2984 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2987 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2989 * class.cs (TypeContainer.VerifyMembers): Distinguish between
2990 not used and not used & assigned.
2991 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2993 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2996 * expression.cs (Is.DoResolve): null is never provided type.
2998 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3001 * cs-parser.jay: Less strict event error rule to catch more errors.
3003 2005-07-11 Martin Baulig <martin@ximian.com>
3005 * generic.cs (ConstructedType.CheckConstraints): Improve the check
3006 for the constructor constraint: we do not only have to check
3007 whether the class has a public constructor, but also ensure that
3008 it's parameterless. Fixes #75492.
3010 2005-07-11 Martin Baulig <martin@ximian.com>
3012 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3013 between type parameters if they either have the reference type
3014 constraint or the class constraint.
3016 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
3018 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3020 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3023 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3024 (ExtractSecurityPermissionSet): Cope with self referencing security
3025 attributes properly.
3027 * driver.cs (SetOutputFile): Made public property OutputFile.
3029 2005-07-07 Raja R Harinath <rharinath@novell.com>
3032 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3033 has_nonstatic_fields. Make into a FieldBase pointer.
3034 (TypeContainer.AddField): Add CS0282 check.
3035 (TypeContainer.EmitType): Update.
3037 2005-07-06 Miguel de Icaza <miguel@novell.com>
3039 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3040 compare if they start with __.
3042 2005-07-06 Raja R Harinath <rharinath@novell.com>
3044 * statement.cs (Switch.SwitchGoverningType): Only look at
3045 UserCasts that don't need implicit standard conversions to one of
3046 the allowed switch types (Fixes test-322.cs).
3047 (LocalInfo.Resolve): Re-enable sanity-test.
3049 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3051 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3053 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3055 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3057 2005-07-06 Raja R Harinath <rharinath@novell.com>
3060 * ecore.cs (SimpleName.GetSignatureForError): Add.
3061 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3062 (MemberAccess.GetSignatureForError): Add.
3064 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3066 The big error and warning messages review.
3096 * typemanager.cs: Updated.
3098 * class.cs: (MethodCore.SetYields): Moved here to share.
3099 (PropertyMethod.Define): Moved iterator setup here.
3101 * iterators.cs: Add orig_method to have full access to parent
3104 2005-07-05 Raja R Harinath <rharinath@novell.com>
3106 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3107 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3108 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3109 variable of struct type.
3110 * expression.cs (Unary.ResolveOperator): Update to change.
3111 (Indirection.VerifyFixed): Likewise.
3112 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3113 (ParameterReference.VerifyFixed): Value parameters are fixed.
3114 (This.VerifyFixed): Treat 'this' as a value parameter.
3115 * statement.cs (LocalInfo.IsFixed): Remove.
3117 2005-07-01 Martin Baulig <martin@ximian.com>
3119 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3120 `ec.EmitThis ()' to get the correct scope.
3122 2005-07-01 Martin Baulig <martin@ximian.com>
3124 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3125 instance is a ParameterReference; fixes #75299.
3127 2005-06-30 Raja R Harinath <rharinath@novell.com>
3130 * expression.cs (Indexers.map): Remove.
3131 (Indexers.Append): Filter out inaccessible setters and getters.
3132 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3135 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3137 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3138 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3139 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3140 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3142 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3145 * class.cs (FieldBase.GetInitializerExpression): One more field
3148 2005-06-28 Miguel de Icaza <miguel@novell.com>
3150 * pending.cs: Do not define a proxy if the base method is virtual,
3151 it will be picked up by the runtime (bug 75270).
3153 2005-07-08 Martin Baulig <martin@ximian.com>
3155 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3156 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3158 2005-07-07 Martin Baulig <martin@ximian.com>
3160 * generic.cs (ConstructedType.CheckConstraint): Use
3161 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3162 called recursively; fixes #75329.
3164 2005-07-06 Martin Baulig <martin@ximian.com>
3166 * generic.cs (TypeManager.InferTypeArguments): Added support for
3167 anonymous methods; fixes #75461.
3169 2005-07-01 Martin Baulig <martin@ximian.com>
3171 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3172 `ec.EmitThis ()' to get the correct scope.
3174 2005-07-01 Martin Baulig <martin@ximian.com>
3176 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3177 instance is `This'; fixes #75299.
3179 2005-06-30 Martin Baulig <martin@ximian.com>
3181 * class.cs (Indexer): Implement IIteratorContainer; added support
3182 for iterators in indexers.
3185 (EmitContext.CurrentIterator): Make this a property, not a field.
3187 * anonymous.cs (AnonymousContainer.Iterator): New public property.
3189 2005-06-28 Miguel de Icaza <miguel@novell.com>
3191 * pending.cs: Do not define a proxy if the base method is virtual,
3192 it will be picked up by the runtime (bug 75270).
3194 2005-06-28 Martin Baulig <martin@ximian.com>
3196 * cs-parser.jay (interface_method_declaration): Avoid a
3197 reduce/reduce conflict by moving some of the code into a separate
3198 `interface_method_declaration_body' rule; fixes #75368.
3200 2005-06-28 Martin Baulig <martin@ximian.com>
3202 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3203 array check after the check for TypeBuilder's.
3205 2005-06-21 Raja R Harinath <rharinath@novell.com>
3207 * convert.cs (FindMostEncompassedType): Add two trivial special
3208 cases (number_of_types == 0 || number_of_types == 1).
3209 (FindMostEncompasingType): Likewise.
3211 2005-06-17 Raja R Harinath <rharinath@novell.com>
3213 Some cleanups preparing for the fix of #75283.
3214 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3216 (EventExpr.InstanceResolve): Likewise.
3217 (EventExpr.DoResolve): Remove redundant checks.
3219 2005-06-08 Miguel de Icaza <miguel@novell.com>
3221 * class.cs: Small fix.
3223 2005-06-08 Raja R Harinath <rharinath@novell.com>
3226 * class.cs (GetPartialBases): Fix return value check of
3229 2005-06-07 Raja R Harinath <rharinath@novell.com>
3231 Ensure that partial classes are registered in their enclosing
3232 namespace. Initial part of fix of #75160.
3233 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3234 Register declspace with namespace here, not in
3235 DeclSpace.RecordDecl.
3236 * cs-parser.jay: Pass namespace to RecordDecl.
3237 * class.cs (PartialContainer.Create): Likewise.
3238 (ClassPart.DefineType): New sanity-check. Throws an exception if
3240 * decl.cs (Declspace.RecordDecl): Remove.
3241 * namespace.cs (NamespaceEntry.DefineName): Remove.
3243 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3245 * rootcontext.cs: Reset TargetExt as well.
3247 2005-06-03 Raja R Harinath <rharinath@novell.com>
3249 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3252 2005-06-02 Raja R Harinath <rharinath@novell.com>
3254 Fix #75080, cs0119.cs.
3255 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3257 (Expression.Resolve): ... this. Use it. Remove bogus code
3258 allowing ExprClass.Type and ExprClass.Namespace for
3259 ResolveFlags.VariableOrValue.
3260 (Expression.Resolve) [1-argument variant]: Change default resolve
3261 flags based on language version.
3262 (Expression.Error_UnexpectedKind): Use a simple string array
3263 rather than an ArrayList.
3264 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3266 (TypeOfVoid.DoResolve): Likewise.
3267 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3268 flags argument -- it always has the same value.
3270 2005-05-31 Raja R Harinath <rharinath@novell.com>
3273 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3274 Use it in the error message.
3275 * assign.cs, expression.cs, statement.cs: Update.
3277 2005-05-30 Raja R Harinath <rharinath@novell.com>
3280 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3281 the "almostMatchedMember" case too.
3282 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3283 that failed the accessibility checks to 'almost_match'.
3285 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3287 * attribute.cs: Use internal MethodBuilder methods to set
3288 ExactSpelling and SetLastError on PInvoke methods, instead
3289 of passing them via charset. Fixes #75060.
3291 2005-05-27 Raja R Harinath <rharinath@novell.com>
3293 * parameter.cs (Parameter): Remove TODO comment.
3294 (Parameter.DefineParameter): Remove Location parameter.
3295 (Parameters.LabelParameters): Likewise.
3296 * class.cs (Constructor.Emit): Update to change.
3297 (MethodData.Emit): Likewise.
3298 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3299 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3301 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3304 Removed Parameters.Location and added Parameter.Location instead.
3305 Removed Location parameter from Emit() and GetSignature().
3312 Modified all related calls.
3314 2005-06-21 Martin Baulig <martin@ximian.com>
3316 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3317 left-hand side is not a nullable type; fixes #75328.
3319 2005-06-21 Martin Baulig <martin@ximian.com>
3322 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3323 (TypeManager.GetFullNameSignature): Likewise.
3325 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3326 `source.FullName' and `target.FullName' to check whether there are
3327 two conflicting definitions.
3329 2005-06-21 Martin Baulig <martin@ximian.com>
3331 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3332 a BoxedCast - also for reference types - to be compatible with csc.
3334 2005-06-21 Martin Baulig <martin@ximian.com>
3336 * expression.cs (MemberAccess.DoResolve): Add support for nested
3337 types in a generic instance; fixes #75320.
3339 2005-06-20 Martin Baulig <martin@ximian.com>
3341 * generic.cs (TypeManager.InferType): Also walk the class
3342 hierarchy for generic instances; fixes #75261.
3344 2005-06-17 Martin Baulig <martin@ximian.com>
3346 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3347 to make things work for corlib.
3349 2005-06-15 Martin Baulig <martin@ximian.com>
3351 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3352 obsolete `SecurityAction' values.
3354 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3356 * rootcontext.cs: Reset TargetExt as well.
3358 2005-06-09 Martin Baulig <martin@ximian.com>
3360 * delegate.cs (Delegate.VerifyMethod): Added
3361 `MethodGroupExpr old_mg' argument; inherit its
3362 `HasTypeParameters'; fix #75085.
3364 2005-06-09 Martin Baulig <martin@ximian.com>
3366 * expression.cs (Invocation.OverloadResolve): Correctly handle
3367 generic methods for the SetMemberIsUsed(); fix #75064.
3369 2005-06-09 Martin Baulig <martin@ximian.com>
3371 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3374 2005-06-08 Martin Baulig <martin@ximian.com>
3376 * cs-parser.jay (nullable_type_or_conditional): If we put the
3377 nullable back and our `type' is a `ComposedCast', remove the
3378 nullable from it. Fixes #75156.
3380 * expression.cs (ComposedCast.RemoveNullable): New public method.
3382 2005-06-08 Martin Baulig <martin@ximian.com>
3384 The big Iterators rewrite :-)
3386 * iterators.cs: Rewrite this to use the anonymous methods framework.
3388 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3389 before the TypeContainers; see 2test-21.cs.
3392 (TypeContainer.DefineType): Don't create a new EmitContext if we
3393 already have one (this only happens if we're an Iterator).
3394 (TypeContainer.Define): Also call Define() on all our iterators.
3395 (Method.CreateEmitContext): Added support for iterators.
3398 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3399 (AnonymousContainer.CreateMethodHost): Moved here from
3400 AnonymousMethod and made abstract.
3401 (AnonymousContainer.CreateScopeType): New abstract method.
3402 (AnonymousContainer.IsIterator): New public property.
3403 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3404 get the ScopeTypeBuilder rather than manually defining it here.
3405 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3408 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3409 before RootContext.DefineTypes().
3411 * codegen.cs (EmitContext.RemapToProxy): Removed.
3412 (EmitContext.CurrentAnonymousMethod): Changed type from
3413 AnonymousMethod -> AnonymousContainer.
3414 (EmitContext.ResolveTopBlock): Protect from being called twice.
3415 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3416 (EmitContext.EmitThis): Removed the iterators hacks; use the
3417 anonymous methods framework for that.
3420 (ToplevelBlock.Container): Make this a property, not a field.
3421 (ToplevelBlock.ReParent): New public method; move the
3422 ToplevelBlock into a new container.
3423 (Foreach.TemporaryVariable): Simplify.
3425 2005-06-05 Martin Baulig <martin@ximian.com>
3427 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3428 (Block.AddTemporaryVariable): New public method; creates a new
3429 `LocalInfo' for a temporary variable.
3430 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3432 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3433 non-iterator variables.
3435 2005-06-05 Martin Baulig <martin@ximian.com>
3437 * statement.cs (Foreach.TemporaryVariable): Create the
3438 LocalBuilder in the Emit phase and not in Resolve since in some
3439 situations, we don't have an ILGenerator during Resolve; see
3440 2test-19.cs for an example.
3442 2005-06-04 Martin Baulig <martin@ximian.com>
3444 The big Foreach rewrite - Part II.
3446 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3447 with `PropertyInfo ienumerator_getcurrent'.
3449 * codegen.cs (VariableStorage): Removed.
3452 (Foreach): Derive from Statement, not ExceptionStatement.
3453 (Foreach.CollectionForeach): New nested class. Moved all the code
3454 dealing with collection foreach here.
3455 (Foreach.ForeachHelperMethods): Removed.
3456 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3458 2005-05-23 Martin Baulig <martin@ximian.com>
3460 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3461 don't need to. Fix #75014.
3463 2005-05-26 Raja R Harinath <rharinath@novell.com>
3465 Improve user-defined conversion handling.
3466 * convert.cs (GetConversionOperators): Rewrite. Return only the
3467 applicable operators.
3468 (AddConversionOperators): New. Helper for GetConversionOperators.
3469 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3470 there is only one most encompassed/encompassing type.
3471 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3472 "applicable operator" handling.
3473 (UserConversion): Move cache here from GetConversionOperators.
3474 Directly cache the chosen operator, rather than the whole
3476 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3477 case. Allow conversion of decimal to sbyte and byte too.
3478 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3479 New static methods. Used to avoid allocating EmptyExpressions in
3482 2005-05-24 Duncan Mak <duncan@novell.com>
3484 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3485 another class, used in Convert.ExplicitNumericConversion.
3486 (CastToDecimal): New class, similar to above, but casts to
3487 System.Decimal, used in Convert.ImplicitNumericConversion and also
3488 in explicit convesion from double/float to decimal.
3490 * convert.cs (ImplicitNumericConversion): Handle implicit
3491 conversions to System.Decimal.
3492 (ExplicitNumericConversion): handle explicit conversions to
3497 2005-05-20 Miguel de Icaza <miguel@novell.com>
3499 * typemanager.cs: Do not throw an exception in the TypeBuilder
3500 case, we take care of it on the TypeCode.
3502 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3504 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3507 * cs-parser.jay: Catch more lexical errors.
3509 * report.cs: Add one more Error method.
3512 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3514 2005-05-20 Martin Baulig <martin@ximian.com>
3516 * class.cs (TypeContainer.CircularDepException): Removed.
3517 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3518 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3519 (CS0146) and interface (CS0529) dependencies here.
3521 2005-05-20 Martin Baulig <martin@ximian.com>
3523 * expression.cs (New.DoResolve): Move the CS0712 check above the
3524 CS0144 check; otherwise it can never be reached.
3526 2005-05-20 Martin Baulig <martin@ximian.com>
3528 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3530 2005-05-20 Martin Baulig <martin@ximian.com>
3532 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3534 * typemanager.cs (TypeManager.IsAttributeType): New public method.
3536 2005-05-19 Martin Baulig <martin@ximian.com>
3539 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3540 to disable error reporting.
3542 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3543 here since we don't want to report an error; see the new test-336.cs.
3545 2005-05-19 Raja R Harinath <rharinath@novell.com>
3547 * statement.cs (ToplevelBlock.GetParameterReference)
3548 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3549 Move here from class Block.
3550 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3551 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3553 2005-05-18 Martin Baulig <martin@ximian.com>
3558 (FlowBranching.Reachability): Add non-static public And() and Or()
3560 (FlowBranchingSwitch): New class; do the `break_origins' thing
3561 like in FlowBranchingLoop.
3562 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3563 reachability, not just locals and parameters.
3564 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3565 switch; MergeBreakOrigins() now takes care of that.
3567 2005-05-18 Martin Baulig <martin@ximian.com>
3569 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3570 a loop and may leave it, reset the barrier; fixes #74974.
3572 2005-05-16 Raja R Harinath <rharinath@novell.com>
3574 Fix test-382.cs. Emit values of decimal constants.
3575 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3577 (TypeContainer.AddField): ... this.
3578 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3579 with initializers to include 'Const's.
3580 (ClassPart.RegisterFieldForInitialization): Forward to
3582 * const.cs (Const.Const): Pass initializer to base class.
3583 (Const.Define): In case of decimal constants, register them for
3584 initialization in a static constructor.
3586 2005-05-14 Martin Baulig <martin@ximian.com>
3588 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3589 do not call ResolveUnreachable() on unreachable statements in
3590 here, see the comment in the source code.
3592 2005-05-13 Raja R Harinath <rharinath@novell.com>
3595 * expression.cs (BinaryResolveOperator): If one of the operands of
3596 an equality comparison is 'null' and the other is a pointer type,
3597 convert the null to a NullPointer.
3598 * convert.cs (ImplicitReferenceConversion): If the expression is a
3599 NullLiteral and the target type is a pointer type, return a
3600 NullPointer instead.
3601 (ImplicitConversionStandard): Likewise.
3603 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3605 * cs-parser.jay: Set readonly context based on special constructs.
3607 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3608 readonly variable error handling.
3610 * rootcontext.cs (EmitCode): Don't verify members when error
3613 * statement.cs (LocalInfo): Add reaodnly context information.
3614 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3616 2005-05-17 Martin Baulig <martin@ximian.com>
3618 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3621 2005-05-13 Martin Baulig <martin@ximian.com>
3623 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3624 handle unreachable blocks.
3626 2005-05-13 Martin Baulig <martin@ximian.com>
3629 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3630 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3633 2005-05-13 Martin Baulig <martin@ximian.com>
3635 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3636 instance variable, not a local. Fix #74873.
3637 (Block.ResolveUnreachable): Set it to true here.
3639 2005-05-12 Martin Baulig <martin@ximian.com>
3641 * cs-parser.jay (property_declaration): Pass the `current_class',
3642 not the `current_container' to Property's .ctor. Fixes #74912.
3644 2005-05-11 Martin Baulig <martin@ximian.com>
3646 * typemanager.cs (Closure): Copy this from MCS and merge all the
3647 GMCS-specific changes into it.
3649 2005-05-12 Raja R Harinath <harinath@gmail.com>
3652 * typemanager.cs (unmanaged_enclosing_types): New.
3653 (IsUnmanagedType): Avoid infloops by using
3654 'unmanaged_enclosing_types' to talk with recursive invocations.
3656 2005-05-11 Duncan Mak <duncan@novell.com>
3658 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3659 continuing to process for 'arg'.
3660 (handle_preprocessing_directive): Check the argument of the #endif
3661 directive and report error CS1025 if there are any trailing
3664 According to the C# spec, having even whitespace after the #endif
3665 directive is illegal; however, because we call arg.TrimEnd ()
3666 beforehand, we have the same behavior as csc, allowing whitespace
3667 after the directive.
3671 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3675 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3676 (Constructor.GetObsoleteAttribute): Implemented correctly.
3678 2005-05-10 Martin Baulig <martin@ximian.com>
3680 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3681 resolve the type; fixes #74864.
3682 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3683 in DoResolve(); fixes #74862.
3685 2005-05-10 Martin Baulig <martin@ximian.com>
3687 * support.cs (ReflectionParameters.ParameterModifier): Use
3688 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3689 and `ParameterAttributes.In'. Fixes #74884.
3691 2005-05-10 Martin Baulig <martin@ximian.com>
3693 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3694 the cache if we're just looking for `MemberTypes.NestedType' in a
3697 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3698 constraints if we're still resolving the type tree.
3699 (Expression.MemberLookup): If we're resolving the type tree, only
3700 look for `MemberTypes.NestedType' since we're only interested in
3703 * class.cs (TypeContainer.DefineType): Don't resolve the type
3704 parameters here; do this later in ResolveType() after the type
3705 tree has been resolved.
3706 (TypeContainer.ResolveType): New public method; this is called
3707 after the type tree is resolved and before the types are being
3708 populated. We resolve the generic constraints here.
3709 (TypeContainer.DoDefineMember): Check the constraints on our base
3710 class and interfaces.
3712 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3713 set the `ResolvingTypeTree' flag on the EmitContext.
3715 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3717 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3719 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3721 * expression.cs (Argument.GetParameterModifier): Turned to property.
3722 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3724 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3727 2005-05-09 Raja R Harinath <rharinath@novell.com>
3730 * decl.cs (MemberCache.AddMethods): Register override methods,
3731 rather than non-override methods.
3732 * typemanager.cs (RegisterOverride): New.
3733 (IsOverride): Update.
3735 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3737 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3739 2005-05-06 Martin Baulig <martin@ximian.com>
3742 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3743 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3745 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3749 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3750 recursive declaration.
3752 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3754 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3756 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3758 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3760 2005-05-05 Raja R Harinath <rharinath@novell.com>
3763 * decl.cs (DeclSpace.FamilyAccessible):
3764 Use TypeManager.IsNestedFamilyAccessible.
3766 Fix reopened #64812.
3767 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3770 2005-05-04 Raja R Harinath <rharinath@novell.com>
3771 Abin Thomas <projectmonokochi@rediffmail.com>
3772 Anoob V E <projectmonokochi@rediffmail.com>
3773 Harilal P R <projectmonokochi@rediffmail.com>
3776 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3777 allow access to all static members.
3779 2005-05-04 Martin Baulig <martin@ximian.com>
3781 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3783 2005-05-04 Martin Baulig <martin@ximian.com>
3787 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3788 section at the end; make things work if `default' is not the last
3791 2005-05-04 Martin Baulig <martin@ximian.com>
3795 * statement.cs (Switch): Replaced the `got_default' field with a
3796 `default_section' one.
3797 (Switch.CheckSwitch): Set `default_section' here.
3798 (Switch.Resolve): If we're a constant switch and the constant is
3799 not found, use the default section.
3801 2005-05-03 Martin Baulig <martin@ximian.com>
3803 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3805 * statement.cs (Foreach.ArrayForeach): New nested class.
3806 (Foreach.TemporaryVariable): New nested class.
3807 (Foreach.EmitArrayForeach): Removed; this is now in the new
3810 2005-05-03 Raja R Harinath <rharinath@novell.com>
3812 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3814 (VerifyPendingMethods): Revert change below.
3816 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3817 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3818 that used to trigger warning -28. Remove warning -28.
3819 * expression.cs (Invocation.OverloadResolve): Use
3820 TypeManager.IsOverride to distinguish override methods.
3823 * pending.cs (VerifyPendingMethods): If a base type implements the
3824 requested interface, don't bother checking individual methods of
3825 the base type. As a side-effect, this prevents the creation of
3826 unnecessary proxies.
3828 2005-05-02 Martin Baulig <martin@ximian.com>
3832 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3833 Also `And' the locals if the old vector is null.
3834 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3835 null; in this case we basically reset all the variables.
3837 2005-05-02 Martin Baulig <martin@ximian.com>
3841 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3842 Added `FlowBranching branching' argument; always `and' the
3843 variables instead of `or'ing them unless we're an infinite loop.
3845 * statement.cs (While.Resolve): Create a new sibling unless we're
3848 2005-05-02 Martin Baulig <martin@ximian.com>
3852 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3853 arguments; use it instead of creating a new TopLevelBlock.
3854 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3855 our ConstructorInitializer.
3858 (TopLevelBlock.TopLevelBranching): New public property.
3859 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3860 and create our `TopLevelBranching'.
3862 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3863 anonymous method host, use `block.TopLevelBranching' rather than
3864 creating a new branching.
3866 2005-04-20 Miguel de Icaza <miguel@novell.com>
3868 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3869 a ScopeInfo, if any of the current children is a child of the new
3870 entry, move those children there.
3872 2005-04-30 Martin Baulig <martin@ximian.com>
3874 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3875 at the beginning of a SwitchSection. Fix #73335.
3877 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3880 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3882 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3883 (FieldExpr.DoResolve): Obsolete members are ignored for field
3886 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3888 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3889 of arrays detection.
3891 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3893 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3895 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3898 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3900 * cs-parser.jay: Use the prefered version of -unsafe in error
3903 2005-04-22 Marek Safar <marek.safar@seznam.cz>
3905 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3908 2005-04-20 John Luke <john.luke@gmail.com>
3910 * driver.cs: fix typo in error message, --outout to --output
3912 2005-04-30 Martin Baulig <martin@ximian.com>
3914 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3915 handle the .NET 2.x security attributes.
3917 2005-04-30 Martin Baulig <martin@ximian.com>
3920 (TypeManager.ExpandInterfaces): Don't add things twice.
3923 (TypeContainer.VerifyClsCompliance): Allow generic instances.
3925 2005-04-29 Martin Baulig <martin@ximian.com>
3927 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3929 * anonymous.cs: Added support for anonymous generic methods.
3931 2005-04-29 Martin Baulig <martin@ximian.com>
3933 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3936 2005-04-29 Martin Baulig <martin@ximian.com>
3938 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3940 * expression.cs (New.DoResolve): Fix the CS0304 check.
3942 2005-04-29 Martin Baulig <martin@ximian.com>
3944 * typemanager.cs (TypeManager.GetFullName): Updated to the new
3947 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3948 explicit interface implementation, compare the interface types.
3949 (MethodData.Define): Use the new naming scheme from the latest
3951 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3953 * decl.cs (MemberName.GetMemberName): Removed.
3954 (MemberName.MethodName, FullName): New properties.
3956 2005-04-25 Raja R Harinath <rharinath@novell.com>
3958 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3960 2005-04-22 Martin Baulig <martin@ximian.com>
3962 * generic.cs (GenericMethod): Create the EmitContext in the
3963 `Define()'; in `Define(MethodBuilder)', create the type parameters
3964 before calling `Define()'. Fixes #73933.
3966 2005-04-22 Martin Baulig <martin@ximian.com>
3969 (Constraints.Resolve): Make things work wrt. the new type lookup system.
3970 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3972 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3973 ConstructedType, check its constraints.
3975 2005-04-20 Marek Safar <marek.safar@seznam.cz>
3977 * codegen.cs (InRefOutArgumentResolving): New field.
3979 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3980 fields outside contructor.
3982 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3984 2005-04-19 Miguel de Icaza <miguel@novell.com>
3986 * anonymous.cs (CaptureContext.EmitParameterInstance): The
3987 parameter code was not completed ever, so it was not as up-to-date
3988 as local variables. Must finish it.
3990 The bug fix was to compare the Toplevel of the block, not the
3991 current block. Thanks for Ben for pointing this out.
3993 2005-04-19 Raja R Harinath <rharinath@novell.com>
3995 * decl.cs (AddMethods): Use the declaring type of the problem
3996 method to determine if we want to squash a warning.
3998 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4000 * attribute.cs: Removed debug output.
4002 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4004 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4007 2005-04-18 Raja R Harinath <rharinath@novell.com>
4010 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4011 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4012 all null comparisons against reference types.
4014 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4017 * class.cs (TypeContainer.CircularDepException) New nested
4019 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4020 (TypeContainer.DefineType): Removed error, reset InTransit before
4022 (Class.DefineType): Throw exception when is in Transit.
4023 Catch exception and report error.
4024 (Struct.DefineType): Throw exception when is in Transit.
4025 Catch exception and report error.
4026 (Interface.DefineType): Throw exception when is in Transit.
4027 Catch exception and report error.
4029 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4030 handle nested exception handlers.
4032 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4035 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4036 InFinally and InCatch storage.
4038 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4039 (Catch.Resolve): Set and Restore ec.InCatch.
4040 (Try.Resolve): Set and Restore ec.InFinally.
4041 (Try.HasCatch): True when try has catch.
4043 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4045 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4046 for the same event member, so exclude such cases from warning 419.
4049 2005-04-16 Miguel de Icaza <miguel@novell.com>
4051 * expression.cs (Binary.ResolveOperator): Apply patch from John
4052 Luke to fix bug 59864: operators &, | and ^ on enumerations
4053 require that the same enum type on both sides.
4055 * driver.cs: Add warnings to old flag usage, this is to assist
4056 people who produce Makefiles and hope that the Makefiles will be
4059 * class.cs (TypeContainer.EmitType): Moved the definition of the
4060 special $PRIVATE$ field from the resolve phase to the Emit phase.
4061 During resolve we do not know if we are a struct with
4062 HasExplicitLayout, we know this only after the attributes for the
4065 Set the FieldOffset to zero on the dummy field that we create for
4066 the class. Fixes 74590.
4068 2005-04-16 Raja R Harinath <rharinath@novell.com>
4071 * ecore.cs (PropertyExpr.resolved): New.
4072 (DoResolve): Use it to handle a case of double resolution here.
4073 Handle a case of identical-name-and-type-name.
4074 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4075 resolution by storing the results of expression resolution back
4076 into the "probes" array.
4078 2005-04-15 Raja R Harinath <rharinath@novell.com>
4080 Fix cs0208-7.cs and cs0208-8.cs.
4081 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4082 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4083 error reporting to point out the reason a struct is not unmanaged.
4085 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4087 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4088 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4090 2005-04-13 Raja R Harinath <rharinath@novell.com>
4093 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4094 IdenticalNameAndTypeName here.
4095 (EventExpr.InstanceResolve): Likewise.
4097 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4099 C# 2.0 DefaultCharSetAttribute implementation
4101 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4102 which allows us to set GlobalNamespace for every resolve.
4103 (Attribute.ResolveArguments): Cut from Resolve.
4104 (Attribute.GetCharSetValue): Returns CharSet named argument.
4105 (Attribute.DefinePInvokeMethod): Gets default charset from
4107 (GlobalAttribute.ResolveAsTypeStep): Override.
4108 (GlobalAttribute.ResolveArguments): Override.
4110 * class.cs (TypeAttr): Is protected.
4112 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4113 (ModuleClass.DefaultCharSetType): New memeber.
4114 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4116 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4117 charset from module.
4119 * delegate.cs (TypeAttr): Override.
4120 (Delegate.DefineType): Use this TypeAttr.
4122 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4123 at very early stage (before types are defined) to resolve model
4124 module attributes. It will probably not work with corlib but it
4127 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4128 charset from module.
4130 * typemanager.cs (default_charset_type): New type.
4132 2005-04-13 Raja R Harinath <rharinath@novell.com>
4134 * decl.cs (MemberCache.AddMethods): Don't warn if
4135 System.Object.Finalize has buggy MethodAttributes.
4137 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4140 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4142 * doc.cs : detect ambiguous reference to overloaded members.
4143 Fixed bug #71603. MS 1.1 csc does not detect it.
4145 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4147 * doc.cs : delegates must not be referenced with parameters.
4150 2005-04-12 Miguel de Icaza <miguel@novell.com>
4152 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4154 2005-04-10 Miguel de Icaza <miguel@novell.com>
4156 * driver.cs (MainDriver): Stop processing if the CLS stage found
4159 (CompilerCallableEntryPoint.InvokeCompiler): Always
4160 reset after execution; Take a TextWriter argument for the
4163 * report.cs: Use the error stream instead of hardcoding stderr.
4165 2005-04-09 Miguel de Icaza <miguel@novell.com>
4167 * class.cs: Reduce code paths to test, too small of an
4168 optimization to make it worth the extra testing. Always perform
4171 2005-04-08 Raja R Harinath <rharinath@novell.com>
4174 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4175 operators that had errors reported on them.
4177 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4179 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4181 (Attribute.Resolve): Add named argument type checking.
4183 * class.cs (FixedField.Define): Use IsPrimitiveType
4185 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4187 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4188 unsafe parameter types.
4190 * statement.cs (Using.ResolveExpression): Add better error description.
4192 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4194 2005-04-08 Raja R Harinath <rharinath@novell.com>
4197 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4198 AttributeUsageAttribute in the emitcontext of the attribute class,
4199 not in the emitcontext of the attributable entity it was attached to.
4200 * cs-parser.jay: Use 'current_class', not 'current_container',
4201 when creating a GlobalAttribute.
4203 2005-04-08 Alp Toker <alp@atoker.com>
4205 * pending.cs: The fix to #58413 failed to compile methods implementing
4206 interfaces with/without params modifiers and vice versa, even though
4207 params modifiers aren't part of the signature. Make the modifier check
4208 less strict as in csc.
4210 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4211 Anoob V E <projectmonokochi@rediffmail.com>
4212 Harilal P R <projectmonokochi@rediffmail.com>
4215 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4216 modifiers of pending methods.
4217 (PendingImplementation.PendingImplementation): Initialize it.
4218 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4219 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4220 with ParameterData. Add check for modifiers.
4221 * class.cs (MethodData.Define): Update to changes.
4223 2005-04-07 Raja R Harinath <rharinath@novell.com>
4225 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4227 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4229 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4232 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4235 * typemanager.cs: Registered RequiredAttributeAttribute.
4237 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4239 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4240 Warning CS0169 is back at level 3.
4241 (IMethodData.SetMemberIsUsed): New method.
4243 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4244 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4246 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4248 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4250 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4253 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4256 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4257 to avoid the problems with nested types.
4259 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4260 Anoob V.E <projectmonokochi@rediffmail.com>
4261 Harilal P.R <projectmonokochi@rediffmail.com>
4262 Raja R Harinath <rharinath@novell.com>
4265 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4267 * typemanager (GetConstructor): Make public.
4269 2005-04-05 John Luke <john.luke@gmail.com>
4270 Raja R Harinath <rharinath@novell.com>
4273 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4274 struct too. Return false quicker in a few cases.
4275 (VerifyUnManaged): Use it.
4277 2005-04-05 Raja R Harinath <rharinath@novell.com>
4280 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4281 not 'unreachable_seen'.
4283 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4285 * attribute.cs (Attribute.GetValue): Removed unused.
4287 * codegen.cs (CodeGen.TrimExt): Removed unused.
4289 * cs-parser.jay (output): Removed unused.
4291 * cs-tokenizer.cs (hex_digits): Removed unused.
4293 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4295 * expression.cs (Indirection.LoadExprValue): Removed unused.
4296 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4298 * iterators.cs (Iterator.param_types): Removed unused.
4300 * statement.cs (Goto.block): Removed unused.
4301 (ToplevelBlock.did): Removed unused.
4302 (Switch.ResolveConstantSwitch): Removed unused.
4304 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4306 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4309 2005-04-19 Martin Baulig <martin@ximian.com>
4311 Merged r42462 from MCS and made it work for GMCS.
4313 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4315 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4317 2005-04-01 Raja R Harinath <rharinath@novell.com>
4319 Fix #74232 and cs0208-3.cs.
4320 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4321 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4322 unmanaged type. Don't use FieldBuilders when 't' is a
4323 TypeBuilder. Use ModFlags and MemberType fields.
4324 * class.cs (MemberBase.member_type): Rename from MemberType.
4325 (MemberBase.MemberType): New property. Determines member_type on
4327 (MemberBase.DoDefine): Don't initialize MemberType here.
4328 (FieldMember.Define): Likewise.
4330 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4333 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4334 Attributes are emitted there.
4336 2005-04-01 Raja R Harinath <rharinath@novell.com>
4338 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4339 keyword in 'partial enum' too.
4340 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4342 Report from Kamil Skalski <nazgul@omega.pl>.
4345 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4346 have partial containers too.
4348 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4349 in block' checks to Block.CheckInvariantMeaningInBlock.
4350 * statement.cs (Block.GetKnownVariableInfo): Make private.
4351 (Block.IsVariableUsedInChildBlock): Remove.
4352 (Block.IsVariableUsedInBlock): Likewise.
4353 (Block.CheckInvariantMeaningInBlock): New. Show location of
4354 conflicting declaration.
4355 (Block.AddVariable): Make error messages less long-winded and more
4356 specific. Show location of conflicting declaration.
4357 * parameter.cs (Parameters.Location): New readonly property.
4359 2005-03-31 Raja R Harinath <rharinath@novell.com>
4361 Clean up semantics of invoking ResolveMemberAccess.
4362 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4363 can have an instance, ensure that we pass in a non-TypeExpression
4364 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4365 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4366 argument. Update to changes and simplify.
4367 (FieldExpr.Emitinstance): Remove CS0120 check.
4368 (PropertyExpr.EmitInstance): Likewise.
4369 * expression.cs (Argument.Resolve): Likewise.
4370 (Invocation.DoResolve): Update to changes in semantics of
4373 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4376 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4379 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4381 2005-03-31 Raja R Harinath <rharinath@novell.com>
4383 Fix difference in behaviour with commandline invocation.
4384 * driver.cs (Driver.Reset): New.
4385 (CompilerCallableEntryPoint): Call it.
4387 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4388 variable" warnings if the boolean expression failed to resolve.
4390 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4392 * attribute.cs: Fix the union of several permissions when some of them
4393 are unrestricted (so the result isn't an unrestricted permission set).
4396 2005-03-30 Raja R Harinath <rharinath@novell.com>
4398 * ecore.cs (MemberExpr): New class. Convert from interface
4400 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4401 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4403 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4404 (MethodGroupExpr.IsExplicitImpl): Remove.
4405 (Expression.GetFieldFromEvent): Remove.
4406 (SimpleName.MemberStaticCheck): Remove.
4407 (SimpleName.DoSimpleNameResolve): Update to changes.
4408 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4409 (MemberAccess.IdenticalNameAndTypeName): Remove.
4410 (MemberAccess.error176): Move to MemberExpr.
4411 (MemberAccess.DoResolve): Update to changes.
4412 (BaseAccess.DoResolve): Likewise.
4414 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4416 C# 2.0 Conditional attribute class implementation
4418 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4419 Analyzes class whether it has attribute which has ConditionalAttribute
4420 and its condition is not defined.
4422 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4423 (Class.IsExcluded): New method. Search for at least one defined
4424 condition in ConditionalAttribute of attribute class.
4426 2005-03-30 Raja R Harinath <rharinath@novell.com>
4428 * ecore.cs (PropertyExpr): Derive from Expression, not
4429 ExpressionStatement.
4430 (PropertyExpr.EmitStatement): Remove.
4432 2005-03-29 Raja R Harinath <rharinath@novell.com>
4435 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4436 internal field "value__" of an enum be private. The examples for
4437 "value__" that I found on MSDN all used FieldAttributes.Private.
4439 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4440 Don't mention IL method attribute names.
4442 Fix #47991. Remove a TODO.
4443 * statement.cs (Block.Toplevel): Make into a field.
4444 (Block.Parameters): Move into ToplevelBlock.
4445 (Block.known_variables): Rename from child_variable_names.
4446 (Block.Block): Remove variants that take Parameters. Initialize
4447 'Toplevel' with the immediately surrounding toplevel block.
4448 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4449 LocalInfo parameter.
4450 (Block.GetKnownVariableInfo): New.
4451 (Block.IsVariableNameUsedInChildBlock): Update.
4452 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4453 the block, even though it may not be in scope.
4454 (Block.AddVariable): Remove Parameters parameter. Use
4455 Toplevel.Parameters instead.
4456 (Block.AddConstant): Remove Parameters parameter.
4457 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4458 (Block.IsParamaterReference): Likewise.
4459 (Block.IsLocalParameter): Likewise. Simplify a lot.
4460 (ToplevelBlock.Parameters): New. Moved from Block.
4461 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4462 initialize Parameters to a non-null value.
4463 * cs-parser.jay: Update to changes.
4464 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4465 simple names that mean different things in the same block. Use
4466 Block.IsVariableNameUsedInBlock.
4468 2005-03-28 Raja R Harinath <rharinath@novell.com>
4470 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4472 2005-03-26 Raja R Harinath <harinath@acm.org>
4475 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4476 fails to resolve, ensure that the LHS is still resolved as an
4479 2005-03-25 Raja R Harinath <harinath@acm.org>
4481 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4483 (Enum.current_ec): Remove.
4484 (Enum.LookupEnumValue): Remove EmitContext argument.
4485 Just uses the one created during DefineType.
4486 (Enum.FindMembers): Update.
4487 * expression.cs (MemberAccess.DoResolve): Update.
4489 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4491 * assign.cs (Assign.DoResolve): Check for CS1717 when
4492 source and target are same (uses Equals).
4494 * expression.cs (LocalVariableReference, ParameterReference,
4495 This): Implemented Equals, GetHashCode.
4497 * statement.cs (Block.GetParameterReference): Removed useless
4500 2005-03-22 Raja R Harinath <rharinath@novell.com>
4503 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4504 blocks before deciding whether the error is cs0136 or cs0128.
4506 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4507 (using_alias_directive, using_namespace_directive): Pass
4508 MemberName, not an expression to Namespace.UsingAlias and
4510 (MakeName): Use the MemberName of the namespace.
4511 * namespace.cs (Namespace.MemberName): New.
4512 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4513 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4515 * decl.cs (MemberName.Name): Make readonly.
4516 (MemberName.FromDotted): New "constructor".
4517 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4518 (MemberCore.Name): Compute from MemberName on demand.
4519 (MemberCore.SetMemberName): Provide a way to change the
4521 (MemberCore.AddToContainer): Don't take a fullname parameter.
4522 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4523 fully qualified name of the container to the member name.
4524 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4525 only if the type is a member of the root container.
4526 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4527 MemberName.Left rather than searching for an embedded ".".
4528 (PartialContainer.CreatePart): Update to changes in RootContext.
4529 (MemberBase.ShortName): Turn into a property. Use
4530 MemberCore.SetMemberName.
4531 (MemberBase.ExplicitInterfaceName): Remove.
4532 (MemberBase.UpdateMemberName): Remove.
4533 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4534 (PropertyBase.SetMemberName): New override.
4535 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4536 (Tree.GetDecl): New.
4537 (Tree.AllDecls): Rename from Decls.
4538 * attribute.cs, enum.cs, report.cs: Update to changes.
4539 * driver.cs (MainDriver): Use MemberName.FromDotted on
4540 RootContext.MainClass.
4542 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4544 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4547 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4549 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4551 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4552 property accessor modifiers.
4554 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4555 fixed buffer attribute (CS1716).
4556 (PropertyMethod.HasCustomAccessModifier): When property accessor
4557 has custom modifier.
4559 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4561 (PropertyExpr.DoResolveLValue): Add CS0272.
4563 2005-03-17 Miguel de Icaza <miguel@novell.com>
4565 * convert.cs: When converting to a pointer, use the proper Conv.U
4566 or Conv.I depending on the source data type.
4568 * cs-tokenizer.cs: Make the size for large decimal constants,
4571 2005-03-17 Martin Baulig <martin@ximian.com>
4573 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4574 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4576 2005-03-17 Martin Baulig <martin@ximian.com>
4578 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4579 to bool so we can return an error condition.
4580 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4583 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4585 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4588 2005-03-16 Raja R Harinath <rharinath@novell.com>
4590 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4591 Refactor to avoid traversing the list of assemblies, and to avoid
4592 string concatenation.
4593 * typemanager.cs (guid_attr_type): Remove.
4594 (negative_hits, pointers, references): Remove hashes.
4596 (GetConstructedType): New. Uses type_hash to handle constructed
4597 types (arrays, references, pointers).
4598 (GetReferenceType, GetPointerType): Use it.
4599 (GetNestedType): New. Uses type_hash to handle nested types of
4601 (LookupType, LookupTypeDirect): Remove.
4602 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4603 'types' hash and LookupTypeReflection directly.
4604 (params_string, params_object): Use GetConstructedType.
4605 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4607 (Namespace.Lookup): Use cached_types.
4608 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4609 provided by old TypeManager.LookupType.
4610 * rootcontext.cs (MakeFQN): Remove.
4611 * decl.cs (DeclSpace.MakeFQN): Likewise.
4612 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4613 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4614 TypeManager.GetConstructedType.
4615 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4617 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
4619 * cs-parser.jay: Fix build.
4621 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4623 * class.cs (TypeContainer.CircularDepException) New nested
4624 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4626 * cs-parser.jay: Reports CS1527 for any namespace element.
4628 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4631 * expression.cs (ParameterReference.IsAssigned): Changed error to
4633 (Error_WrongNumArguments): Moved CS0245 detection here.
4635 * statement.cs (Return.Resolve): Add CS1622 report.
4637 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4639 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4641 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4643 * attribute.cs expression.cs: Get rid of some allocations.
4645 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4647 * doc.cs : just eliminate the latest change.
4649 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4651 * doc.cs : commented out the latest change. It breaks xml-030.cs
4653 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4655 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4656 fail. So invoke CreateType() in FindDocumentedType().
4658 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4660 * cs-tokenizer.cs : added IsKeyword().
4661 * doc.cs : Detect keyword incorrectly used as identifier.
4662 Allow identifiers prefixed by @.
4664 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4666 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4667 It caused exception in namespace resolving (again!).
4669 * class.cs (Class.ctor): Removed exit.
4670 (PropertyMethod.ctor): ditto.
4672 * codegen.cs (Codegen.Reset): Reset static data.
4673 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4675 * cs-tokenizer.cs (Cleanup): Removed.
4677 * driver.cs (GetSystemDir): Rewrote to one line command.
4678 It caused problem with unloaded dynamic modules.
4679 (UnixParseOption): Removed Exit.
4680 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4681 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4682 Now can be mcs used as library.
4684 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4687 * location.cs (Reset): Reset static data.
4689 * namespace.cs (Reset): Reset static data.
4691 * report.cs (Report.Reset): Reset static data.
4693 * rootcontext.cs (RootContext.Reset): Reset static data.
4695 * tree.cs (RootTypes.ctor): Use Location.Null
4697 * typemanager.cs (TypeManager.Reset): Reset static data.
4698 (CoreLookupType): Removed Exit.
4699 (TypeHandle.Reset): Reset static data.
4701 2005-03-10 Raja R Harinath <rharinath@novell.com>
4704 * typemanager.cs (ComputeNamespaces): Import namespaces from
4705 referenced modules too.
4707 2005-03-09 Raja R Harinath <rharinath@novell.com>
4709 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4712 2005-03-09 Raja R Harinath <rharinath@novell.com>
4714 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4715 enclosing DeclSpace. This ensures that a name-lookup populates
4716 more caches and there are fewer 'TypeExpression's. Carve out
4717 nested type lookup into ...
4718 (LookupNestedTypeInHierarchy): ... this.
4720 2005-04-15 Martin Baulig <martin@ximian.com>
4722 Merged r41590 from MCS and make it work in the generics land.
4724 * generic.cs (TypeParameter.UpdateConstraints): Removed the
4727 * class.cs (PartialContainer.UpdateConstraints): Removed.
4728 (PartialContainer.CheckConstraints): Removed.
4729 (PartialContainer.SetParameterInfo): Store the constraints here.
4730 (PartialContainer.DefineTypeParameters): New public method;
4731 resolve the type parameter's constraints here. Note that the
4732 PartialContainer doesn't have an EmitContext anymore, so we must
4733 do this in the ClassPart.
4735 2005-03-09 Raja R Harinath <rharinath@novell.com>
4737 Clean up a few partial-class semantics.
4738 Fixes test-357.cs and cs1618-2.cs.
4739 * cs-parser.jay (struct_declaration): Use 'current_class' as
4740 parent of newly-created struct. Remove call to Register ().
4741 Use 'pop_current_class' to complete handing the current struct.
4742 (interface_declaration): Likewise.
4743 (class_declaration): Likewise.
4744 (enum_declaration): Use 'current_class' as parent of newly created
4746 (delegate_declaration): Likewise.
4747 (pop_current_class): New function. This is used to handle closing
4748 up the 'current_class' and 'current_container', and pointing them
4749 to the enclosing class/container.
4750 (CSharpParser): Initialize 'current_class' too.
4751 * decl.cs (MemberCore): Add check for invariant: a partial
4752 container is not a parsed entity, and thus does not enclose any
4754 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4755 (DeclSpace.BaseTypeExpr): Use it.
4756 (DeclSpace.LookupType): Add check for invariant.
4757 * class.cs (TypeContainer): Add check for invariant: a nested
4758 class should have the same NamespaceEntry as its enclosing class.
4759 (TypeContainer.EmitFieldInitializers): Make virtual.
4760 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4762 (TypeContainer.Register): Remove.
4763 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4764 null. Use TypeResolveEmitContext for resolving base types and
4765 interfaces. Move initialization of Parts.TypeBuilder here from
4767 (TypeContainer.DefineNestedTypes): ... here.
4768 (PartialContainer): Take a Namespace not a NamespaceEntry.
4769 (PartialContainer.Create): Don't use Register. Call the
4770 appropriate Add... function directly.
4771 (ClassPart): Take both the PartialContainer and the enclosing
4772 class as constructor arguments.
4773 (ClassPart.EmitFieldInitializers): Override.
4774 (ClassPart.PartFindNestedTypes): Remove.
4775 (FieldBase.GetInitializerExpression): Resolve the initializer
4776 expression in the emit context of the enclosing class.
4777 * tree.cs (RootTypes): Remove Register ().
4779 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4781 * cs-parser.jay: Removed CS0134.
4783 * driver.cs: Removed CS1901.
4785 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4786 for predefined types.
4788 2005-03-07 Duncan Mak <duncan@novell.com>
4790 * codegen.cs (Save): Catch UnauthorizedAccessException as
4791 well. Fixes bug #73454.
4793 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4795 * cs-tokenizer.cs (xtoken): Add CS1035.
4797 * class.cs (MethodData.Define): Add CS0683.
4798 (FieldMember.ctor): Add CS0681.
4800 2005-03-07 Raja R Harinath <rharinath@novell.com>
4802 * ecore.cs (SimpleName.DoResolve): Rename from
4803 SimpleName.DoResolveAllowStatic.
4804 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4805 Pass 'intermediate' flag to MemberStaticCheck.
4806 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4807 of "intermediate" lookups via MemberAccess.
4808 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4809 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4811 2005-03-07 Raja R Harinath <rharinath@novell.com>
4814 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4815 slipped in because of variable names that are identical to a
4816 builtin type's BCL equivalent ('string String;', 'int Int32;').
4817 (PropertyExpr.EmitInstance): Likewise.
4819 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4821 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4823 * report.cs (warning_ignore_table): Made public.
4825 2005-03-04 Raja R Harinath <rharinath@novell.com>
4828 * class.cs (MethodData.Emit): Pass 'container' to
4829 container.GetObsoleteAttribute instead of 'container.Parent'.
4831 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4833 * cs-parser.jay: Add 1534 error test.
4835 * iterators.cs (Yield.CheckContext): Add error 1629.
4836 (Iterator.ctor): Save unsafe modifier.
4837 (MoveNextMethod.DoEmit): Restore unsafe context.
4839 * namespace.cs (UsingAlias): Better error message.
4841 2005-03-03 Dan Winship <danw@novell.com>
4843 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4844 the warning message [#73219]
4846 2005-03-03 Raja R Harinath <rharinath@novell.com>
4848 Fix compile with MCS 1.0.0.0.
4849 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4850 w_restore to not depend on string constant folding.
4852 2005-03-03 Raja R Harinath <rharinath@novell.com>
4854 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4855 CS0246 check to users who passed 'silent = false'.
4856 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4858 (SimpleName.SimpleNameResolve): Update.
4859 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4860 (MemberAccess.IdenticalNameAndTypeName): Update.
4861 * doc.cs (FindDocumentedTypeNonArray): Update.
4863 2005-03-03 Raja R Harinath <rharinath@novell.com>
4865 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4866 * parameters.cs (ComputeAndDefineParameters): Remove.
4867 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4868 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4869 Use GetParameterInfo.
4871 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4873 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4875 2005-03-02 Raja R Harinath <rharinath@novell.com>
4877 Unify DeclSpace.LookupType and DeclSpace.FindType.
4878 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4879 is in charge of defining nested types on demand.
4880 (DeclSpace.LookupType): Use it when the current_type is a
4881 TypeBuilder. Use LookupTypeDirect for reflected types.
4882 (DeclSpace.FindType): Remove.
4883 (DeclSpace.LookupInterfaceOrClass): Likewise.
4884 (DeclSpace.DefineTypeAndParents): Likewise.
4885 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4886 DeclSpace.LookupType.
4887 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4888 * typemanager.cs (LookupType): Simplify.
4889 (AddUserType): Remove type from negative_hits.
4890 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4891 * class.cs (TypeContainer.FindMembers): Move handling of nested
4893 (TypeContainer.FindMembers_NestedTypes): ... here.
4894 (TypeContainer.FindNestedType): Implement override.
4895 (ClassPart.FindNestedType): Delegate to PartialContainer.
4896 (ClassPart.PartFindNestedType): Looks up the nested types of the
4899 2005-04-14 Martin Baulig <martin@ximian.com>
4901 * generic.cs (ConstructedType): Moved all the type lookup and
4902 nested class logic into SimpleName.
4903 (ConstructedType.ResolveConstructedType): Our underlying type is
4904 already fully resolved; all the type lookup stuff is in
4907 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4908 constructed types here instead of in ConstructedType.
4910 * decl.cs (MemberName.GetTypeExpression): Always create a
4911 SimpleName, not a ConstructedType.
4912 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4914 2005-03-02 Martin Baulig <martin@ximian.com>
4916 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4917 static constructor in static classes.
4919 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4921 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4922 sizeParamIndex is not specified.
4924 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4927 * report.cs (WarningMessage.IsEnabled): Missing null check.
4929 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4931 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4932 in the fields and not in the properties.
4934 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4936 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4939 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4941 * attribute.cs: Small refactoring (improved robustness).
4942 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4943 (ValidateGuid): Removed.
4944 (Resolve): Removed referenced to above mentioned.
4945 (GetAttributeUsage): Made private and changed to work without
4947 (GetIndexerAttributeValue): Don't crash.
4948 (GetConditionalAttributeValue): Ditto.
4949 (GetClsCompliantAttributeValue): Ditto.
4950 (ExtractSecurityPermissionSet): All attributes exceptions are
4952 (GetPropertyValue): New helper.
4953 (GetMethodImplOptions): New method.
4954 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4955 some missing properties.
4957 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4958 (Method.ApplyAttributeBuilder): Updated.
4960 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4963 2005-02-28 Raja R Harinath <rharinath@novell.com>
4966 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4967 non-simple types (array, pointer, reference).
4969 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4971 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4973 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4975 (Method.CheckBase): Catch wrong destructor here.
4976 (MethodData.Define): Add errors 550, 668.
4978 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4980 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4982 * pending.cs (VerifyPendingMethods): Add error 551.
4984 * typemanager.cs (CSharpName): Next error report helper.
4986 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4988 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4989 attributes. Removed useless attribute double check.
4990 It saves almost 2MBs for corlib.
4992 2005-02-25 Raja R Harinath <rharinath@novell.com>
4995 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4996 called twice in case of error.
4998 2005-02-23 Chris Toshok <toshok@ximian.com>
5000 Fix compiler portions of #72827.
5001 * statement.cs (Block.Emit): call Begin/EndScope on the
5002 EmitContext instead of the ILGenerator.
5004 * codegen.cs (EmitContext.BeginScope): new method, call
5005 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5007 (EmitContext.BeginScope): same, but EndScope and CloseScope
5009 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5010 offset and call the superclass's OpenScope(int) with it.
5011 (SymbolWriter.CloseScope): get the current il
5012 offset and call superclass's CloseScope(int) with it.
5014 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5016 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5017 CS1677 for out and ref as well.
5019 * class.cs (Method.Define): Add error CS1599 detection.
5021 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5023 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5025 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5027 * support.cs.cs (ModifierDesc): New helper method.
5029 2005-02-23 Raja R Harinath <rharinath@novell.com>
5030 Abin Thomas <projectmonokochi@rediffmail.com>
5031 Anoob V E <projectmonokochi@rediffmail.com>
5032 Harilal P R <projectmonokochi@rediffmail.com>
5035 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5036 MemberLookup (used for error reporting) actually returns a result.
5037 Fix error report number (122, not 112).
5039 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5040 Anoob V E <projectmonokochi@rediffmail.com>
5041 Harilal P R <projectmonokochi@rediffmail.com>
5044 * pending.cs (PendingImplementation.GetAbstractMethods):
5045 Find NonPublic members too.
5047 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5049 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5052 * class.cs (MethodCore.CheckMethodAgainstBase):
5053 Add error 239 report.
5055 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5057 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5059 * class.cs (Operator.Define): Add error 217 report.
5061 2005-02-21 Raja R Harinath <rharinath@novell.com>
5064 * expression.cs (Invocation.IsApplicable): Make public.
5065 (Invocation.IsParamsMethodApplicable): Likewise.
5066 * delegate.cs (Delegate.VerifyApplicability): Don't use
5067 Invocation.VerifyArgumentCompat for parameter applicability
5068 testing. Use Invocation.IsApplicable and
5069 Invocation.IsParamsMethodApplicable.
5071 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5073 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5075 * class.cs (Operator.Define): Add error 217 report.
5077 2005-02-21 Raja R Harinath <rharinath@novell.com>
5079 * namespace.cs (UsingEntry.Resolve): Undo change below.
5081 2005-02-21 Raja R Harinath <rharinath@novell.com>
5084 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5085 disable the error message when the extended MemberLookup also
5087 (Expression.MemberLookupFinal): Update.
5088 (SimpleName.DoSimpleNameResolve): Update.
5089 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5090 Don't use MemberLookupFinal.
5091 (New.DoResolve): Update.
5092 (BaseAccess.CommonResolve): Update.
5094 2005-02-21 Raja R Harinath <rharinath@novell.com>
5097 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5098 occured previously, don't resolve again.
5100 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5103 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5104 argument. Call ResolveAttributeUsage for unresolved.
5105 when types doesn't match ctor arguments.
5107 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5108 for nested attribute classes.
5109 (Class.attribute_usage): Removed.
5110 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5111 for attribute class.
5113 * ecore.cs (IsAttribute): Removed.
5115 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5117 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5119 (attribute_types): Removed.
5120 (EmitCode): Global attributes are emited as the latest.
5122 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5124 * class.cs (EmitFieldInitializers): Don't emit field initializer
5125 for default values when optimilization is on.
5127 * constant.cs (Constant.IsDefaultValue): New property.
5129 * driver.cs: Add /optimize handling.
5133 * literal.cs: Implement new IsDefaultValue property.
5135 * rootcontext.cs (Optimize): New field, holds /optimize option.
5137 2005-02-18 Raja R Harinath <rharinath@novell.com>
5139 Fix crasher in re-opened #72347.
5140 * namespace.cs (Namespace.Lookup): Return null if
5141 DeclSpace.DefineType returns null.
5144 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5146 2005-02-18 Raja R Harinath <rharinath@novell.com>
5148 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5149 now returns null if it cannot resolve to an lvalue.
5150 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5151 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5152 returned null. Remove check for SimpleName.
5153 (EventExpr.DoResolveLValue): New.
5154 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5155 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5157 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5159 (Unary.ResolveOperator): Move CS0211 check ...
5160 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5162 (Unary.DoResolveLValue): Simplify.
5163 (AddressOf.DoResolveLValue): New.
5164 (ArrayAccess.DoResolveLValue): New.
5166 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5168 * attribute.cs (Attribute.Resolve): Add arguments casting for
5169 when types doesn't match ctor arguments.
5171 2005-02-16 Raja R Harinath <rharinath@novell.com>
5173 Fix parts of #63202.
5174 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5175 lookup of operator in base type. Ensure that all checks happen
5176 when the operator resolves to an "op_..." method.
5178 2005-02-15 Raja R Harinath <rharinath@novell.com>
5181 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5182 'ignore_cs0104' parameter. Pass it to ...
5183 (NamespaceEntry.Lookup): ... this.
5184 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5185 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5186 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5187 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5188 Update. Request that cs0104 errors be ignored.
5189 (ComposedCast.ResolveAsTypeStep): Update.
5191 2005-02-14 Raja R Harinath <rharinath@novell.com>
5194 * expression.cs (Invocation.BetterFunction): Remove support for
5195 comparing virtual functions and their overrides.
5196 (Invocation.IsOverride): New.
5197 (Invocation.OverloadResolve): Don't consider 'override' functions
5198 during candidate selection. Store them in a lookaside list.
5199 If the selected method is a 'virtual' function, use the list to
5200 find any overrides that are closer to the LHS type.
5202 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5204 * expression.cs (New.DoResolve): Add complex core type reduction.
5205 (New.Constantify): Converts complex core type syntax like 'new int ()'
5208 2005-02-14 Raja R Harinath <rharinath@novell.com>
5210 * decl.cs (EntryType.EntryType): New constructor to create an
5211 updated copy of a cache entry.
5212 (MemberCache.AddMethods): Use it.
5213 (MemberCache.ClearDeclaredOnly): Remove.
5214 (MemberCache.MemberCache): Update.
5216 2005-02-11 Miguel de Icaza <miguel@novell.com>
5218 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5219 variable. This one is represents the actual low-level declaration
5220 of the method, as opposed to the semantic level `IsStatic'.
5222 An anonymous method which is hosted into a static method might be
5223 actually an instance method. IsStatic would reflect the
5224 container, while MethodIsStatic represents the actual code
5227 * expression.cs (ParameterReference): Use the new MethodIsStatic
5228 instead of IsStatic.
5230 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5231 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5232 set on the current EmitContext.
5234 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5235 resolve our casted expression as an LValue. This triggers the
5236 proper LValue processing that is later required by Assign.
5240 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5242 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5244 C# 2.0 Fixed buffer implementation
5246 * anonymous.cs: Update after RegisterHelperClass renaming.
5248 * attribute.cs (AttributeTester.fixed_buffer_cache):
5249 Cache of external fixed buffers.
5250 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5251 implementation if field is fixed buffer else null.
5254 (TypeContainer.AddField): Accept FieldMember instead of Field.
5255 (FieldBase.IsFieldClsCompliant): Extracted code from
5256 VerifyClsCompliance descendant customization.
5257 (FixedField): New class handles fixed buffer fields.
5258 (FixedFieldExternal): Keeps information about imported fixed
5260 (IFixedField): Make access to internal or external fixed buffer
5263 * cs-parser.jay: Add fixed buffer parsing.
5265 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5268 * expression.cs (Indirection): Extended implementation to accept
5270 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5271 (ElementAccess.MakePointerAccess): Get type as parameter.
5272 (DoResolve): Add fixed buffer field expression conversion.
5273 (DoResolveLValue): Ditto.
5274 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5275 (ArrayPtr): Derives from FixedBufferPtr.
5276 (ArrayPtr.Emit): Add extra emit for array elements.
5278 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5280 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5281 for compiler generated types.
5282 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5284 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5285 and consume less memory.
5286 (Fixed.Resolve): Add fixed buffer case.
5288 * typemanager.cs (compiler_generated_attr_ctor,
5289 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5290 (HasElementType): Add our own implementation to work on every
5293 2005-02-11 Miguel de Icaza <miguel@novell.com>
5295 * anonymous.cs (CaptureContext): Track whether `this' has been
5298 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5299 only captured `this' if it was implicitly done (instance
5300 methods/variables were used).
5302 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5303 `this' must be captured.
5305 2005-01-30 Miguel de Icaza <miguel@novell.com>
5307 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5308 is null it means that there has been no need to capture anything,
5309 so we just create a sibling.
5311 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5313 Just a partial fix. The other half is fairly elusive.
5315 2005-02-10 Raja R Harinath <rharinath@novell.com>
5317 Fix #52586, cs0121-4.cs.
5318 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5319 and return a hashtable.
5320 (MemberCache.ClearDeclaredOnly): New.
5321 (MemberCache.MemberCache): Update to change. Make a deep copy of
5322 the method_hash of a base type too.
5323 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5324 type methods. Overwrite entries with the same MethodHandle so
5325 that the ReflectedType is correct. The process leaves in base
5326 virtual functions and their overrides as distinct entries.
5327 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5328 matters since it was boxed in a ArrayList before.
5329 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5331 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5332 case of a virtual function and its override (choose the overload
5334 (Invocation.OverloadResolve): Avoid 'override' members during
5335 'applicable_type' calculation.
5337 2005-03-28 Raja R Harinath <rharinath@novell.com>
5339 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5340 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5341 GetTypeHandle. It is possible for a reflected type to derive from
5342 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5343 System.Array during mscorlib compilation).
5344 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5345 contain a method_hash, don't create one either. Don't create a
5346 deep copy of the base cache's method_hash.
5347 (MemberCache.SetupCache): Rename back from DeepCopy.
5348 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5349 already initialized. If we see an override function, add its
5350 underlying base virtual function to the member_hash too.
5352 2005-02-09 Raja R Harinath <rharinath@novell.com>
5354 Combine two near-redundant caches.
5355 * typemanager.cs (method_params): Rename from method_internal_params.
5356 (TypeManager.GetParameterData): New. Replace
5357 Invocation.GetParameterData.
5358 (TypeManager.LookupParametersByBuilder): Remove.
5359 * expression.cs (Invocation.method_parameter_cache): Remove.
5360 (Invocation.GetParameterData): Remove.
5362 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5365 2005-02-08 Raja R Harinath <rharinath@novell.com>
5368 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5369 TypeManager.multicast_delegate_type is null, resolve it by looking
5370 up "System.MulticastDelegate".
5371 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5373 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5374 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5375 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5378 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5379 (LabeledStatement.AddReference): New. Set 'referenced'.
5380 (Goto.Resolve): Use it.
5382 2005-02-05 John Luke <john.luke@gmail.com>
5384 * driver.cs: remove duplicate -doc line in Usage ()
5386 2005-02-04 Raja R Harinath <rharinath@novell.com>
5388 * location.cs (Location.AddFile): Fix CS2002 error report.
5390 2005-02-02 Martin Baulig <martin@ximian.com>
5392 * delegate.cs (Delegate.DefineType): Report an internal error if
5393 TypeManager.multicast_delegate_type is null. See bug #72015 for
5396 2005-02-02 Raja R Harinath <rharinath@novell.com>
5398 Fix a crasher in a variant of #31984.
5399 * const.cs (Constant.CheckBase): New override that defers the
5400 new-or-override check in case the base type hasn't been populated
5402 (Constant.Define): Ensure the new-or-override check is performed.
5404 2005-02-01 Duncan Mak <duncan@ximian.com>
5406 * const.cs (LookupConstantValue): Check that `ce' is not null
5407 before calling GetValue ().
5409 2005-02-01 Raja R Harinath <rharinath@novell.com>
5411 Fix test-334.cs (#69519).
5412 * cs-parser.jay (using_alias_directive): Pass in an expression to
5413 NamespaceEntry.UsingAlias.
5414 (using_namespace_directive): Pass in an expression to
5415 NamespaceEntry.Using.
5416 (namespace_name): Don't flatten to a string.
5417 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5418 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5420 (NamespaceEntry.UsingEntry): Likewise.
5421 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5423 (NamespaceEntry.LookupForUsing): Remove.
5424 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5426 (NamespaceEntry.Lookup): Remove support for dotted names.
5428 2005-02-01 Raja R Harinath <rharinath@novell.com>
5430 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5432 (NamespaceEntry.ImplicitParent): Compute on demand.
5433 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5434 parallels the current.
5435 (NamespaceEntry.LookupForUsing): Use it.
5436 (NamespaceEntry.Lookup): If the current namespace-entry is
5437 implicit, don't search aliases and using tables.
5439 2005-02-01 Raja R Harinath <rharinath@novell.com>
5442 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5444 (TypeContainer.BaseCache): Compute on demand.
5445 (TypeContainer.FindMembers): Define constants and types if they're
5446 not already created.
5447 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5449 * const.cs (Constant.Define): Make idempotent.
5451 2005-01-29 Miguel de Icaza <miguel@novell.com>
5453 * pending.cs: Produce better code (no nops produced by using Ldarg
5456 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5457 i - 1' it should be arg + 1.
5461 2005-01-28 Raja R Harinath <rharinath@novell.com>
5463 * attribute.cs (Attribute.CheckAttributeType): Make private
5465 (Attribute.ResolveType): Make virtual.
5466 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5467 handling of RootContext.Tree.Types.
5469 2005-01-27 Raja R Harinath <rharinath@novell.com>
5471 Update attribute-handling to use the SimpleName/MemberAccess
5473 * cs-parser.jay (attribute): Pass in an expression to the
5474 constructors of Attribute and GlobalAttribute.
5475 * attribute.cs (Attribute): Take an expression for the name.
5476 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5477 passed in attribute name expression.
5478 (Attribute.CheckAttributeType): Use it.
5479 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5480 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5481 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5482 argument to prevent error messages if the lookup fails.
5484 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5486 * expression.cs (Indirection): Implemented IVariable interface
5487 to support indirection in AddressOf operator.
5488 (PointerArithmetic.Emit): Add optimalization for case where
5489 result can be precomputed.
5491 2005-01-26 Martin Baulig <martin@ximian.com>
5493 * class.cs (TypeContainer.AttributeTargets): Return the correct
5494 AttributeTargets depending on our `Kind' instead of throwing an
5495 exception; fixes #71632.
5497 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5500 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5503 2005-03-17 Martin Baulig <martin@ximian.com>
5505 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5506 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5508 2005-03-17 Martin Baulig <martin@ximian.com>
5510 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5511 to bool so we can return an error condition.
5512 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5515 2005-03-17 Martin Baulig <martin@ximian.com>
5517 * generic.cs (TypeMananager.IsIEnumerable): New public method.
5519 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5520 converting from an array-type of T to `IEnumerable<T>'.
5522 2005-03-16 Martin Baulig <martin@ximian.com>
5524 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5525 (Nullable.LiftedUnaryMutator): New public class.
5527 * expression.cs (UnaryMutator.DoResolve): Added support for
5530 2005-03-14 Martin Baulig <martin@ximian.com>
5532 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5534 2005-03-14 Martin Baulig <martin@ximian.com>
5536 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5537 the comparision operators `<', `>', `<=' and `>='.
5539 2005-03-13 Martin Baulig <martin@ximian.com>
5542 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5543 avoid confusion with the `NullLiteral'.
5544 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5546 2005-03-13 Martin Baulig <martin@ximian.com>
5548 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5549 comparing arbitrary types with the null literal.
5551 2005-03-13 Martin Baulig <martin@ximian.com>
5553 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5554 boolean operators '&&', '||', '&' and '|'.
5555 (Nullable.OperatorTrueOrFalse): New public class.
5557 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5558 instead of a `StaticCallExpr'; added support for nullables.
5560 2005-03-10 Martin Baulig <martin@ximian.com>
5563 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5564 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
5566 2005-03-07 Martin Baulig <martin@ximian.com>
5568 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5569 it work if `expr' is not an IMemoryLocation.
5570 (Nullable.Lifted): Implement IMemoryLocation.
5571 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5574 2005-03-05 Martin Baulig <martin@ximian.com>
5576 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5577 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5578 (Nullable): Added support for lifted unary and binary operators.
5580 * expression.cs (Unary.DoResolve): Added support for nullable types.
5581 (Binary.DoResolve): Likewise.
5582 (Conditional.DoResolve): Likewise.
5584 2005-03-02 Martin Baulig <martin@ximian.com>
5586 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5588 * class.cs (ClassPart.SetParameterInfo): Override this.
5589 (PartialContainer.SetParameterInfo): Override this.
5590 (TypeContainer.CheckConstraints): New protected method.
5591 (PartialContainer.CheckConstraints): Override this and check
5592 whether the same contraints were specified in all parts of a
5593 partial generic type definition.
5594 (PartialContainer.UpdateConstraints): New public method.
5596 * generic.cs (TypeParameter.UpdateConstraints): New public method.
5598 2005-03-02 Martin Baulig <martin@ximian.com>
5600 Committing a patch from Carlos Alberto Cortez to fix #72887.
5602 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5603 casts from `T []' to `int []'.
5605 2005-03-02 Martin Baulig <martin@ximian.com>
5607 * generic.cs (TypeManager.IsEqual): Make this symmetric.
5609 * expression.cs (Binary.ResolveOperator): When resolving a
5610 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5611 `=='. Fixes #71866. See gen-127.cs.
5613 2005-03-02 Martin Baulig <martin@ximian.com>
5615 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5616 static constructor in static classes.
5618 2005-03-02 Martin Baulig <martin@ximian.com>
5621 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5622 (Nullable.LiftedConversion): Added support for user-defined
5625 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5627 * cs-parser.jay: Use ComposedCast everywhere instead of
5628 NullableType, so we don't need to check for NullableType
5630 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5631 case where we'll be resolved into a `parenthesized_expression_0'
5635 (Convert.UserDefinedConversion): Added nullable conversions.
5637 2005-02-28 Martin Baulig <martin@ximian.com>
5639 * generic.cs (TypeManager.IsNullableType): New static method.
5640 (Nullable): New abstract class.
5641 (Nullable.NullLiteral): New public class.
5642 (Nullable.LiftedConversion): New public class.
5644 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5645 `builtin_types opt_nullable'.
5648 (Convert.ImplicitConversionStandard): Added nullable conversions.
5649 (Convert.ExplicitConversionStandard): Likewise.
5650 (Convert.ExplicitConversion): Likewise.
5652 2005-02-26 Martin Baulig <martin@ximian.com>
5654 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5655 begin with a "?", for instance "?[]". Don't do a type lookup if
5658 2005-02-25 Martin Baulig <martin@ximian.com>
5660 The first part of Nullable Types :-)
5662 * generic.cs (NullableType): New public class.
5663 (NullCoalescingOperator): New public class.
5664 (TypeArguments.Resolve): Add a CS0306 check.
5666 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5667 (opt_nullable): New rule.
5668 (type): Added `opt_nullable' to `namespace_or_type_name',
5669 `builtin_types' and `pointer_type'.
5670 (array_type): Added `opt_nullable'.
5671 (opt_rank_specifier_or_nullable): New rule; this is the
5672 combination of `opt_rank_specifier' and `opt_nullable'.
5673 (opt_error): New rule; catch errors here.
5674 (nullable_type_or_conditional): New rule; we use this to check for
5675 nullable and still detect the conditional operator.
5676 (local_variable_type): Use `opt_rank_specifier_or_nullable'
5677 instead `opt_rank_specifier'.
5679 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5682 2005-02-24 Martin Baulig <martin@ximian.com>
5684 * README, README.Changes: Removed; they're old and obsolete.
5686 2005-02-22 Martin Baulig <martin@ximian.com>
5688 * generic.cs (TypeParameter.Resolve): If resolving the constraints
5689 returned an error, set `constraints' to null to avoid a crash
5691 (TypeParameter.ResolveType): Likewise.
5693 2005-02-22 Martin Baulig <martin@ximian.com>
5696 (Constraints.ResolveTypes): Protect against being called twice.
5697 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5698 (TypeParameter.ResolveType): New public method; calls
5699 constraints.ResolveTypes().
5700 (TypeParameter.DefineType): Moved constraints.ResolveType() out
5701 into the new ResolveType().
5702 (GenericMethod.Define): Call ResolveType() on all our
5705 2005-02-21 Martin Baulig <martin@ximian.com>
5708 (TypeManager.generic_nullable_type): New static public field.
5709 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5712 (RootContext.ResolveCore): Resolve "System.Nullable`1".
5714 2005-02-15 Martin Baulig <martin@ximian.com>
5716 * generic.cs (ConstructedType.Constraints): Correctly check
5717 constraints if the argument type is a type parameter; fixes
5720 2005-02-02 Martin Baulig <martin@ximian.com>
5722 * delegate.cs (Delegate.DefineType): Report an internal error if
5723 TypeManager.multicast_delegate_type is null. See bug #72015 for
5726 2005-01-29 Miguel de Icaza <miguel@novell.com>
5728 * pending.cs: Produce better code (no nops produced by using Ldarg
5731 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5732 i - 1' it should be arg + 1.
5736 2005-01-26 Martin Baulig <martin@ximian.com>
5738 * cs-parser.jay (indexer_declarator): Don't report an error if we
5739 have type parameters since we can be an explicit interface
5740 implementation; fixes #71449.
5742 2005-01-26 Martin Baulig <martin@ximian.com>
5744 * class.cs (TypeContainer.AttributeTargets): Return the correct
5745 AttributeTargets depending on our `Kind' instead of throwing an
5746 exception; fixes #71632.
5748 2005-01-26 Martin Baulig <martin@ximian.com>
5750 * delegate.cs (Delegate.DefineType): Correctly define our type
5751 parameters. Fixes #71483.
5753 2005-01-25 Raja R Harinath <rharinath@novell.com>
5756 * expression.cs (MemberAccess.DoResolve): Don't complain with
5757 cs0572 when the LHS of a member access has identical name and type
5760 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5763 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5765 Create custom PermissionSet only for PermissionSetAttribute.
5767 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5770 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5771 delegates in static class.
5773 2005-01-24 Martin Baulig <martin@ximian.com>
5775 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5776 merging an implicit block, just use its reachability.
5778 * statement.cs (Block.Resolve): Make the unreachable code check
5779 work wrt. implicit blocks; see test-337 from #63842.
5781 2005-01-21 Alp Toker <alp@atoker.com>
5783 * cs-parser.jay: destructor_declaration's container is PartialContainer
5784 not Class when partial types are used, so use Kind prop instead of
5787 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5789 * cs-parser.jay: Improve error reporting when an interface
5792 2005-01-20 Dick Porter <dick@ximian.com>
5794 * support.cs: SeekableStreamReader fix from Sandor Dobos
5795 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5796 chars are read. Fixes bug 70369.
5798 2005-01-20 Raja R Harinath <rharinath@novell.com>
5800 * cs-parser.jay (catch_clause): Simplify current_block handling
5803 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5805 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5806 code with ImplicitStandardConversion to handle the implicit
5807 conversion of method groups into valid delegate invocations.
5809 The problem is that in parameter handling we were using this code
5810 path. Fixes bug #64698
5812 2005-01-19 Raja R Harinath <rharinath@novell.com>
5814 * cs-parser.jay: Fix several infelicities.
5815 - Avoid assigning to the parser value stack. Code like
5816 '$3 = null' is unclean. Synthesize a value for the code block
5818 - Avoid using oob_stack for storing location information. Use ...
5819 (_mark_): ... this. New (empty) rule. Saves the current location
5821 (foreach_statement): Avoid using oob_stack for current_block
5822 handling. Use technique used in for_statement and
5823 using_statement. Synthesize a value for the code block to store
5824 additional intermediate information.
5826 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5828 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5829 of a different type is only allowed to private fields of a
5830 containing type, not on fields of a base class.
5832 See test-174.cs and error cs0122-9.cs
5834 2005-01-13 Raja R Harinath <rharinath@novell.com>
5836 Fix test-335.cs (bug #58126).
5837 * cs-parser.jay (argument): Split out non-expression parts of the
5838 rule into 'non_simple_argument'.
5839 (invocation_expression): Support parenthesized invocations with
5840 multiple arguments, and with single non-simple arguments.
5842 2005-01-13 Raja R Harinath <rharinath@novell.com>
5844 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5847 2005-01-12 Raja R Harinath <rharinath@novell.com>
5849 Fix cs0038-1.cs, cs1640-6.cs.
5850 * ecore.cs (Expression.Resolve): Remove special-case for
5851 SimpleName in error-handling.
5852 (Expression.almostMatchedMembers): Relax access permission to
5854 (Expression.MemberLookupFailed): Handle duplicates in
5855 almostMatchedMembers list.
5856 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5857 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5858 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5859 overload if the passed in MemberInfo is a MethodBase.
5861 2005-01-25 Martin Baulig <martin@ximian.com>
5864 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5866 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5869 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5870 for non-CAS & merge permission sets properly.
5872 2005-01-11 Raja R Harinath <rharinath@novell.com>
5874 Improve standard-compliance of simple name and member access
5875 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5876 * ecore.cs (FullNamedExpression): New abstract base class
5877 for Namespaces and TypeExpressions.
5878 (ResolveFlags.SimpleName): Remove.
5879 (SimpleName): Remove support for dotted names.
5880 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5881 DeclSpace.FindType and DeclSpace.LookupType.
5882 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5883 (Expression.ExprClassName): Make member function.
5884 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5885 a namespace. Remove creation of dotted "SimpleName"s.
5886 (MemberAccess.DoResolve): Likewise.
5887 * decl.cs (DeclSpace.Cache): Make private.
5888 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5889 (DeclSpace.FindType): Update.
5890 (DeclSpace.LookupType): Move here from RootContext. Return a
5891 FullNamedExpression.
5892 * namespace.cs (Namespace): Derive from FullNamedExpression
5893 so that it can be part of expression resolution.
5894 (Namespace.Lookup): Return an FullNamedExpression.
5895 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5897 * rootcontext.cs (NamespaceLookup): Remove.
5898 (LookupType): Move to DeclSpace.
5899 * attribute.cs (CheckAttributeType): Update.
5900 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5901 (FindDocumentedTypeNonArray): Likewise.
5903 2005-01-11 Raja R Harinath <rharinath@novell.com>
5905 Fix cs0509.cs, cs1632.cs.
5906 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5907 is the same as IsInterface.
5908 (TypeContainer.GetClassBases): Likewise.
5909 * statement.cs (LabeledStatement.ig): New field.
5910 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5912 (LabeledStatement.DoEmit): Check that the label was created with
5913 the same ILGenerator.
5915 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5918 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5919 accessors to its properties.
5921 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5922 from accessors to property.
5924 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5927 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5930 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5932 * attribute.cs: Check for null and empty strings.
5934 I have lost another battle to Paolo.
5936 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5939 * class.cs (PropertyMethod): Set Parent field in ctors.
5940 (SetMethod.InternalParameters): Add unsafe switch hack.
5941 Override MarkForDuplicationCheck where it is appropriate.
5943 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5944 It says whether container allows members with the same name.
5946 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5947 Removed is_method parameter.
5949 2005-01-06 Duncan Mak <duncan@ximian.com>
5951 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5952 because the previous change led to incorrect reporting of CS1032
5953 ("Cannot define/undefine preprocessor symbols after first token in
5954 file"). Instead of using `tokens_seen' as the only flag that
5955 triggers CS1040, introduce `comments_seen'. This new flag is used
5956 to signify having seen comments on the current line, so it is
5957 unset after a newline.
5959 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5961 * doc.cs : When searching for a type, find nested type too.
5962 This fixes bug #71040.
5964 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5967 - Warn missing member comment on those classes which also does not
5968 have doc comments. Fixed bug #71041.
5969 - Don't warn missing doc comment on default constructor.
5972 2005-01-06 Duncan Mak <duncan@ximian.com>
5974 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5975 comments, set `tokens_seen' to true. This allows us to detect
5976 misplaced preprocessor directives (i.e. not at the beginning of
5977 the a line, nor after whitespaces). In that case, report error
5978 CS1040. This fixes bug #56460.
5980 * cs-parser.jay (interface_member_declaration): Add checks for
5981 IsExplicitImpl, and report CS0541 error if an interface member is
5982 defined as an explicit interface declaration.
5984 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5987 * class.cs (PropertyMethod): Set Parent field in ctors.
5988 (SetMethod.InternalParameters): Add unsafe switch hack.
5990 * decl.cs (MemberCore.Parent): Cannot be readonly.
5992 2005-01-06 Raja R Harinath <rharinath@novell.com>
5994 * decl.cs (DeclSpace.ResolveType): Remove.
5995 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5996 Merge in code from ...
5997 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5998 * class.cs, enum.cs: Update to changes.
6000 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6002 * anonymous.cs: Ensure that we init the scope of our parent if it
6003 has not been initialized yet.
6005 2004-12-30 Duncan Mak <duncan@ximian.com>
6007 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6008 if field.FieldBuilder is null. Fixes #70758.
6010 * convert.cs: Fixed some typos and updated some of the comments.
6011 (ImplicitStandardConversionExists):
6012 (TryImplicitIntConversion): If `target_type' is an interface and
6013 the type of `ic' implements this interface, return true or a new
6014 BoxedCast instead of null. This fixes #70468.
6016 2004-12-29 Duncan Mak <duncan@ximian.com>
6018 * expression.cs (Argument.Emit): Check that Expr is
6019 IMemoryLocation before casting to it, and report CS1510 otherwise.
6023 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6025 * statement.cs (Block.ThisVariable): remove the recursion here, to
6026 make the --profile more sane.
6028 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6030 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6031 assembly, by JB Evain.
6033 2004-12-17 Raja R Harinath <rharinath@novell.com>
6035 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6036 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6037 "parent" refers to enclosing type/class. "base" refers to superclass.
6039 2004-12-17 Raja R Harinath <rharinath@novell.com>
6041 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6042 Ensure that we only have GlobalAttributes.
6043 * attribute.cs (Attribute.Emit): Make non-virtual.
6044 (GlobalAttribute.Emit): Remove.
6045 (Attribute.Resolve): Make virtual.
6046 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6047 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6048 the argument. Don't create one.
6049 (Attribute.GetObsoleteAttribute): Likewise.
6050 (Attribute.GetClsCompliantAttributeValue): Likewise.
6051 * class.cs, decl.cs: Update to changes.
6053 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6055 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6057 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6059 * statement.cs (Foreach.Resolve): Add error 186 report.
6061 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6063 * expression.cs (Conditional.DoResolve): Add warning 429.
6065 * statement.cs (If.Resolve): Add warning 665.
6067 2004-12-16 Raja R Harinath <rharinath@novell.com>
6069 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6070 except when in the parser, and in GlobalAttribute.
6071 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6072 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6073 RootContext.Tree.Types.NamespaceEntry once work is done.
6074 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6075 and resets RootContext.Tree.Types.NamespaceEntry.
6077 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6079 * cs-parser.jay: Don't create a block for every variable.
6081 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6083 * location.cs: Provide extra information.
6085 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6086 variables from the captured environment, it is the ldarg_0.
6088 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6090 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6093 * class.cs: Changed warning level for 169 to avoid developer
6094 displeasure from warning flooding. It will be changed back when they
6095 fix most of current BCL warnings.
6097 * RootContext.cs: Pushed default WarningLevel to 3.
6099 * statement.cs: Removed unused variable.
6101 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6103 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6104 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6105 Add error 502 report.
6106 (StaticClass.DefineType): Add error 441 report.
6107 (Class.AllowedModifiersProp): New virtual property as temporary
6108 extension to AllowedModifiers.
6109 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6110 to share implementation with StaticClass and don't call virtual
6113 * driver.cs (MainDriver): Add error 1558 test.
6115 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6116 report. Moved error 36 test here.
6118 * statement.cs (Throw.Resolve): Add error 724 report.
6120 * typemanager.cs: Add out_attribute_type core type.
6122 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6124 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6126 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6128 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6131 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6133 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6134 Add error 3023 report.
6135 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6137 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6140 2004-12-12 John Luke <john.luke@gmail.com>
6142 * driver.cs (AddArgs): take -- into account when
6143 adding arguments, fixes bug 65710
6145 2004-12-12 Martin Baulig <martin@ximian.com>
6147 * expression.cs (Unary.TryReduceNegative): Added support for
6148 SByteConstant and ByteConstant.
6149 (Unary.Reduce): Check error values from TryReduceNegative().
6151 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6153 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6154 and report exception as error 182.
6156 2004-12-10 Raja R Harinath <rharinath@novell.com>
6158 * driver.cs (Main): Fix message when there are warnings.
6160 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6162 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6164 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6166 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6167 Reduced number of warnings.
6169 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6171 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6173 * driver.cs: Removed message.
6175 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6177 2004-12-08 <vargaz@freemail.hu>
6179 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6181 2004-12-08 Martin Baulig <martin@ximian.com>
6183 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6184 instead of a CS3002 for properties and indexer.
6186 2004-12-08 Martin Baulig <martin@ximian.com>
6188 * decl.cs (MemberName.ToString): Make this work again.
6190 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6192 * attribute.cs (Resolve): Add error 591 detection.
6194 * class.cs (FieldMember.Define): Add error 1547 detection.
6195 (Indexer.Define): Add error 620 detection.
6196 (Operator.Define): Add error 590 detection.
6198 * ecore.cs: Missing argument for error 79.
6200 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6203 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6206 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6209 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6211 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6212 Some operator comments were suppressed.
6213 * doc.cs : Implicit/explicit operator name in doc comments are like
6214 "op_Explicit(type)~returnType", so added suffix handling.
6216 2005-01-21 Alp Toker <alp@atoker.com>
6218 * cs-parser.jay: destructor_declaration's container is PartialContainer
6219 not Class when partial types are used, so use Kind prop instead of 'is'.
6221 2004-12-12 Martin Baulig <martin@ximian.com>
6223 * expression.cs (Unary.TryReduceNegative): Added support for
6224 SByteConstant and ByteConstant.
6225 (Unary.Reduce): Check error values from TryReduceNegative().
6227 2004-12-11 Martin Baulig <martin@ximian.com>
6229 * support.cs (ReflectionParameters.ParameterName): If we have a
6230 `gpd', call `ParameterName' on it.
6232 * parameter.cs (Parameter.GetParameterAttributes): New static method.
6234 * pending.cs (PendingImplementation.DefineProxy): Call
6235 DefineParameter() for all of the MethodBuilder's arguments.
6237 2004-12-09 Martin Baulig <martin@ximian.com>
6239 * doc.cs (DocUtil): Make this a static class.
6241 2004-12-09 Martin Baulig <martin@ximian.com>
6243 * expression.cs (Invocation.InferType): Moved the type inference
6244 implementation into TypeManager.
6246 * generics.cs (TypeManager): Moved the type inference
6247 implementation here.
6249 2004-12-09 Martin Baulig <martin@ximian.com>
6251 * typemanager.cs (TypeManager): Make this a partial class.
6254 (TypeManager): Move the generics part of `TypeManager' here.
6256 2004-12-08 Martin Baulig <martin@ximian.com>
6258 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6259 instead of a CS3002 for properties and indexer. Added CS3024
6260 check for generic interfaces.
6262 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6263 instances are not CLS-compliant.
6265 2004-12-08 Martin Baulig <martin@ximian.com>
6268 (void_pointer_expression): New rule for `void*', `void**' etc.
6269 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
6271 2004-12-08 Martin Baulig <martin@ximian.com>
6273 * expression.cs (Invocation.InferType): Removed the hack for
6274 MethodCore.MayUnify().
6276 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6279 * class.cs (MethodCore.MayUnify): Use
6280 TypeManager.MayBecomeEqualGenericTypes().
6282 2004-12-08 Martin Baulig <martin@ximian.com>
6284 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6285 parameter, box it. Fixes #69233.
6287 2004-12-08 Martin Baulig <martin@ximian.com>
6289 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6290 have the ctor constraint. Fixes #68326.
6292 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6294 * cs-parser.jay : interface comment was not consumed because of
6295 extra opt_semicolon before doc handling.
6297 2004-12-03 Raja R Harinath <rharinath@novell.com>
6299 Fix test-327.cs, test-328.cs, and put in early infrastructure
6300 for eventually fixing #52697.
6301 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6302 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6304 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6305 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6306 (VerifyUsing, error246): Update.
6307 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6308 'NamespaceEntry.LookupNamespaceOrType'.
6310 2004-12-07 Martin Baulig <martin@ximian.com>
6312 * driver.cs: Call it "BETA SOFTWARE" :-)
6314 2004-12-06 Raja R Harinath <rharinath@novell.com>
6316 Fix crash on cs0657-17.cs.
6317 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6318 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6319 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6320 the case where the NamespaceEntry gets overwritten.
6322 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6324 Fixed #69195, #56821
6325 * ecore.cs (ResolveBoolean): Tiny refactoring.
6327 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6328 of right expression resolving when left is false constant and
6329 operator is LogicalAnd OR true constant and operator is LogicalOr.
6331 * statement.cs (ResolveUnreachable): Always reports warning.
6333 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6335 * class.cs: Distinguish between 1721 and 1722 (just a little help
6336 for the programmer).
6338 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6340 * delegate.cs: Only allow this on new versions of the language.
6342 2004-12-02 Duncan Mak <duncan@ximian.com>
6344 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6346 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6347 here as a static method. Take an additional bool out parameter
6348 `must_do_cs1540_check' for signaling to InstanceResolve.
6349 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6350 member field from PropertyExpr class and made it an argument of
6352 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6353 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6354 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6355 and `remove_accessor' as well as InstanceResolve: report CS0122
6360 2004-12-07 Martin Baulig <martin@ximian.com>
6362 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6363 and CS0692 where appropriate.
6365 2004-12-06 Martin Baulig <martin@ximian.com>
6367 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6368 IsDuplicateImplementation() and improved it.
6370 * expression.cs (Invocation.InferTypeArguments): Added
6371 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6372 and removed the "ref" modifier from `infered_types'.
6374 * decl.cs (MemberName.ToString): Removed the exception.
6376 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6378 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6379 comments are allowed.
6381 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6383 * delegate.cs: Add checks for subtypes in paramaters and return values
6384 in VerifyMethod () to add support for Covariance/Contravariance
6387 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6389 * report.cs: Remove extra closing parenthesis.
6391 * convert.cs (Error_CannotImplicitConversion): If the name of the
6392 types are the same, provide some extra information.
6394 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6397 * attribute.cs (Resolve): Improved implementation of params
6398 attribute arguments.
6400 * support.cs (ParameterData): Add HasParams to be faster.
6402 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6404 all things are for /doc support:
6406 * doc.cs: new file that supports XML documentation generation.
6407 * mcs.exe.sources: added doc.cs.
6409 Handle /doc command line option.
6410 Report error 2006 instead of 5 for missing file name for /doc.
6411 Generate XML documentation when required, after type resolution.
6413 Added support for picking up documentation (/// and /** ... */),
6414 including a new XmlCommentState enumeration.
6416 Added lines to fill Documentation element for field, constant,
6417 property, indexer, method, constructor, destructor, operator, event
6418 and class, struct, interface, delegate, enum.
6419 Added lines to warn incorrect comment.
6421 Added Documentation field (passed only when /doc was specified).
6423 Added DocComment, DocCommentHeader, GenerateDocComment() and
6424 OnGenerateDocComment() and some supporting private members for
6425 /doc feature to MemberCore.
6427 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6429 Added overriden DocCommentHeader.
6431 Added overriden DocCommentHeader and GenerateDocComment().
6433 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6435 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6436 unwrapping the enumeration values, chain to
6437 DoConstantNumericPromotions again, so we can promote things to the
6438 fundamental types (takes care of enums that are bytes, sbytes).
6442 2004-12-01 Raja R Harinath <rharinath@novell.com>
6444 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6445 Fix long-standing bug in type-lookup. Use FindType instead of
6446 LookupType when ec.ResolvingTypeTree.
6447 (Attribute.ResolveType, Attribute.Resolve)
6448 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6450 (Attributes.Search): Remove internal version. Update.
6451 (Attributes.SearchMulti): Update.
6452 (Attributes.GetClsCompliantAttribute): Remove.
6453 (Attributes.GetIndexerNameAttribute): Remove.
6454 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6455 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6456 * class.cs (Indexer.Define): Likewise.
6458 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6461 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6462 MarshallByReference members access.
6464 * expression.cs: Use CheckMarshallByRefAccess;
6465 Better error CS0197 message.
6467 * report.cs: Print whole related error message.
6469 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6471 * class (GetClassBases): Better error 60 report.
6472 (EventProperty): Disabled warning 67 detection.
6474 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6477 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6479 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6482 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6485 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6487 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6489 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6491 * attribute.cs (Attribute.Resolve): Refine error reporting and
6492 report a cs0117 if the identifier does not exist, to distinguish
6493 from 0617 which is a miss-use of the actual identifier.
6495 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6496 between cs0070 and cs0079.
6498 * class.cs (MemberBase.DoDefine): When reporting a wrong
6499 accessibility level, we use MethodCore to compare instead of
6500 Method (this was a regression in some refactoring effort).
6502 So now we correctly report cs0056 again.
6504 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6505 testing the target_type (which was known to be object_type) and
6506 not the source type (which is anonymous_method).
6508 Fixed reporting of error cs1660.
6510 * expression.cs (UserCast.Source): Expose the underlying cast.
6512 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6513 allowed types to find a match to int32 first (most common).
6515 In addition, it ignores any ImplicitUserConversions that did an
6516 internal implicit conversion (as the switch statement allows only
6517 one integral conversion to exist).
6519 * class.cs (PartialContainer.Create): rename `name' to
6520 `member_name' for clarity. Then replace the string calls with a
6521 call to MemberName.GetPartialName, as now using
6522 MemberName.ToString is an error (this is due to the side effects
6523 it had, that were fixed in the past).
6525 This will restore the error reporting on a number of partial class
6526 errors that were missusing this (and getting an exception as a
6527 results, which is now just a plain textual warning, because
6528 yyparse debug output would crash otherwise).
6530 2004-11-26 Raja R Harinath <rharinath@novell.com>
6532 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6534 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6536 * rootcontext.cs (LookupType): Make sure to cache lookups that
6537 don't give us a negative result. This saves about 5% of corlib
6540 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6542 * report.cs (AbstractMessage.Print): messages are sent to stderr
6544 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6545 non-interface in the list of interfaces (at this point, either
6546 parent was properly set, or a base class is being listed in the
6547 interfaces section).
6549 This flags error 1722, and resolves the crash from bug 69259.
6551 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6553 * statement.cs (Using.EmitExpressionFinally): make this work right
6554 for valuetypes. Fixes 69926.
6556 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6558 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6559 converted to an enum" here, before we try to change the underlying
6560 type. This code exists, but it is a different code path than the
6561 one used while encoding constants.
6563 (ImplicitReferenceConversionExists): In addition, resynchronized
6564 the code here, so it matches the same code in
6565 ImplicitReferenceConversionExists for the `from any class-type S
6566 to any interface-type T'.
6568 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6570 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6572 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6574 * cs-parser.jay: Use verbosity accordingly.
6576 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6578 * expression.cs (Unary.ResolveOperator): Do not report warning;
6579 AddressOf reads from variable.
6581 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6583 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6587 * attribute.cs (Attributable): Removed CheckTargets.
6588 (Attributes.Emit): Explicit attribute targets are tested here.
6590 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6591 not enabled for interfaces.
6593 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6594 (GetAssemblyName): Ouch next bug there.
6596 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6598 * expression.cs: Error 275 added.
6600 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6602 Fix bug #69177 (Implemented decimal constant support)
6604 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6605 (BinaryFold): Add DecimalConstant.
6607 * const.cs (Define): Decimal constant
6609 (ChangeType): Add decimal type handling.
6610 (LookupConstantValue): Don't set value for decimal type but
6611 emit DecimalConstantAttribute. Needed for constant optimization.
6613 * constant.cs (ToDecimal): New method.
6614 (ConvertToDecimal): New method.
6615 (IntConstant): Implemented ConvertToDecimal.
6616 (DecimalConstant.Emit): Emit optimized version for decimals in
6619 * expression.cs (ResolveOperator): Changed order of constant
6620 reduction to work correctly with native types which have
6621 overloaded operators.
6622 (ResolveMemberAccess): Extract constant value from attribute
6625 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6627 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6628 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6629 (ChangeType): Decimal is special.
6630 (TypeToCoreType): Add decimal type.
6632 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6634 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6637 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6639 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6642 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6644 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6646 * pending.cs (PendingImplementation): Grab only interfaces.
6648 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6650 * statement.cs (ForeachHelperMethods): Add location member and
6651 error 202 detection.
6653 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6655 * expression.cs (DoResolveBase): Fixed wrong warning for out
6658 2004-12-04 Martin Baulig <martin@ximian.com>
6660 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6661 to check whether the conversion is ok.
6663 * typemanager.cs (TypeManager.GetTypeArguments): Just return
6664 `Type.EmptyTypes' if we're not a generic TypeContainer.
6666 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6668 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6669 old bug: when converting from the null literal to a pointer,
6670 return an EmptyCast, not the NullLiteral.
6672 This fixes #69921, the recent null_type changes probably made this
6675 2004-12-03 Martin Baulig <martin@ximian.com>
6677 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6678 method as our child, call AnonymousMethod.Compatible() on it.
6680 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6682 * class.cs (FieldBase): Use an unused bit field from the field to
6683 encode the `has_offset' property from the FieldMember. This saves
6684 a couple of Ks on bootstrap compilation.
6686 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6687 method as our child, return the AnonymousMethod resolved
6690 * expression.cs (New.DoResolve): Allow return values from
6691 NewDelegate to also include AnonymousMethods.
6695 2004-11-29 Raja R Harinath <rharinath@novell.com>
6697 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6699 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6700 System.Runtime.InteropServices._Exception, since it's a base
6701 interface of the core type System.Exception in the net_2_0 profile.
6703 2004-11-27 Martin Baulig <martin@ximian.com>
6705 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6707 2004-11-26 Raja R Harinath <rharinath@novell.com>
6709 * Makefile: Convert to use executable.make.
6710 * gmcs.exe.sources: New.
6712 2004-11-25 Martin Baulig <martin@ximian.com>
6714 * expression.cs (Invocation.InferType): Added support for byref types.
6716 2004-11-25 Martin Baulig <martin@ximian.com>
6718 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6719 in TypeManager.TypeToCoreType().
6721 2004-11-25 Martin Baulig <martin@ximian.com>
6723 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6724 "Dispose" method from the `current_type'.
6725 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6726 DoDefineMembers() instead of using the MethodBuilder; this is
6727 required for generic iterators.
6729 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6731 2004-11-24 Martin Baulig <martin@ximian.com>
6733 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6735 2004-11-20 Martin Baulig <martin@ximian.com>
6737 * expression.cs (Invocation.InferType): Correctly infer generic
6738 instances; see gen-103.cs.
6739 (Invocation.InferTypeArguments): If a generic method doesn't have
6740 any unbound type parameters, we don't need to infer anything.
6742 2004-11-19 Raja R Harinath <rharinath@novell.com>
6744 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6746 2004-11-17 Raja R Harinath <rharinath@novell.com>
6748 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6749 (TypeHandle.GetMemberCache): New.
6750 (TypeHandle.TypeHandle): Update.
6751 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6752 (TypeManager.LookupParentInterfacesCache):
6753 Rename from LookupInterfaceCache. Optimize slightly.
6754 (TypeManager.MemberLookup_FindMembers): Update.
6755 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6757 (AddCacheContents): Rename from AddHashtable.
6758 * class.cs (TypeContainer.parent_container): Remove.
6759 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6760 (TypeContainer.DoDefineMembers): Don't initialize it.
6761 Update to name changes.
6763 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6765 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6766 that factors the code to check access modifiers on override.
6768 (PropertyBase): Use the code here.
6770 Patch from Lluis S'anchez, fixes bug #69361.
6772 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6774 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6775 routine that is used to report the use of a captured variable
6776 whose address has been taken.
6778 There are two checks: one when variables are being captured and
6779 the other check is when the address of a variable is taken.
6781 (because an anonymous methods might be resolved before *or* after
6782 the address has been taken) and
6784 * expression.cs (Conditional.DoResolve): Remove the special
6785 casing that Martin added to trueExpr and falseExpr being both
6786 NullLiteral. We get the right behavior now just by introducing
6787 the null_type into the compiler.
6789 * convert.cs (ExplicitConversion): Change the code to use
6790 null_type instead of testing `expr is NullLiteral'.
6791 (ImplicitConversionStandard): use null_type too.
6792 (ImplicitReferenceConversionExists): use null_type too.
6793 (ImplicitReferenceConversion): use null_type too.
6795 * literal.cs: The type of `NullLiteral' is now null_type instead
6797 (Resolve): Set the type here.
6799 * typemanager.cs: Introduce null_type.
6801 2004-11-18 Martin Baulig <martin@ximian.com>
6804 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6806 2004-11-18 Martin Baulig <martin@ximian.com>
6808 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6810 2004-11-18 Martin Baulig <martin@ximian.com>
6812 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6813 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
6814 call ResolveConstructedType() on it to resolve it without checking
6816 (Constraints.ResolveTypes): Check them here.
6817 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6818 but don't check constraints.
6819 (ConstructedType.ResolveAsTypeTerminal): Override this and also
6820 check constraints here.
6821 (ConstructedType.ResolveConstructedType): New public method. This
6822 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6823 resolve ourselves without checking constraints.
6825 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6827 2004-11-18 Martin Baulig <martin@ximian.com>
6830 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6832 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6834 2004-11-18 Martin Baulig <martin@ximian.com>
6836 * ecore.cs (TypeExpr.ResolveType): Removed.
6837 (Expression.ResolveAsTypeTerminal): We always return a fully
6838 resolved `TypeExpr', so we can just access its `Type'.
6840 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6842 2004-11-17 Martin Baulig <martin@ximian.com>
6844 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6845 sure we don't return any unresolved TypeExpr's.
6846 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6848 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6850 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6851 unresolved `ConstructedType's.
6853 2004-11-17 Martin Baulig <martin@ximian.com>
6855 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6857 2004-11-17 Martin Baulig <martin@ximian.com>
6860 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6862 * decl.cs (DeclSpace.ResolveType): Removed.
6863 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6865 2004-11-17 Martin Baulig <martin@ximian.com>
6867 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6868 direction, like FindMembers() does. Fixes #69546, testcase is in
6871 2004-11-16 Martin Baulig <martin@ximian.com>
6873 This is based on a patch from Marek Safar, see bug #69082.
6874 Fixes bugs #63705 and #67130.
6876 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6877 method; create a MemberCache for an interface type and cache the
6880 * decl.cs (IMemberContainer.ParentContainer): Removed.
6881 (IMemberContainer.ParentCache): New property.
6882 (MemberCache.SetupCacheForInterface): Removed.
6883 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6884 to create a cache for an interface's "parent".
6886 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6889 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6891 * statement.cs: Avoid adding bools to a hashtable.
6893 2004-11-15 Martin Baulig <martin@ximian.com>
6895 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6897 2004-11-11 Martin Baulig <martin@ximian.com>
6899 * typemanager.cs (TypeManager.GetMethodName): New method.
6901 * class.cs (MethodData.Define): Include the generic arity in the
6902 name of an explicit interface; also add it to the method name.
6904 * pending.cs (PendingImplementation.InterfaceMethod): The method
6905 name now includes the generic arity.
6907 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6909 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6910 calling an unsafe method from a safe location.
6912 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6915 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6917 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6919 * namespace.cs (VerifyUsing): use GetPartialName instead of
6922 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6924 * statement.cs (Return.Resolve): Fix regression in typo: if
6925 `in_exc', we have to request a NeedReturnLabel, this was a typo
6926 introduced in the anonymous method check-in. Fixes #69131.
6928 * Indexers were using the ShortName when defining themselves,
6929 causing a regression in the compiler bootstrap when applying the
6930 patch from 2004-11-02 (first part), now they use their full name
6931 and the bug is gone.
6933 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6935 * driver.cs: Strip the path from the names of embedded resources. Fixes
6938 2004-11-04 Raja R Harinath <rharinath@novell.com>
6940 Fix error message regression: cs0104-2.cs.
6941 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6942 (AliasEntry.Resolve): Update.
6943 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6945 (RootContext.LookupType): Update.
6947 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6949 * cs-parser.jay: Add support for handling accessor modifiers
6950 * class: Add support port accessor modifiers and error checking,
6951 define PropertyMethod.Define as virtual (not abstract anymore)
6952 * ecore.cs: Add checking for proeprties access with access modifiers
6953 * iterators.cs: Modify Accessor constructor call based in the modified
6955 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6957 * expression.cs (StringConcat): Handle being called twice,
6958 as when we have a concat in a field init with more than two
6961 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6963 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6964 special case explicit implementations, we should always produce
6965 the .property or .event declaration.
6967 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6968 since it will not return correct data if people use this
6969 unresolved in the presence of using statements (see test-313).
6971 * class.cs (MethodData.Define): If we are an explicit interface
6972 implementation, set the method name to the full name of the
6973 interface plus the name of the method.
6975 Notice that using the method.MethodName.GetFullName() does not
6976 work, as it will only contain the name as declared on the source
6977 file (it can be a shorthand in the presence of using statements)
6978 and not the fully qualifed type name, for example:
6982 class D : ICloneable {
6983 object ICloneable.Clone () {
6987 Would produce a method called `ICloneable.Clone' instead of
6988 `System.ICloneable.Clone'.
6990 * namespace.cs (Alias.Resolve): Use GetPartialName.
6992 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6994 * cs-parser.jay: Add error 1055 report.
6996 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6998 * assign.cs (Assign.DoResolve): Only do the transform of
6999 assignment into a New if the types are compatible, if not, fall
7000 through and let the implicit code deal with the errors and with
7001 the necessary conversions.
7003 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7005 * cs-parser.jay: Add error 1031 report.
7007 * cs-tokenizer.cs: Add location for error 1038.
7009 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7011 * cs-parser.jay: Add error 1016 report.
7013 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7015 * cs-parser.jay: Add errors 1575,1611 report.
7017 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7019 * cs-parser.jay: Add error 1001 report.
7021 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7024 * attribute.cs (GetMarshal): Add method argument for
7025 caller identification.
7027 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7028 agument for GetMarshal and RuntimeMissingSupport.
7030 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7032 * attribute.cs (ExtractSecurityPermissionSet): Removed
7033 TypeManager.code_access_permission_type.
7035 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7037 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7039 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7040 for obsolete use of a variable here. Fixes regression on errors
7041 cs0619-25 and cs0619-26.
7043 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7045 Fix #62358, implemented security attribute encoding.
7047 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7048 Tests permitted SecurityAction for assembly or other types.
7049 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7050 data from SecurityPermissionAttribute to PermisionSet class.
7052 * class.cs (ApplyAttributeBuilder): Added special handling
7053 for System.Security.Permissions.SecurityAttribute based types.
7055 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7056 special handling for System.Security.Permissions.SecurityAttribute
7059 * enum.cs (ApplyAttributeBuilder): Added special handling
7060 for System.Security.Permissions.SecurityAttribute based types.
7062 * parameter.cs (ApplyAttributeBuilder): Added special handling
7063 for System.Security.Permissions.SecurityAttribute based types.
7065 * rootcontext.cs: Next 2 core types.
7067 * typemanager.cs (TypeManager.security_permission_attr_type):
7068 Built in type for the SecurityPermission Attribute.
7069 (code_access_permission_type): Build in type.
7071 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7073 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7074 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7075 all of this information into
7076 EmitContext.EmitCapturedVariableInstance.
7078 * codegen.cs (EmitCapturedVariableInstance): move here the
7079 funcionality of emitting an ldarg.0 in the presence of a
7080 remapping. This centralizes the instance emit code.
7082 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7083 then emit a load of this: it means that we have reached the
7084 topmost ScopeInfo: the one that contains the pointer to the
7085 instance of the class hosting the anonymous method.
7087 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7088 captures to the topmost CaptureContext.
7090 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7092 * expression.cs (LocalVariableReference): Move the knowledge about
7093 the iterators into codegen's EmitCapturedVariableInstance.
7095 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7097 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7098 all code paths return a value from an anonymous method (it is the
7099 same as the 161 error, but for anonymous methods).
7101 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7103 The introduction of anonymous methods in the compiler changed
7104 various ways of doing things in the compiler. The most
7105 significant one is the hard split between the resolution phase
7106 and the emission phases of the compiler.
7108 For instance, routines that referenced local variables no
7109 longer can safely create temporary variables during the
7110 resolution phase: they must do so from the emission phase,
7111 since the variable might have been "captured", hence access to
7112 it can not be done with the local-variable operations from the runtime.
7116 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7117 is a toplevel block.
7119 (ToplevelBlock): A new kind of Block, these are the blocks that
7120 are created by the parser for all toplevel method bodies. These
7121 include methods, accessors and anonymous methods.
7123 These contain some extra information not found in regular blocks:
7124 A pointer to an optional CaptureContext (for tracking captured
7125 local variables and parameters). A pointer to the parent
7128 (Return.Resolve): Catch missmatches when returning a value from an
7129 anonymous method (error 1662).
7130 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7133 (Break.Resolve): ditto.
7135 (SwitchLabel): instead of defining the labels during the
7136 resolution phase, we now turned the public ILLabel and ILLabelCode
7137 labels into methods called GetILLabelCode() and GetILLabel() that
7138 only define the label during the Emit phase.
7140 (GotoCase): Track the SwitchLabel instead of the computed label
7141 (its contained therein). Emit the code by using
7142 SwitchLabel.GetILLabelCode ().
7144 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7145 whether the Local has been captured or not.
7147 (LocalInfo.IsCaptured): New property, used to tell whether the
7148 local has been captured.
7150 * anonymous.cs: Vastly updated to contain the anonymous method
7153 The main classes here are: CaptureContext which tracks any
7154 captured information for a toplevel block and ScopeInfo used to
7155 track the activation frames for various local variables.
7157 Each toplevel block has an optional capture context associated
7158 with it. When a method contains an anonymous method both the
7159 toplevel method and the anonymous method will create a capture
7160 context. When variables or parameters are captured, they are
7161 recorded on the CaptureContext that owns them, for example:
7165 MyDelegate d = delegate {
7170 Here `a' will be recorded as captured on the toplevel
7171 CapturedContext, the inner captured context will not have anything
7172 (it will only have data if local variables or parameters from it
7173 are captured in a nested anonymous method.
7175 The ScopeInfo is used to track the activation frames for local
7176 variables, for example:
7178 for (int i = 0; i < 10; i++)
7179 for (int j = 0; j < 10; j++){
7180 MyDelegate d = delegate {
7185 At runtime this captures a single captured variable `i', but it
7186 captures 10 different versions of the variable `j'. The variable
7187 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7188 recorded on a child.
7190 The toplevel ScopeInfo will also track information like the `this'
7191 pointer if instance variables were referenced (this is necessary
7192 as the anonymous method lives inside a nested class in the host
7193 type of the method).
7195 (AnonymousMethod): Expanded to track the Toplevel, implement
7196 `AnonymousMethod.Compatible' to tell whether an anonymous method
7197 can be converted to a target delegate type.
7199 The routine now also produces the anonymous method content
7201 (AnonymousDelegate): A helper class that derives from
7202 DelegateCreation, this is used to generate the code necessary to
7203 produce the delegate for the anonymous method that was created.
7205 * assign.cs: API adjustments for new changes in
7206 Convert.ImplicitStandardConversionExists.
7208 * class.cs: Adjustments to cope with the fact that now toplevel
7209 blocks are of type `ToplevelBlock'.
7211 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7212 insteda of standard blocks.
7214 Flag errors if params arguments are passed to anonymous methods.
7216 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7217 `CurrentAnonymousMethod' which points to the current Anonymous
7218 Method. The variable points to the AnonymousMethod class that
7219 holds the code being compiled. It is set in the new EmitContext
7220 created for the anonymous method.
7222 (EmitContext.Phase): Introduce a variable and an enumeration to
7223 assist in enforcing some rules about when and where we are allowed
7224 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7225 only one that enfonces this right now).
7227 (EmitContext.HaveCaptureInfo): new helper method that returns
7228 whether we have a CapturedContext initialized.
7230 (EmitContext.CaptureVariable): New method used to register that a
7231 LocalInfo must be flagged for capturing.
7233 (EmitContext.CapturedParameter): New method used to register that a
7234 parameters must be flagged for capturing.
7236 (EmitContext.CapturedField): New method used to register that a
7237 field must be flagged for capturing.
7239 (EmitContext.HaveCapturedVariables,
7240 EmitContext.HaveCapturedFields): Return whether there are captured
7241 variables or fields.
7243 (EmitContext.EmitMethodHostInstance): This is used to emit the
7244 instance for the anonymous method. The instance might be null
7245 (static methods), this (for anonymous methods that capture nothing
7246 and happen to live side-by-side with the current method body) or a
7247 more complicated expression if the method has a CaptureContext.
7249 (EmitContext.EmitTopBlock): Routine that drives the emission of
7250 code: it will first resolve the top block, then emit any metadata
7251 and then emit the code. The split is done so that we can extract
7252 any anonymous methods and flag any captured variables/parameters.
7254 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7255 during this phase, the ILGenerator should not be used as labels
7256 and local variables declared here might not be accessible to any
7257 code that is part of an anonymous method.
7259 Exceptions to this include the temporary variables that are
7260 created by some statements internally for holding temporary
7263 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7266 (EmitContext.TemporaryReturn): This method is typically called
7267 from the Emit phase, and its the only place where we allow the
7268 ReturnLabel to be defined other than the EmitMeta. The reason is
7269 that otherwise we would have to duplicate a lot of logic in the
7270 Resolve phases of various methods that today is on the Emit
7273 (EmitContext.NeedReturnLabel): This no longer creates the label,
7274 as the ILGenerator is not valid during the resolve phase.
7276 (EmitContext.EmitThis): Extended the knowledge in this class to
7277 work in anonymous methods in addition to iterators.
7279 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7280 code is necessary on the stack to access the instance to a local
7281 variable (the variable will be accessed as a field).
7283 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7284 EmitContext.EmitAddressOfParameter): Routines to support
7285 parameters (not completed at this point).
7287 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7288 will also remove the parameters.
7290 * convert.cs (Convert): Define a `ConstantEC' which points to a
7291 null. This is just to prefity some code that uses
7292 ImplicitStandardConversion code and do not have an EmitContext
7295 The idea is to flag explicitly that at that point in time, it is
7296 known that the conversion will not trigger the delegate checking
7297 code in implicit conversions (which requires a valid
7300 Everywhere: pass new EmitContext parameter since
7301 ImplicitStandardConversionExists now requires it to check for
7302 anonymous method conversions.
7304 (Convert.ImplicitStandardConversionExists): If the type of an
7305 expression is the anonymous_method_type, and the type is a
7306 delegate, we invoke the AnonymousMethod.Compatible method to check
7307 whether an implicit conversion is possible.
7309 (Convert.ImplicitConversionStandard): Only do implicit method
7310 group conversions if the language level is not ISO_1.
7312 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7313 MethodInfo for the Invoke method. used by Delegate and
7316 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7317 method conversions if the target type is a delegate.
7319 Removed extra debugging nops.
7321 (LocalVariableReference): Turn the `local_info' into a public
7324 Add `prepared' field, the same hack used for FieldExprs to cope
7325 with composed assignments, as Local variables do not necessarily
7326 operate purely on the stack as they used to: they can be captured
7329 Add `temp' for a temporary result, like fields.
7331 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7333 It now copes with Local variables that are captured and emits the
7334 proper instance variable to load it from a field in the captured
7337 (ParameterReference.DoResolveBase): During the resolve phase,
7338 capture parameters if we are in an anonymous method.
7340 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7341 anonymous method, use the EmitContext helper routines to emit the
7342 parameter reference.
7344 * iterators.cs: Set RemapToProxy to true/false during the
7347 * parameters.cs (GetParameterByName): New helper method.
7349 * typemanager.cs (anonymous_method_type) a new type that
7350 represents an anonyous method. This is always an internal type,
7351 used as a fencepost to test against the anonymous-methodness of an
7354 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7356 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7358 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7360 2004-11-10 Martin Baulig <martin@ximian.com>
7362 * expression.cs (Invocation.BetterFunction): If two methods have
7363 equal parameter types, but only one of them is generic, the
7364 non-generic one wins.
7365 (New.DoResolve): Don't set `is_struct' to false if we're a generic
7366 instance; just use `Type.IsValueType' to determine whether
7367 something is a struct or not.
7368 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7369 so we can be called multiple times.
7371 2004-11-10 Martin Baulig <martin@ximian.com>
7373 * generic.cs (TypeParameter.DefineConstraints): New public method.
7374 (TypeParameter.CheckAccessLevel): Override this and return true.
7375 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7376 override ResolveType() anymore.
7377 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7379 2004-11-10 Martin Baulig <martin@ximian.com>
7381 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7382 call DeclSpace.ResolveNestedType() on it.
7384 2004-11-10 Martin Baulig <martin@ximian.com>
7386 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7387 non-null, call ParameterModifier() on it.
7389 2004-11-10 Martin Baulig <martin@ximian.com>
7392 (Iterators): Added `current_type' and `this_type' fields.
7393 (Iterators.DefineIterator): Create a new EmitContext and store it
7394 in `ec'; compute `this_type'.
7396 2004-11-10 Martin Baulig <martin@ximian.com>
7399 (TypeManager.IsPrivateAccessible): New public method.
7400 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7402 2004-11-10 Martin Baulig <martin@ximian.com>
7404 * class.cs (TypeContainer.DefineType): Call
7405 TypeBuilder.DefineGenericParameters() before resolving the type
7407 (MethodData.parent_method): New protected field.
7408 (MethodData..ctor): Added `MethodInfo parent_method' argument.
7409 (MethodData.Define): Compute `parent_method'.
7412 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7413 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7414 (DeclSpace.ec): New protected field; store the EmitContext here.
7415 (DeclSpace.EmitContext): New public property.
7416 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7417 (DeclSpace.ResolveNestedType): New public method.
7418 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7419 (DeclSpace.NestedAccessible): Added `Type tb' argument.
7420 (DeclSpace.FamilyAccessible): Likewise.
7421 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7422 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7425 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7428 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7429 (Enum.Emit): Don't create a new EmitContext.
7431 2004-10-18 Martin Baulig <martin@ximian.com>
7433 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7434 `Type' directly, but call ResolveType() on it.
7435 (Catch.Resolve): Likewise.
7436 (Foreach.Resolve): Likewise.
7438 2004-10-18 Martin Baulig <martin@ximian.com>
7440 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7441 `Type' directly, but call ResolveType() on it.
7442 (Probe.DoResolve): Likewise.
7443 (ArrayCreation.LookupType): Likewise.
7444 (TypeOf.DoResolve): Likewise.
7445 (SizeOf.DoResolve): Likewise.
7447 2004-10-18 Raja R Harinath <rharinath@novell.com>
7449 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7452 2004-10-17 John Luke <john.luke@gmail.com>
7454 * class.cs (Operator.GetSignatureForError): use CSharpName
7456 * parameter.cs (Parameter.GetSignatureForError): Returns
7457 correct name even if was not defined.
7459 2004-10-13 Raja R Harinath <rharinath@novell.com>
7462 * class.cs (TypeContainer.EmitContext): New property.
7463 (DefineNestedTypes): Create an emitcontext for each part.
7464 (MethodCore.DoDefineParameters): Use container's emitcontext.
7465 Pass type array to InternalParameters.
7466 (MemberBase.DoDefine): Use container's emitcontext.
7467 (FieldMember.Define): Likewise.
7468 (Event.Define): Likewise.
7469 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7470 Pass type array to InternalParameters.
7471 (SetIndexerMethod.GetParameterInfo): Likewise.
7472 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7473 * delegate.cs (Define): Pass emitcontext to
7474 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7475 array to InternalParameters.
7476 * expression.cs (ParameterReference.DoResolveBase): Pass
7477 emitcontext to GetParameterInfo.
7478 (ComposedCast.DoResolveAsTypeStep): Remove check on
7479 ec.ResolvingTypeTree.
7480 * parameter.cs (Parameter.Resolve): Change argument to
7481 EmitContext. Use ResolveAsTypeTerminal.
7482 (Parameter.GetSignature): Change argument to EmitContext.
7483 (Parameters.ComputeSignature): Likewise.
7484 (Parameters.ComputeParameterTypes): Likewise.
7485 (Parameters.GetParameterInfo): Likewise.
7486 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7487 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7488 * support.cs (InternalParameters..ctor): Remove variant that takes
7490 * typemanager.cs (system_intptr_expr): New.
7491 (InitExpressionTypes): Initialize it.
7493 2004-10-12 Chris Toshok <toshok@ximian.com>
7495 * cs-parser.jay: fix location for try_statement and catch_clause.
7497 2004-10-18 Martin Baulig <martin@ximian.com>
7499 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7500 `Type' directly, but call ResolveType() on it.
7501 (MemberBase.DoDefine): Likewise.
7503 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7504 `Type' directly, but call ResolveType() on it.
7505 (ComposedCast.DoResolveAsTypeStep): Likewise.
7507 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7508 `Type' directly, but call ResolveType() on it.
7510 2004-10-17 John Luke <john.luke@gmail.com>
7512 * class.cs (Operator.GetSignatureForError): use CSharpName
7514 * parameter.cs (Parameter.GetSignatureForError): Returns
7515 correct name even if was not defined.
7517 2004-10-13 Raja R Harinath <rharinath@novell.com>
7520 * class.cs (TypeContainer.EmitContext): New property.
7521 (DefineNestedTypes): Create an emitcontext for each part.
7522 (MethodCore.DoDefineParameters): Use container's emitcontext.
7523 Pass type array to InternalParameters.
7524 (MemberBase.DoDefine): Use container's emitcontext.
7525 (FieldMember.Define): Likewise.
7526 (Event.Define): Likewise.
7527 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7528 Pass type array to InternalParameters.
7529 (SetIndexerMethod.GetParameterInfo): Likewise.
7530 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7531 * delegate.cs (Define): Pass emitcontext to
7532 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7533 array to InternalParameters.
7534 * expression.cs (ParameterReference.DoResolveBase): Pass
7535 emitcontext to GetParameterInfo.
7536 (ComposedCast.DoResolveAsTypeStep): Remove check on
7537 ec.ResolvingTypeTree.
7538 * parameter.cs (Parameter.Resolve): Change argument to
7539 EmitContext. Use ResolveAsTypeTerminal.
7540 (Parameter.GetSignature): Change argument to EmitContext.
7541 (Parameters.ComputeSignature): Likewise.
7542 (Parameters.ComputeParameterTypes): Likewise.
7543 (Parameters.GetParameterInfo): Likewise.
7544 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7545 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7546 * support.cs (InternalParameters..ctor): Remove variant that takes
7548 * typemanager.cs (system_intptr_expr): New.
7549 (InitExpressionTypes): Initialize it.
7551 2004-10-12 Chris Toshok <toshok@ximian.com>
7553 * cs-parser.jay: fix location for try_statement and catch_clause.
7555 2004-10-07 Raja R Harinath <rharinath@novell.com>
7557 More DeclSpace.ResolveType avoidance.
7558 * decl.cs (MemberCore.InUnsafe): New property.
7559 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7560 with newly created EmitContext.
7561 (FieldMember.Define): Likewise.
7562 * delegate.cs (Delegate.Define): Likewise.
7563 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7564 only if normal name-lookup fails.
7565 (TypeExpr.DoResolve): Enable error-checking.
7566 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7567 (SizeOf.DoResolve): Likewise.
7568 (ComposedCast.DoResolveAsTypeStep): Likewise.
7569 (StackAlloc.DoResolve): Likewise.
7570 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7571 (Block.Unsafe): New property.
7572 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7573 (Unsafe): Set 'unsafe' flag of contained block.
7574 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7575 (Fixed.Resolve): Likewise.
7576 (Catch.Resolve): Likewise.
7577 (Using.ResolveLocalVariableDecls): Likewise.
7578 (Foreach.Resolve): Likewise.
7580 2004-10-05 John Luke <john.luke@gmail.com>
7582 * cs-parser.jay: add location to error CS0175
7584 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7586 * ecore.cs (Expression.Constantity): Add support for turning null
7589 * const.cs (Const.Define): Allow constants to be reference types
7590 as long as the value is Null.
7592 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7594 * namespace.cs (NamespaceEntry.Using): No matter which warning
7595 level is set, check if this namespace name has already been added.
7597 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7599 * expression.cs: reftype [!=]= null should always use br[true,false].
7602 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7605 * attribute.cs: Enum conversion moved to
7606 GetAttributeArgumentExpression to be applied to the all
7609 2004-10-01 Raja R Harinath <rharinath@novell.com>
7611 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7612 * class.c (TypeContainer.DefineType): Flag error if
7613 base types aren't accessible due to access permissions.
7614 * decl.cs (DeclSpace.ResolveType): Move logic to
7615 Expression.ResolveAsTypeTerminal.
7616 (DeclSpace.ResolveTypeExpr): Thin layer over
7617 Expression.ResolveAsTypeTerminal.
7618 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7619 Refactor code into NestedAccess. Use it.
7620 (DeclSpace.NestedAccess): New.
7621 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7622 argument to silence errors. Check access permissions.
7623 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7624 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7625 (Cast.DoResolve): Likewise.
7626 (New.DoResolve): Likewise.
7627 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7628 (TypeOf.DoResolve): Likewise.
7630 * expression.cs (Invocation.BetterConversion): Return the Type of
7631 the better conversion. Implement section 14.4.2.3 more faithfully.
7632 (Invocation.BetterFunction): Make boolean. Make correspondence to
7633 section 14.4.2.2 explicit.
7634 (Invocation.OverloadResolve): Update.
7635 (Invocation): Remove is_base field.
7636 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7637 (Invocation.Emit): Likewise.
7639 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7641 * cs-parser.jay: Reverted 642 warning fix.
7643 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7646 * decl.cs (FindMemberWithSameName): Indexer can have more than
7649 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7651 * expression.cs (LocalVariableReference.DoResolveLValue):
7652 Do not report warning 219 for out values.
7653 (EmptyExpression.Null): New member to avoid extra allocations.
7655 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7657 * cs-parser.jay: Fix wrong warning 642 report.
7659 * cs-tokenizer.cs (CheckNextToken): New helper;
7660 Inspect next character if is same as expected.
7662 2004-09-23 Martin Baulig <martin@ximian.com>
7664 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7665 (Convert.ImplicitReferenceConversionExists): Likewise.
7667 2004-11-09 Raja R Harinath <rharinath@novell.com>
7669 * Makefile (DISTFILES): Comment out a few missing files.
7671 2004-10-29 Raja R Harinath <rharinath@novell.com>
7673 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7674 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
7675 (gmcs.exe): Invoke bootstrap-libs.
7676 (clean-local): Clean the net_2_0_bootstrap profile too.
7677 (PROGRAM_INSTALL_DIR): New.
7678 (install-local): Use it.
7680 2004-10-13 Martin Baulig <martin@ximian.com>
7682 * generic.cs (TypeManager.InflatedConstraints): New nested class.
7683 (TypeParameter.DefineType): If we're a method type parameter and
7684 that method is overriding something, "inflate" its constraints.
7686 2004-10-12 Martin Baulig <martin@ximian.com>
7688 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7689 and have type arguments, create and resolve a ConstructedType.
7691 2004-10-12 Martin Baulig <martin@ximian.com>
7693 * decl.cs (MemberCache.FindMemberToOverride): Use
7694 TypeManager.IsEqual() to compare the parameters and Type.Equals()
7695 to compare the invocationType.
7697 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7698 When comparing two type parameters, only do the signature-only
7699 comparision for method type parameters.
7701 2004-10-11 Martin Baulig <martin@ximian.com>
7703 * report.cs: Don't make --fatal abort on warnings, we have
7704 -warnaserror for that.
7706 2004-10-11 Martin Baulig <martin@ximian.com>
7709 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7710 (TypeManager.IsEqual): Call ourself recursively instead of using
7713 2004-10-11 Martin Baulig <martin@ximian.com>
7715 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7716 on our own type parameters, not on the ones we inherit from a containing
7719 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7722 * generic.cs (TypeParameter.Define): We may only be called once.
7724 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7725 instead of TypeManager.IsEqual().
7727 2004-09-28 Martin Baulig <martin@ximian.com>
7730 (GenericConstraints.EffectiveBaseClass): New public property.
7731 (TypeParameter.GenericConstraints): New public property.
7732 (ConstructedType.CheckConstraints): Improved.
7734 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7735 (Convert.TypeParameterConversion): New private method; use this in
7736 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7737 for all conversions related to type parameters.
7739 2004-09-24 Martin Baulig <martin@ximian.com>
7741 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7742 type parameter conversions for type parameters which are known to
7745 2004-09-24 Martin Baulig <martin@ximian.com>
7747 * generic.cs (GenericConstraints): Added `IsReferenceType' and
7748 `IsValueType' properties.
7750 * support.cs (ReflectionConstraints): Use
7751 Type.GetGenericParameterConstraints() instead of the old hack.
7753 2004-09-24 Martin Baulig <martin@ximian.com>
7755 * generic.cs (GenericConstraints): Moved here and made it an
7758 * support.cs (GenericConstraints): Moved to generic.cs.
7760 2004-09-24 Martin Baulig <martin@ximian.com>
7763 (ReflectionConstraints): Un-nested this class and made it public.
7766 (TypeManager.GetTypeParameterConstraints): New public method.
7767 (TypeManager.HasConstructorConstraint): Use the attributes.
7769 2004-09-24 Martin Baulig <martin@ximian.com>
7771 * support.cs (GenericConstraints): Replaced `HasConstructor',
7772 `IsReferenceType' and `IsValueType' with `Attributes'.
7773 (ReflectionParameters.ReflectionConstraints): Removed the Create()
7774 method and made the .ctor public.
7776 * generic.cs (Constraints.Attributes): New public property.
7777 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7778 `IsReferenceType' -> `HasReferenceTypeConstraint' and
7779 `IsValueType' -> `HasValueTypeConstraint'.
7781 2004-09-23 Martin Baulig <martin@ximian.com>
7783 * generic.cs (Constraints): Reflect latest runtime changes.
7785 2004-09-23 Martin Baulig <martin@ximian.com>
7787 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7788 (Convert.ImplicitReferenceConversionExists): Likewise.
7790 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7792 * class.cs (Operator.Define): Add error 448 and 559 report.
7794 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7796 * class.cs (MemberBase.IsTypePermitted): New protected
7797 method for checking error CS0610.
7799 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7801 * class.cs (TypeContainer.HasExplicitLayout): New property
7802 Returns whether container has StructLayout attribute set Explicit.
7803 (FieldMember): New abstract class for consts and fields.
7804 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7805 (Field): Reuse FieldMember.
7807 * const.cs (Const): Reuse FieldMember.
7809 * rootcontext.cs: EmitConstants call moved to class.
7811 2004-09-22 Martin Baulig <martin@ximian.com>
7813 Marek and me just fixed one of our oldest bugs: #28562 :-)
7815 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7817 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7818 we're an EnumConstant, just return that.
7819 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7820 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7821 to get the value which'll actually be written into the attribute.
7822 However, we have to use GetValue() to access the attribute's value
7825 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7827 * constant.cs (Constant.IsNegative): New abstract property
7830 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7831 (StackAlloc.DoResolve): Reused IsNegative.
7833 2004-09-22 Martin Baulig <martin@ximian.com>
7835 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7836 public method; like LookupTypeContainer, but also works for
7839 * report.cs (Report.SymbolRelatedToPreviousError): Use
7840 TypeManager.LookupGenericTypeContainer().
7842 2004-09-22 Martin Baulig <martin@ximian.com>
7844 Thanks to Peter Sestoft for this bug report.
7846 * expression.cs (Conditional): If both the `trueExpr' and the
7847 `falseExpr' is a NullLiteral, return a NullLiteral.
7849 2004-09-22 Martin Baulig <martin@ximian.com>
7851 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7852 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7853 for the "get_Current" call.
7855 2004-09-21 Martin Baulig <martin@ximian.com>
7857 * convert.cs (Convert.ImplicitReferenceConversion): When
7858 converting to an interface type, first check whether we're
7859 converting from a reference type.
7861 2004-09-14 Martin Baulig <martin@ximian.com>
7863 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7865 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7868 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7869 called and is obsolete then this member suppress message
7870 when call is inside next [Obsolete] method or type.
7872 * expression.cs: Use TestObsoleteMethodUsage member.
7874 2004-09-14 Martin Baulig <martin@ximian.com>
7876 * genericparser.cs: Removed.
7878 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7880 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7882 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7884 * attribute.cs (Attribute.Resolve): Add error 653 report.
7886 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7888 (Method.ApplyAttributeBuilder): Add error 685 report.
7889 (Operator.Define): Add error 564 report.
7891 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7893 * expression.cs (Invocation.DoResolve): Add error
7896 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7899 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7901 * class.cs (ConstructorInitializer.Resolve):
7902 Wrong error number (515->516).
7904 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7906 * class.cs (Indexer.Define): Add error 631 report.
7908 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7910 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7912 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7914 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7916 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7918 * cs-parser.jay: Added error CS0241 report.
7920 2004-09-10 Raja R Harinath <rharinath@novell.com>
7922 * cs-parser.jay (fixed_statement): Introduce a scope for the
7923 declaration in the 'fixed' statement.
7925 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7927 * cs-parser.jay: Added CS0230 error report.
7929 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7931 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7933 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7935 * expression.cs (Argument.Resolve): Added error CS0192 and
7938 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7940 C# 2.0 #pragma warning feature
7942 * cs-tokenizer.cs (PreProcessPragma): New method;
7943 Handles #pragma directive.
7945 * report.cs (WarningRegions): New class; Support
7946 class for #pragma warning directive. It tests whether
7947 warning is enabled for a given line.
7949 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7951 * const.cs: Add more descriptive error report, tahnks to
7954 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7956 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7958 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7960 * expression.cs: Apply patch from Ben: Remove dead code from
7961 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7962 as that code just threw an exception anwyays.
7964 * const.cs: Remove the call to the turnintoconstant, for details
7967 * literal.cs: The type of the null-literal is the null type; So
7968 we use a placeholder type (literal.cs:System.Null, defined here)
7971 * expression.cs (Conditional.DoResolve): Remove some old code that
7972 is no longer needed, conversions have been fixed.
7974 (ArrayCreationExpression.DoResolve): Return false if we fail to
7975 resolve the inner expression.
7977 2004-09-07 Raja R Harinath <rharinath@novell.com>
7980 * cs-parser.jay (delegate_declaration): Record a delegate
7981 declaration as a type declaration.
7982 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7984 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7986 * parameter.cs: Do not crash if the type can not be resolved.
7988 * expression.cs: Report errors with unsafe pointers, fixes #64896
7990 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7992 * expression.cs: Pointer arith always needs to do a conv.i
7993 if the operand is a long. fix 65320
7995 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7997 Fixed cs0619-37.cs, cs0619-38.cs
7999 * enum.cs (GetObsoleteAttribute): Removed.
8001 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8002 on Enum member is double staged. The first is tested member
8005 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8007 Fixed #56986, #63631, #65231
8009 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8010 adds member to name container.
8011 (TypeContainer.AddToTypeContainer): New method, adds type to
8013 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8014 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8015 AddOperator): Simplified by reusing AddToMemberContainer.
8016 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8018 (Method.CheckForDuplications): Fixed implementation to test all
8020 (MemberBase): Detection whether member is explicit interface
8021 implementation is now in constructor.
8022 (MemberBase.UpdateMemberName): Handles IndexerName.
8023 (Accessor): Changed to keep also location information.
8024 (AbstractPropertyEventMethod): Is derived from MemberCore.
8025 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8026 will be emited or not.
8027 (PropertyBase.AreAccessorsDuplicateImplementation):
8028 Tests whether accessors are not in collision with some method.
8029 (Operator): Is derived from MethodCore to simplify common
8032 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8034 (DeclSpace.AddToContainer): Adds the member to defined_names
8035 table. It tests for duplications and enclosing name conflicts.
8037 * enum.cs (EnumMember): Clean up to reuse the base structures
8039 2004-09-03 Martin Baulig <martin@ximian.com>
8041 Merged latest changes into gmcs. Please keep this comment in
8042 here, it makes it easier for me to see what changed in MCS since
8043 the last time I merged.
8045 2004-09-03 Martin Baulig <martin@ximian.com>
8047 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8048 into TypeContainer, to make partial classes work again.
8050 2004-09-03 Martin Baulig <martin@ximian.com>
8052 * rootcontext.cs (RootContext.V2): Removed.
8054 2004-03-23 Martin Baulig <martin@ximian.com>
8056 * expression.cs (Invocation.OverloadResolve): Added `bool
8057 may_fail' argument and use it instead of the Location.IsNull() hack.
8059 2004-09-09 Martin Baulig <martin@ximian.com>
8061 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8063 2004-09-09 Martin Baulig <martin@ximian.com>
8065 * generic.cs (TypeParameter.DefineType): Added support for
8066 explicit interface methods.
8068 2004-09-09 Martin Baulig <martin@ximian.com>
8070 * README.Changes: New document. Started to list important changes
8071 between MCS and GMCS here.
8073 2004-09-08 Martin Baulig <martin@ximian.com>
8076 (TypeContainer.CheckRecursiveDefinition): New protected method.
8077 (TypeContainer.DefineType): Move the CS0146 check into
8078 CheckRecursiveDefinition().
8080 2004-09-06 Martin Baulig <martin@ximian.com>
8082 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8083 types for the constructor constraint.
8085 2004-09-03 Martin Baulig <martin@ximian.com>
8087 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8088 into TypeContainer, to make partial classes work again.
8090 2004-09-03 Martin Baulig <martin@ximian.com>
8092 * rootcontext.cs (RootContext.V2): Removed.
8094 2004-03-23 Martin Baulig <martin@ximian.com>
8096 * expression.cs (Invocation.OverloadResolve): Added `bool
8097 may_fail' argument and use it instead of the Location.IsNull() hack.
8099 2004-09-03 Martin Baulig <martin@ximian.com>
8101 Merged latest changes into gmcs. Please keep this comment in
8102 here, it makes it easier for me to see what changed in MCS since
8103 the last time I merged.
8105 2004-09-03 Raja R Harinath <rharinath@novell.com>
8108 * expression.cs (BetterConversion): Don't allow either conversion
8109 to be null. Remove redundant implicit conversion test when 'q ==
8110 null' -- when this function is invoked, we already know that the
8111 implicit conversion exists.
8112 (BetterFunction): Assume that 'best' is non-null. Remove
8113 redundant reimplementation of IsApplicable when 'best' is null.
8114 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8115 number of arguments.
8116 (IsAncestralType): Extract from OverloadResolve.
8117 (OverloadResolve): Make robust to the MethodGroupExpr being
8118 unsorted. Implement all the logic of Section 14.5.5.1, and
8119 support overloading of methods from multiple applicable types.
8120 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8122 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8123 (RealError, Warning): Append type of report to related symbol.
8125 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8127 * enum.cs: Fixed CLS-Compliance checks for enum members.
8128 Error tests cs3008-8.cs, cs3014-8.cs
8130 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8132 Fixed bug #62342, #63102
8133 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8134 like ImplementMethod.
8136 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8138 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8141 2004-09-02 Martin Baulig <martin@ximian.com>
8143 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8144 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8147 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8149 C# 2.0 Static classes implemented
8151 * class.cs (TypeContainer): instance_constructors,
8152 initialized_fields, initialized_static_fields,
8153 default_constructor, base_inteface_types are protected to be
8154 accessible from StaticClass.
8155 (TypeContainer.DefineDefaultConstructor): New virtual method
8156 for custom default constructor generating
8157 (StaticClass): New class to handle "Static classes" feature.
8159 * cs-parser.jay: Handle static keyword on class like instance
8162 * driver.cs: Added "/langversion" command line switch with two
8163 options (iso-1, default).
8165 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8167 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8169 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8171 * delegate.cs: Style.
8173 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8175 * delegate.cs: Add seperate instance expr field for miguel.
8177 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8179 * PointerArithmetic (Resolve): make sure we are not doing
8180 pointer arith on void*. Also, make sure we are resolved
8181 by not setting eclass until resolve.
8183 All callers: Make sure that PointerArithmetic gets resolved.
8185 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8187 * ArrayCreation (LookupType): If the type does not resolve
8188 to an array, give an error.
8190 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8192 * statement.cs (Try.Resolve): Fixed bug #64222
8194 2004-08-27 Martin Baulig <martin@ximian.com>
8197 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8200 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8202 * ecore.cs (Constantify): Get underlying type via
8203 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8204 Windows in special cases.
8206 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8208 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8209 for obtaining also private methods.
8210 (GetRemoveMethod): Used GetRemoveMethod (true)
8211 for obtaining also private methods.
8213 2004-09-02 Martin Baulig <martin@ximian.com>
8215 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8216 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8219 2004-08-27 Martin Baulig <martin@ximian.com>
8222 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8225 2004-08-25 Martin Baulig <martin@ximian.com>
8227 * support.cs (ReflectionParameters..ctor): If this is a generic
8228 method, retrieve and store its type parameters.
8229 (InternalParameters..ctor): Added `TypeParameter[]' argument.
8230 (ReflectionParameters.GenericConstraints): The argument specifies
8231 the type parameter, not the method parameter.
8232 (InternalParameters.GenericConstraints): Likewise.
8234 * generic.cs (TypeParameter.DefineType): Correctly handle
8235 constraints wrt. generic methods in interfaces and their
8238 2004-08-24 Martin Baulig <martin@ximian.com>
8240 * generic.cs (TypeParameter.IsSubclassOf): New public method.
8241 (Constraints.IsSubclassOf): New internal method.
8243 * typemanager.cs (TypeManager.FindMembers): Added special support
8244 for GenericTypeParameterBuilder's.
8245 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8248 2004-08-24 Martin Baulig <martin@ximian.com>
8251 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8252 this for accessibility checks.
8253 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8254 IsNestedFamilyAccessible.
8255 (TypeManager.IsSubclassOf): New method, do what the name actually
8258 2004-08-24 Martin Baulig <martin@ximian.com>
8260 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8261 as a SimpleName, include the generic arity.
8263 2004-08-24 Martin Baulig <martin@ximian.com>
8265 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8266 MethodAttributes.HideBySig for operators.
8268 2004-08-23 Martin Baulig <martin@ximian.com>
8270 Back to the old error reporting system :-)
8272 * report.cs (Message): Removed.
8273 (Report.MessageData, ErrorData, WarningData): Removed.
8274 (Report.Error, Warning): Back to the old system.
8276 2004-08-23 Martin Baulig <martin@ximian.com>
8278 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8280 * class.cs (TypeContainer.ParentContainer): New public virtual
8281 method; replaces the explicit interface implementation.
8282 (ClassPart.ParentContainer): Override.
8284 2004-08-23 Martin Baulig <martin@ximian.com>
8286 * statement.cs (Switch): Added support for constant switches; see
8287 #59428 or test-285.cs.
8289 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8292 * statement.cs (GetEnumeratorFilter): Removed useless
8293 logic because C# specs is strict. GetEnumerator must be
8296 2004-08-22 Martin Baulig <martin@ximian.com>
8298 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8299 a switch and may break, reset the barrier. Fixes #59867.
8301 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8303 CLS-Compliance speed up (~5% for corlib)
8305 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8306 New method. Tests container for CLS-Compliant names
8308 * class.cs (TypeContainer.VerifyClsName): New method.
8309 Checks whether container name is CLS Compliant.
8310 (Constructor): Implements IMethodData.
8312 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8313 low-case table for CLS Compliance test.
8314 (MemberCache.VerifyClsParameterConflict): New method.
8315 Checks method parameters for CS3006 error.
8317 * enum.cs (EnumMember): Is derived from MemberCore.
8318 (Enum.VerifyClsName): Optimized for better performance.
8320 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8322 * report.cs: Renamed Error_T to Error and changed all
8325 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8327 * class.cs (TypeContainer.IndexerArrayList): New inner class
8328 container for indexers.
8329 (TypeContainer.DefaultIndexerName): New constant for default
8330 indexer name. Replaced all "Item" with this constant.
8331 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8333 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8334 DefaultMemberAttribute constructor.
8336 2004-08-05 Martin Baulig <martin@ximian.com>
8338 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8341 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8343 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8344 multi platforms problem.
8346 * compiler.csproj: Included shared files.
8348 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8350 Fix bug 60333, 55971 in the more general way
8351 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8352 Added arg_type argument for constant conversion.
8353 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8355 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8358 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8359 OperatorArrayList, MethodCoreArrayList for typecontainer
8360 containers. Changed class member types to these new types.
8361 (MethodArrayList.DefineMembers): Added test for CS0659.
8363 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8365 * cfold.cs: Synchronize the folding with the code in expression.cs
8366 Binary.DoNumericPromotions for uint operands.
8368 * attribute.cs: Revert patch from Raja, it introduced a regression
8369 while building Blam-1.2.1 (hard to isolate a test case).
8371 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8375 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8377 (MethodCore.parent_method): New member. The method we're overriding
8378 if this is an override method.
8379 (MethodCore.CheckBase): Moved from Method class and made common.
8380 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8382 (MethodCore.CheckForDuplications): New abstract method. For custom
8383 member duplication search in a container
8384 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8385 method and its return type.
8386 (Event.conflict_symbol): New member. Symbol with same name in the
8390 (MemberCache.FindMemberWithSameName): New method. The method
8391 is looking for conflict with inherited symbols.
8393 2004-08-04 Martin Baulig <martin@ximian.com>
8395 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8397 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8399 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8401 * report.cs (Message): New enum for better error, warning reference in
8403 (MessageData): New inner abstract class. It generally handles printing of
8404 error and warning messages.
8405 Removed unused Error, Warning, Message methods.
8407 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8409 Fix for cs0592-8.cs test
8411 (Attributable.ValidAttributeTargets): Made public.
8412 (Attribute.ExplicitTarget): New member for explicit target value.
8413 (Attribute.CheckTargets): Now we translate explicit attribute
8414 target to Target here.
8416 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8418 * ecore.cs (MethodGroupExpr): new IsBase property.
8420 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8422 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8423 rather than an instance expr.
8425 (DelegateCreation.Emit): Use the method group rather than
8426 the instance expression. Also, if you have base.Foo as the
8427 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8429 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8431 (NewDelegate.DoResolve): Only check for the existance of Invoke
8432 if the method is going to be needed. Use MethodGroupExpr.
8434 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8436 * expression.cs: For pointer arith., make sure to use
8437 the size of the type, not the size of the pointer to
8440 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8443 * class.cs (Class): Added error CS0502 test.
8445 2004-08-03 John Luke <jluke@cfl.rr.com>
8446 Raja R Harinath <rharinath@novell.com>
8449 * attribute.cs (Attribute.complained_before): New flag.
8450 (Attribute.ResolveType, Attribute.Resolve),
8451 (Attribute.DefinePInvokeMethod): Set it.
8452 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8454 2004-08-03 Martin Baulig <martin@ximian.com>
8456 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8457 use a user-defined operator; we still need to do numeric
8458 promotions in case one argument is a builtin type and the other
8459 one has an implicit conversion to that type. Fixes #62322.
8461 2004-08-18 Martin Baulig <martin@ximian.com>
8463 * class.cs (Method.Define): Use the correct method name when
8464 creating the MethodBuilder for a generic method.
8466 2004-08-17 Martin Baulig <martin@ximian.com>
8468 * generic.cs (Constraints): Support type parameter constraints.
8470 2004-08-16 Martin Baulig <martin@ximian.com>
8472 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8473 (Token.GENERIC_DIMENSION): New token; this is returned if we
8474 encounter an unbound generic type in a typeof() expression.
8476 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8477 this token is only generated while parsing a typeof() expression.
8478 (typeof_expression): Removed the old unbound_type hack.
8480 * generic.cs (TypeArguments.IsUnbound): New public property.
8482 * decl.cs (MemberName): Added support for unbound types.
8484 2004-08-14 Martin Baulig <martin@ximian.com>
8487 (TypeManager.IsEqualGenericInstance): New static method.
8488 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8489 just used to check accessibility, so follow the rules of 26.1.6.
8491 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8492 ConstructedType instead of a TypeExpression if we have type arguments.
8494 * cs-parser.jay (typeof_expression): Support unbound generic types.
8496 * ecore.cs (UnboundTypeExpression): New public class.
8498 2004-08-12 Martin Baulig <martin@ximian.com>
8500 * typemanager.cs (TypeManager.IsNestedChildOf): Use
8501 TypeManager.IsEqual() rather than `=='.
8503 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8504 generic instances as well.
8506 2004-08-12 Martin Baulig <martin@ximian.com>
8508 * expression.cs (Invocation.InferType): We can only infer method
8509 type parameters. Fixes #62647.
8511 2004-08-11 Martin Baulig <martin@ximian.com>
8513 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8514 before resolving the base classes.
8516 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8518 * Makefile: install .mdb file too.
8520 2004-08-05 Martin Baulig <martin@ximian.com>
8522 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8523 initializer, the current type is just the TypeBuilder, not the
8524 instantiated generic type.
8525 (FieldExpr.IsFieldInitializer): New public property.
8527 2004-08-04 Martin Baulig <martin@ximian.com>
8529 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8531 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8533 2004-08-03 Martin Baulig <martin@ximian.com>
8535 * class.cs (MethodData.Define): If we're an explicit
8536 implementation, remove the generic arity from the type name.
8538 2004-08-03 Martin Baulig <martin@ximian.com>
8540 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8541 use a user-defined operator; we still need to do numeric
8542 promotions in case one argument is a builtin type and the other
8543 one has an implicit conversion to that type. Fixes #62322.
8545 2004-08-02 Martin Baulig <martin@ximian.com>
8547 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8549 (TypeContainer.GetClassBases): Return the unexpanded list of
8550 interfaces; we expand them later.
8551 (TypeContainer.DefineType): After creating the TypeBuilder, call
8552 TypeManager.ExpandInterfaces() to get an expanded and resolved
8555 * ecore.cs (TypeExpr.GetInterfaces): Removed
8557 * generics.cs (Constraints.InterfaceConstraints): Remove.
8558 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8559 register the interface constraints.
8562 (TypeManager.AddUserType): Removed the `ifaces' argument.
8563 (TypeManager.AddTypeParameter): Likewise.
8564 (TypeManager.AddUserInterface): Removed, was unused.
8565 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8566 `TypeExpr[]' array for the interfaces.
8567 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8568 has been defined, returns a list of the resolved interfaces types.
8569 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8570 (TypeManager.GetExplicitInterfaces): Likewise.
8572 2004-08-02 Martin Baulig <martin@ximian.com>
8574 * expression.cs (Invocation.EmitCall): If we're invoking a method
8575 on a type parameter, use the new `Constrained' prefix opcode.
8577 2004-08-02 Martin Baulig <martin@ximian.com>
8579 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8580 (LocalInfo.IsThis): New public property.
8581 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8583 2004-08-01 Martin Baulig <martin@ximian.com>
8585 * class.cs (TypeContainer.GetClassBases): Don't set the default
8586 here since we may get called from GetPartialBases().
8587 (TypeContainer.DefineType): If GetClassBases() didn't return a
8588 parent, use the default one.
8590 2004-07-30 Martin Baulig <martin@ximian.com>
8592 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8594 * class.cs (SourceMethod): New public class, derive from the
8595 symbol writer's ISourceMethod.
8596 (Method): Use the new symbol writer API.
8598 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8599 as argument and use the new symbol writer.
8602 (SourceFile): Implement the symbol writer's ISourceFile.
8603 (Location.SymbolDocument): Removed.
8604 (Location.SourceFile): New public property.
8606 * symbolwriter.cs: Use the new symbol writer API.
8608 2004-07-30 Raja R Harinath <rharinath@novell.com>
8610 * Makefile (install-local): Remove. Functionality moved to
8613 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8615 * Makefile: Install mcs.exe.config file together with mcs.exe.
8616 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8617 correct runtime version.
8619 2004-07-25 Martin Baulig <martin@ximian.com>
8622 (TypeContainer.RegisterOrder): Removed, this was unused.
8623 (TypeContainer, interface_order): Removed.
8624 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8625 TypeContainer as argument since we can also be called with a
8626 `PartialContainer' for a partial class/struct/interface.
8627 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8628 of checking whether we're an `Interface' - we could be a
8630 (PartialContainer.Register): Override; call
8631 AddClass()/AddStruct()/AddInterface() on our parent.
8633 * cs-parser.jay (interface_member_declaration): Add things to the
8634 `current_container', not the `current_class'.
8636 * rootcontext.cs (RegisterOrder): The overloaded version which
8637 takes an `Interface' was unused, removed.
8639 * typemanager.cs (TypeManager.LookupInterface): Return a
8640 `TypeContainer', not an `Interface'.
8641 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8642 contain a `PartialContainer' for an interface, so check it's
8643 `Kind' to figure out what it is.
8645 2004-07-25 Martin Baulig <martin@ximian.com>
8647 * class.cs (Class.DefaultTypeAttributes): New public constant.
8648 (Struct.DefaultTypeAttributes): Likewise.
8649 (Interface.DefaultTypeAttributes): Likewise.
8650 (PartialContainer.TypeAttr): Override this and add the
8651 DefaultTypeAttributes.
8653 2004-07-25 Martin Baulig <martin@ximian.com>
8655 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8656 we can just use the `Parent' field instead.
8658 2004-07-25 Martin Baulig <martin@ximian.com>
8660 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8662 2004-07-25 Martin Baulig <martin@ximian.com>
8664 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8665 our parts before defining any methods.
8666 (TypeContainer.VerifyImplements): Make this virtual.
8667 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8668 on our PartialContainer.
8670 2004-07-25 Martin Baulig <martin@ximian.com>
8672 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8674 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8675 argument, we can just use the `Parent' field instead.
8678 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8679 (MemberBase.DoDefine): Likewise.
8681 2004-07-24 Martin Baulig <martin@ximian.com>
8683 * decl.cs (MemberCore.Parent): New public field.
8684 (DeclSpace.Parent): Moved to MemberCore.
8686 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8687 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8689 (FieldBase, Field, Operator): Likewise.
8690 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8691 (EventField, Event): Likewise.
8693 2004-07-23 Martin Baulig <martin@ximian.com>
8695 * class.cs (PartialContainer): New public class.
8696 (ClassPart): New public class.
8697 (TypeContainer): Added support for partial classes.
8698 (TypeContainer.GetClassBases): Splitted some of the functionality
8699 out into GetNormalBases() and GetPartialBases().
8701 * cs-tokenizer.cs (Token.PARTIAL): New token.
8702 (Tokenizer.consume_identifier): Added some hacks to recognize
8703 `partial', but only if it's immediately followed by `class',
8704 `struct' or `interface'.
8706 * cs-parser.jay: Added support for partial clases.
8708 2004-07-23 Martin Baulig <martin@ximian.com>
8710 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8711 a `DeclSpace' and also made it readonly.
8712 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8713 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8714 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8716 * cs-parser.jay: Pass the `current_class', not the
8717 `current_container' (at the moment, this is still the same thing)
8718 to a new Method, Property, Event, Indexer or Constructor.
8720 2004-07-23 Martin Baulig <martin@ximian.com>
8722 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8723 and removed the `current_interface' one.
8724 (struct_declaration, class_declaration, interface_declaration):
8725 Set `current_class' to the newly created class/struct/interface;
8726 set their `Bases' and call Register() before parsing their body.
8728 2004-07-23 Martin Baulig <martin@ximian.com>
8730 * class.cs (Kind): New public enum.
8731 (TypeContainer): Made this class abstract.
8732 (TypeContainer.Kind): New public readonly field.
8733 (TypeContainer.CheckDef): New public method; moved here from
8735 (TypeContainer.Register): New public abstract method.
8736 (TypeContainer.GetPendingImplementations): New public abstract
8738 (TypeContainer.GetClassBases): Removed the `is_class' and
8739 `is_iface' parameters.
8740 (TypeContainer.DefineNestedTypes): Formerly known as
8742 (ClassOrStruct): Made this class abstract.
8744 * tree.cs (RootTypes): New public type.
8746 2004-07-20 Martin Baulig <martin@ximian.com>
8748 * tree.cs (Tree.RecordNamespace): Removed.
8749 (Tree.Namespaces): Removed.
8751 * rootcontext.cs (RootContext.IsNamespace): Removed.
8753 * cs-parser.jay (namespace_declaration): Just create a new
8754 NamespaceEntry here.
8756 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
8758 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8759 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8760 entry to make sure it runs in the correct runtime version.
8762 2004-07-18 Martin Baulig <martin@ximian.com>
8764 * generic.cs (ConstructedType.CheckConstraints): Improved
8765 constraints checking.
8767 2004-07-18 Martin Baulig <martin@ximian.com>
8769 * expression.cs (Invocation.BetterMethod): Call
8770 TypeManager.TypeToCoreType() on all types and removed my previous
8771 hack; we're already doig the right thing here.
8773 2004-07-17 Martin Baulig <martin@ximian.com>
8775 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8777 2004-07-16 Martin Baulig <martin@ximian.com>
8779 * iterators.cs: Added generics support.
8781 2004-07-16 Martin Baulig <martin@ximian.com>
8783 * iterators.cs: Rewrote this. We're now using one single Proxy
8784 class for both the IEnumerable and the IEnumerator interface and
8785 `Iterator' derives from Class so we can use the high-level API.
8787 * class.cs (TypeContainer.AddIterator): New method.
8788 (TypeContainer.DoDefineType): New protected virtual method, which
8789 is called from DefineType().
8790 (TypeContainer.DoDefineMembers): Call DefineType() and
8791 DefineMembers() on all our iterators.
8792 (TypeContainer.Emit): Call Emit() on all our iterators.
8793 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8795 * codegen.cs (EmitContext.CurrentIterator): New public field.
8797 2004-07-15 Martin Baulig <martin@ximian.com>
8800 (TypeManager.not_supported_exception_type): New type.
8802 2004-07-14 Martin Baulig <martin@ximian.com>
8805 (TypeManager.generic_ienumerable_type): New type.
8806 (TypeManager.generic_ienumerator_type): New type.
8809 (RootContext.interfaces_first_stage): Added
8810 "System.Collections.Generic.IEnumerator`1" and
8811 "System.Collections.Generic.IEnumerable`1".
8813 2004-07-14 Martin Baulig <martin@ximian.com>
8815 * iterators.cs: Use real error numbers.
8817 2004-07-14 Martin Baulig <martin@ximian.com>
8819 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8820 requires this to be a System.Collection.IEnumerable and not a
8821 class implementing that interface.
8822 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8824 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8826 * class.cs: Fixed previous fix, it broke some error tests.
8828 2004-07-12 Martin Baulig <martin@ximian.com>
8830 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8833 2004-07-14 Martin Baulig <martin@ximian.com>
8835 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8836 an exclamation mark (!) for the generic arity to reflect the
8837 latest spec changes; ie. use "System.Collections.Generic.IList`1".
8839 2004-07-13 Martin Baulig <martin@ximian.com>
8841 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8842 specifiers being part of a type argument.
8844 2004-07-13 Martin Baulig <martin@ximian.com>
8846 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8847 name for generic types.
8849 2004-07-13 Martin Baulig <martin@ximian.com>
8851 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8854 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8856 * assign.cs (LocalTemporary): Add new argument: is_address,If
8857 `is_address' is true, then the value that we store is the address
8858 to the real value, and not the value itself.
8860 * ecore.cs (PropertyExpr): use the new local temporary
8861 stuff to allow us to handle X.Y += z (where X is a struct)
8863 2004-07-08 Martin Baulig <martin@ximian.com>
8865 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8866 not always return, just like we're doing in Using.Resolve().
8868 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8870 * cs-parser.jay (fixed_statement): flag this as Pinned.
8872 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8874 * typemanager.cs (TypeManager): Removed MakePinned method, this
8875 mechanism is replaced with the .NET 2.x compatible mechanism of
8876 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8878 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8879 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8880 `IsFixed' property which has a different meaning.
8882 2004-07-02 Raja R Harinath <rharinath@novell.com>
8884 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8885 visible from inside a nested class, not just the names of the
8886 immediately enclosing class.
8889 2004-06-24 Raja R Harinath <rharinath@novell.com>
8891 * expression.cs (BetterConversion): Remove buggy special-case
8892 handling of "implicit constant expression conversions". At this
8893 point, we already know that the conversion is possible -- we're
8894 only checking to see which is better.
8896 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8898 * cs-parser.jay: Added error CS0210 test.
8900 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8902 * cs-parser.jay: Added error CS0134 test.
8904 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8907 * cs-parser.jay: Added error CS0145 test.
8909 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8911 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8913 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8915 * expression.cs (StackAlloc.Resolve): The argument may not
8916 be a constant; deal with this case.
8918 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8920 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8921 GetIndexerAttributeValue.
8922 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8924 * class.cs (Indexer.Define): Added error tests for CS0415,
8927 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8929 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8932 2004-06-23 Martin Baulig <martin@ximian.com>
8934 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8935 neither return nor throw, reset the barrier as well. Fixes #60457.
8937 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8939 * class.cs : EventAttributes is now set to None by default.
8940 This fixes bug #60459.
8942 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8945 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8946 Don't throw exception but return null (it's sufficient now).
8948 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8950 * typemanager.cs (GetArgumentTypes): Faster implementation.
8952 2004-06-18 Martin Baulig <martin@ximian.com>
8954 * attribute.cs (Attribute.Resolve): Check whether we're an
8955 EmptyCast which a Constant child. Fixes #60333.
8957 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8959 * statement.cs (EmitCollectionForeach): Account for the fact that
8960 not all valuetypes are in areas which we can take the address of.
8961 For these variables, we store to a temporary variable. Also, make
8962 sure that we dont emit a `callvirt' on a valuetype method.
8964 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8966 * expression.cs (StackAlloc.DoReSolve): Added test for
8967 negative parameter (CS0247).
8969 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8972 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8974 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8977 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8980 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8982 Fix bug #58254 & cs1555.cs, cs1556.cs
8983 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8985 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8987 * cs-parser.jay: Added error CS1669 test for indexers.
8989 2004-06-18 Martin Baulig <martin@ximian.com>
8991 * generics.cs (GenericMethod.ctor): Don't take an Attributes
8992 argument. Fixes #60441.
8994 2004-06-16 Ben Maurer <bmaurer@ximian.com>
8995 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8996 The name needs to have the actual name of the method in order
8997 for other tests (such as the one in OverloadResolve for Invoke
8998 on a delegate) to work. As well, it does not really help
8999 error reporting because the method group had multiple methods.
9000 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9001 Make profiling work.
9003 2004-06-13 Martin Baulig <martin@ximian.com>
9005 * cs-parser.jay: Don't allow generic attributes.
9007 2004-06-13 Martin Baulig <martin@ximian.com>
9009 * class.cs (MemberBase.DoDefineBase): New protected method.
9010 (MemberBase.DoDefine): Compute the `flags' in the new
9011 DoDefineBase() which must be called first.
9012 (Method.Define): Call DoDefineBase() first so we have the flags
9013 when defining the generic method.
9015 * cs-parser.jay (interface_method_declaration): Support generic methods.
9017 2004-06-13 Martin Baulig <martin@ximian.com>
9019 * decl.cs (TypeName): Removed.
9020 (MemberName): Removed TypeName and MemberNow; now we just have
9023 * cs-parser.jay: Don't distinguish between type arguments and type
9024 parameters in the grammar and simplified the rules a bit. The
9025 reduce/reduce conflicts are now gone (except the one we inherited
9028 2004-06-11 Martin Baulig <martin@ximian.com>
9030 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9031 call this twice: for params and varargs methods.
9033 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9036 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9038 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9040 * attribute.cs (Attribute.GetValidTargets): Made public.
9043 (AbstractPropertyEventMethod): New class for better code sharing.
9044 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9046 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9048 2004-06-09 Martin Baulig <martin@ximian.com>
9050 * cs-parser.jay: Removed a reduce/reduce conflict.
9052 2004-06-03 Martin Baulig <martin@ximian.com>
9054 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9055 GetSimpleName() and return a SimpleName.
9057 * ecore.cs (SimpleName.Arguments): New public field.
9058 (SimpleName): Added overloaded ctor which takes an additional
9059 TypeArguments argument.
9060 (SimpleName.SimpleNameResolve): Added support for generic methods.
9061 (MethodGroupExpr.ResolveGeneric): New public method. The code was
9062 formerly in MemberAccess.DoResolve(), but we also need it in
9063 SimpleNameResolve().
9065 * expression.cs (MemberAccess.DoResolve): Use the new
9066 MethodGroupExpr.ResolveGeneric().
9068 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9070 * decl.cs: If possible, use lookuptypedirect here. We can only do
9071 this if there is no `.' after the namespace. Avoids using
9072 LookupType, which does lots of slow processing.
9073 (FindNestedType) New method, does what it says :-).
9074 * namespace.cs: use LookupTypeDirect.
9075 * rootcontext.cs: use membercache, if possible.
9076 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9078 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9081 According to the spec,
9083 In a member access of the form E.I, if E is a single identifier,
9084 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9085 field, property, localvariable, or parameter with the same type as
9086 the meaning of E as a type-name (§3.8), then both possible
9087 meanings of E are permitted.
9089 We did not check that E as a simple-name had the same type as E as
9092 This trivial check gives us 5-7% on bootstrap time.
9094 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9096 * expression.cs (Invocation.OverloadResolve): Avoid the
9097 use of hashtables and boxing here by allocating on demand.
9099 2004-05-30 Martin Baulig <martin@ximian.com>
9101 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9102 we're doing a silent lookup. Don't try to lookup nested types in
9103 TypeManager.object_type (thanks to Ben Maurer).
9105 2004-05-30 Martin Baulig <martin@ximian.com>
9107 Committing a patch from Ben Maurer.
9109 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9111 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9113 * convert.cs: add a trivial cache for overload operator resolution.
9115 2004-05-31 Marek Safar <marek.safar@seznam.cz>
9118 (AttributeTester.GetObsoleteAttribute): Returns instance of
9119 ObsoleteAttribute when type is obsolete.
9122 (TypeContainer.VerifyObsoleteAttribute): Override.
9123 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9124 (MethodCode.VerifyObsoleteAttribute): Override.
9125 (MemberBase.VerifyObsoleteAttribute): Override.
9128 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9129 and report proper error.
9132 (Delegate.VerifyObsoleteAttribute): Override.
9135 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9136 and report proper error.
9137 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9140 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9144 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9145 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9146 Added test for ObsoleteAttribute.
9149 (Catch): Derived from Statement.
9151 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9153 * decl.cs: If possible, use lookuptypedirect here. We can only do
9154 this if there is no `.' after the namespace. Avoids using
9155 LookupType, which does lots of slow processing.
9156 (FindNestedType) New method, does what it says :-).
9157 * namespace.cs: use LookupTypeDirect.
9158 * rootcontext.cs: use membercache, if possible.
9159 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9161 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9164 According to the spec,
9166 In a member access of the form E.I, if E is a single identifier,
9167 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9168 field, property, localvariable, or parameter with the same type as
9169 the meaning of E as a type-name (§3.8), then both possible
9170 meanings of E are permitted.
9172 We did not check that E as a simple-name had the same type as E as
9175 This trivial check gives us 5-7% on bootstrap time.
9177 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9179 Fixed bug #59071 & cs0160.cs
9180 * statement.cs (Try.Resolve): Check here whether order of catch
9181 clauses matches their dependencies.
9183 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9186 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9189 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9191 * expression.cs (Invocation.OverloadResolve): Avoid the
9192 use of hashtables and boxing here by allocating on demand.
9194 2004-05-30 Martin Baulig <martin@ximian.com>
9196 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9197 we're doing a silent lookup. Don't try to lookup nested types in
9198 TypeManager.object_type (thanks to Ben Maurer).
9200 2004-05-30 Martin Baulig <martin@ximian.com>
9202 Committing a patch from Ben Maurer.
9204 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9206 2004-05-29 Martin Baulig <martin@ximian.com>
9208 * class.cs (IMethodData.ShouldIgnore): New method.
9210 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9211 `Location' argument, we don't need it anywhere. Use
9212 `IMethodData.ShouldIgnore ()' instead of
9213 `MethodData.GetMethodFlags ()'.
9214 (TypeManager.AddMethod): Removed.
9215 (TypeManager.AddMethod2): Renamed to AddMethod.
9217 2004-05-29 Martin Baulig <martin@ximian.com>
9219 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9221 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9222 converting from a class type S to an interface type and we already
9223 have an object on the stack, don't box it again. Fixes #52578.
9225 2004-05-29 Martin Baulig <martin@ximian.com>
9227 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9228 Added support for `params' parameters. Fixes #59267.
9230 2004-05-29 Martin Baulig <martin@ximian.com>
9232 * literal.cs (NullPointer): Provide a private .ctor which sets
9233 `type' to TypeManager.object_type. Fixes #59048.
9235 2004-05-29 Martin Baulig <martin@ximian.com>
9237 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9238 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9240 * ecore.cs (EventExpr.instance_expr): Make the field private.
9242 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9244 Fixed bug #50080 & cs0214-2.cs
9245 * expression.cs (Cast.DoResolve): Check unsafe context here.
9247 * statement.cs (Resolve.DoResolve): Likewise.
9249 2004-05-26 Martin Baulig <martin@ximian.com>
9251 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9253 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9254 (RootContext.LookupType): Pass down the `silent' flag.
9256 2004-05-25 Martin Baulig <martin@ximian.com>
9259 (MethodGroupExpr.IdenticalTypeName): New public property.
9260 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9261 expression actually refers to a type.
9263 2004-05-25 Martin Baulig <martin@ximian.com>
9265 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9266 for #56176 and made it actually work.
9268 2004-05-25 Martin Baulig <martin@ximian.com>
9270 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9271 (FieldExpr, PropertyExpr): Override and implement
9272 CacheTemporaries. Fixes #52279.
9274 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9276 * location.cs: In the new compiler listing a file twice is a
9277 warning, not an error.
9279 2004-05-24 Martin Baulig <martin@ximian.com>
9281 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9282 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9284 2004-05-24 Martin Baulig <martin@ximian.com>
9286 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9287 walking the `using' list. Fixes #53921.
9289 2004-05-24 Martin Baulig <martin@ximian.com>
9291 * const.cs (Const.LookupConstantValue): Added support for
9292 EmptyCast's; fixes #55251.
9294 2004-05-24 Martin Baulig <martin@ximian.com>
9296 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9297 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9298 which does the CS0135 check. The reason is that we first need to
9299 check whether the variable actually exists.
9301 2004-05-24 Martin Baulig <martin@ximian.com>
9303 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9304 than RootContext.LookupType() to find the explicit interface
9307 2004-05-24 Raja R Harinath <rharinath@novell.com>
9309 * Makefile: Simplify. Use executable.make.
9310 * mcs.exe.sources: New file. List of sources of mcs.exe.
9312 2004-05-24 Anders Carlsson <andersca@gnome.org>
9316 Use the invariant culture when doing String.Compare for CLS case
9319 2004-05-23 Martin Baulig <martin@ximian.com>
9321 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9322 don't have any dots. Fixes #52622, added cs0246-8.cs.
9324 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9326 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9328 * class.cs (MemberBase.Define): Reuse MemberType member for
9329 resolved type. Other methods can use it too.
9331 2004-05-23 Martin Baulig <martin@ximian.com>
9333 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9334 the variable also exists in the current block (otherwise, we need
9335 to report a CS0103). Fixes #58670.
9337 2004-05-23 Martin Baulig <martin@ximian.com>
9339 * flowanalysis.cs (Reachability.Reachable): Compute this
9340 on-the-fly rather than storing it as a field.
9342 2004-05-23 Martin Baulig <martin@ximian.com>
9344 * flowanalysis.cs (Reachability.And): Manually compute the
9345 resulting `barrier' from the reachability.
9347 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9350 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9351 instance of ObsoleteAttribute when symbol is obsolete.
9354 (IMethodData): Extended interface for ObsoleteAttribute support.
9356 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9358 * attribute.cs: Fix bug #55970
9360 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9364 (GetObsoleteAttribute): New method. Creates the instance of
9366 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9367 ObsoleteAttribute when member is obsolete.
9368 (AttributeTester.Report_ObsoleteMessage): Common method for
9369 Obsolete error/warning reporting.
9372 (TypeContainer.base_classs_type): New member for storing parent type.
9375 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9376 for this MemberCore.
9378 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9380 * attribute.cs, const.cs: Fix bug #58590
9382 2004-05-21 Martin Baulig <martin@ximian.com>
9384 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9385 out parameters if the end of the method is unreachable. Fixes
9388 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9390 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9391 Hari was right, why extra method.
9393 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9395 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9397 2004-05-20 Martin Baulig <martin@ximian.com>
9399 * delegate.cs: Convert this file to Unix mode - like the original
9402 2004-05-20 Martin Baulig <martin@ximian.com>
9404 * attribute.cs: Convert this file to Unix mode - like the original
9407 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9409 Fix bug #58688 (MCS does not report error when the same attribute
9412 * attribute.cs (Attribute.Emit): Distinction between null and default.
9414 2004-05-19 Raja R Harinath <rharinath@novell.com>
9416 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9417 of a top-level attribute without an attribute target.
9418 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9420 (Attribute.Conditional_GetConditionName),
9421 (Attribute.Obsolete_GetObsoleteMessage): Update.
9422 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9423 part of ScanForIndexerName.
9424 (Attribute.CanIgnoreInvalidAttribute): New function.
9425 (Attribute.ScanForIndexerName): Move to ...
9426 (Attributes.ScanForIndexerName): ... here.
9427 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9428 (Attributes.Search): New internal variant that can choose not to
9429 complain if types aren't resolved. The original signature now
9431 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9432 complaints suppressed.
9433 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9434 only if it not useful.
9435 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9436 top-level for attributes that are shared between the assembly
9437 and a top-level class.
9438 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9439 * class.cs: Update to reflect changes.
9440 (DefineIndexers): Fuse loops.
9441 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9442 a couple more variants of attribute names.
9444 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9446 Fix bug #52585 (Implemented explicit attribute declaration)
9449 (Attributable.ValidAttributeTargets): New abstract method. It gets
9450 list of valid attribute targets for explicit target declaration.
9451 (Attribute.Target): It holds target itself.
9452 (AttributeSection): Removed.
9453 (Attribute.CheckTargets): New method. It checks whether attribute
9454 target is valid for the current element.
9457 (EventProperty): New class. For events that are declared like
9458 property (with add and remove accessors).
9459 (EventField): New class. For events that are declared like field.
9462 * cs-parser.jay: Implemented explicit attribute target declaration.
9464 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9465 Override ValidAttributeTargets.
9468 (ReturnParameter): Class for applying custom attributes on
9470 (ParameterAtribute): New class. Class for applying custom
9471 attributes on the parameter type.
9473 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9475 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9478 (Method): Allow UNSAFE here.
9480 * modifiers.cs: Support unsafe reporting.
9482 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9484 * decl.cs: Fix bug #58478.
9486 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9488 * statement.cs: When checking for unreachable code on an EmptyStatement,
9489 set the location. Fixes bug #58488.
9491 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9493 * driver.cs: Add -pkg handling.
9495 From Gonzalo: UseShelLExecute=false
9497 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9500 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9502 (Attribute.IsClsCompliaceRequired): Moved to base for better
9504 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9505 when attribute is AttributeUsageAttribute.
9506 (Attribute.GetValidTargets): Simplified.
9507 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9508 attribute for this type.
9509 (Attribute.ApplyAttributes): Method renamed to Emit and make
9511 (GlobalAttributeSection): New class for special handling of global
9512 attributes (assembly, module).
9513 (AttributeSection.Emit): New method.
9515 * class.cs: Implemented Attributable abstract methods.
9516 (MethodCore.LabelParameters): Moved to Parameter class.
9517 (Accessor): Is back simple class.
9518 (PropertyMethod): Implemented Attributable abstract class.
9519 (DelegateMethod): Implemented Attributable abstract class.
9520 (Event): New constructor for disctintion between normal Event
9521 and Event with accessors.
9523 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9525 * codegen.cs, const.cs, decl.cs, delegate.cs:
9526 (CommonAssemblyModulClass): Implemented Attributable abstract class
9529 * enum.cs: Implement IAttributeSupport interface.
9530 (EnumMember): New class for emum members. Implemented Attributable
9534 (ParameterBase): Is abstract.
9535 (ReturnParameter): New class for easier [return:] attribute handling.
9537 * typemanager.cs: Removed builder_to_attr.
9539 2004-05-11 Raja R Harinath <rharinath@novell.com>
9542 * attribute.cs (Attribute.GetPositionalValue): New function.
9543 * class.cs (TypeContainer.VerifyMembers): New function.
9544 (TypeContainer.Emit): Use it.
9545 (ClassOrStruct): New base class for Class and Struct.
9546 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9547 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9549 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9550 then each non-static field should have a FieldOffset attribute.
9551 Otherwise, none of the fields should have a FieldOffset attribute.
9552 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9553 and FieldOffset attributes.
9554 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9555 (TypeManager.field_offset_attribute_type): New core types.
9556 (TypeManager.InitCoreTypes): Initialize them.
9558 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9560 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9561 Return correct type.
9564 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9566 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9567 be implicitly converted to ulong.
9569 * expression.cs: The logic for allowing operator &, | and ^ worked
9570 was wrong, it worked before because we did not report an error in
9571 an else branch. Fixes 57895.
9573 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9574 allow volatile fields to be reference types.
9576 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9578 * driver.cs: Add support for /debug-
9580 2004-05-07 Raja R Harinath <rharinath@novell.com>
9582 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9583 Add a 'complain' parameter to silence errors.
9584 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9585 silently overlooked type-resolutions.
9586 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9588 (Attributes.Search): New function.
9589 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9590 (Attributes.GetAttributeFullName): Remove hack.
9591 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9592 Update to reflect changes.
9593 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9594 Use Attributes.Search instead of nested loops.
9596 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9599 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9600 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9601 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9603 * report.cs: (Report.Warning): Renamed to Warning_T because of
9604 parameter collision.
9606 2004-05-05 Raja R Harinath <rharinath@novell.com>
9608 * expression.cs (MemberAccess.ResolveMemberAccess):
9609 Exit with non-zero status after Report.Error.
9610 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9612 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9614 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9616 * support.cs: Don't hang when the file is empty.
9618 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9620 * support.cs: In SeekableStreamReader, compute the preamble size of the
9621 underlying stream. Position changes should take into account that initial
9624 2004-05-03 Todd Berman <tberman@sevenl.net>
9626 * driver.cs: remove unused GetSysVersion function.
9628 2004-05-03 Todd Berman <tberman@sevenl.net>
9630 * driver.cs: Remove the hack from saturday, as well as the hack
9631 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9632 link_paths to get that bit proper.
9634 2004-05-01 Todd Berman <tberman@sevenl.net>
9636 * driver.cs: Try a LoadFrom before a Load, this checks the current
9637 path. This is currently a bug in mono that is be fixed, however, this
9638 provides a workaround for now. This will be removed when the bug
9641 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9643 * CryptoConvert.cs: Updated to latest version. Fix issue with
9644 incomplete key pairs (#57941).
9646 2004-05-01 Todd Berman <tberman@sevenl.net>
9648 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9651 2004-04-30 Jackson Harper <jackson@ximian.com>
9653 * codegen.cs: Open keys readonly.
9655 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9657 * typemanager.cs: don't report cyclic struct layout when a struct
9658 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9659 which has 2 Pango.Rectangle fields.
9661 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9663 * expression.cs: Handle IntPtr comparisons with IL code
9664 rather than a method call.
9666 2004-04-29 Martin Baulig <martin@ximian.com>
9668 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9669 the list of PropertyInfo's in class hierarchy and find the
9670 accessor. Fixes #56013.
9672 2004-04-29 Martin Baulig <martin@ximian.com>
9674 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9676 2004-04-29 Martin Baulig <martin@ximian.com>
9678 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9680 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9682 2004-04-29 Martin Baulig <martin@ximian.com>
9684 * class.cs (ConstructorInitializer.Resolve): Check whether the
9685 parent .ctor is accessible. Fixes #52146.
9687 2004-04-29 Martin Baulig <martin@ximian.com>
9689 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9691 * statement.cs (Using.EmitLocalVariableDecls): Use
9692 TypeManager.idisposable_type, not typeof (IDisposable).
9693 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9695 2004-04-29 Martin Baulig <martin@ximian.com>
9697 * class.cs (Event.Define): Don't emit the field and don't set
9698 RTSpecialName and SpecialName for events on interfaces. Fixes
9701 2004-04-29 Raja R Harinath <rharinath@novell.com>
9703 Refactor Attribute.ApplyAttributes.
9704 * attribute.cs (Attributable): New base class for objects that can
9705 have Attributes applied on them.
9706 (Attribute): Make AttributeUsage fields public.
9707 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9708 (Attribute.IsInternalCall): New property.
9709 (Attribute.UsageAttr): Convert to a public read-only property.
9710 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9711 (Attribute.ResolveType, Attribute.Resolve)
9712 (Attribute.ScanForIndexerName): Update to reflect changes.
9713 (Attribute.CheckAttributeTarget): Re-format.
9714 (Attribute.ApplyAttributes): Refactor, to various
9715 Attributable.ApplyAttributeBuilder methods.
9716 * decl.cs (MemberCore): Make Attributable.
9717 * class.cs (Accessor): Make Attributable.
9718 (MethodData.ApplyAttributes): Use proper attribute types, not
9720 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9721 (TypeContainer.ApplyAttributeBuilder)
9722 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9723 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9724 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9725 (Operator.ApplyAttributeBuilder): New factored-out methods.
9726 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9727 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9728 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9729 * parameter.cs (ParameterBase): New Attributable base class
9730 that can also represent Return types.
9731 (Parameter): Update to the changes.
9733 2004-04-29 Jackson Harper <jackson@ximian.com>
9735 * driver.cs: Prefer the corlib system version when looking for
9736 assemblies in the GAC. This is still a hack, but its a better hack
9739 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9741 * decl.cs, enum.cs: Improved error 3005 reporting.
9743 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9744 (related_symbols): New private member for list of symbols
9745 related to reported error/warning.
9747 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9749 2004-04-29 Martin Baulig <martin@ximian.com>
9751 * ecore.cs (Expression.Constantify): If we're an enum and
9752 TypeManager.TypeToCoreType() doesn't give us another type, use
9753 t.UnderlyingSystemType. Fixes #56178.
9755 2004-04-29 Martin Baulig <martin@ximian.com>
9757 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9758 interfaces and for each interface, only add members directly
9759 declared in that interface. Fixes #53255.
9761 2004-04-28 Martin Baulig <martin@ximian.com>
9763 * expression.cs (ConditionalLogicalOperator): Use a temporary
9764 variable for `left' to avoid that we evaluate it more than once;
9767 2004-04-28 Martin Baulig <martin@ximian.com>
9769 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9772 2004-04-28 Martin Baulig <martin@ximian.com>
9774 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9777 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9778 whether the type is not void (CS1547).
9780 2004-04-28 Martin Baulig <martin@ximian.com>
9782 * expression.cs (Unary.DoResolveLValue): Override this and report
9783 CS0131 for anything but Operator.Indirection.
9785 2004-04-28 Martin Baulig <martin@ximian.com>
9787 Committing a patch from Ben Maurer; see bug #50820.
9789 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9792 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9795 2004-04-28 Martin Baulig <martin@ximian.com>
9797 Committing a patch from Ben Maurer; see bug #50820.
9799 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9802 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9805 2004-04-28 Martin Baulig <martin@ximian.com>
9807 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9808 (Block.AddLabel): Call DoLookupLabel() to only search in the
9811 2004-04-28 Martin Baulig <martin@ximian.com>
9813 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9814 comparing StringConstants and NullLiterals in Equality and Inequality.
9816 2004-04-28 Jackson Harper <jackson@ximian.com>
9818 * driver.cs: Attempt to load referenced assemblies from the
9819 GAC. This is the quick and dirty version of this method that
9820 doesnt take into account versions and just takes the first
9821 canidate found. Will be good enough for now as we will not have more
9822 then one version installed into the GAC until I update this method.
9824 2004-04-28 Martin Baulig <martin@ximian.com>
9826 * typemanager.cs (TypeManager.CheckStructCycles): New public
9827 static method to check for cycles in the struct layout.
9829 * rootcontext.cs (RootContext.PopulateTypes): Call
9830 TypeManager.CheckStructCycles() for each TypeContainer.
9831 [Note: We only need to visit each type once.]
9833 2004-04-28 Martin Baulig <martin@ximian.com>
9835 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9837 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9838 success and added `out object value'. Use a `bool resolved' field
9839 to check whether we've already been called rather than
9840 `ConstantValue != null' since this breaks for NullLiterals.
9842 2004-04-28 Raja R Harinath <rharinath@novell.com>
9844 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9845 setting of this flag, since the 'set' method may be non-public.
9847 2004-04-28 Raja R Harinath <rharinath@novell.com>
9849 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9850 check on current_vector.Block.
9852 2004-04-27 Martin Baulig <martin@ximian.com>
9854 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9855 a field initializer. Fixes #56459.
9857 2004-04-27 Martin Baulig <martin@ximian.com>
9859 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9860 we're not attempting to use an indexer. Fixes #52154.
9862 2004-04-27 Martin Baulig <martin@ximian.com>
9864 * statement.cs (Return): Don't create a return label if we don't
9865 need it; reverts my change from January 20th. Thanks to Ben
9868 2004-04-27 Martin Baulig <martin@ximian.com>
9870 According to the spec, `goto' can only leave a nested scope, but
9873 * statement.cs (Block.LookupLabel): Only lookup in the current
9874 block, don't recurse into parent or child blocks.
9875 (Block.AddLabel): Check in parent and child blocks, report
9876 CS0140/CS0158 if we find a duplicate.
9877 (Block): Removed this indexer for label lookups.
9878 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9879 this already does the error reporting for us.
9882 (FlowBranching.UsageVector.Block): New public variable; may be null.
9883 (FlowBranching.CreateSibling): Added `Block' argument.
9884 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9885 label for the target of a `goto' and check whether we're not
9886 leaving a `finally'.
9888 2004-04-27 Martin Baulig <martin@ximian.com>
9890 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9891 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9894 2004-04-27 Martin Baulig <martin@ximian.com>
9896 * statement.cs (Block.AddLabel): Also check for implicit blocks
9897 and added a CS0158 check.
9899 2004-04-27 Martin Baulig <martin@ximian.com>
9901 * flowanalysis.cs (FlowBranchingLoop): New class.
9902 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9903 UsageVector's instead of an ArrayList.
9904 (FlowBranching.Label): Likewise.
9905 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9906 (FlowBranching.AddBreakVector): New method.
9908 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9910 * attribute.cs: Small regression fix: only convert the type if we
9911 the type is different, fixes System.Drawing build.
9913 2004-04-27 Martin Baulig <martin@ximian.com>
9915 * attribute.cs (Attribute.Resolve): If we have a constant value
9916 for a named field or property, implicity convert it to the correct
9919 2004-04-27 Raja R Harinath <rharinath@novell.com>
9921 * statement.cs (Block.Block): Implicit blocks share
9922 'child_variable_names' fields with parent blocks.
9923 (Block.AddChildVariableNames): Remove.
9924 (Block.AddVariable): Mark variable as "used by a child block" in
9925 every surrounding block.
9926 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9927 been used in a child block, complain about violation of "Invariant
9928 meaning in blocks" rule.
9929 * cs-parser.jay (declare_local_variables): Don't use
9930 AddChildVariableNames.
9931 (foreach_statement): Don't create an implicit block: 'foreach'
9934 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9936 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9937 converting from 0L to ulong. Fixes 57522.
9939 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9941 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9942 derived class hides via 'new' keyword field from base class (test-242.cs).
9943 TODO: Handle this in the more general way.
9945 * class.cs (CheckBase): Ditto.
9947 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9949 * decl.cs (caching_flags): New member for storing cached values
9951 (MemberCore.Flags): New enum where bit flags for caching_flags
9953 (MemberCore.cls_compliance): Moved to caching_flags.
9954 (DeclSpace.Created): Moved to caching_flags.
9956 * class.cs: Use caching_flags instead of DeclSpace.Created
9958 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9960 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9961 if we are only a derived class, not a nested class.
9963 * typemanager.cs: Same as above, but do this at the MemberLookup
9964 level (used by field and methods, properties are handled in
9965 PropertyExpr). Allow for the qualified access if we are a nested
9968 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9970 * class.cs: Refactoring.
9971 (IMethodData): New inteface; Holds links to parent members
9972 to avoid member duplication (reduced memory allocation).
9973 (Method): Implemented IMethodData interface.
9974 (PropertyBase): New inner classes for get/set methods.
9975 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9976 (Event): New inner classes for add/remove methods.
9977 (Event.DelegateMethod): Implemented IMethodData interface.
9979 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9980 EmitContext (related to class.cs refactoring).
9982 2004-04-21 Raja R Harinath <rharinath@novell.com>
9984 * delegate.cs (Delegate.VerifyApplicability): If the number of
9985 arguments are the same as the number of parameters, first try to
9986 verify applicability ignoring any 'params' modifier on the last
9990 2004-04-08 Martin Baulig <martin@ximian.com>
9992 Merged latest changes into gmcs. Please keep this comment in
9993 here, it makes it easier for me to see what changed in MCS since
9994 the last time I merged.
9996 2004-04-16 Raja R Harinath <rharinath@novell.com>
9998 * class.cs (TypeContainer.AddIndexer): Use
9999 'ExplicitInterfaceName' to determine if interface name was
10000 explicitly specified. 'InterfaceType' is not initialized at this time.
10001 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10002 Indexers array is already in the required order. Initialize
10003 'IndexerName' only if there are normal indexers.
10004 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10005 (TypeContainer.Emit): Emit DefaultMember attribute only if
10006 IndexerName is initialized.
10009 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10011 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10014 2004-04-15 Raja R Harinath <rharinath@novell.com>
10016 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10020 * attribute.cs (Attribute.Resolve): Check for duplicate named
10024 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10026 * iterators.cs (MarkYield): track whether we are in an exception,
10027 and generate code accordingly. Use a temporary value to store the
10028 result for our state.
10030 I had ignored a bit the interaction of try/catch with iterators
10031 since their behavior was not entirely obvious, but now it is
10032 possible to verify that our behavior is the same as MS .NET 2.0
10036 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10038 * iterators.cs: Avoid creating temporaries if there is no work to
10041 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10042 Enumerations, use TypeManager.EnumToUnderlying and call
10045 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10048 (This.Emit): Use EmitContext.EmitThis to emit our
10051 (This.EmitAssign): Ditto.
10053 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10054 codepaths, we will move all the functionality into
10057 (FieldExpr.EmitAssign): Ditto.
10059 This fixes several hidden bugs that I uncovered while doing a code
10060 review of this today.
10062 * codegen.cs (EmitThis): reworked so the semantics are more clear
10063 and also support value types "this" instances.
10065 * iterators.cs: Changed so that for iterators in value types, we
10066 do not pass the value type as a parameter.
10068 Initialization of the enumerator helpers is now done in the caller
10069 instead of passing the parameters to the constructors and having
10070 the constructor set the fields.
10072 The fields have now `assembly' visibility instead of private.
10074 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10076 * expression.cs (Argument.Resolve): Check if fields passed as ref
10077 or out are contained in a MarshalByRefObject.
10079 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10080 another compiler type.
10082 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10084 * class.cs (Indexer.Define): use the new name checking method.
10085 Also, return false on an error.
10086 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10087 (is_identifier_[start/part]_character): make static.
10089 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10091 * expression.cs (Binary.ResolveOperator): Do no append strings
10092 twice: since we can be invoked more than once (array evaluation)
10093 on the same concatenation, take care of this here. Based on a fix
10094 from Ben (bug #56454)
10096 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10098 * codegen.cs: Fix another case where CS1548 must be reported (when
10099 delay-sign isn't specified and no private is available #56564). Fix
10100 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10101 error when MCS is used on the MS runtime and we need to delay-sign
10102 (which seems unsupported by AssemblyBuilder - see #56621).
10104 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10106 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10107 (TypeManager.ComputeNamespaces): Faster implementation for
10110 * compiler.csproj: Updated AssemblyName to mcs.
10112 2004-05-11 Jackson Harper <jackson@ximian.com>
10114 * Makefile: Preserve MONO_PATH
10116 2004-05-11 Jackson Harper <jackson@ximian.com>
10118 * Makefile: Use mono and mcs to build gmcs
10120 2004-05-03 Miguel de Icaza <miguel@ximian.com>
10122 * codegen.cs: Add patch from Robert Shade
10123 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10126 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
10128 * CryptoConvert.cs: Updated to latest version. Fix issue with
10129 incomplete key pairs (#57941).
10131 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10133 * codegen.cs: Fix another case where CS1548 must be reported (when
10134 delay-sign isn't specified and no private is available #56564). Fix
10135 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10136 error when MCS is used on the MS runtime and we need to delay-sign
10137 (which seems unsupported by AssemblyBuilder - see #56621).
10139 2004-04-29 Jackson Harper <jackson@ximian.com>
10141 * Makefile: Set MONO_PATH to use the bootstrap corlib
10142 * driver.cs: Check the GAC for referenced assemblies.
10144 2004-04-29 Martin Baulig <martin@ximian.com>
10146 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10148 2004-04-07 Martin Baulig <martin@ximian.com>
10150 * expression.cs (Binary.ResolveOperator): Added special case for
10151 Equality/Inequality between a type parameter and a null literal.
10153 2004-04-07 Martin Baulig <martin@ximian.com>
10155 * convert.cs: Check null literal -> type parameter conversions.
10157 2004-04-07 Martin Baulig <martin@ximian.com>
10159 * generic.cs (ConstructedType.CheckConstraints): Enforce the
10160 `class' and `struct' constraints.
10162 2004-04-07 Martin Baulig <martin@ximian.com>
10164 * generic.cs (SpecialConstraint): New public enum.
10165 (Constraints.Resolve): Added support for the `class' and `struct'
10168 * cs-parser.jay (type_parameter_constraint): Added support for the
10169 `class' and `struct' constraints.
10171 2004-04-07 Martin Baulig <martin@ximian.com>
10173 * support.cs (GenericConstraints): Replaced `Types' by
10174 `ClassConstraint' and `InterfaceConstraints'; added
10175 `HasClassConstraint'.
10177 2004-04-07 Martin Baulig <martin@ximian.com>
10180 (Constraints.InterfaceConstraints): New public property.
10181 (Constraints.Types): Make this property public
10182 (TypeParameter): Implement IMemberContainer.
10183 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10184 instead of a TypeBuilder/MethodBuilder; pass the interface
10185 constraints to TypeManager.AddTypeParameter().
10186 (TypeParameter.DefineType): Just take an EmitContext and no
10187 TypeBuilder/MethodBuilder. Use the new public API.
10189 * typemanager.cs (TypeManager.AddTypeParameter): Added
10190 `TypeExpr[]' argument; add the interfaces to the
10191 `builder_to_ifaces' hash.
10192 (TypeManager.LookupMemberContainer): For
10193 GenericTypeParameterBuilders, get the TypeParameter from the
10194 `builder_to_type_param'.
10195 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10196 the TypeParameter and call FindMembers on it.
10198 2004-04-07 Martin Baulig <martin@ximian.com>
10201 (MethodCore.GenericMethod): Moved this field here from Method.
10202 (MethodCore.IsDuplicateImplementation): Take the number of type
10203 parameters into account if we're a generic method.
10205 * expression.cs (Invocation.InferTypeArguments): Don't return true
10206 if `arguments' is null; we still need to check whether we actually
10207 don't need to infer anything in this case.
10208 (MemberAccess): Merged the functionality from GenericMemberAccess
10211 * generic.cs (GenericMemberAccess): Removed.
10213 2004-04-05 Martin Baulig <martin@ximian.com>
10215 * decl.cs (MemberCore): For generic classes, interfaces and
10216 structs, `Name' now includes the number of type parameters
10217 ("Stack!1.Node!1").
10218 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10219 encode the number of type arguments in the type name.
10221 * expression.cs (Expression.MemberLookup): Removed the
10222 `num_type_args' argument; we now encode the number of type
10223 arguments in the type name.
10225 * ecore.cs (SimpleName): Encode the number of type arguments in
10226 the type name itself.
10228 * generic.cs (ConstructedType): Likewise.
10230 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10231 `MemberName'; we now include the number of type parameters in the
10234 * typemanager.cs (TypeManager.CheckGeneric): Removed.
10235 (TypeManager.MemberLookup): Removed the
10236 `num_type_args' argument; we now encode the number of type
10237 arguments in the type name.
10239 2004-04-03 Martin Baulig <martin@ximian.com>
10241 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10242 (MemberCore.MemberName): Moved here from MemberBase.
10243 (DeclSpace.SetParameterInfo): Just take the constraints as an
10244 ArrayList; we already have the type parameters in our
10245 `MemberName'; also do the CS0080 reporting here.
10247 * cs-parser.jay (struct_declaration): Use `member_name' instead of
10248 `IDENTIFIER opt_type_parameter_list'; when constructing our
10249 `MemberName', it'll already include our type parameters.
10250 (class_declaration, interface_declaration): Likewise.
10251 (delegate_declaration): Likewise.
10252 (MakeName): Take a MemberName and return a MemberName.
10253 The following two changes are required to avoid shift/reduce conflicts:
10254 (member_name): Don't include a TypeName anymore; ie. this is now
10255 just 'IDENTIFIER opt_type_parameter_list'.
10256 (property_declaration, event_declaration): Use a
10257 `namespace_or_type_name' instead of a `member_name'.
10259 2004-04-03 Martin Baulig <martin@ximian.com>
10261 * decl.cs (MemberName): Renamed to `TypeName' and created a new
10262 `MemberName' class.
10263 (TypeName): Formerly known as MemberName.
10265 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10266 instead of a `MemberName'.
10268 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10269 (member_name): New rule; create a MemberName.
10271 2004-04-02 Martin Baulig <martin@ximian.com>
10273 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10274 (CS0305 and CS0308).
10276 2004-04-02 Martin Baulig <martin@ximian.com>
10278 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10279 support for nested types.
10281 2004-04-02 Martin Baulig <martin@ximian.com>
10283 * ecore.cs (IAlias): New public interface.
10284 (TypeExpr, TypeExpression): Implement IAlias.
10285 (TypeAliasExpression): New public class.
10287 * namespace.cs (Namespace): Implement IAlias.
10288 (Namespace.Lookup): Return an IAlias instead on an object.
10289 (Namespace.DefineName): Take an IAlias instead of an object.
10290 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10292 (NamespaceEntry.UsingAlias): Take a Membername instead of an
10294 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10296 (NamespaceEntry.Lookup): Likewise.
10298 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10301 * decl.cs (DeclSpace): Implement IAlias.
10302 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10304 * generic.cs (ConstructedType): Improved error checking.
10306 2004-04-02 Martin Baulig <martin@ximian.com>
10308 * convert.cs: Added type parameter conversions.
10311 (UnboxCast.Emit): Emit an `unbox.any' for type params.
10312 (ClassCast.Emit): If the source type is a type parameter, box it.
10313 If the target type is a type parameter, emit an `unbox.any'
10314 instead of a `classcast'.1
10316 2004-04-01 Martin Baulig <martin@ximian.com>
10318 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10320 2004-04-01 Martin Baulig <martin@ximian.com>
10322 * generic.cs (ConstructedType.CheckConstraints): Use
10323 Convert.ImplicitStandardConversionExists(); user-defined implicit
10324 conversions are not allowed according to the spec.
10326 2004-03-30 Martin Baulig <martin@ximian.com>
10328 * expression.cs (New): Added support for type parameters.
10331 (TypeManager.activator_type): New public static field.
10332 (TypeManager.activator_create_instance): Likewise.
10334 2004-03-30 Martin Baulig <martin@ximian.com>
10336 * typemanager.cs (TypeManager.HasConstructorConstraint): New
10339 2004-03-30 Martin Baulig <martin@ximian.com>
10341 * generic.cs (ConstructedType.CheckConstraints): Actually follow
10342 the spec here: the argument type must be convertible to the
10345 2004-03-30 Martin Baulig <martin@ximian.com>
10348 (TypeParameter.Define, TypeParameter.DefineMethod): Call
10349 TypeManager.AddTypeParameter().
10350 (ConstructedType.CheckConstraints): Re-enable this and actually
10351 check whether we have a constructor constraint.
10354 (TypeManager.builder_to_type_param): New static field.
10355 (TypeManager.AddTypeParameter): New static method.
10356 (TypeManager.LookupTypeParameter): New public method.
10358 2004-03-30 Martin Baulig <martin@ximian.com>
10360 * generic.cs (TypeParameter.DefineType): Return a boolean and use
10361 the new API to actually define the constructor constraint.
10364 (TypeManager.new_constraint_attr_type): New static field.
10365 (TypeManager.InitCoreTypes): Initialize it.
10367 2004-03-30 Martin Baulig <martin@ximian.com>
10369 * generic.cs (Constraints): Completed error checking, use correct
10372 2004-03-29 Martin Baulig <martin@ximian.com>
10374 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10376 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10377 public version which takes a `ParameterData pd' instead of an
10380 2004-03-29 Martin Baulig <martin@ximian.com>
10382 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10385 2004-03-29 Martin Baulig <martin@ximian.com>
10387 * expression.cs (Argument.ResolveMethodGroup): If we're a
10388 ConstructedType, call GetMemberAccess() on it.
10390 2004-03-29 Martin Baulig <martin@ximian.com>
10392 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10393 (MethodCore.CheckGenericOverride): When overriding a generic
10394 method, check whether the constraints match.
10396 * support.cs (GenericConstraints): New public interface.
10397 (ParameterData.GenericConstraints): New public method.
10399 * parameter.cs (Parameter.Resolve): Check whether we're a generic
10400 method parameter and compute our constraints if appropriate.
10401 (Parameter.GenericConstraints): New public property.
10403 * generic.cs (Constraints): Implement GenericConstraints.
10405 2004-03-29 Martin Baulig <martin@ximian.com>
10407 * decl.cs (MemberCache.FindMemberToOverride): Use
10408 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10410 2004-03-29 Martin Baulig <martin@ximian.com>
10412 * generic.cs (GenericMethod.Define): Resolve our type parameters.
10414 2004-03-29 Martin Baulig <martin@ximian.com>
10416 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10417 not allowed on non-generic declarations").
10419 2004-03-29 Martin Baulig <martin@ximian.com>
10421 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10422 public version of this method.
10424 * class.cs (MethodCore.IsDuplicateImplementation): Use
10425 Invocation.InferTypeArguments() to check this.
10427 2004-03-29 Martin Baulig <martin@ximian.com>
10429 * convert.cs: Use TypeManager.IsDelegateType() instead of
10430 comparing types correctly.
10432 2004-03-29 Martin Baulig <martin@ximian.com>
10434 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10435 types directly to make it work for generic instances.
10437 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10439 2004-03-29 Martin Baulig <martin@ximian.com>
10441 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10442 support for arrays.
10444 2004-03-24 Martin Baulig <martin@ximian.com>
10446 * decl.cs (DeclSpace.FindType): Also use
10447 TypeManager.CheckGeneric() for types from the using clauses.
10449 2004-03-23 Martin Baulig <martin@ximian.com>
10451 * expression.cs (Invocation.OverloadResolve): Added `bool
10452 may_fail' argument and use it instead of the Location.IsNull() hack.
10454 2004-03-23 Martin Baulig <martin@ximian.com>
10456 * expression.cs (Invocation.InferType): Use correct type inference
10459 2004-03-23 Martin Baulig <martin@ximian.com>
10461 * ecore.cs (MethodGroupExpr.Name): Use
10462 TypeManager.CSharpSignature() instead of just the name.
10464 * expression.cs (Invocation.OverloadResolve): Provide better error
10466 (Invocation.DoResolve): OverloadResolve() never returns null
10467 without reporting an error, so removed the error -6 reporting here.
10469 2004-03-23 Martin Baulig <martin@ximian.com>
10471 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10474 * cs-parser.jay (delegate_declaration): Support generic delegates.
10476 * delegate.cs: Support generic delegates.
10478 2004-03-22 Martin Baulig <martin@ximian.com>
10480 * expression.cs (Invocation.InferParamsTypeArguments): New static
10481 method; does type inference for params arguments.
10483 2004-03-21 Martin Baulig <martin@ximian.com>
10485 * typemanager.cs (TypeManager.IsGenericMethod): New public static
10486 method; checks whether a method is a generic method.
10488 * expression.cs (Invocation.InferTypeArguments): New static method;
10489 infer type arguments for generic method invocation.
10491 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10492 property; we set this to true if we're resolving a generic method
10493 invocation and the user specified type arguments, ie. we're not
10494 doing type inference.
10496 2004-03-20 Martin Baulig <martin@ximian.com>
10498 * class.cs (MethodData.DeclaringType): New public property.
10499 (MethodData.Define): Set DeclaringType here.
10500 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10501 instead of OperatorMethodBuilder.DeclaringType.
10503 2004-03-20 Martin Baulig <martin@ximian.com>
10505 * cs-tokenizer.cs (xtoken): Return a special
10506 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10508 * cs-parser.jay (default_value_expression): Switch to the new
10511 2004-03-19 Martin Baulig <martin@ximian.com>
10513 * decl.cs (MemberName): New class. We use this to "construct"
10514 namespace_or_type_name's.
10516 * generics.cs (TypeArguments.GetDeclarations): New public method;
10517 returns the type arguments as a string[] and reports a CS0081 if
10518 one of them is not an identifier.
10520 * class.cs (MemberBase): The .ctor now takes the name as a
10521 MemberName instead of a string.
10522 (MemberBase.ExplicitInterfaceName): Changed type from string to
10524 (MemberBase.DoDefine): If we're an explicit implementation, the
10525 InterfaceType may be a generic instance.
10527 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10528 (namespace_name): Call MemberName.GetName () to transform the
10529 MemberName into a string and ensure we don't have any type
10531 (type_name): Call MemberName.GetTypeExpression() to transfrom the
10532 MemberName into an expression.
10533 (method_header): Use namespace_or_type_name instead of member_name.
10535 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10537 * rootcontext.cs: Add new types to the boot resolution.
10539 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10540 MulticastDelegate is not allowed.
10542 * typemanager.cs: Add new types to lookup: System.TypedReference
10545 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10546 check for TypedReference or ArgIterator, they are not allowed.
10548 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10549 makes us properly catch 1510 in some conditions (see bug 56016 for
10552 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10554 * CryptoConvert.cs: update from corlib version
10557 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10559 * class.cs (Indexer.Define): Check indexername declaration
10561 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10563 * attribute.cs (IsClsCompliant): Fixed problem with handling
10564 all three states (compliant, not-compliant, undetected).
10566 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10568 * attribute.cs (Attribute): Location is now public.
10569 (Resolve): Store resolved arguments (pos_values) in attribute class.
10570 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10571 (GetClsCompliantAttributeValue): New method that gets
10572 CLSCompliantAttribute value.
10573 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10574 if exists else null.
10575 (AttributeTester): New class for CLS-Compliant verification routines.
10577 * class.cs (Emit): Add CLS-Compliant verification.
10578 (Method.GetSignatureForError): Implemented.
10579 (Constructor.GetSignatureForError): Implemented
10580 (Constructor.HasCompliantArgs): Returns if constructor has
10581 CLS-Compliant arguments.
10582 (Constructor.Emit): Override.
10583 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10584 is needed to test only parameters.
10585 (FieldBase.GetSignatureForError): Implemented.
10586 (TypeContainer): New member for storing base interfaces.
10587 (TypeContainer.FindMembers): Search in base interfaces too.
10589 * codegen.cs (GetClsComplianceAttribute): New method that gets
10590 assembly or module CLSCompliantAttribute value.
10591 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10593 (ModuleClass.Emit): Add error 3012 test.
10595 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10597 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10598 state for all decl types.
10599 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10600 if CLS-Compliant tests are required.
10601 (IsClsCompliaceRequired): New method. Analyze whether code
10602 must be CLS-Compliant.
10603 (IsExposedFromAssembly): New method. Returns true when MemberCore
10604 is exposed from assembly.
10605 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10606 value or gets cached value.
10607 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10608 is explicitly marked with CLSCompliantAttribute.
10609 (IsIdentifierClsCompliant): New abstract method. This method is
10610 used to testing error 3005.
10611 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10612 for identifier and parameters CLS-Compliant testing.
10613 (VerifyClsCompliance): New method. The main virtual method for
10614 CLS-Compliant verifications.
10615 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10616 null. I don't know why is null (too many public members !).
10617 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10618 and get value of first CLSCompliantAttribute that found.
10620 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10621 (VerifyClsCompliance): Override and add extra tests.
10623 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10624 clscheck- disable CLS-Compliant verification event if assembly is has
10625 CLSCompliantAttribute(true).
10627 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10628 ApllyAttribute is now called in emit section as in the other cases.
10629 Possible future Emit integration.
10630 (IsIdentifierClsCompliant): New override.
10631 (VerifyClsCompliance): New override.
10632 (GetEnumeratorName): Returns full enum name.
10634 * parameter.cs (GetSignatureForError): Implemented.
10636 * report.cs (WarningData): New struct for Warning message information.
10637 (LocationOfPreviousError): New method.
10638 (Warning): New method. Reports warning based on the warning table.
10639 (Error_T): New method. Reports error based on the error table.
10641 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10642 verifications are done here.
10644 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10646 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10647 CLSCompliantAttribute.
10648 (all_imported_types): New member holds all imported types from other
10650 (LoadAllImportedTypes): New method fills static table with exported types
10651 from all referenced assemblies.
10652 (Modules): New property returns all assembly modules.
10654 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10656 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10657 throwing a parser error.
10659 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10660 which removes the hardcoded get_/set_ prefixes for properties, as
10661 IL allows for the properties to be named something else.
10665 * expression.cs: Do not override operand before we know if it is
10666 non-null. Fix 56207
10668 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10670 * typemanager.cs: support for pinned variables.
10672 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10674 * decl.cs, typemanager.cs: Avoid using an arraylist
10675 as a buffer if there is only one result set.
10677 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10679 * expression.cs: Make sure you cant call a static method
10680 with an instance expression, bug #56174.
10682 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10684 * class.cs (IsDuplicateImplementation): Improve error reporting to
10685 flag 663 (method only differs in parameter modifier).
10687 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10688 in preprocessor directives.
10690 * location.cs (LookupFile): Allow for the empty path.
10692 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10693 better approach for some of that patch, but its failing with the
10694 CharSet enumeration. For now try/catch will do.
10696 * typemanager.cs: Do not crash if a struct does not have fields.
10699 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10701 * expression.cs: cs0213, cant fix a fixed expression.
10704 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10706 * cs-parser.jay: detect invalid embeded statements gracefully.
10709 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10711 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10714 the invocation type may not be a subclass of the tye of the item/
10715 The type of the item must be a subclass of the invocation item.
10720 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10722 * attribute.cs: Added methods to get a string and a bool from an
10723 attribute. Required to information from AssemblyKeyFileAttribute,
10724 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10725 * codegen.cs: Modified AssemblyName creation to include support for
10726 strongnames. Catch additional exceptions to report them as CS1548.
10727 * compiler.csproj: Updated include CryptoConvert.cs.
10728 * compiler.csproj.user: Removed file - user specific configuration.
10729 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10730 Mono.Security assembly. The original class is maintained and tested in
10731 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10732 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10733 like CSC 8.0 (C# v2) supports.
10734 * Makefile: Added CryptoConvert.cs to mcs sources.
10735 * rootcontext.cs: Added new options for strongnames.
10737 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10739 * driver.cs: For --expect-error, report error code `2'
10740 if the program compiled with no errors, error code `1' if
10741 it compiled with an error other than the one expected.
10743 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10745 * compiler.csproj: Updated for Visual Studio .NET 2003.
10746 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10747 * compiler.sln: Updated for Visual Studio .NET 2003.
10749 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10751 * expression.cs: Fix bug #47234. We basically need to apply the
10752 rule that we prefer the conversion of null to a reference type
10753 when faced with a conversion to 'object' (csc behaviour).
10755 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10757 * statement.cs: Shorter form for foreach, eliminates
10758 a local variable. r=Martin.
10760 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10762 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10763 checks if we can use brtrue/brfalse to test for 0.
10764 * expression.cs: use the above in the test for using brtrue/brfalse.
10765 cleanup code a bit.
10767 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10769 * expression.cs: Rewrite string concat stuff. Benefits:
10771 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10772 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10773 rather than a concat chain.
10775 * typemanager.cs: Add lookups for more concat overloads.
10777 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10779 * expression.cs: Emit shorter il code for array init.
10796 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10798 * statement.cs: Before, two switch blocks would be merged if the
10799 total size of the blocks (end_item - begin_item + 1) was less than
10800 two times the combined sizes of the blocks.
10802 Now, it will only merge if after the merge at least half of the
10807 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10809 * class.cs : csc build fix for GetMethods(). See bug #52503.
10811 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10813 * expression.cs: Make sure fp comparisons work with NaN.
10814 This fixes bug #54303. Mig approved this patch a long
10815 time ago, but we were not able to test b/c the runtime
10818 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10820 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10822 2004-03-19 Martin Baulig <martin@ximian.com>
10824 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10825 two overloads may unify for some type parameter substitutions and
10826 report a CS0408 if appropriate.
10828 2004-03-19 Martin Baulig <martin@ximian.com>
10830 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10831 error here and not in our caller.
10833 2004-03-19 Martin Baulig <martin@ximian.com>
10835 * interface.cs: Completely killed this file.
10836 (Interface): We're now a TypeContainer and live in class.cs.
10838 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10839 argument; we're now also called for interfaces.
10840 (TypeContainer.DefineMembers): Allow this method being called
10842 (TypeContainer.GetMethods): New public method; formerly known as
10843 Interface.GetMethod(). This is used by PendingImplementation.
10844 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10845 it's now private and non-static.
10846 (Interface): Moved this here; it's now implemented similar to
10848 (Method, Property, Event, Indexer): Added `bool is_interface'
10849 argument to their .ctor's.
10850 (MemberBase.IsInterface): New public field.
10852 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10853 instances instead of InterfaceMethod, InterfaceProperty, etc.
10854 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10855 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10857 2004-03-19 Martin Baulig <martin@ximian.com>
10859 * class.cs (MethodCore.IsDuplicateImplementation): New private
10860 method which does the CS0111 checking.
10861 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10862 Use IsDuplicateImplementation().
10864 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10866 * decl.cs (FindMemberToOverride): New method to find the correct
10867 method or property to override in the base class.
10869 - Make Method/Property use the above method to find the
10870 version in the base class.
10871 - Remove the InheritableMemberSignatureCompare as it is now
10874 This patch makes large code bases much faster to compile, as it is
10875 O(n) rather than O(n^2) to do this validation.
10877 Also, it fixes bug 52458 which is that nested classes are not
10878 taken into account when finding the base class member.
10880 Reviewed/Approved by Martin.
10882 2004-03-17 Martin Baulig <martin@ximian.com>
10884 * expression.cs (MemberAccess.DoResolve): Take the parent's number
10885 of type arguments into account; use the `real_num_type_args'
10886 approach like in DoResolveAsTypeStep().
10888 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10891 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10893 * interface.cs: In all interface classes removed redundant
10894 member initialization.
10896 2004-03-16 Martin Baulig <martin@ximian.com>
10898 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10900 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10902 * decl.cs (DefineTypeAndParents): New helper method to define a
10903 type's containers before the type itself is defined; This is a
10904 bug exposed by the recent changes to Windows.Forms when an
10905 implemented interface was defined inside a class that had not been
10908 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10910 (Check): Loop correctly to report errors modifiers
10911 (UNSAFE was not in the loop, since it was the same as TOP).
10913 * interface.cs: Every interface member now takes a ModFlags,
10914 instead of a "is_new" bool, which we set on the base MemberCore.
10916 Every place where we called "UnsafeOk" in the interface, now we
10917 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10918 the unsafe settings from the member declaration instead of the
10919 container interface.
10921 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10923 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10924 `set_indexer_name' to the pending bits (one per type).
10926 We fixed a bug today that was picking the wrong method to
10927 override, since for properties the existing InterfaceMethod code
10928 basically ignored the method name. Now we make sure that the
10929 method name is one of the valid indexer names.
10931 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10933 * support.cs (SeekableStreamReader): Keep track of stream byte
10934 positions and don't mix them with character offsets to the buffer.
10936 Patch from Gustavo Giráldez
10938 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10940 * interface.cs (InterfaceSetGetBase): Removed double member
10941 initialization, base class does it as well.
10943 2004-03-13 Martin Baulig <martin@ximian.com>
10945 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10946 when compiling corlib.
10948 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10950 * convert.cs (ExplicitConversion): We were reporting an error on
10951 certain conversions (object_type source to a value type, when the
10952 expression was `null') before we had a chance to pass it through
10953 the user defined conversions.
10955 * driver.cs: Replace / and \ in resource specifications to dots.
10958 * class.cs: Add check for duplicate operators. Fixes 52477
10960 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10962 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10963 that are in the middle of the statements, not only at the end.
10966 * class.cs (TypeContainer.AddField): No longer set the
10967 `HaveStaticConstructor' flag, now we call it
10968 `UserDefineStaticConstructor' to diferentiate the slightly
10969 semantic difference.
10971 The situation is that we were not adding BeforeFieldInit (from
10972 Modifiers.TypeAttr) to classes that could have it.
10973 BeforeFieldInit should be set to classes that have no static
10978 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10980 And most importantly Zoltan's comment:
10982 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10984 "I think beforefieldinit means 'it's ok to initialize the type sometime
10985 before its static fields are used', i.e. initialization does not need
10986 to be triggered by the first access to the type. Setting this flag
10987 helps the JIT to compile better code, since it can run the static
10988 constructor at JIT time, and does not need to generate code to call it
10989 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10990 this flag for lots of classes like String.
10992 csc sets this flag if the type does not have an explicit static
10993 constructor. The reasoning seems to be that if there are only static
10994 initalizers for a type, and no static constructor, then the programmer
10995 does not care when this initialization happens, so beforefieldinit
10998 This bug prevents the AOT compiler from being usable, since it
10999 generates so many calls to mono_runtime_class_init that the AOT code
11000 is much slower than the JITted code. The JITted code is faster,
11001 because it does not generate these calls if the vtable is type is
11002 already initialized, which is true in the majority of cases. But the
11003 AOT compiler can't do this."
11005 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11007 * class.cs (MethodData.Emit): Refactor the code so symbolic
11008 information is generated for destructors; For some reasons we
11009 were taking a code path that did not generate symbolic information
11012 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11014 * class.cs: Create a Constructor.CheckBase method that
11015 takes care of all validation type code. The method
11016 contains some code that was moved from Define.
11018 It also includes new code that checks for duplicate ctors.
11019 This fixes bug #55148.
11021 2004-03-09 Joshua Tauberer <tauberer@for.net>
11023 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11024 a { ... }-style array creation invokes EmitStaticInitializers
11025 which is not good for reference-type arrays. String, decimal
11026 and now null constants (NullCast) are not counted toward
11027 static initializers.
11029 2004-03-05 Martin Baulig <martin@ximian.com>
11031 * location.cs (SourceFile.HasLineDirective): New public field;
11032 specifies whether the file contains or is referenced by a "#line"
11034 (Location.DefineSymbolDocuments): Ignore source files which
11035 either contain or are referenced by a "#line" directive.
11037 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11039 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11040 direct access to our parent, so check the method inline there.
11042 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11044 * expression.cs (Invocation.EmitCall): Miguel's last commit
11045 caused a regression. If you had:
11050 In Foo the implict this would be null.
11052 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11054 * expression.cs (Invocation.EmitCall): If the method is not
11055 virtual, do not emit a CallVirt to it, use Call.
11057 * typemanager.cs (GetFullNameSignature): Improve the method to
11058 cope with ".ctor" and replace it with the type name.
11060 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11061 as an argument the ConstructorBuilder where it is being defined,
11062 to catch the recursive constructor invocations.
11064 2004-03-16 Martin Baulig <martin@ximian.com>
11066 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11067 ConstructedType, call ResolveType() on it to get the type rather
11068 than just using `expr.Type'.
11070 2004-03-16 Martin Baulig <martin@ximian.com>
11072 * generics.cs (ConstructedType.GetMemberAccess): Take the
11073 EmitContext instead on the TypeExpr and use
11074 ec.TypeContainer.CurrentType/ec.ContainerType.
11076 2004-03-16 Martin Baulig <martin@ximian.com>
11078 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11079 parameters before aliases.
11081 2004-03-16 Martin Baulig <martin@ximian.com>
11083 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11084 New oublic function; checks whether two generic instances may become
11085 equal under some instantiations (26.3.1).
11087 * class.cs (TypeContainer.Define): Call
11088 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11091 2004-03-16 Martin Baulig <martin@ximian.com>
11093 * class.cs (TypeContainer.GetClassBases): Moved
11094 Error_TypeParameterAsBase() here and also check whether the base
11095 class is not an attribute.
11097 2004-03-16 Martin Baulig <martin@ximian.com>
11099 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11101 2004-03-16 Martin Baulig <martin@ximian.com>
11103 * class.cs (Error_TypeParameterAsBase): Use correct error number
11106 2004-03-16 Martin Baulig <martin@ximian.com>
11108 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11111 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11114 2004-03-15 Martin Baulig <martin@ximian.com>
11116 * typemanager.cs (TypeManager.GetFullName): New public method.
11117 (TypeManager.MemberLookup): Added `int_num_type_arguments'
11118 argument; only return members with the correct number of type
11120 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11121 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11122 whether the number of type arguments matches.
11124 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11125 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11127 * expression.cs (MemberAccess): Added public `NumTypeArguments'
11128 field; it's set by the protected .ctor when we're actually a
11129 GenericMemberAccess.
11130 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11131 arguments and pass it to MemberLookupFinal ().
11133 * ecore.cs (Expression.MemberLookup): Added `int
11134 num_type_arguments' argument; only return members with the correct
11135 number of type arguments.
11136 (Expression.MemberLookupFailed): Check whether the MemberLookup
11137 failed because we did not have the correct number of type
11138 arguments; report CS0305 in this case.
11140 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11141 `e.ResolveAsTypeTerminal()' already did so.
11143 2004-03-15 Martin Baulig <martin@ximian.com>
11145 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11146 we're a ConstructedType; in this case, the caller must report an
11147 error (for instance CS0131).
11149 * generic.cs (TypeArguments): Added Location argument to the .ctor.
11150 (TypeArguments.Resolve): Actually report errors here.
11152 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11154 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11155 `set_indexer_name' to the pending bits (one per type).
11157 We fixed a bug today that was picking the wrong method to
11158 override, since for properties the existing InterfaceMethod code
11159 basically ignored the method name. Now we make sure that the
11160 method name is one of the valid indexer names.
11162 2004-03-15 Martin Baulig <martin@ximian.com>
11164 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11165 for generic instances.
11167 2004-03-13 Martin Baulig <martin@ximian.com>
11169 * class.cs (TypeContainer.DefineType): Call
11170 TypeManager.AddUserType() immediately after creating the
11171 TypeBuilder; pass all type parameters when creating the
11174 * decl.cs (DeclSpace.FindNestedType): New public method.
11175 (DeclSpace.FindType): Added `int num_type_args' argument; only
11176 return types with the correct number of type parameters.
11177 (DeclSpace.CountTypeParams): New public property.
11179 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11180 the number of type parameters; defaults to zero.
11182 * generic.cs (TypeArguments.Count): New public property.
11183 (ConstructedType.DoResolveAsTypeStep): First call
11184 ds.FindNestedType() to find out whether we're nested in the
11185 current generic type; in this case, we inherit all type parameters
11186 from the current class.
11188 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11189 num_type_args' argument.
11190 (RootContext.LookupType): Added overloaded version which takes the
11191 number of type arguments; only return types with the correct
11192 number of type arguments.
11194 * typemanager.cs (TypeManager.CheckGeneric): New public function;
11195 checks whether `Type t' has `int num_type_args'.
11197 2004-03-13 Martin Baulig <martin@ximian.com>
11199 * generic.cs (GenericMethod.DefineType): New method; calls
11200 DefineType() on all the type parameters.
11202 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11203 (MethodData.Define): If we're a generic method, call
11204 GenericMethod.DefineType() to define the type parameters.
11206 2004-03-10 Martin Baulig <martin@ximian.com>
11208 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11209 instead of IsAssignableFrom.
11211 2004-03-10 Martin Baulig <martin@ximian.com>
11213 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11215 * support.cs (ParameterData.HasArrayParameter): New property.
11216 (ReflectionParameters.ctor): Take a MethodBase instead of a
11217 ParameterInfo[]. If we have any type parameters, get the generic
11218 method definition and ask it whether we have variable arguments.
11220 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11222 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11223 routines to check if a type is an enumerable/enumerator allow
11224 classes that implement the IEnumerable or IEnumerator interfaces.
11226 * class.cs (Property, Operator): Implement IIteratorContainer, and
11227 implement SetYields.
11229 (Property.Define): Do the block swapping for get_methods in the
11230 context of iterators. We need to check if Properties also
11231 include indexers or not.
11233 (Operator): Assign the Block before invoking the
11234 OperatorMethod.Define, so we can trigger the Iterator code
11237 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11238 Property and Operator classes are not created when we parse the
11239 declarator but until we have the block completed, so we use a
11240 singleton SimpleIteratorContainer.Simple to flag whether the
11241 SetYields has been invoked.
11243 We propagate this setting then to the Property or the Operator to
11244 allow the `yield' to function.
11246 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11248 * codegen.cs: Implemented attribute support for modules.
11249 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11250 Assembly/Module functionality.
11252 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11253 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11254 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11256 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11258 * interface.cs (FindMembers): The operation is performed on all base
11259 interfaces and not only on the first. It is required for future CLS Compliance patch.
11261 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11263 * statement.cs, codegen.cs:
11264 This patch deals with patterns such as:
11266 public class List : IEnumerable {
11268 public MyEnumerator GetEnumerator () {
11269 return new MyEnumerator(this);
11272 IEnumerator IEnumerable.GetEnumerator () {
11276 public struct MyEnumerator : IEnumerator {
11281 Before, there were a few things we did wrong:
11282 1) we would emit callvirt on a struct, which is illegal
11283 2) we emited ldarg when we needed to emit ldarga
11284 3) we would mistakenly call the interface methods on an enumerator
11285 type that derived from IEnumerator and was in another assembly. For example:
11287 public class MyEnumerator : IEnumerator
11289 Would have the interface methods called, even if there were public impls of the
11290 method. In a struct, this lead to invalid IL code.
11292 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11294 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11297 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11299 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11301 * cs-parser.jay: Fix small regression: we were not testing V2
11302 compiler features correctly.
11304 * interface.cs: If the emit context is null, then create one
11306 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11308 * decl.cs (GetSignatureForError): New virtual method to get full name
11309 for error messages.
11311 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11312 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11314 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11315 Duplicated members and code in these classes has been removed.
11316 Better encapsulation in these classes.
11318 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11320 * assign.cs (Assign.DoResolve): When dealing with compound
11321 assignments, there is a new rule in ECMA C# 2.4 (might have been
11322 there before, but it is documented here) that states that in:
11326 If b is of type int, and the `op' is a shift-operator, then the
11327 above is evaluated as:
11331 * expression.cs (Binary.ResolveOperator): Instead of testing for
11332 int/uint/long/ulong, try to implicitly convert to any of those
11333 types and use that in pointer arithmetic.
11335 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11336 method to print information for from the type, not from the
11337 null-method we were given.
11339 2004-02-01 Duncan Mak <duncan@ximian.com>
11341 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11342 parsing for cmd, fixes bug #53694.
11344 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11346 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11347 in the member name duplication tests. Property and operator name duplication
11348 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11350 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11352 * interface.cs (PopulateMethod): Fixed crash when interface method
11353 returns not existing type (error test cs0246-3.cs).
11355 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11357 * cs-parser.jay (interface_accessors): Re-write actions to also
11358 store attributes attached to get and set methods. Fix spelling
11361 (inteface_property_declaration): Modify accordingly.
11363 (InterfaceAccessorInfo): New helper class to store information to pass
11364 around between rules that use interface_accessors.
11366 * interface.cs (Emit): Apply attributes on the get and set
11367 accessors of properties and indexers too.
11369 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11370 right MethodBuilder when applying attributes to the get and set accessors.
11372 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11374 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11376 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11378 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11380 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11382 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11383 changes that treat `yield' specially when present before `break'
11384 or `return' tokens.
11386 * cs-tokenizer.cs: yield is no longer a keyword.
11388 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11390 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11391 setting for default constructors.
11392 For default constructors are almost every time set wrong Modifier. The
11393 generated IL code has been alright. But inside mcs this values was
11394 wrong and this was reason why several of my CLS Compliance tests
11397 2004-02-27 Martin Baulig <martin@ximian.com>
11399 * generics.cs (ConstructedType.ResolveType): Make the nested type
11400 stuff actually work.
11402 2004-02-25 Martin Baulig <martin@ximian.com>
11404 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11405 property; returns the type parameters just from the current type,
11406 ie. with the ones from outer classes.
11407 (DeclSpace.LookupGeneric): First search in the current class, then
11409 (DeclSpace.initialize_type_params): When hiding a type parameter
11410 from an outer class, put it into the `type_param_list' anyways.
11412 * expression.cs (MemberAccess.expr): Made this field protected.
11414 * class.cs (TypeContainer.Define): The `CurrentType' just contains
11415 the type parameters from the current class.
11417 * generic.cs (ConstructedType.ResolveType): Support nested generic
11418 types by taking the type parameters which we inherit from outer
11419 classes into account.
11420 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11421 support for nested generic types.
11423 2004-02-23 Martin Baulig <martin@ximian.com>
11425 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11426 field and check whether we're nested inside a generic type.
11427 (DeclSpace.ResolveType): If we're resolving to a generic type
11428 definition, create a ConstructedType and return its resolved type.
11429 (DeclSpace.initialize_type_params): New private method;
11430 initializes the `type_param_list' field from the type parameters
11431 from this and all enclosing classes.
11432 (DeclSpace.TypeParameters): Call initialize_type_params() unless
11433 we're already initialized.
11435 2004-02-23 Martin Baulig <martin@ximian.com>
11437 * class.cs (Method.Define): Create the generic method before
11438 calling DoDefine().
11439 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11440 the TypeContainer one); we use this for generic methods.
11442 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11443 parent's TypeBuilder.
11445 2004-02-18 Martin Baulig <martin@ximian.com>
11447 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11448 to check for equality.
11450 2004-02-05 Martin Baulig <martin@ximian.com>
11452 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11453 `ec.TypeContainer.CurrentType', use it instead of
11454 `ec.ContainerType' to check whether we're in the type's ctor.
11456 2004-01-29 Martin Baulig <martin@ximian.com>
11458 * expression.cs (Invocation.DoResolve): If we're a
11459 `ConstructedType', then we're actually a generic method, so
11460 rewrite the expr as a GenericMemberAccess.
11462 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11463 here; manually parse it into a string.
11465 2004-01-28 Martin Baulig <martin@ximian.com>
11467 * typemanager.cs (TypeManager.IsEqual): New static method.
11468 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11469 check for equality instead of using `=='.
11471 2004-01-26 Martin Baulig <martin@ximian.com>
11473 * decl.cs (DeclSpace.CurrentType): New public field.
11475 * expression.cs (This.ResolveBase): If we have an
11476 `ec.TypeContainer.CurrentType', use it instead of
11477 `ec.ContainerType'.
11479 * class.cs (TypeContainer.DefineType): If we're a generic type,
11480 create the `CurrentType' (unresolved).
11481 (TypeContainer.GenericType): New private field.
11482 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11483 it and store it in `GenericType' before creating the MemberCache.
11484 (TypeContainer.GetMembers): If we have a `GenericType', call
11485 TypeManager.FindMembers() on it.
11487 * interface.cs (Interface.GenericType): New private field.
11488 (Interface.DefineType): If we're a generic type, create the
11489 `CurrentType' (unresolved).
11490 (Interface.DefineMembers): If we have a `CurrentType', resolve it
11491 and store it in `GenericType' before creating the MemberCache.
11492 (Interface.GetMembers): If we have a `GenericType', call
11493 TypeManager.FindMembers() on it.
11495 2004-01-22 Martin Baulig <martin@ximian.com>
11497 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11498 not a QualifiedIdentifier. This is what `type_name_expression'
11499 was previously doing.
11500 (type_name_expression): Removed; the code is now in
11501 `namespace_or_type_name'.
11502 (qualified_identifier): Removed, use `namespace_or_type_name'
11504 (QualifiedIdentifier): Removed this class.
11506 2004-01-22 Martin Baulig <martin@ximian.com>
11508 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11509 not a string as alias name.
11511 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11513 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11514 #52730 bug, and instead compute correctly the need to use a
11515 temporary variable when requesting an address based on the
11516 static/instace modified of the field and the constructor.
11518 2004-01-21 Martin Baulig <martin@ximian.com>
11520 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11521 class and namespace before looking up aliases. Fixes #52517.
11523 2004-01-21 Martin Baulig <martin@ximian.com>
11525 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11526 assinged in a 'try'; fixes exception4.cs.
11528 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11529 * class.cs : Implemented parameter-less constructor for TypeContainer
11531 * decl.cs: Attributes are now stored here. New property OptAttributes
11533 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11535 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11537 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11539 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11540 (CSharpSignature): New method for indexer and property signature.
11542 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11544 * pending.cs (IsVirtualFilter): Faster implementation.
11546 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11548 * typemanager.cs: Avoid inclusion of same assembly more than once.
11550 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11552 * cs-parser.jay: Fixed problem where the last assembly attribute
11553 has been applied also to following declaration (class, struct, etc.)
11555 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11557 * class.cs: Added error CS0538, CS0539 reporting.
11558 Fixed crash on Microsoft runtime when field type is void.
11560 * cs-parser.jay: Added error CS0537 reporting.
11562 * pending.cs: Added error CS0535 reporting.
11563 Improved error report for errors CS0536, CS0534.
11565 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11567 Merge a few bits from the Anonymous Method MCS tree.
11569 * statement.cs (ToplevelBlock): New class for toplevel methods,
11570 will hold anonymous methods, lifted variables.
11572 * cs-parser.jay: Create toplevel blocks for delegates and for
11573 regular blocks of code.
11575 2004-01-20 Martin Baulig <martin@ximian.com>
11577 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11578 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11579 and `NeedExplicitReturn'; added `IsLastStatement'.
11580 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11581 have a `ReturnLabel' or we're not unreachable.
11583 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11584 child's reachability; don't just override ours with it. Fixes
11585 #58058 (lluis's example).
11586 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11587 InFinally(), InLoop(), InSwitch() and
11588 BreakCrossesTryCatchBoundary() methods.
11590 * statement.cs (Return): Do all error checking in Resolve().
11591 Unless we are the last statement in a top-level block, always
11592 create a return label and jump to it.
11593 (Break, Continue): Do all error checking in Resolve(); also make
11594 sure we aren't leaving a `finally'.
11595 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11596 statement in a top-level block.
11597 (Block.Flags): Added `IsDestructor'.
11598 (Block.IsDestructor): New public property.
11600 2004-01-20 Martin Baulig <martin@ximian.com>
11602 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11604 2004-01-20 Martin Baulig <martin@ximian.com>
11606 * statement.cs (Statement.ResolveUnreachable): New public method.
11607 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11608 (Block.Resolve): Resolve unreachable statements.
11610 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11612 * expression.cs: We need to fix the case where we do
11613 not have a temp variable here.
11615 * assign.cs: Only expression compound assignments need
11616 temporary variables.
11618 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11620 * flowanalysis.cs: Reduce memory allocation in a few ways:
11621 - A block with no variables should not allocate a bit
11623 - A method with no out parameters does not need any tracking
11624 for assignment of the parameters, so we need not allocate
11627 public readonly Type[] VariableTypes;
11628 public readonly string[] VariableNames;
11629 Are redundant. The data is already stored in the variable
11630 map, so we need not allocate another array for it.
11631 - We need to add alot of checks for if (params | locals) == null
11632 due to the first two changes.
11634 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11636 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11637 implement IMemoryLocation, we store a copy on a local variable and
11638 take the address of it. Patch from Benjamin Jemlich
11640 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11641 to use a special "type_name_expression" rule which reduces the
11642 number of "QualifiedIdentifier" classes created, and instead
11643 directly creates MemberAccess expressions.
11645 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11647 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11648 that fixes #52853. Null literal assignment to ValueType
11650 * class.cs (MethodData.Emit): Instead of checking the name of the
11651 method to determine if its a destructor, create a new derived
11652 class from Method called Destructor, and test for that.
11654 * cs-parser.jay: Create a Destructor object instead of a Method.
11656 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11660 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11662 * expression.cs (Binary.ResolveOperator): Perform an implicit
11663 conversion from MethodGroups to their delegate types on the
11664 Addition operation.
11666 * delegate.cs: Introduce a new class DelegateCreation that is the
11667 base class for `NewDelegate' and `ImplicitDelegateCreation',
11668 factor some code in here.
11670 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11671 conversion from MethodGroups to compatible delegate types.
11673 * ecore.cs (Expression.Resolve): Do not flag error 654
11674 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11675 we allow conversions from MethodGroups to delegate types now.
11677 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11678 assignments in v2 either.
11680 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11682 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11683 static read-only fields in ctors.
11685 Applied patch from Benjamin Jemlich
11687 * expression.cs (UnaryMutator): Avoid leaking local variables.
11689 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11691 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11692 here to return true, as they can be used like this:
11694 (XXX) int.MEMBER ()
11696 Fixed 49836 and all the other dups
11698 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11700 * driver.cs: Implement /win32res and /win32icon.
11702 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11704 * cs-parser.jay: Add a rule to improve error handling for the
11705 common mistake of placing modifiers after the type.
11707 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11709 * cs-parser.jay (interface_event_declaration): Catch
11710 initialization of events on interfaces, and report cs0068
11712 * cs-parser.jay (interface_event_declaration): Catch
11713 initialization of events.
11715 * ecore.cs: Better report missing constructors.
11717 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11718 the error reporting done in the wrong place. Fix.
11720 * expression.cs (Binary.ResolveOperator): Catch the
11721 operator + (E x, E y) error earlier, and later allow for implicit
11722 conversions in operator +/- (E e, U x) from U to the underlying
11725 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11726 52596, if the container class is abstract, the default constructor
11727 is protected otherwise its public (before, we were always public).
11729 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11732 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11733 Jemlich that fixes bug #52597, MCS was generating invalid code for
11734 idisposable structs. Thanks to Ben for following up with this
11737 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11739 * driver.cs: Allow assemblies without code to be generated, fixes
11742 2004-01-07 Nick Drochak <ndrochak@gol.com>
11744 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11746 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11748 * cs-parser.jay: Add rules to improve error reporting if fields or
11749 methods are declared at the namespace level (error 116)
11751 * Add rules to catch event add/remove
11753 2004-01-04 David Sheldon <dave-mono@earth.li>
11755 * expression.cs: Added matching ")" to error message for
11758 2004-01-03 Todd Berman <tberman@gentoo.org>
11760 * ecore.cs, attribute.cs:
11761 Applying fix from #52429.
11763 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11765 * ecore.cs, expression.cs, statement.cs:
11766 Total rewrite of how we handle branching. We
11767 now handle complex boolean expressions with fewer
11768 jumps. As well if (x == 0) no longer emits a ceq.
11770 if (x is Foo) is much faster now, because we generate
11773 Overall, we get a pretty big improvement on our benchmark
11774 tests. The code we generate is smaller and more readable.
11776 I did a full two-stage bootstrap. The patch was reviewed
11777 by Martin and Miguel.
11779 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11781 * cs-parser.jay: Make primary_expression not take a QI.
11782 we dont need this because the member_access rule covers
11783 us here. So we replace the rule with just IDENTIFIER.
11785 This has two good effects. First, we remove a s/r conflict.
11786 Second, we allocate many fewer QualifiedIdentifier objects.
11788 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11790 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11791 set the correct information via SRE. This prevents
11792 hanging on the MS runtime. Fixes #29374.
11794 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11796 * convert.cs: correctly handle conversions to value types
11797 from Enum and ValueType as unboxing conversions.
11799 Fixes bug #52569. Patch by Benjamin Jemlich.
11801 2004-01-02 Ravi Pratap <ravi@ximian.com>
11803 * expression.cs (BetterConversion): Prefer int -> uint
11804 over int -> ulong (csc's behaviour). This fixed bug #52046.
11806 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11808 * decl.cs (MemberCache.FindMembers): now returns a
11811 * typemanager.cs: In general, go with with ^^.
11812 (CopyNewMethods): take an IList.
11813 (RealMemberLookup): Only allocate an arraylist
11814 if we copy from two sets of methods.
11816 This change basically does two things:
11817 1) Fewer array lists allocated due to CopyNewMethods.
11818 2) the explicit cast in MemberList costed ALOT.
11820 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11822 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11823 a hashtable to avoid needless string allocations when an identifier is
11824 used more than once (the common case).
11826 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11828 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11829 is broken, it will not return anything. So, we
11830 have to use the information we have in mcs to
11833 * typemanager.cs: Add a cache for GetInterfaces,
11834 since this will now be used more often (due to ^^)
11836 (GetExplicitInterfaces) New method that gets the
11837 declared, not effective, interfaces on a type
11838 builder (eg, if you have interface IFoo, interface
11839 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11842 This patch makes MCS able to bootstrap itself on
11845 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11847 * expression.cs: Remove the Nop's that Miguel put
11850 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11852 * report.cs, codegen.cs: Give the real stack trace to
11853 the error when an exception is thrown.
11855 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11857 * decl.cs: only allocate hashtables for ifaces if
11860 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11862 * expression.cs: fix the error from cs0121-2.cs
11863 (a parent interface has two child interfaces that
11864 have a function with the same name and 0 params
11865 and the function is called through the parent).
11867 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11869 * class.cs, rootcontext.cs, typmanager.cs: do not
11872 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11874 * codegen.cs: remove stack for the ec flow branching.
11875 It is already a linked list, so no need.
11877 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11879 * Makefile: Allow custom profiler here.
11881 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11883 * typemanager.cs (LookupType):
11884 - Use a static char [], because split takes
11885 a param array for args, so it was allocating
11887 - Do not store true in a hashtable, it boxes.
11889 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11891 * flowanalysis.cs: bytify common enums.
11893 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11895 * modifiers.cs: Add a new set of flags for the
11896 flags allowed on explicit interface impls.
11897 * cs-parser.jay: catch the use of modifiers in
11898 interfaces correctly.
11899 * class.cs: catch private void IFoo.Blah ().
11901 All related to bug #50572.
11903 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11905 * decl.cs: Rewrite the consistant accessability checking.
11906 Accessability is not linear, it must be implemented in
11907 a tableish way. Fixes #49704.
11909 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11911 * expression.cs: Handle negation in a checked context.
11912 We must use subtraction from zero. Fixes #38674.
11914 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11916 * class.cs: Ignore static void main in DLLs.
11917 * rootcontext.cs: Handle the target type here,
11918 since we are have to access it from class.cs
11919 * driver.cs: account for the above.
11921 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11923 * report.cs: Give line numbers and files if available.
11925 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11927 * driver.cs: Implement /addmodule.
11929 * typemanager.cs: Change 'modules' field so it now contains Modules not
11932 2003-12-20 Martin Baulig <martin@ximian.com>
11934 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11935 (FieldBase.IsAssigned): Removed this field.
11936 (FieldBase.SetAssigned): New public method.
11937 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11939 2003-12-20 Martin Baulig <martin@ximian.com>
11941 * expression.cs (LocalVariableReference.DoResolve): Don't set
11942 `vi.Used' if we're called from DoResolveLValue().
11944 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11945 returns the usage vector it just merged into the current one -
11946 pass this one to UsageWarning().
11947 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11948 of the `EmitContext', don't call this recursively on our children.
11950 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11952 * driver.cs: Implement /target:module.
11954 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11956 * support.cs (CharArrayHashtable): New helper class.
11958 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11959 char arrays, not strings, so we can avoid creating a string in
11960 consume_identifier if the identifier is a keyword.
11962 2003-12-16 Martin Baulig <martin@ximian.com>
11964 * statement.cs (LocalInfo.Assigned): Removed this property.
11965 (LocalInfo.Flags): Removed `Assigned'.
11966 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11967 and uses flow analysis.
11968 (Block.UsageWarning): Made this method private.
11969 (Block.Resolve): Call UsageWarning() if appropriate.
11971 * expression.cs (LocalVariableReference.DoResolve): Always set
11972 LocalInfo.Used here.
11974 2003-12-13 Martin Baulig <martin@ximian.com>
11976 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11977 any value here; we're now using flow analysis to figure out
11978 whether a statement/block returns a value.
11980 2003-12-13 Martin Baulig <martin@ximian.com>
11982 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11984 (FlowBranching.MergeFinally): Don't call
11985 `branching.CheckOutParameters()' here, this is called in
11987 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11988 when adding the `finally' vector.
11990 2003-12-13 Martin Baulig <martin@ximian.com>
11993 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11994 actually work and also fix #48962.
11996 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11998 * decl.cs: Do not check System.Object for nested types,
11999 since we know it does not have any. Big bang for buck:
12002 Run 1: 8.35 seconds
12003 Run 2: 8.32 seconds
12004 corlib: 17.99 seconds
12006 Run 1: 8.17 seconds
12007 Run 2: 8.17 seconds
12008 corlib: 17.39 seconds
12010 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12012 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12013 time we are returning 0 members, so we save alot here.
12015 2003-12-11 Martin Baulig <martin@ximian.com>
12017 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12018 `MergeChild()', also just take the `FlowBranching' as argument;
12019 call Merge() on it and return the result.
12020 (FlowBranching.Merge): We don't need to do anything if we just
12023 2003-12-11 Martin Baulig <martin@ximian.com>
12025 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12026 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12027 Maurer for this idea.
12029 2003-12-11 Martin Baulig <martin@ximian.com>
12031 * flowanalysis.cs (MergeResult): This class is now gone; we now
12032 use the `UsageVector' for this. The reason for this is that if a
12033 branching just has one sibling, we don't need to "merge" them at
12034 all - that's the next step to do.
12035 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12038 2003-12-11 Martin Baulig <martin@ximian.com>
12040 Reworked flow analyis and made it more precise and bug-free. The
12041 most important change is that we're now using a special `Reachability'
12042 class instead of having "magic" meanings of `FlowReturns'. I'll
12043 do some more cleanups and optimizations and also add some more
12044 documentation this week.
12046 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12047 largely reworked this class.
12048 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12049 the new `Reachability' class instead of having "magic" values here.
12050 (FlowBranching): We're now using an instance of `Reachability'
12051 instead of having separate `Returns', `Breaks' etc. fields.
12053 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12054 based on flow analysis; ignore the return value of block.Emit ().
12056 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12058 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12059 if they are private.
12061 2003-12-09 Martin Baulig <martin@ximian.com>
12063 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12064 call them directly on the UsageVector.
12066 2003-12-09 Martin Baulig <martin@ximian.com>
12068 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12069 Changed return type from `FlowReturns' to `Reachability'.
12071 2003-12-09 Martin Baulig <martin@ximian.com>
12073 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12074 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12075 `Reachable' fields with a single `Reachability' one.
12077 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12079 * class.cs (FindMembers): Remove foreach's.
12084 Run 1: 8.74 seconds
12085 Run 2: 8.71 seconds
12088 Run 1: 8.64 seconds
12089 Run 2: 8.58 seconds
12092 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12097 This patch does a few things:
12098 1. EmptyStatement is now a singleton, so it is never reallocated.
12099 2. All blah is EmptyStatement constructs have been changed to
12100 blah == EmptyStatement.Value, which is much faster and valid
12101 now that EmptyStatement is a singleton.
12102 3. When resolving a block, rather than allocating a new array for
12103 the non-empty statements, empty statements are replaced with
12104 EmptyStatement.Value
12105 4. Some recursive functions have been made non-recursive.
12106 Mainly the performance impact is from (3), however (1) and (2) are needed for
12107 this to work. (4) does not make a big difference in normal situations, however
12108 it makes the profile look saner.
12113 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12114 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12115 Total memory allocated: 56397 KB
12118 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12119 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12120 Total memory allocated: 55666 KB
12122 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12124 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12125 than the hashtable in a hashtable version
12127 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12128 we always end up concating a string. This results in a huge perf
12129 loss, because many strings have to be tracked by the GC. In this
12130 patch, we first use a hashtable that works with two keys, so that
12131 the strings do not need to be concat'ed.
12135 Run 1: 8.74 seconds
12136 Run 2: 8.71 seconds
12139 Run 1: 8.65 seconds
12140 Run 2: 8.56 seconds
12142 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12144 * Makefile: Add a new target `do-time' that does a quick and simple
12145 profile, leaving easy to parse output.
12147 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12149 * codegen.cs (Init): Create the dynamic assembly with
12150 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12152 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12154 * support.cs: Make the PtrHashtable use only one
12155 instance of its comparer.
12157 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12159 * typemanager.cs: Fix lookup of GetNamespaces.
12161 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12163 * expression.cs: Removed redundant line.
12165 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12166 ArrayLists, use for loops with bounds.
12168 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12171 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12172 arraylists, use for loop with bounds.
12174 The above three changes give us a 0.071 second performance
12175 improvement out of 3.294 seconds down to 3.223. On my machine
12176 the above changes reduced the memory usage by 1,387 KB during
12177 compiler bootstrap.
12179 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12180 QualifiedIdentifiers. Before we created a new string through
12181 concatenation, and mostly later on, the result would be
12182 manipulated by DecomposeQI through string manipulation.
12184 This reduced the compiler memory usage for bootstrapping from
12185 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12186 compile times in 0.05 seconds.
12188 2003-11-28 Dick Porter <dick@ximian.com>
12190 * support.cs: Do string compares with the Invariant culture.
12198 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12199 the comparison is done with the Invariant culture.
12201 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12203 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12204 GetEnumerator method.
12206 (ProbeCollectionType): Iterate starting at the most specific type
12207 upwards looking for a GetEnumerator
12209 * expression.cs: Shift count can be up to 31 for int/uint and 63
12212 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12214 * statement.cs (Block.LookupLabel): Also look for the label on the
12215 children blocks. Use a hash table to keep track of visited
12218 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12219 we actually did transform the other operand, otherwise fall back
12220 to the common codepath that casts to long.
12222 * cs-tokenizer.cs: Use the same code pattern as the int case.
12223 Maybe I should do the parsing myself, and avoid depending on the
12224 Parse routines to get this done.
12226 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12228 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12229 which fixes bug 51347. This time test it.
12231 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12232 attributes for example can not tell the difference between these.
12233 The difference was only a syntax feature of the language.
12235 * attribute.cs: Apply attributes to delegates.
12237 * delegate.cs: Call the apply attributes method.
12239 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12241 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12242 comparing 0 vs Byte.MinValue, not the value
12244 (ImplicitConversionRequired): When reporting a conversion error,
12245 use error 31 to print out the constant error instead of the
12248 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12249 which fixes bug 51347.
12251 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12253 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12254 which fixes the -warnaserror command line option.
12256 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12258 * cfold.cs (DoNumericPromotions): During constant folding of
12259 additions on UIntConstant, special case intconstants with
12260 IntConstants like we do on the expression binary operator.
12262 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12264 * convert.cs (ImplicitReferenceConversion): We were missing a case
12265 (System.Enum are not value types or class types, so we need to
12266 classify them separatedly).
12268 * driver.cs: We do not support error 2007.
12270 2003-11-12 Jackson Harper <jackson@ximian.com>
12272 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12273 system directory. Also use the full file name so users can
12274 libraries names mscorlib-o-tron.dll in a non system dir.
12276 2004-01-04 David Sheldon <dave-mono@earth.li>
12278 * expression.cs: Added matching ")" to error message for CS0077.
12280 2003-12-19 Martin Baulig <martin@ximian.com>
12282 * typemanager.cs (TypeManager.IsEqualGenericType): New public
12283 static method; see documentation in the method.
12284 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12286 * convert.cs (Convert.ImplicitReferenceConversion,
12287 Convert.ImplicitReferenceConversionExists): Add support for
12288 generic type declarations; see gen-36.cs.
12290 2003-12-19 Martin Baulig <martin@ximian.com>
12292 * pending.cs (Pending.InterfaceMethod): Use
12293 `Type.IsAssignableFrom()' instead of `=='.
12295 2003-12-18 Martin Baulig <martin@ximian.com>
12297 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12300 * convert.cs (Convert.ImplicitStandardConversionExists): Use
12301 `expr_type.Equals (target_type)' instead of `=='.
12303 2003-12-08 Martin Baulig <martin@ximian.com>
12305 * generics.cs (Constraints.Types): Removed.
12306 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12308 (Constraints.ResolveTypes): New public method; resolves the
12309 TypeExpr's to Type's.
12310 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12311 longer takes the constraints.
12312 (TypeParameter.DefineMethod): Likewise.
12313 (TypeParameter.DefineType): New public method. Calls
12314 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12317 2003-12-08 Martin Baulig <martin@ximian.com>
12319 * convert.cs (Convert.ImplicitConversionStandard): Use
12320 `expr_type.Equals (target_type)' instead of `=='.
12322 2003-12-08 Martin Baulig <martin@ximian.com>
12324 * typemanager.cs (TypeManager.GetReferenceType): Call
12325 `Type.MakeByRefType ()'.
12327 2003-12-08 Martin Baulig <martin@ximian.com>
12329 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12330 just has some special meaning in some situations. For instance,
12331 it is allowed to use `where' as the name of a variable etc.
12333 2003-12-04 Martin Baulig <martin@ximian.com>
12335 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12336 `Type.MakeArrayType()' for array types.
12338 2003-11-18 Miguel de Icaza <miguel@ximian.com>
12340 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12343 (SizeOf.DoResolve): assign the `type_queried' field. This gets
12346 2003-11-16 Martin Baulig <martin@ximian.com>
12348 * codegen.cs (EmitContext.IsGeneric): Removed.
12350 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12351 ResolveGeneric() on the DeclSpace.
12353 2003-11-16 Martin Baulig <martin@ximian.com>
12355 * generic.cs (TypeArguments.Resolve):
12356 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12357 `ResolveType()' on it to get the Type.
12359 2003-11-15 Martin Baulig <martin@ximian.com>
12361 * generic.cs (ConstructedType.GetInterfaces): Override this.
12363 2003-11-14 Martin Baulig <martin@ximian.com>
12365 * interface.cs (Interface.DefineType): Define all type parameters
12366 before adding the interfaces we inherit.
12368 2003-11-11 Martin Baulig <martin@ximian.com>
12370 * generic.cs (ConstructedType.ResolveType): Always call
12371 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12373 2003-11-10 Martin Baulig <martin@ximian.com>
12375 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12376 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12377 calling `ResolveType()' on them, directly assign their `Type'.
12379 2003-11-08 Martin Baulig <martin@ximian.com>
12381 * generic.cs (ConstructedType): Override `IsClass' etc.
12383 2003-11-08 Martin Baulig <martin@ximian.com>
12385 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12386 return value and the `out parent' parameter.
12387 (TypeContainer.DefineType): Moved the CS0644 check into
12388 GetClassBases(). Don't pass the interface types to the
12389 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12390 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12392 * ecore.cs (TypeExpr.IsAttribute): New property.
12393 (TypeExpr.GetInterfaces): New method.
12395 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12396 TypeExpr instead of a Type.
12397 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12398 (Interface.DefineType): Don't pass the interface types to the
12399 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12400 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12402 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12403 instead of a `Type[]'.
12404 (TypeManager.RegisterBuilder): Likewise.
12405 (TypeManager.AddUserInterface): Likewise.
12406 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12407 `Type[]' and also return a `TypeExpr[]'.
12408 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12410 2003-11-08 Martin Baulig <martin@ximian.com>
12412 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12415 2003-11-08 Martin Baulig <martin@ximian.com>
12417 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12418 TypeManager.ResolveExpressionTypes().
12420 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12421 instead of an Expression.
12422 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12423 (TypeExpression): New public class; formerly known as `TypeExpr'.
12425 * expression.cs (ComposedCast): Derive from TypeExpr.
12427 * typemanager.cs (TypeManager.system_*_expr): These are now
12428 TypExpr's instead of Expression's.
12429 (TypeManager.ResolveExpressionTypes): New public static function;
12430 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12433 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12435 * expression.cs (New.DoResolve): Do not dereference value that
12436 might be a null return.
12438 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12439 sure that the constant value has the right type. Fixes an
12440 unreported bug, similar to 50425.
12442 * const.cs (Const.LookupConstantValue): Call
12443 ImplicitStandardConversionExists before doing a conversion to
12444 avoid havng the TypeManager.ChangeType do conversions.
12446 Reduced the number of casts used
12448 (Const.ChangeType): New routine to enable reuse of the constant
12449 type changing code from statement.
12451 * typemanager.cs (ChangeType): Move common initialization to
12452 static global variables.
12456 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12457 every value type to go through, even if it was void. Fix that.
12459 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12460 character of the define, and the is_identifier_part_character for
12461 the rest of the string.
12463 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12465 * expression.cs (UnaryMutator.EmitCode): When I updated
12466 LocalVariableReference.DoResolve, I overdid it, and dropped an
12467 optimization done on local variable references.
12469 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12471 * ecore.cs: Convert the return from Ldlen into an int.
12473 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12475 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12476 the accessibility, this is a special case for toplevel non-public
12477 classes (internal for instance).
12479 2003-10-20 Nick Drochak <ndrochak@gol.com>
12481 * ecore.cs: Fix typo and build. Needed another right paren.
12483 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12485 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12486 `internal' case regular and protected, but not allowing protected
12487 to be evaluated later. Bug 49840
12489 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12491 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12492 to kb.Nlast, and not the kb.nFirst to isolate the switch
12495 Extract the underlying type, so enumerations of long/ulong are
12496 treated like long/ulong.
12498 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12500 * expression.cs (New): Overload the meaning of RequestedType to
12501 track the possible creation of the NewDelegate type, since
12502 DoResolve is invoked more than once for new constructors on field
12505 See bugs: #48800 and #37014
12507 * cs-parser.jay (declare_local_constants): Take an arraylist
12508 instead of a single constant.
12510 (local_constant_declaration): It should take a
12511 constant_declarators, not a constant_declarator. Fixes 49487
12513 * convert.cs: Fix error report.
12515 2003-10-13 Jackson Harper <jackson@ximian.com>
12517 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12520 2003-11-03 Martin Baulig <martin@ximian.com>
12522 * expression.cs (ArrayAccess.GetStoreOpcode): Added
12523 `out bool has_type_arg'; if set, we need to pass the type to
12525 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12526 Stelem_Any/Ldelem_Any for generic parameters.
12528 2003-11-02 Martin Baulig <martin@ximian.com>
12530 * expression.cs (Invocation.EmitCall): Use
12531 `TypeManager.IsValueType()' to check whether it's a value type.
12532 Don't set `struct_call' when calling a method on a type parameter.
12534 2003-11-02 Martin Baulig <martin@ximian.com>
12536 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12537 and removed the TypeBuilder argument.
12539 * typemanager.cs (TypeManager.IsValueType): Return
12540 `t.IsGenericParameter || t.IsValueType'.
12542 2003-10-25 Martin Baulig <martin@ximian.com>
12544 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12545 call ConstructedType.Resolve() on it.
12547 * generic.cs (ConstructedType.Resolve): Set `type' on success.
12549 2003-10-25 Martin Baulig <martin@ximian.com>
12551 * class.cs (TypeContainer.GetClassBases): Changed
12552 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
12553 CS8214 reporting here.
12554 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12555 instead of a `Type' for our parent. In case of a recursive
12556 declaration (see tests/gen-23.cs for an example), our parent is a
12557 ConstructedType and it doesn't have its type set. So, first
12558 create our own TypeBuilder, then call constructed.Resolve() to get
12559 the parent's type and finally TypeBuilder.SetParent() it.
12561 * ecore.cs (TypeExpr.Name): New public virtual property.
12564 (ConstructedType): We're now a TypeExpr and not just an Expression.
12565 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12566 arguments here; this is done later.
12567 (ConstructedType.Resolve): New public method to resolve the type
12568 arguments and bind them.
12570 2003-10-21 Martin Baulig <martin@ximian.com>
12572 * convert.cs: Use `TypeManager.IsValueType' instead of
12573 'type.IsValueType' everywhere.
12575 * typemanager.cs (TypeManager.IsValueType): Return true for type
12576 parameters. The reason for this is that we need to box a type
12577 parameter when converting it to a reference type.
12579 * cs-parser.jay: Added support for default value expressions.
12581 * generics.cs (DefaultValueExpression): New public class.
12583 2003-10-17 Martin Baulig <martin@ximian.com>
12585 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12586 TypeContainer so we can also use this for Interfaces.
12587 (TypeParameter.Resolve): Likewise.
12589 * interface.cs (Interface.DefineType): Added support for generic
12592 * cs-parser.jay: Added support for generic structs and interfaces.
12594 2003-10-17 Martin Baulig <martin@ximian.com>
12596 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12597 call generic methods :-)
12599 2003-10-16 Martin Baulig <martin@ximian.com>
12601 * cs-parser.jay (namespace_or_type_name): Only create a
12602 GenericMemberAccess if we actually have type arguments.
12604 2003-10-13 Martin Baulig <martin@ximian.com>
12606 * class.cs (Method.Define): If we're a generic method, call
12607 TypeBuilder.DefineGenericMethod () before resolving
12609 (MethodData): Added .ctor which takes an additional MethodBuilder
12610 argument; this is used for generic methods.
12611 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12612 we already have a MethodBuilder.
12614 2003-10-10 Martin Baulig <martin@ximian.com>
12616 * class.cs (Method): Added .ctor which takes a `GenericMethod'
12617 instead of a `DeclSpace'. This is used for generic methods.
12619 * cs-parser.jay (method_header): Added support for generic
12620 methods; create a `GenericMethod' instance and pass it to the
12621 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12622 parameters and locals.
12624 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12625 since we already have the location. Check whether we're a generic
12626 type declaration or a generic method and create the correct type
12629 * generic.cs (TypeParameter.DefineMethod): New public method.
12630 (GenericMethod): New public class; derives from DeclSpace and is
12631 used for generic methods.
12633 2003-10-09 Martin Baulig <martin@ximian.com>
12635 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12637 (MethodCore.DoDefineParameters): Removed the TypeContainer
12638 argument; use the DeclSpace which was passed to the .ctor instead.
12639 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12640 TypeContainer; we only need a DeclSpace here.
12642 2003-10-09 Martin Baulig <martin@ximian.com>
12644 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12646 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12647 EmitContext's .ctor.
12649 2003-10-09 Martin Baulig <martin@ximian.com>
12651 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12652 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12653 AsAccessible(), moved them as well.
12655 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12657 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12659 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12660 generation for >=, as spotted by Paolo, bug 48679.
12661 Patch from David Waite.
12663 * cs-tokenizer.cs: Add handling for #pragma.
12665 * cs-parser.jay: Allow for both yield and yield return in the
12666 syntax. The anti-cobolization of C# fight will go on!
12668 * class.cs (TypeBuilder.DefineType): Catch error condition here
12669 (Parent.DefineType erroring out and returning null).
12671 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12672 coping with enumerations variables, we were mistakenly processing
12673 them as a regular value type instead of built-in types. Fixes the
12676 * typemanager.cs (IsBuiltinOrEnum): New method.
12678 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12680 * cs-parser.jay: Upgrade: yield now needs the return clause.
12682 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12684 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12686 2003-09-29 Martin Baulig <martin@ximian.com>
12688 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12689 inflated generic methods.
12691 * generics.cs (ConstructedType): Distinguish between open and
12692 closed constructed types; correctly resolve the arguments.
12694 2003-09-22 Martin Baulig <martin@ximian.com>
12696 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12697 all type arguments meet their constraints.
12699 2003-09-19 Martin Baulig <martin@ximian.com>
12701 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12702 `MemberCache parent' argument. Normally, an interface doesn't
12703 have a parent type except System.Object, but we use this in gmcs
12704 for generic type parameters.
12706 2003-09-18 Martin Baulig <martin@ximian.com>
12708 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12709 on `type.IsInterface'; don't check whether the type has a parent
12710 to determine whether it's an interface.
12712 2003-09-17 Martin Baulig <martin@ximian.com>
12714 * generic.cs (ConstructedType.ToString): Always use `name' as the
12717 2003-09-15 Martin Baulig <martin@ximian.com>
12719 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12721 * generic.cs (Constraints.Resolve): New public method; this is
12722 called to resolve the constraint types and to check whether all
12723 the constraints are correct.
12724 (Constraints.Types): New public property.
12725 (TypeParameter.Resolve): New public method; resolves all the
12726 type's constraints.
12728 * class.cs (TypeContainer.DefineType): Call
12729 TypeParameter.Resolve() before actually defining the type.
12731 2003-09-15 Martin Baulig <martin@ximian.com>
12733 * class.cs (TypeContainer.DefineType): Added an error flag to
12734 avoid reporting duplicate CS0146's ("class definition is
12737 * driver.cs (Driver.MainDriver): Abort if
12738 RootContext.ResolveTree() reported any errors.
12740 2003-09-07 Martin Baulig <martin@ximian.com>
12742 * report.cs (Error, Warning): Added overloaded versions which take
12743 a `params object[] args' and call String.Format().
12745 2003-09-07 Martin Baulig <martin@ximian.com>
12747 * decl.cs (DeclSpace..ctor): Don't call
12748 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12749 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12750 (DeclSpace.RecordDecl): New method.
12752 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12754 2003-09-02 Ravi Pratap <ravi@ximian.com>
12756 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12757 value attributes to be applied to ParameterBuilders.
12759 * class.cs (MethodCore.LabelParameters): Make static and more
12760 generic so that it can be used from other places - like interface
12761 methods, for instance.
12763 * interface.cs (Interface.Emit): Call LabelParameters before
12764 emitting attributes on the InterfaceMethod.
12766 2003-09-07 Martin Baulig <martin@ximian.com>
12768 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12769 if the number of type parameters doesn't match.
12771 2003-09-04 Martin Baulig <martin@ximian.com>
12773 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12774 for arrays of generic type params (ie. `!0[]').
12776 2003-09-04 Martin Baulig <martin@ximian.com>
12778 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12781 2003-09-04 Martin Baulig <martin@ximian.com>
12783 * decl.cs (DeclSpace.LookupGeneric): New method.
12784 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12787 * generic.cs (TypeParameterExpr): Take a TypeParameter as
12788 argument, not just a string.
12789 (TypeParameter.Define): New public method; this is called to
12790 actually define the generic parameter; after this, you can use the
12791 new `Type' property to get the type.
12793 2003-09-04 Martin Baulig <martin@ximian.com>
12795 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12796 is now an ArrayList; initialize the result of the `TypeParameters'
12798 (DeclSpace.GetGenericData): Removed.
12799 (DeclSpace.LookupGeneric): Temporarily removed; we need to
12800 implement this in a different way.
12801 (DeclSpace.GetTypeParameters): Removed; there's now a
12802 `TypeParameters' property.
12803 (DeclSpace.TypeParameters): New public property.
12805 * generic.cs (Constraints): Make this class public.
12806 (TypeParameter): New public class.
12808 2003-09-04 Martin Baulig <martin@ximian.com>
12810 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12811 generic parameters.
12813 * class.cs (TypeContainer.DefineType): Call
12814 TypeBuilder.DefineGenericParameter () on all generic parameters if
12815 this is a generic type.
12817 2003-08-28 Martin Baulig <martin@ximian.com>
12819 * sample-stack.il: Compile this with ilasm: "ilasm /dll
12822 * sample-hello.cs: Compile this with gmcs: "gmcs
12823 /r:sample-stack.dll sample-hello.cs".
12825 2003-08-28 Martin Baulig <martin@ximian.com>
12827 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12828 the parameters to the generic type.
12830 2003-08-28 Martin Baulig <martin@ximian.com>
12832 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12834 2003-08-28 Martin Baulig <martin@ximian.com>
12836 * cs-parser.jay (opt_type_argument_list): Use
12837 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12838 (primary_expression): Replace `qualified_identifier' with `type_name'.
12839 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12841 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12842 parser to check whether it is syntactically a type parameter list;
12843 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12846 2003-08-26 Martin Baulig <martin@ximian.com>
12848 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12849 resolving aliases; fixes #47927.
12851 2003-08-26 Martin Baulig <martin@ximian.com>
12853 * statement.cs (Using.DoResolve): This is internally emitting a
12854 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12855 do not always return. Fixes #47681.
12857 2003-08-26 Martin Baulig <martin@ximian.com>
12859 * decl.cs (MemberCore): Moved WarningNotHiding(),
12860 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12862 (AdditionResult): Make this nested in DeclSpace.
12863 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12864 argument; call NamespaceEntry.Define() unless we're nested in a
12867 * namespace.cs (Namespace.DefineName): New public function. This
12868 is called from DeclSpace's .ctor to add
12869 (Namespace.Lookup): Include DeclSpaces in the lookup.
12871 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12873 * const.cs (Const): Derive from MemberBase, not MemberCore.
12875 2003-08-25 Martin Baulig <martin@ximian.com>
12877 * convert.cs (Convert.ExplicitReferenceConversion): When
12878 converting from an interface type to a class, unbox if the target
12879 type is a struct type. Fixes #47822.
12881 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12883 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12886 2003-08-22 Martin Baulig <martin@ximian.com>
12888 * class.cs (TypeManager.DefineType): When defining a nested type,
12889 call DefineType() on our parent; fixes #47801.
12891 2003-08-22 Martin Baulig <martin@ximian.com>
12893 * class.cs (MethodData.Define): While checking if a method is an
12894 interface implementation, improve the test a bit more to fix #47654.
12896 2003-08-22 Martin Baulig <martin@ximian.com>
12898 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12899 correctly; fixes #47722.
12901 2003-08-22 Martin Baulig <martin@ximian.com>
12903 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12904 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12906 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12908 2003-08-22 Martin Baulig <martin@ximian.com>
12910 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12911 can only be assigned in static constructors. Fixes #47161.
12913 2003-08-22 Martin Baulig <martin@ximian.com>
12915 Rewrote and improved the flow analysis code.
12917 * flowbranching.cs (FlowBranching): Make this class abstract.
12918 (FlowBranching.CreateBranching): New static function to create a
12919 new flow branching.
12920 (FlowBranchingBlock, FlowBranchingException): New classes.
12921 (FlowBranching.UsageVector.Type): New public readonly field.
12922 (FlowBranching.UsageVector.Breaks): Removed the setter.
12923 (FlowBranching.UsageVector.Returns): Removed the setter.
12924 (FlowBranching.UsageVector): Added Break(), Return(),
12925 NeverReachable() and Throw() methods to modify the reachability.
12926 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12927 done by FlowBranching.Merge().
12928 (FlowBranching.UsageVector.MergeChild): New method; merges the
12929 merge result into the current vector.
12930 (FlowBranching.Merge): New abstract method to merge a branching.
12932 2003-08-12 Martin Baulig <martin@ximian.com>
12934 * expression.cs (Indirection.CacheTemporaries): Create the
12935 LocalTemporary with the pointer type, not its element type.
12937 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12939 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12940 token was a keyword or not.
12942 Add `error' options where an IDENTIFIER was expected; Provide
12943 CheckToken and CheckIdentifierToken convenience error reporting
12946 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12948 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12949 NameSpaceEntry NameSpaceEntry.
12951 (LookupInterfaceOrClass): Avoid creating a full qualified name
12952 from namespace and name: avoid doing lookups when we know the
12953 namespace is non-existant. Use new Tree.LookupByNamespace which
12954 looks up DeclSpaces based on their namespace, name pair.
12956 * driver.cs: Provide a new `parser verbose' to display the
12957 exception thrown during parsing. This is turned off by default
12958 now, so the output of a failure from mcs is more graceful.
12960 * namespace.cs: Track all the namespaces defined in a hashtable
12963 (IsNamespace): New method
12965 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12967 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12968 we know that we need to concatenate (full typename can never be
12973 * statement.cs: Use a bitfield; Do not initialize to null things
12974 which are done by the constructor by default.
12976 * cs-parser.jay: bug fix, parameter was 4, not 3.
12978 * expression.cs: Just use the property;
12980 * statement.cs: No need for GetVariableInfo method.
12982 2003-08-08 Martin Baulig <martin@ximian.com>
12984 * flowanalysis.cs (FlowReturns): This is now nested in the
12985 `FlowBranching' class.
12986 (MyBitVector): Moved this here from statement.cs.
12987 (FlowBranching.SiblingType): New enum type.
12988 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12990 2003-08-07 Martin Baulig <martin@ximian.com>
12992 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12993 `FlowBranching' class and called `BranchingType'.
12995 2003-08-07 Martin Baulig <martin@ximian.com>
12997 * flowanalysis.cs: Moved all the control flow analysis code into
13000 2003-08-07 Martin Baulig <martin@ximian.com>
13002 * assign.cs (Assign.DoResolve): `target' must either be an
13003 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13006 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13008 * expression.cs (BinaryMethod): This kind of expression is created by the
13009 Binary class if it determines that the operator has to be handled
13012 (BinaryDelegate): This kind of expression is created if we are
13013 dealing with a + or - operator on delegates.
13015 (Binary): remove method, argumetns, and DelegateOperator: when
13016 dealing with methods,
13018 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13020 * statement.cs (Block): use bitfields for the three extra booleans
13021 we had in use. Remove unused topblock parameter.
13023 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13025 * assign.cs: Drop extra unneeded tests.
13027 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13029 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13031 * statement.cs (Foreach): Use VariableStorage instead of
13034 * codegen.cs (VariableStorage): New class used by clients that
13035 require a variable stored: locals or fields for variables that
13036 need to live across yield.
13038 Maybe provide a convenience api for EmitThis+EmitLoad?
13040 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13043 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13045 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13046 RemapParameterLValue): New methods that are used to turn a
13047 precomputed FieldInfo into an expression like this:
13051 The idea is to use this instead of making LocalVariableReference
13052 have more than one meaning.
13054 * cs-parser.jay: Add error production to BASE.
13056 * ecore.cs: Deal with TypeManager.GetField returning null, which
13057 is now a valid return value.
13059 (FieldExprNoAddress): New expression for Fields whose address can
13062 * expression.cs (LocalVariableReference): During the resolve
13063 phases, create new expressions if we are in a remapping context.
13064 Remove code that dealt with remapping here.
13066 (ParameterReference): same.
13068 (ProxyInstance): New expression, like the `This' expression, but
13069 it is born fully resolved. We know what we are doing, so remove
13070 the errors that are targeted to user-provided uses of `this'.
13072 * statement.cs (Foreach): our variable is now stored as an
13073 Expression; During resolution, follow the protocol, dont just
13074 assume it will return this.
13076 2003-08-06 Martin Baulig <martin@ximian.com>
13078 * support.cs (SeekableStreamReader.cs): New public class.
13080 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13081 SeekableStreamReader instead of the normal StreamReader.
13083 2003-08-04 Martin Baulig <martin@ximian.com>
13085 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13086 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13087 deambiguate casts and delegate invocations.
13088 (parenthesized_expression): Use the new tokens to ensure this is
13089 not a cast of method invocation.
13091 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13092 when reading a `)' and Deambiguate_CloseParens () was previously
13095 * expression.cs (ParenthesizedExpression): New class. This is
13096 just used for the CS0075 test.
13097 (Binary.DoResolve): Check for CS0075.
13099 2003-07-29 Ravi Pratap <ravi@ximian.com>
13101 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13102 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13103 reference comparison.
13105 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13106 examine the ReturnType for equality - this is necessary in the
13107 cases of implicit and explicit operators whose signature also
13108 includes the return type.
13110 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13112 * namespace.cs: Cache the result of the namespace computation,
13113 instead of computing it every time.
13115 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13117 * decl.cs: Use a global arraylist that we reuse over invocations
13118 to avoid excesive memory consumption. Reduces memory usage on an
13119 mcs compile by one meg (45 average).
13121 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13122 private, work around that.
13124 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13126 * literal.cs (IntLiteral): Define Zero and One static literals.
13128 * cs-parser.jay (integer_literal): use static literals to reduce
13129 memory usage for the most used literals (0, 1 and -1). 211kb
13130 reduced in memory usage.
13132 Replace all calls to `new ArrayList' with `new
13133 ArrayList(4)' which is a good average number for most allocations,
13134 and also requires only 16 bytes of memory for its buffer by
13137 This reduced MCS memory usage in seven megabytes for the RSS after
13140 2003-07-28 Ravi Pratap <ravi@ximian.com>
13142 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13143 handle params methods the correct way by forming only one
13144 applicable set with params and normal methods in them. Earlier we
13145 were looking at params methods only if we found no normal methods
13146 which was not the correct thing to do.
13148 (Invocation.BetterFunction): Take separate arguments indicating
13149 when candidate and the best method are params methods in their
13152 This fixes bugs #43367 and #46199.
13154 * attribute.cs: Documentation updates.
13156 (CheckAttribute): Rename to CheckAttributeTarget.
13157 (GetValidPlaces): Rename to GetValidTargets.
13159 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13160 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13164 2003-07-28 Miguel de Icaza <miguel@ximian.com>
13166 * codegen.cs: Compute IsGeneric correctly.
13168 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13171 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13172 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
13173 regressions, and I was chasing more bugs than I required.
13175 * interface.cs: Use expressions for base type names (like classes
13176 and structs have been doing for a while now), and resolve that.
13177 This patch should probably go into head as well.
13179 This makes it one less user of FindType.
13181 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13183 This compiler can not self host currently. Need to fix that.
13185 * Makefile: compile to `gmcs.exe'
13187 * driver.cs: Turn on v2 by default on gmcs.
13189 * generic.cs (ConstructedType): Does no longer take a container
13190 type argument; That will be taken care of later.
13192 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13193 Use SimpleName to resolve for now, so we can continue the work on
13194 the parser, until we get Type.GetType that understands generics.
13196 (ConstructedType.ToString): Implement
13198 (TypeArguments.Resolve): Resolve the child expressions as types.
13200 * cs-parser.jay: Rename interface_constraints to
13201 type_parameter_constraints
13203 (namespace_or_type_name): Only use constructed types for the basic
13204 construction, we will deal with identifier<...> later.
13206 (type/type_name): No longer call DecomposeQI, as
13207 namespace_or_type_name is always decoded now.
13209 2003-07-22 Ravi Pratap <ravi@ximian.com>
13211 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13212 closely: we eliminate methods in base types when we have an
13213 applicable method in a top-level type.
13215 Please see section 14.5.5.1 for an exact description of what goes
13218 This fixes bug #45127 and a host of other related to corlib compilation.
13220 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13221 array is the method corresponding to the top-level type (this is
13222 because of the changes made to icall.c) so we change this
13225 (MethodGroupExpr.Name): This too.
13227 * typemanager.cs (GetElementType): New method which does the right
13228 thing when compiling corlib.
13230 * everywhere: Make use of the above in the relevant places.
13232 2003-07-22 Martin Baulig <martin@ximian.com>
13234 * cs-parser.jay (invocation_expression): Moved
13235 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13236 `cast_expression', but create a InvocationOrCast which later
13237 resolves to either an Invocation or a Cast.
13239 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13240 method; call this before EmitStatement() to make sure that this
13241 expression can be used as a statement.
13243 * expression.cs (InvocationOrCast): New class; resolves to either
13244 an Invocation or a Cast.
13246 * statement.cs (StatementExpression): Call ResolveStatement() on
13247 the ExpressionStatement before emitting it.
13249 2003-07-21 Martin Baulig <martin@ximian.com>
13251 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13252 `ref' and `out' attributes match; fixes #46220.
13253 (MemberAccess.ResolveMemberAccess): You can't reference a type
13254 through an expression; fixes #33180.
13255 (Indexers.GetIndexersForType): Don't return the indexers from
13256 interfaces the class implements; fixes #46502.
13258 2003-07-21 Martin Baulig <martin@ximian.com>
13260 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13261 CS0661 checks; fixes bug #30442.
13263 2003-07-21 Martin Baulig <martin@ximian.com>
13265 * decl.cs (AdditionResult): Added `Error'.
13267 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13269 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13270 cs0031.cs actually work.
13272 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13274 * cs-parser.jay (namespace_name): do not use
13275 namespace_or_type_name, use qualified_identifier, because
13276 namespace_or_type_name will soon return a composed expression
13277 instead of a string.
13279 (namespace_or_type_name): Instead of returning a string, now this
13280 production returns an expression.
13282 * codegen.cs (EmitContext): Setup IsGeneric property based on
13283 whether our DeclSpace is generic, our the method is generic.
13285 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13286 the method is generic.
13288 * cs-parser.jay (type_arguments, opt_type_argument_list,
13289 type_parameters, type_parameter_list, opt_type_parameter_list,
13290 type_parameter,, opt_type_parameter_constraints_clauses,
13291 type_parameter_constraints_clauses,
13292 type_parameter_constraint_clause, type_parameter_constraint,
13293 interface_constraints): Add new production
13295 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13296 DeclSpace is generic or not.
13298 (DeclSpace.SetParameterInfo): New routine, used to set the
13299 parameter info for a type.
13301 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13302 returns a GenericTypeExpr
13304 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13305 generic, lookup the generic argument.
13307 * attribute.cs: Do not allow TypeParameterExpressions in
13310 * class.cs: Do not allow the Main method to be defined in a
13313 * expression.cs (SizeOf): Do not allow generic types to be used as
13314 arguments to sizeof.
13316 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13317 it: whether a type is generic or not. Only works for types we are
13318 currently building for now.
13320 2003-07-20 Martin Baulig <martin@ximian.com>
13322 * namespace.cs: Fixed that bug which caused a crash when compiling
13323 the debugger's GUI.
13325 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13327 * typemanager.cs (LookupTypeReflection): Never expose types which
13328 are NotPublic, NestedPrivate, NestedAssembly, or
13329 NestedFamANDAssem. We used to return these, and later do a check
13330 that would report a meaningful error, but the problem is that we
13331 would not get the real match, if there was a name override.
13333 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13335 * namespace.cs (Namespace, Name): Do not compute the namespace
13336 name dynamically, compute it in the constructor. This reduced
13337 memory usage by 1697 KB.
13339 * driver.cs: Use --pause to pause at the end.
13341 2003-07-17 Peter Williams <peter@newton.cx>
13343 * Makefile: Change the name of the test target so that it doesn't
13344 conflict with the recursive test target.
13346 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13348 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13349 AddressOf): Do not use EmitThis, that was wrong, use the actual
13352 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13354 * class.cs (MethodData.Define): While checking if a method is an
13355 interface implementation, improve the test: If we are not public
13356 (use new test here: use the computed MethodAttributes directly,
13357 instead of the parsed modifier flags) check if the `implementing'
13358 method comes from an interface or not.
13360 * pending.cs (VerifyPendingMethods): Slightly better error
13363 * makefile: add test target that does the mcs bootstrap.
13365 2003-07-16 Ravi Pratap <ravi@ximian.com>
13367 * interface.cs (Define): Do nothing here since there are no
13368 members to populate etc. Move the attribute emission out of here
13369 since this was just totally the wrong place to put it. Attribute
13370 application happens during the 'Emit' phase, not in the 'Define'
13373 (Emit): Add this method and move the attribute emission here
13375 * rootcontext.cs (EmitCode): Call the Emit method on interface
13378 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13380 * expression.cs (OverloadResolve): Report error only if Location
13381 is not 'Null' which means that there was a probe going on.
13383 2003-07-14 Martin Baulig <martin@ximian.com>
13385 * expression.cs (ConditionalLogicalOperator): New public class to
13386 implement user defined conditional logical operators.
13387 This is section 14.11.2 in the spec and bug #40505.
13389 2003-07-14 Martin Baulig <martin@ximian.com>
13391 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13393 2003-07-14 Martin Baulig <martin@ximian.com>
13395 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13397 * ecore.cs (IVariable.VerifyFixed): New interface method.
13399 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13400 operator, check whether the variable is actually fixed. Fixes bug
13401 #36055. Set a variable definitely assigned when taking its
13402 address as required by the spec.
13404 * statement.cs (LocalInfo.IsFixed): New field.
13405 (LocalInfo.MakePinned): Set `IsFixed' to true.
13407 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13409 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13410 for .ctors, ensure that we only ask for members declared in the
13411 attribute type (BindingFlags.DeclaredOnly).
13415 * expression.cs (Error_WrongNumArguments): Report error 1501
13416 correctly the way CSC does.
13418 2003-07-13 Martin Baulig <martin@ximian.com>
13420 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13421 lookup on the fully qualified name, to make things like "X.X" work
13422 where "X.X" is a fully qualified type name, but we also have a
13423 namespace "X" in the using list. Fixes #41975.
13425 2003-07-13 Martin Baulig <martin@ximian.com>
13427 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13428 function. If we're a CompoundAssign, we need to create an embedded
13429 CompoundAssign, not an embedded Assign.
13430 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13433 2003-07-13 Martin Baulig <martin@ximian.com>
13435 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13436 work to fix bug #46088.
13438 2003-07-13 Ravi Pratap <ravi@ximian.com>
13440 * class.cs (Operator.Emit): Do not emit attributes here - it is
13441 taken care of by the Method class that we delegate too. This takes
13442 care of bug #45876.
13444 2003-07-10 Martin Baulig <martin@ximian.com>
13446 * expression.cs (TypeOfVoid): New class.
13447 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13449 2003-07-10 Martin Baulig <martin@ximian.com>
13451 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13454 2003-07-10 Martin Baulig <martin@ximian.com>
13456 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13457 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13459 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13461 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13463 2003-07-10 Martin Baulig <martin@ximian.com>
13465 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13466 of decimal. Fixes #42850.
13468 NOTE: I also fixed the created byte blob, but this doesn't work on
13469 the MS runtime and csc never produces any byte blobs for decimal
13472 2003-07-10 Martin Baulig <martin@ximian.com>
13474 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13475 structs; fixes #32068.
13476 (Block.AddChildVariableNames): Fixed #44302.
13478 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13480 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13482 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13484 * attribute.cs: And this test is onger needed.
13486 2003-07-08 Martin Baulig <martin@ximian.com>
13488 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13489 inaccessible types. Fixes #36313.
13491 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13493 * namespace.cs (NamespaceEntry): Create implicit entries for all
13494 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13495 implicit entries for N1.N2 and N1.
13497 2003-07-08 Martin Baulig <martin@ximian.com>
13499 Rewrote the handling of namespaces to fix a lot of the issues
13500 wrt. `using' aliases etc.
13502 * namespace.cs (Namespace): Splitted this class into a
13503 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13505 * typemanager.cs (TypeManager.IsNamespace): Removed.
13506 (TypeManager.ComputeNamespaces): Only compute namespaces from
13507 loaded assemblies here, not the namespaces from the assembly we're
13508 currently compiling.
13510 2003-07-08 Martin Baulig <martin@ximian.com>
13512 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13514 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13516 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13519 I thought about the memory savings here, but LookupTypeReflection
13520 is used under already very constrained scenarios. Compiling
13521 corlib or mcs only exposes one hit, so it would not really reduce
13522 any memory consumption.
13524 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13526 * typemanager.cs: fixes bug #45889 by only adding public types from
13527 other assemblies to the list of known types.
13529 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13531 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13532 on the type we resolved.
13534 2003-07-05 Martin Baulig <martin@ximian.com>
13536 * pending.cs (PendingImplementation.ParentImplements): Don't
13537 create the proxy if the parent is abstract.
13539 * class.cs (TypeContainer.DefineIndexers): Process explicit
13540 interface implementations first. Fixes #37714.
13542 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13544 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13545 defined recursively; but since we modify the input parameters
13546 (left is set to `this' temporarily), we reset this value if the
13547 left_is_explicit is false, which gives the original semantics to
13550 * literal.cs (NullPointer): new class used to represent a null
13551 literal in a pointer context.
13553 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13554 type is a pointer, use a NullPointer object instead of a
13555 NullLiteral. Closes 43687
13557 (ExplicitConversion): Convert pointer values using
13558 the conv opcode to the proper type.
13560 * ecore.cs (New): change ValueTypeVariable property into a method,
13561 that returns whether the valuetype is suitable for being used.
13563 * expression.cs (Binary.DoNumericPromotions): Only return if we
13564 the int constant was a valid uint, and we can return both left and
13565 right as uints. If not, we continue processing, to trigger the
13566 type conversion. This fixes 39018.
13568 * statement.cs (Block.EmitMeta): During constant resolution, set
13569 the CurrentBlock property on the emitcontext, so that we resolve
13570 constants propertly.
13572 2003-07-02 Martin Baulig <martin@ximian.com>
13574 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13575 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13577 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13578 than emitting it here.
13580 * statement.cs: Fixed some more flow analysis bugs.
13582 2003-07-02 Martin Baulig <martin@ximian.com>
13584 * class.cs (MethodData.Define): When implementing interface
13585 methods, set Final unless we're Virtual.
13587 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13588 check work for interface methods.
13590 2003-07-01 Martin Baulig <martin@ximian.com>
13592 * ecore.cs (EmitContext.This): Replaced this property with a
13593 GetThis() method which takes a Location argument. This ensures
13594 that we get the correct error location for a CS0188.
13596 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13598 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13599 ImplicitStandardConversion.
13601 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13603 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13605 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13608 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13610 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13613 (MethodData.Define): Turn off initlocals for unsafe methods.
13615 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13617 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13618 complete; Fixes #37521.
13620 * delegate.cs: Use Modifiers.TypeAttr to compute the
13621 TypeAttributes, instead of rolling our own. This makes the flags
13622 correct for the delegates.
13624 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13626 * class.cs (Constructor.Define): Set the private flag for static
13627 constructors as well.
13629 * cs-parser.jay (statement_expression): Set the return value to
13630 null, to avoid a crash when we catch an error.
13632 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13634 * cs-parser.jay: Applied patch from Jackson that adds support for
13635 extern and unsafe modifiers to destructor declarations.
13637 * expression.cs: Report error 21 if the user is trying to index a
13640 * driver.cs: Add an error message, suggested by the bug report.
13642 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13643 if we do not have a ": this ()" constructor initializer. Fixes 45149
13645 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13647 * namespace.cs: Add some information to reduce FAQs.
13649 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13651 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13652 underlying enumeration types. Fixes #43915.
13654 * expression.cs: Treat ushort/short as legal values to be used in
13655 bitwise operations.
13657 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13659 * delegate.cs: transfer custom attributes for paramenters from
13660 the delegate declaration to Invoke and BeginInvoke.
13662 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13664 * attribute.cs: handle custom marshalers and emit marshal info
13667 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13669 * makefile.gnu: Added anonymous.cs to the compiler sources.
13671 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13673 * iterators.cs: Change the name of the proxy class to include two
13676 * cs-parser.jay: Update grammar to include anonymous methods.
13678 * anonymous.cs: new file.
13680 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13682 * class.cs (Field.Define): Add missing test for pointers and
13685 2003-05-27 Ravi Pratap <ravi@ximian.com>
13687 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13688 we use the stobj opcode.
13690 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13691 since it wasn't the correct fix.
13693 It still is puzzling that we are required to use stobj for IntPtr
13694 which seems to be a ValueType.
13696 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13698 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13699 during regular simple name resolution. Now, the trick is that
13700 instead of returning for processing the simplename, we do a
13701 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13702 contextual lookup type). If a match is found, return that, if
13703 not, return for further composition.
13705 This fixes long-standing 30485.
13707 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13708 using the address to initialize an object, do an Stobj instead of
13709 using the regular Stelem.
13711 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13712 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13713 Because if we are a BaseIndexerAccess that value will be true.
13716 * statement.cs (GotoCase.Resolve): Return after reporting an
13717 error, do not attempt to continue.
13719 * expression.cs (PointerArithmetic.Emit): If our operand is a
13720 long, convert our constants to match the operand before
13721 multiplying. Convert to I type before adding. Fixes 43670.
13723 2003-05-14 Ravi Pratap <ravi@ximian.com>
13725 * enum.cs (ImplicitConversionExists) : Rename to
13726 ImplicitEnumConversionExists to remove ambiguity.
13728 * ecore.cs (NullCast): New type of cast expression class which
13729 basically is very similar to EmptyCast with the difference being
13730 it still is a constant since it is used only to cast a null to
13732 (eg. (string) null)
13734 * convert.cs (ImplicitReferenceConversion): When casting a null
13735 literal, we return a NullCast.
13737 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13738 should be around anymore.
13740 The renaming (reported was slightly wrong). Corrections:
13742 ConvertImplicitStandard -> ImplicitConversionStandard
13743 ConvertExplicitStandard -> ExplicitConversionStandard
13745 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13746 before passing them in !
13748 * convert.cs (ImplicitConversionStandard): When comparing for
13749 equal expr and target types, ensure that expr is not a
13752 In general, we must not be checking (expr_type ==
13753 target_type) in the top level conversion methods
13754 (ImplicitConversion, ExplicitConversion etc). This checking is
13755 done in the methods that they delegate to.
13757 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13759 * convert.cs: Move Error_CannotConvertType,
13760 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13761 ImplicitNumericConversion, ImplicitConversionExists,
13762 ImplicitUserConversionExists, StandardConversionExists,
13763 FindMostEncompassedType, FindMostSpecificSource,
13764 FindMostSpecificTarget, ImplicitUserConversion,
13765 ExplicitUserConversion, GetConversionOperators,
13766 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13767 TryImplicitIntConversion, Error_CannotConvertImplicit,
13768 ConvertImplicitRequired, ConvertNumericExplicit,
13769 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13770 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13773 Perform the following renames:
13775 StandardConversionExists -> ImplicitStandardConversionExists
13776 ConvertImplicit -> ImplicitConversion
13777 ConvertImplicitStandard -> ImplicitStandardConversion
13778 TryImplicitIntConversion -> ImplicitIntConversion
13779 ConvertImplicitRequired -> ImplicitConversionRequired
13780 ConvertNumericExplicit -> ExplicitNumericConversion
13781 ConvertReferenceExplicit -> ExplicitReferenceConversion
13782 ConvertExplicit -> ExplicitConversion
13783 ConvertExplicitStandard -> ExplicitStandardConversion
13785 2003-05-19 Martin Baulig <martin@ximian.com>
13787 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13788 (TypeInfo): Added support for structs having structs as fields.
13790 * ecore.cs (FieldExpr): Implement IVariable.
13791 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13792 VariableInfo for the field.
13794 2003-05-18 Martin Baulig <martin@ximian.com>
13796 * expression.cs (This.DoResolve): Report a CS0027 if we're
13797 emitting a field initializer.
13799 2003-05-18 Martin Baulig <martin@ximian.com>
13801 * expression.cs (This.ResolveBase): New public function.
13802 (This.DoResolve): Check for CS0188.
13804 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13807 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13808 `instance_expression' to null if we don't have any non-static
13811 2003-05-18 Martin Baulig <martin@ximian.com>
13813 Reworked the way how local variables and parameters are handled by
13814 the flow analysis code.
13816 * statement.cs (TypeInfo, VariableMap): New public classes.
13817 (VariableInfo): New public class. This is now responsible for
13818 checking whether a variable has been assigned. It is used for
13819 parameters and local variables.
13820 (Block.EmitMeta): Take the InternalParameters as argument; compute
13821 the layout of the flow vectors here.
13822 (Block.LocalMap, Block.ParameterMap): New public properties.
13823 (FlowBranching): The .ctor doesn't get the InternalParameters
13824 anymore since Block.EmitMeta() now computes the layout of the flow
13826 (MyStructInfo): This class is now known as `StructInfo' and nested
13827 in `TypeInfo'; we don't access this directly anymore.
13829 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13830 property and removed IsAssigned(), IsFieldAssigned(),
13831 SetAssigned() and SetFieldAssigned(); we now call them on the
13832 VariableInfo so we don't need to duplicate this code everywhere.
13834 * expression.cs (ParameterReference): Added `Block block' argument
13836 (LocalVariableReference, ParameterReference, This): The new
13837 VariableInfo class is now responsible for all the definite
13840 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13841 IsParameterAssigned, SetParameterAssigned): Removed.
13843 2003-05-18 Martin Baulig <martin@ximian.com>
13845 * typemanager.cs (InitCoreTypes): Try calling
13846 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13847 the 3-args-version. Corlib now also needs our `void_type'.
13848 (GetMethod): Added overloaded version which takes an optional
13849 `bool report_errors' to allow lookups of optional methods.
13851 2003-05-12 Martin Baulig <martin@ximian.com>
13853 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13854 only used for locals and not for parameters.
13856 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13858 * support.cs (InternalParameters.ParameterType): Return the
13859 ExternalType of the parameter.
13861 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13864 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13866 * class.cs (MethodData.Define): Do not set the `newslot' on
13867 interface members, if they are also flagged as "override".
13869 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13870 better code for ++i and i++. This only works for static fields
13871 and local variables.
13873 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13874 want to pull the DeclSpace out of the builder_to_declspace instead
13875 of the TypeBuilder (like in TypeContainer.FindMembers).
13877 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13878 instead of LookupTypeContainer. Fixes the crash on .NET for
13879 looking up interface members.
13881 * const.cs: Create our own emit context during the Definition
13882 stage, so that constants are evaluated in the proper context, when
13883 a recursive definition happens.
13885 2003-05-11 Martin Baulig <martin@ximian.com>
13887 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13888 new block for a switch section.
13889 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13890 the adding/lookup in the switch block. Fixes #39828.
13892 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13894 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13895 functionality: I needed to convert the data after I had performed
13896 the add/sub operation into the operands type size.
13898 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13899 pass the type for the box operation, otherwise the resulting
13900 object would have been of type object.
13902 (BoxedCast): Add constructor to specify the type to box as.
13904 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13906 * iterators.cs: I was reusing the `count' variable inadvertently,
13907 take steps to not allow this to happen.
13909 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13911 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13912 by creating an array at the point where the params starts and
13913 putting all those arguments there, then adjusting the size of the
13916 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13918 * expression.cs (New.AddressOf): Implement interface
13919 IMemoryLocation. This is used when the `new' operator is used in
13920 the context of an invocation to a method on a value type.
13922 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13925 * namespace.cs: Also check the using aliases here.
13927 * driver.cs: Move the test for using validity after the types have
13928 been entered, so we do a single pass that also includes the using
13931 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13932 in the regular case. CreateSiblingForFinally is doing extra
13935 * attribute.cs (GetAttributeArgumentExpression): Store the result
13936 on an out value, and use the return value to indicate failure
13937 instead of using null (which is a valid return for Constant.GetValue).
13939 * statement.cs: Perform the analysis flow for the increment
13940 portion after the statement, because this will be the real flow of
13941 execution. Fixes #42385
13943 * codegen.cs (EmitContext.EmitArgument,
13944 EmitContext.EmitStoreArgument): New helper functions when the
13945 RemapToProxy flag is set.
13947 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13950 Add support for remapping parameters.
13952 * iterators.cs: Propagate parameter values; Store parameter
13953 values in the proxy classes.
13955 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13957 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13958 need a proxy reference; I do not know what I was thinking
13960 * cs-parser.jay (constructor_initializer): catch another error,
13961 and display nice message.
13963 (field_declaration): catch void field declaration
13964 to flag a better error.
13966 * class.cs (MemberBase.CheckBase): Report an error instead of a
13967 warning if a new protected member is declared in a struct.
13968 (Field.Define): catch the error of readonly/volatile.
13970 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13972 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13973 volatile variable is taken
13975 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13977 * statement.cs (Fixed.Resolve): Report an error if we are not in
13980 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13982 * typemanager.cs: reuse the code that handles type clashes for
13983 delegates and enumerations.
13985 * class.cs (Report28): Always report.
13987 * expression.cs (EncodeAsAttribute): Allow nulls here.
13989 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13991 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13992 the functionality for testing whether an expression is valid for
13993 an attribute here. Also handle the case of arrays of elements
13996 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13997 encoding a linear array into an array of objects that are suitable
13998 to be passed to an CustomAttributeBuilder.
14000 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14002 * ecore.cs: (FieldExpr): Handle field remapping here.
14004 * iteratators.cs: Pass the instance variable (if the method is an
14005 instance method) to the constructors, so we can access the field
14006 variables on the class.
14008 TODO: Test this with structs. I think the THIS variable on
14009 structs might have to be a pointer, and not a refenrece
14011 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14013 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14014 local variables to fields in a proxy class.
14016 * iterators.cs (PopulateProxy): Rename our internal fields to
14018 Create a <THIS> field if we are an instance method, so we can
14019 reference our parent container variables.
14020 (MapVariable): Called back from the EmitContext code to enter a
14021 new variable to field mapping into the proxy class (we just create
14025 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14026 for using the remapped locals to fields.
14028 I placed the code here, because that gives the same semantics to
14029 local variables, and only changes the Emit code.
14031 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14032 statements inside iterators.
14033 (VariableInfo): Add a FieldBuilder for the cases when we are
14034 remapping local variables to fields in a proxy class
14036 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14037 current_block != null.
14039 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14040 not cope with strings, as it has been moved to the
14041 TableSwitchEmit. Fixed bug in switch generation.
14043 * expression.cs (New.DoResolve): Provide more context for the user
14044 when reporting an error.
14046 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14049 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14050 check the permissions for it. Note than in a type-resolution
14051 context the check was already present in DeclSpace.ResolveType,
14052 but was missing from the MemberAccess.
14054 (ArrayCreation.CheckIndices): warn if the user has
14055 more nested levels of expressions, but there are no more
14056 dimensions specified. Avoids crash on bug 41906.
14058 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14060 * statement.cs (Block): replace Implicit bool, for a generic
14062 New flag: `Unchecked'. This is used during the EmitMeta phase
14063 (which is out-of-line with the regular Resolve/Emit process for a
14064 statement, as this is done ahead of time, but still gets a chance
14065 to call constant resolve).
14067 (Block.Flags): new enum for adding a new flag.
14069 (Block.EmitMeta): track the state of unchecked.
14071 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14072 to enable constant resolution to work there as well.
14074 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14076 * typemanager.cs (ienumerable_type): Also look up
14077 System.Collections.IEnumerable.
14079 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14081 TODO: Test more than one conditional per method.
14083 * class.cs (Indexer.Define): Report the location where the user is
14084 referencing the unsupported feature.
14086 (MethodData): Overload the use of `conditionals' to
14087 minimize the creation of needless ArrayLists. This saves roughly
14088 212kb on my machine.
14090 (Method): Implement the new IIteratorContainer interface.
14091 (Method.SetYields): Implement the method by setting the ModFlags
14092 to contain METHOD_YIELDS.
14094 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14095 which just got set to null.
14097 * iterators.cs: New file.
14099 (Yield, YieldBreak): New statements.
14101 * statement.cs (Return.Resolve): Flag an error if we are used in
14102 an iterator method.
14104 * codegen.cs (InIterator): New flag set if the code is being
14105 compiled in an iterator method.
14107 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14108 internal modifier, and we just use it to avoid adding extra
14109 fields, as this is seldom used.
14111 * cs-parser.jay: Add yield_statement (yield and yield break).
14113 * driver.cs: New flag -v2 to turn on version 2 features.
14115 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14116 hashtable when v2 is enabled.
14118 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14120 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14121 there is already a namespace defined with this name.
14123 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14124 people upgraded their corlibs.
14126 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14127 always use fully qualified types, no need to use the compiler
14130 (TypeManager.IsNamespace): Use binarysearch.
14132 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14133 AddDelegate): I did not quite use the new IsValid API properly: I
14134 have to pass the short-name and the fullname. I was passing only
14135 the basename instead of the fullname sometimes.
14137 (TypeContainer.DefineType): call NamespaceClash.
14139 * interface.cs (Interface.DefineType): use NamespaceClash before
14142 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14145 * enum.cs: (Enum.DefineType): use NamespaceClash before
14148 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14149 speed increase. First, use the negative_hits cache when we get a
14150 negative. Second, add the type with its full original name
14151 instead of the new . and + encoded name (reflection uses + to
14152 separate type from a nested type). Use LookupTypeReflection
14153 directly which bypasses the type->name hashtable (that we already
14154 know does not contain the type.
14156 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14157 location/container type.
14159 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14161 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14163 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14165 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14166 method is being referenced in the method group from a static
14167 context, and report error 120 if so.
14169 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14172 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14173 is created, we create the A namespace).
14175 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14178 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14180 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14181 invocation to ModuleBuilder.GetType with the same values will
14182 return a new type instance, so we need to cache its return
14185 * expression.cs (Binary.ResolveOperator): Only allow the compare
14186 operators on enums if they are of the same type.
14188 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14189 types of ValueType on their own case. Before we were giving them
14190 the same treatment as objects.
14192 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14193 fullname. Short name is used to compare against container name.
14194 Fullname is used to check against defined namespace names.
14196 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14197 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14199 (Method.CheckBase): Call parent.
14200 (MemberBase.CheckBase): Check for protected members on sealed
14202 (PropertyBase.CheckBase): Call parent.
14203 (Field.Define): Call parent.
14205 * report.cs: Negative error codes are now mapped to 8000 - code,
14206 so that the display is render more nicely.
14208 * typemanager.cs: Do not use try/catch, instead report a regular
14211 (GetPointerType, GetReferenceType): These methods provide
14212 mechanisms to obtain the T* and T& from a T. We had the code
14213 previously scattered around the code base, and it also used
14214 TypeManager.LookupType that would go through plenty of caches.
14215 This one goes directly to the type source.
14217 In some places we did the Type.GetType followed by
14218 ModuleBuilder.GetType, but not in others, so this unifies the
14219 processing as well.
14221 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14222 statements now that we have namespace information.
14224 * typemanager.cs (IsNamespace): New method, returns whether the
14225 string presented is a namespace or not.
14227 (ComputeNamespaces): New public entry point, computes the list of
14228 available namespaces, using the GetNamespaces API call in Mono, or
14229 the slower version in MS.NET.
14231 Now before we start the semantic analysis phase, we have a
14232 complete list of namespaces including everything that the user has
14235 Deleted old code to cache namespaces in .nsc files.
14237 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14239 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14240 class/struct location definition Location for the implicit
14241 constructor location.
14243 (Operator.Define): Use the location of the operator for the
14244 implicit Method definition.
14246 (Constructor.Emit): use the constructor location for the implicit
14247 base initializer constructor.
14249 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14250 and the Expression class now contains two new methods:
14252 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14253 isolate type lookup from the rest of the resolution process.
14255 Since we use Expressions to hold type definitions due to the way
14256 we parse the input we have historically overloaded Resolve to
14257 perform the Type lookups if a special flag is passed. Now this is
14258 eliminated and two methods take their place.
14260 The differences in the two methods between xStep and xTerminal is
14261 that xStep is involved in our current lookup system that uses
14262 SimpleNames to compose a name, while xTerminal is used just to
14263 catch the case where the simplename lookup failed.
14265 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14267 * expression.cs (ResolveMemberAccess): Remove redundant code.
14268 TypeExpr expressions are always born fully resolved.
14270 * interface.cs (PopulateMethod): Do not lookup the types twice.
14271 We were doing it once during SemanticAnalysis and once during
14274 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14275 in local variable type definitions, were being returned as a
14276 SimpleName (we decomposed everything into a string), that is
14277 because primary_expression was being used instead of a type in the
14278 grammar (reduce/reduce conflicts).
14280 The part that was wrong is that we converted the expression into a
14281 string (an oversimplification in one hand, compounded with primary
14282 expressions doing string concatenation).
14288 Would return "A.B.C[]" as a SimpleName. This stopped things like
14289 using clauses from working on this particular context. And a type
14290 was being matched directly against "A.B.C[]".
14292 We now use the correct approach, and allow for ComposedCast to be
14293 part of the unary expression. So the "A.B.C []" become a composed
14294 cast of "A.B.C" (as a nested group of MemberAccess with a
14295 SimpleName at the end) plus the rank composition "[]".
14299 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14301 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14302 for the access level checking.
14304 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14305 `TypeContainer container', because I kept getting confused when I
14306 was debugging this code.
14308 * expression.cs (Indexers): Instead of tracking getters/setters,
14309 we now track them in parallel. We create one arraylist less, but
14310 most importantly it is possible now for the LValue code to find a
14311 matching get for a set.
14313 (IndexerAccess.DoResolveLValue): Update the code.
14314 GetIndexersForType has been modified already to extract all the
14315 indexers from a type. The code assumed it did not.
14317 Also make the code set the correct return type for the indexer.
14318 This was fixed a long time ago for properties, but was missing for
14319 indexers. It used to be void_type.
14321 (Binary.Emit): Test first for doubles instead of
14322 floats, as they are more common.
14324 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14325 when dealing with floats and the <=, >= operators. This fixes bug
14328 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14329 to load the array value by emitting a load on the foreach variable
14330 type. This was incorrect.
14332 We now emit the code to load an element using the the array
14333 variable type, and then we emit the conversion operator.
14337 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14339 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14341 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14343 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14344 test for protection before we test for signatures.
14346 (MethodSignature.ToString): implement.
14348 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14349 to the case where we reduced into a LongConstant.
14351 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14352 depend on whether the information is acurrate, because the
14353 Microsoft runtime will always claim that the array type is public,
14354 regardless of the real state.
14356 If the type is a pointer, another problem happens: the type is
14357 reported as non-public in Microsoft.
14359 In both cases we have to call CheckAccessLevel recursively with
14360 the underlying type as the argument to be tested.
14362 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14364 * assign.cs (Assign.Emit): If we are dealing with a compound
14365 assignment expression, we should use the code path that stores the
14366 intermediate result in a temporary value. This fixes #40903.
14368 *expression.cs (Indirection.ToString): Provide ToString method for
14371 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14373 * class.cs: Null out fields holding references to Block objects so
14374 they can be garbage collected.
14376 * expression.cs (OverloadResolve): Remove unused local.
14378 2003-04-07 Martin Baulig <martin@ximian.com>
14380 * codegen.cs (EmitContext.CurrentFile): New public field.
14381 (EmitContext.Mark): Use the CurrentFile to check whether the
14382 location is in the correct file.
14383 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14385 2003-04-07 Martin Baulig <martin@ximian.com>
14387 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14389 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14390 location. [FIXME: The location argument which gets passed to this
14391 method is sometimes wrong!]
14393 2003-04-07 Nick Drochak <ndrochak@gol.com>
14395 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14397 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14399 * expression.cs (Indirection.EmitAssign): We were using the
14400 temporary, but returning immediately instead of continuing the
14403 2003-04-06 Martin Baulig <martin@ximian.com>
14405 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14406 if it's a nested child, but also deriving from the outer class.
14409 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14410 nested child, but also deriving from the outer class. See
14412 (FilterWithClosure): We may access private members of the outer
14413 class if we're a nested child and deriving from the outer class.
14414 (RealMemberLookup): Only set `closure_private_ok' if the
14415 `original_bf' contained BindingFlags.NonPublic.
14417 2003-04-05 Martin Baulig <martin@ximian.com>
14419 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14420 probe if its a type parameter, and if so, flag an error.
14422 * decl.cs: Move here the SetParameterInfo code from class.cs.
14423 Handle IsGeneric here.
14425 Handle a variety of errors in the parameter info definition.
14427 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14428 type parameters here.
14430 * cs-parser.jay (class_declaration): report errors for parameters
14433 2003-01-21 Miguel de Icaza <miguel@ximian.com>
14435 * generic.cs: New file, contains support code for generics.
14437 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14438 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14440 Update parser for the above removals.
14442 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
14443 now taken care of in the parser.
14445 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14447 * class.cs (Event.Define): Do not allow abstract events to have
14450 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14452 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14453 block in event declarations.
14455 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14456 value type, get its address.
14458 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14459 leaving a class on the stack instead of a boolean value (int
14460 0/1). Change the code so we compare against null, and then the
14461 result against zero.
14463 * class.cs (TypeContainer.GetClassBases): We were checking for the
14464 parent class being sealed too late.
14466 * expression.cs (Binary.Emit): For <= and >= when dealing with
14467 floating point values, use cgt.un and clt.un instead of cgt and
14470 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14472 * statement.cs: Apply the same optimization as MS: skip the
14473 GetEnumerator returning an IEnumerator, and use the one returning a
14474 CharEnumerator instead. This allows us to avoid the try-finally block
14477 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14479 * cs-parser.jay: Attributes cannot be applied to
14480 namespaces. Fixes #40473
14482 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14485 (Add*): check if the name is valid using the full name for constants,
14486 fields, properties and events.
14488 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14490 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14491 char constants to be part of the enumeration.
14493 * expression.cs (Conditional.DoResolve): Add support for operator
14494 true. Implements the missing functionality from 14.12
14496 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14497 operator true/false as required by the spec.
14499 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14500 implicit conversion to boolean.
14502 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14503 also one where the type implements `operator true'.
14505 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14506 get an expression that will invoke operator true based on an
14509 (GetConversionOperators): Removed the hack that called op_True
14512 (Expression.ResolveBoolean): Move this from Statement.
14514 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14516 * ecore.cs (FieldExpr): do not allow initialization of initonly
14517 fields on derived classes
14519 2003-03-13 Martin Baulig <martin@ximian.com>
14521 * statement.cs (Block.Emit): Call ig.BeginScope() and
14522 ig.EndScope() when compiling with debugging info; call
14523 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14525 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14527 * expression.cs (Indexers): Do not construct immediately, allow
14528 for new members to be appended as we go. Fixes 38143
14530 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14532 * expression.cs: save/restore context when resolving an unchecked
14535 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14537 * cfold.cs: Catch division by zero in modulus operator during
14540 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14542 * interface.cs (Interface.DefineMembers): Avoid defining members
14545 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14547 * driver.cs: handle the +/- options for -noconfig
14549 * statement.cs (Unckeched.Resolve): Also track the state of
14550 unchecked in the Resolve phase.
14552 2003-02-27 Martin Baulig <martin@ximian.com>
14554 * ecore.cs (Expression.MemberLookup): Don't create a
14555 MethodGroupExpr for something which is not a method. Fixes #38291.
14557 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14559 * class.cs (MemberBase.CheckParameters): Also check that the type
14560 is unmanaged if it is a pointer.
14562 * expression.cs (SizeOf.Resolve): Add location information.
14564 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14565 a managed type is declared.
14567 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14568 parameter modifiers as well. Fixes bug 38606
14570 * class.cs: Very sad. Am backing out the speed up changes
14571 introduced by the ArrayList -> Array in the TypeContainer, as they
14572 were not actually that much faster, and introduced a bug (no error
14573 reports on duplicated methods).
14575 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14576 source first, this will guarantee that we have a valid expression
14577 before calling in lower levels functions that will require a
14578 resolved object. Then use this original_source in the
14579 target.ResolveLValue instead of the original source that was
14582 Another change. Use target.Resolve instead of LValueResolve.
14583 Although we are resolving for LValues, we will let the Assign code
14584 take care of that (it will be called again from Resolve). This
14585 basically allows code like this:
14587 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14588 class Y { void A (X x) { x [0] += o; }
14590 The problem was that the indexer was trying to resolve for
14591 set_Item (idx, object o) and never finding one. The real set_Item
14592 was set_Item (idx, X). By delaying the process we get the right
14597 2003-02-23 Martin Baulig <martin@ximian.com>
14599 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14600 while calling DoEmit ().
14602 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14603 source files; if you use the #line directive inside a method, the
14604 compiler stops emitting line numbers for the debugger until it
14605 reaches the end of the method or another #line directive which
14606 restores the original file.
14608 2003-02-23 Martin Baulig <martin@ximian.com>
14610 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14612 2003-02-23 Martin Baulig <martin@ximian.com>
14614 * statement.cs (Block.AddChildVariableNames): We need to call this
14615 recursively, not just for our immediate children.
14617 2003-02-23 Martin Baulig <martin@ximian.com>
14619 * class.cs (Event.Define): Always make the field private, like csc does.
14621 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14622 actually work, fixes bug #37521.
14624 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14626 * delegate.cs: When creating the various temporary "Parameters"
14627 classes, make sure that we call the ComputeAndDefineParameterTypes
14628 on those new parameters (just like we do with the formal ones), to
14629 allow them to be resolved in the context of the DeclSpace.
14631 This fixes the bug that Dick observed in Bugzilla #38530.
14633 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14635 * expression.cs (ResolveMemberAccess): When resolving a constant,
14636 do not attempt to pull a constant if the value was not able to
14637 generate a valid constant.
14639 * const.cs (LookupConstantValue): Do not report more errors than required.
14641 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14643 * expression.cs: fixes bug #38328.
14645 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14647 * class.cs: Changed all the various members that can be part of a
14648 class from being an ArrayList to be an Array of the right type.
14649 During the DefineType type_list, interface_list, delegate_list and
14650 enum_list are turned into types, interfaces, delegates and enums
14653 And during the member population, indexer_list, event_list,
14654 constant_list, field_list, instance_constructor_list, method_list,
14655 operator_list and property_list are turned into their real arrays.
14657 Although we could probably perform this operation earlier, for
14658 good error reporting we need to keep the lists and remove the
14659 lists for longer than required.
14661 This optimization was triggered by Paolo profiling the compiler
14662 speed on the output of `gen-sample-program.pl' perl script.
14664 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14665 not crash in methods like MemberLookupFailed that use this field.
14667 This problem arises when the compiler fails to resolve a type
14668 during interface type definition for example.
14670 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14672 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14673 inherit from System.Object, so we have to stop at null, not only
14674 when reaching System.Object.
14676 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14678 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14679 DeclaredOnly because the parent indexer might have had a different
14680 name, but did not loop until the top of the hierarchy was reached.
14682 The problem this one fixes is 35492: when a class implemented an
14683 indexer from an interface, we were getting the interface method
14684 (which was abstract) and we were flagging an error (can not invoke
14687 This also keeps bug 33089 functioning, and test-148 functioning.
14689 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14690 out if a method is special is to see if it is declared in a
14691 property or event, or whether it is one of the predefined operator
14692 names. This should fix correctly #36804.
14694 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14696 The goal here is to remove the dependency on EmptyCast.Peel ().
14697 Killing it completely.
14699 The problem is that currently in a number of places where
14700 constants are expected, we have to "probe" for an EmptyCast, and
14701 Peel, which is not the correct thing to do, as this will be
14702 repetitive and will likely lead to errors.
14704 The idea is to remove any EmptyCasts that are used in casts that
14705 can be reduced to constants, so we only have to cope with
14708 This bug hunt was triggered by Bug 37363 and the desire to remove
14709 the duplicate pattern where we were "peeling" emptycasts to check
14710 whether they were constants. Now constants will always be
14713 * ecore.cs: Use an enumconstant here instead of wrapping with
14716 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14717 throwing me off. By handling this we can get rid of a few hacks.
14719 * statement.cs (Switch): Removed Peel() code.
14721 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14723 * class.cs: Location information for error 508
14725 * expression.cs (New.DoResolve): Add a guard against double
14726 resolution of an expression.
14728 The New DoResolve might be called twice when initializing field
14729 expressions (see EmitFieldInitializers, the call to
14730 GetInitializerExpression will perform a resolve on the expression,
14731 and later the assign will trigger another resolution
14733 This leads to bugs (#37014)
14735 * delegate.cs: The signature for EndInvoke should contain any ref
14736 or out parameters as well. We were not doing this in the past.
14738 * class.cs (Field.Define): Do not overwrite the type definition
14739 inside the `volatile' group. Turns out that volatile enumerations
14740 were changing the type here to perform a validity test, which
14743 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14745 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14746 and structs, we do not want to load the instance variable
14748 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14749 enum_type has to be handled like an object reference (implicit
14750 conversions exists from this to object), but the regular IsClass
14751 and IsValueType tests will never return true for this one.
14753 Also we use TypeManager.IsValueType instead of type.IsValueType,
14754 just for consistency with the rest of the code (this is only
14755 needed if we ever use the construct exposed by test-180.cs inside
14756 corlib, which we dont today).
14758 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14760 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14763 2003-02-09 Martin Baulig <martin@ximian.com>
14765 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14766 (Namespace.DefineNamespaces): New static public method; this is
14767 called when we're compiling with debugging to add all namespaces
14768 to the symbol file.
14770 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14771 pass it to the Namespace's .ctor.
14773 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14774 and MethodBase arguments; pass the namespace ID to the symwriter;
14775 pass the MethodBase instead of the token to the symwriter.
14776 (SymbolWriter.DefineNamespace): New method to add a namespace to
14779 2003-02-09 Martin Baulig <martin@ximian.com>
14781 * symbolwriter.cs: New file. This is a wrapper around
14782 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14783 methods here in near future.
14785 2003-02-09 Martin Baulig <martin@ximian.com>
14787 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14788 ILGenerator.MarkSequencePoint() which are actually used by the
14791 2003-02-09 Martin Baulig <martin@ximian.com>
14793 * location.cs (SourceFile): New public sealed class. This
14794 contains the name and an index which is used in the location's token.
14795 (Location): Reserve an appropriate number of bits in the token for
14796 the source file instead of walking over that list, this gives us a
14797 really huge performance improvement when compiling with debugging.
14799 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14800 `SourceFile' argument instead of a string.
14801 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14802 but don't parse/tokenize here, we need to generate the list of all
14803 source files before we do that.
14804 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14807 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14808 instead of a string.
14810 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14813 2003-02-09 Martin Baulig <martin@ximian.com>
14815 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14816 filename on `#line default'.
14818 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14820 * statement.cs: don't clear the pinned var when the fixed statement
14821 returns from the method (fixes bug#37752).
14823 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14825 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14828 2003-02-07 Martin Baulig <martin@ximian.com>
14830 * driver.cs: Removed the `--debug-args' command line argument.
14832 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14833 automatically by the AsssemblyBuilder.
14834 (CodeGen.InitializeSymbolWriter): We don't need to call any
14835 initialization function on the symbol writer anymore. This method
14836 doesn't take any arguments.
14838 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14840 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14841 from referenced assemblies as well.
14843 2003-02-02 Martin Baulig <martin@ximian.com>
14845 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14847 2003-02-02 Martin Baulig <martin@ximian.com>
14849 * class.cs (Constructor.Emit): Open the symbol writer before
14850 emitting the constructor initializer.
14851 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14852 single-stepping through constructor initializers.
14854 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14856 * class.cs: Handle error 549: do not allow virtual methods in
14859 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14861 * decl.cs: Check access levels when resolving types
14863 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14865 * statement.cs: Add parameters and locals set in catch blocks that might
14866 return to set vector
14868 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14870 * class.cs (Operator): Set the SpecialName flags for operators.
14872 * expression.cs (Invocation.DoResolve): Only block calls to
14873 accessors and operators on SpecialName methods.
14875 (Cast.TryReduce): Handle conversions from char constants.
14878 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14880 * statement.cs: small memory and time optimization in FlowBranching.
14882 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14884 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14885 problem that the last fix but in the other sid (Set).
14887 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14888 access when there is no indexer in the hierarchy.
14890 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14892 * class.cs: Combine some if statements.
14894 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14896 * driver.cs: fixed bug #37187.
14898 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14900 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14901 any indexer, it's needed to build a list with all the indexers in the
14902 hierarchy (AllGetters), else we have problems. Fixes #35653.
14904 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14906 * class.cs (MethodData.Define): It is wrong for an interface
14907 implementation to be static in both cases: explicit and implicit.
14908 We were only handling this in one case.
14910 Improve the if situation there to not have negations.
14912 * class.cs (Field.Define): Turns out that we do not need to check
14913 the unsafe bit on field definition, only on usage. Remove the test.
14915 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14917 * driver.cs: use assembly.Location instead of Codebase (the latest
14918 patch made mcs fail when using MS assemblies).
14920 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14922 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14923 get the path to *corlib.dll.
14925 2003-01-21 Nick Drochak <ndrochak@gol.com>
14929 * typemanager.cs: Remove compiler warnings
14931 2003-01-20 Duncan Mak <duncan@ximian.com>
14933 * AssemblyInfo.cs: Bump the version number to 0.19.
14935 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14937 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14939 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14941 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14943 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14945 * cs-parser.jay: Small fix: we were not comparing the constructor
14946 name correctly. Thanks to Zoltan for the initial pointer.
14948 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14950 * cs-tokenizer.cs: Set file name when specified with #line
14952 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14954 * cs-parser.jay: Only perform the constructor checks here if we
14955 are named like the class; This will help provider a better
14956 error. The constructor path is taken when a type definition is
14957 not found, but most likely the user forgot to add the type, so
14958 report that rather than the constructor error.
14960 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14962 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14965 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14967 * cs-parser.jay: Add cleanup call.
14969 2003-01-13 Duncan Mak <duncan@ximian.com>
14971 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14972 consistent with other methods.
14974 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14976 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14978 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14980 * attribute.cs: only set GuidAttr to true when we have a
14983 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14987 * typemanager.cs: fixes to allow mcs compile corlib with the new
14988 Type.IsSubclassOf fix.
14990 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14992 * expression.cs (LocalVariableReference.DoResolve): Classify a
14993 constant as a value, not as a variable. Also, set the type for
14996 * cs-parser.jay (fixed_statement): take a type instead of a
14997 pointer_type, so we can produce a better error message later.
14999 * statement.cs (Fixed.Resolve): Flag types that are not pointers
15002 (For.DoEmit): Make inifinite loops have a
15003 non-conditional branch back.
15005 (Fixed.DoEmit): First populate the pinned variables, then emit the
15006 statement, then clear the variables. Before I was emitting the
15007 code once for each fixed piece.
15010 2003-01-08 Martin Baulig <martin@ximian.com>
15012 * statement.cs (FlowBranching.MergeChild): A break in a
15013 SWITCH_SECTION does not leave a loop. Fixes #36155.
15015 2003-01-08 Martin Baulig <martin@ximian.com>
15017 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15018 lives in the same number space than `param_map'. Fixes #36154.
15020 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15022 * cs-parser.jay (constructor_declaration): Set the
15023 Constructor.ModFlags before probing for it. This makes the
15024 compiler report 514, 515 and 132 (the code was there, but got
15027 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15028 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15029 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15031 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15033 * enum.cs: create the enum static fields using the enum type.
15035 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15037 * class.cs: don't try to create the ParamBuilder for the return
15038 type if it's not needed (and handle it breaking for the ms runtime
15041 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15043 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15045 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15047 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15048 the command. This showed up while compiling the JANET source
15049 code, which used \r as its only newline separator.
15051 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15053 * class.cs (Method.Define): If we are an operator (because it
15054 reuses our code), then set the SpecialName and HideBySig. #36128
15056 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15058 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15059 exception, report error 120 `object reference required'.
15061 * driver.cs: Add --pause option, used during to measure the size
15062 of the process as it goes with --timestamp.
15064 * expression.cs (Invocation.DoResolve): Do not allow methods with
15065 SpecialName to be invoked.
15067 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15069 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15070 number before adding it.
15072 2002-12-21 Ravi Pratap <ravi@ximian.com>
15074 * ecore.cs (StandardImplicitConversion): When in an unsafe
15075 context, we allow conversion between void * to any other pointer
15076 type. This fixes bug #35973.
15078 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15080 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15081 is not thrown when extensionless outputs are used
15083 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15085 * rootcontext.cs: fixed compilation of corlib.
15087 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15089 * attribute.cs (Attributes.Contains): Add new method.
15091 * class.cs (MethodCore.LabelParameters): if the parameter is an
15092 `out' parameter, check that no attribute `[In]' has been passed.
15094 * enum.cs: Handle the `value__' name in an enumeration.
15096 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15098 * decl.cs: Added special case to allow overrides on "protected
15101 2002-12-18 Ravi Pratap <ravi@ximian.com>
15103 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15104 since it makes much more sense.
15106 (Attributes.ctor): Don't require a Location parameter.
15108 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15110 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15111 since we already have that information per attribute.
15113 * everywhere : make appropriate changes.
15115 * class.cs (LabelParameters): Write the code which actually
15116 applies attributes to the return type. We can't do this on the MS
15117 .NET runtime so we flag a warning in the case an exception is
15120 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15122 * const.cs: Handle implicit null conversions here too.
15124 2002-12-17 Ravi Pratap <ravi@ximian.com>
15126 * class.cs (MethodCore.LabelParameters): Remove the extra
15127 Type [] parameter since it is completely unnecessary. Instead
15128 pass in the method's attributes so that we can extract
15129 the "return" attribute.
15131 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15133 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15134 of ignoring it and letting the compile continue.
15136 * typemanager.cs (ChangeType): use an extra argument to return an
15137 error condition instead of throwing an exception.
15139 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15141 * expression.cs (Unary.TryReduce): mimic the code for the regular
15142 code path. Perform an implicit cast in the cases where we can
15143 implicitly convert to one of the integral types, and then reduce
15144 based on that constant. This fixes bug #35483.
15146 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15148 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15150 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15152 * namespace.cs: fixed bug #35489.
15154 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15156 * class.cs: Remove some dead code.
15158 * cs-parser.jay: Estimate the number of methods needed
15159 (RootContext.MethodCount);
15161 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15162 numbers instead of StringBuilders.
15164 * support.cs (PtrHashtable): Add constructor with initial size;
15165 We can now reduce reallocations of the method table.
15167 2002-12-10 Ravi Pratap <ravi@ximian.com>
15169 * attribute.cs (ApplyAttributes): Keep track of the emitted
15170 attributes on a per-target basis. This fixes bug #35413.
15172 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15174 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15175 default to the Windows 1252 encoding.
15177 (UnixParseOption): Support version, thanks to Alp for the missing
15180 * AssemblyInfo.cs: Add nice assembly information.
15182 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15185 * cs-parser.jay: Allow a trailing comma before the close bracked
15186 in the attribute_section production.
15188 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15189 address of the instance was being taken, I will take this out,
15190 because we take the address of the object immediately here.
15192 2002-12-09 Ravi Pratap <ravi@ximian.com>
15194 * typemanager.cs (AreMultipleAllowed): Take care of the most
15195 obvious case where attribute type is not in the current assembly -
15198 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15200 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15201 definitions, instead of doing that afterwards.
15203 Also we use a nice little hack, depending on the constructor, we
15204 know if we are a "composed" name or a simple name. Hence, we
15205 avoid the IndexOf test, and we avoid
15207 * codegen.cs: Add code to assist in a bug reporter to track down
15208 the source of a compiler crash.
15210 2002-12-07 Ravi Pratap <ravi@ximian.com>
15212 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15213 types have been emitted for a given element and flag an error
15214 if something which does not have AllowMultiple set is used more
15217 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15218 attribute types and their corresponding AllowMultiple properties
15220 (AreMultipleAllowed): Check the property for a given type.
15222 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15223 property in the case we have a TypeContainer.
15225 (Attributes.AddAttribute): Detect duplicates and just skip on
15226 adding them. This trivial fix catches a pretty gross error in our
15227 attribute emission - global attributes were being emitted twice!
15229 Bugzilla bug #33187 is now fixed.
15231 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15233 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15234 instead of pp_and).
15236 * expression.cs (Binary.ResolveOperator): I can only use the
15237 Concat (string, string, string) and Concat (string, string,
15238 string, string) if the child is actually a concatenation of
15241 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15243 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15244 context where we need a 2-character lookahead.
15246 * pending.cs (PendingImplementation): Rework so we can keep track
15247 of interface types all the time, and flag those which were
15248 implemented by parents as optional.
15250 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15252 * expression.cs (Binary.ResolveOperator): Use
15253 String.Concat(string,string,string) or
15254 String.Concat(string,string,string,string) when possible.
15256 * typemanager: More helper methods.
15259 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15261 * pending.cs: remove the bogus return from GetMissingInterfaces()
15262 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15264 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15266 * namespace.cs: avoid duplicated 'using xxx' being added to
15267 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15268 when we get more than one 'using' statement for the same namespace.
15269 Report a CS0105 warning for it.
15271 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15273 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15274 of calling getChar/putback, uses internal knowledge of it.
15276 (xtoken): Reorder tokenizer so most common patterns are checked
15277 first. This reduces the compilation time in another 5% (from 8.11s
15278 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15280 The parsing time is 22% of the compilation in mcs, and from that
15281 64% is spent on the tokenization process.
15283 I tried using a binary search for keywords, but this is slower
15284 than the hashtable. Another option would be to do a couple of
15287 * Not use a StringBuilder, instead use an array of chars,
15288 with a set value. Notice that this way we could catch
15289 the 645 error without having to do it *afterwards*.
15291 * We could write a hand-parser to avoid the hashtable
15292 compares altogether.
15294 The identifier consumption process takes 37% of the tokenization
15295 time. Another 15% is spent on is_number. 56% of the time spent
15296 on is_number is spent on Int64.Parse:
15298 * We could probably choose based on the string length to
15299 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15302 Another 3% is spend on wrapping `xtoken' in the `token' function.
15304 Handle 0xa0 as whitespace (#34752)
15306 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15308 * typemanager.cs (IsCLRType): New routine to tell whether a type
15309 is one of the builtin types.
15311 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15312 typecode in more places instead of doing pointer comparissions.
15313 We could leverage some knowledge about the way the typecodes are
15316 New code to cache namespaces in assemblies, it is currently not
15317 invoked, to be used soon.
15319 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15321 * expression.cs (Binary.ResolveOperator): specially handle
15322 strings, and do not perform user-defined operator overloading for
15325 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15327 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15328 internalcall as it is a pretty simple operation; Avoid whenever
15329 possible to call Char.IsLetter.
15331 (consume_identifier): Cut by half the number of
15332 hashtable calls by merging the is_keyword and GetKeyword behavior.
15334 Do not short-circuit, because if we do, we
15335 report errors (ie, #if false && true would produce an invalid
15339 2002-11-24 Martin Baulig <martin@ximian.com>
15341 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15342 check constant ranges and report a CS0221. Fixes #33186.
15344 2002-11-24 Martin Baulig <martin@ximian.com>
15346 * cs-parser.jay: Make this work for uninitialized variable
15347 declarations in the `for' initializer. Fixes #32416.
15349 2002-11-24 Martin Baulig <martin@ximian.com>
15351 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15352 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15354 2002-11-24 Martin Baulig <martin@ximian.com>
15356 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15357 argument; if true, we also check for user-defined conversions.
15358 This is only needed if both arguments are of a user-defined type.
15359 Fixes #30443, added test-175.cs.
15360 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15362 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15364 2002-11-24 Martin Baulig <martin@ximian.com>
15366 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15367 function to get the store opcode.
15368 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15369 only emit the Ldelema if the store opcode is Stobj. You must run
15370 both test-34 and test-167 to test this. Fixes #34529.
15372 2002-11-23 Martin Baulig <martin@ximian.com>
15374 * ecore.cs (Expression.MemberLookup): Added additional
15375 `qualifier_type' argument which is used when we're being called
15376 from MemberAccess.DoResolve() and null if we're called from a
15378 (Expression.MemberLookupFailed): New method to report errors; this
15379 does the CS1540 check and reports the correct error message.
15381 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15382 argument for the CS1540 check and redone the way how we're dealing
15383 with private members. See the comment in the source code for details.
15384 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15385 `closure_start_type' to `closure_qualifier_type' and check whether
15386 it's not null. It was not this filter being broken, it was just
15387 being called with the wrong arguments.
15389 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15390 and pass it the correct `qualifier_type'; this also does the error
15393 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15395 * expression.cs (Invocation.EmitParams): If the we are dealing
15396 with a non-built-in value type, load its address as well.
15398 (ArrayCreation): Use a a pretty constant instead
15399 of the hardcoded value 2. Use 6 instead of 2 for the number of
15400 static initializers.
15402 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15403 because they are not really value types, just glorified integers.
15405 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15407 * ecore.cs: Remove redundant code for enumerations, make them use
15408 the same code path as everything else, fixes the casting issue
15409 with enumerations in Windows.Forms.
15411 * attribute.cs: Do only cast to string if it is a string, the
15412 validation happens later.
15414 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15415 people upgrade their corlibs.
15417 * ecore.cs: Oops, enumerations were not following the entire code path
15419 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15421 * typemanager.cs (FilterWithClosure): Commented out the test for
15422 1540 in typemanager.cs, as it has problems when accessing
15423 protected methods from a parent class (see test-174.cs).
15425 * attribute.cs (Attribute.ValidateGuid): new method.
15426 (Attribute.Resolve): Use above.
15428 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15430 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15432 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15433 handling for enumerations, as we only needed the TypeContainer
15434 functionality to begin with (this is required for the fix below to
15435 work for enums that reference constants in a container class for
15438 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15440 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15441 a valid TypeBuilder to perform lookups on.o
15443 * class.cs (InheritableMemberSignatureCompare): Use true in the
15444 call to GetGetMethod and GetSetMethod, because we are comparing
15445 the signature, and we need to get the methods *even* if they are
15448 (PropertyBase.CheckBase): ditto.
15450 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15451 GotoCase.Resolve): Use Peel on EmpytCasts.
15453 * ecore.cs (EmptyCast): drop child, add Peel method.
15455 2002-11-17 Martin Baulig <martin@ximian.com>
15457 * ecore.cs (EmptyCast.Child): New public property.
15459 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15460 label resolved to an EmptyCast. Fixes #34162.
15461 (GotoCase.Resolve): Likewise.
15462 (Block.EmitMeta): Likewise.
15464 2002-11-17 Martin Baulig <martin@ximian.com>
15466 * expression.cs (Invocation.BetterConversion): Prefer int over
15467 uint; short over ushort; long over ulong for integer literals.
15468 Use ImplicitConversionExists instead of StandardConversionExists
15469 since we also need to check for user-defined implicit conversions.
15470 Fixes #34165. Added test-173.cs.
15472 2002-11-16 Martin Baulig <martin@ximian.com>
15474 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15475 with the `true' and `false' literals. Fixes #33151.
15477 2002-11-16 Martin Baulig <martin@ximian.com>
15479 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15480 October 22nd; don't do the cs1540 check for static members.
15482 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15483 now using our own filter here and doing the cs1540 check again.
15485 2002-11-16 Martin Baulig <martin@ximian.com>
15487 * support.cs (InternalParameters): Don't crash if we don't have
15488 any fixed parameters. Fixes #33532.
15490 2002-11-16 Martin Baulig <martin@ximian.com>
15492 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15493 when looking up static methods to make this work on Windows.
15496 2002-11-16 Martin Baulig <martin@ximian.com>
15498 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15499 a setter rather than using PropertyInfo.CanWrite.
15501 2002-11-15 Nick Drochak <ndrochak@gol.com>
15503 * class.cs: Allow acces to block member by subclasses. Fixes build
15506 2002-11-14 Martin Baulig <martin@ximian.com>
15508 * class.cs (Constructor.Emit): Added the extern/block check.
15511 2002-11-14 Martin Baulig <martin@ximian.com>
15513 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15514 iteration while looking for indexers, this is needed because the
15515 indexer may have a different name in our base classes. Fixed the
15516 error reporting (no indexers at all, not get accessor, no
15517 overloaded match). Fixes bug #33089.
15518 (IndexerAccess.DoResolveLValue): Likewise.
15520 2002-11-14 Martin Baulig <martin@ximian.com>
15522 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15523 indexers. Fixes the first part of bug #33089.
15524 (MethodSignature.InheritableMemberSignatureCompare): Added support
15527 2002-11-13 Ravi Pratap <ravi@ximian.com>
15529 * attribute.cs (Attribute.Resolve): Catch the
15530 NullReferenceException and report it since it isn't supposed to
15533 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15535 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15536 LogicalOr and LogicalAnd that can benefit from recursively
15537 handling EmitBranchable. The code now should be nice for Paolo.
15539 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15541 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15542 the Type lookups, as we perform quite a number of lookups on
15543 non-Types. This can be removed once we can deterministically tell
15544 whether we have a type or a namespace in advance.
15546 But this might require special hacks from our corlib.
15550 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15551 and double which avoids a conversion from an integer to a double.
15553 * expression.cs: tiny optimization, avoid calling IsConstant,
15554 because it effectively performs the lookup twice.
15556 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15558 But a bogus return here to keep the semantics of the old code
15559 until the Mono runtime is fixed.
15561 * pending.cs (GetMissingInterfaces): New method used to remove all
15562 the interfaces that are already implemented by our parent
15563 classes from the list of pending methods.
15565 * interface.cs: Add checks for calls after ResolveTypeExpr.
15567 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15569 * class.cs (Class.Emit): Report warning 67: event not used if the
15570 warning level is beyond 3.
15572 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15573 being a NullLiteral.
15575 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15578 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15579 path that might fail if a type can not be resolved.
15581 * expression.cs (Binary.Emit): Emit unsigned versions of the
15584 * driver.cs: use error 5.
15586 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15588 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15590 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15592 * cs-parser.jay (switch_section): A beautiful patch from Martin
15593 Baulig that fixed 33094.
15595 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15597 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15598 Check whether the base is abstract and report an error if so.
15600 * expression.cs (IndexerAccess.DoResolveLValue,
15601 IndexerAccess.DoResolve): ditto.
15603 (Invocation.DoResolve): ditto.
15605 (Invocation.FullMethodDesc): Improve the report string.
15607 * statement.cs (Block): Eliminate IsVariableDefined as it is
15608 basically just a wrapper for GetVariableInfo.
15610 * ecore.cs (SimpleName): Use new
15612 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15613 type, as we return the actual parameter ref/unref state on a
15616 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15618 * support.cs: Return proper flags REF/OUT fixing the previous
15621 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15622 not used to mean `ref' but `ref or out' in ParameterReference
15624 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15625 full type signature instead of calling TypeManger.CSharpName
15628 * support.cs (InternalParameters.ParameterDesc): Do not compare
15629 directly to the modflags, because REF/OUT will actually be bitsets
15632 * delegate.cs (VerifyMethod): Check also the modifiers.
15634 * cs-tokenizer.cs: Fix bug where floating point values with an
15635 exponent where a sign was missing was ignored.
15637 * driver.cs: Allow multiple assemblies to be specified in a single
15640 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15642 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15643 because identifiers after a parenthesis would end up in this kind
15644 of production, and we needed to desamiguate it for having casts
15647 (UserDefinedType *) xxx
15649 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15651 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15652 we should set on the Bindingflags.NonPublic, but not turn on
15653 private_ok. private_ok controls whether a Private member is
15654 returned (this is chekced on the filter routine), while the
15655 BindingFlags.NonPublic just controls whether private/protected
15656 will be allowed. This fixes the problem part of the problem of
15657 private properties being allowed to be used in derived classes.
15659 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15660 so we can call the children DoResolveLValue method (this will
15661 properly signal errors on lvalue assignments to base properties)
15663 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15664 getter are null, and we have a property info, we know that this
15665 happened because the lookup failed, so we report an error 122 for
15666 protection level violation.
15668 We also silently return if setter and getter are null in the
15669 resolve functions, this condition only happens if we have flagged
15670 the error before. This is the other half of the problem.
15672 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15673 not have accessibility information, that is why we were returning
15674 true in the filter function in typemanager.cs.
15676 To properly report 122 (property is inaccessible because of its
15677 protection level) correctly, we report this error in ResolveAccess
15678 by failing if both the setter and the getter are lacking (ie, the
15681 DoResolve and DoLResolve have been modified to check for both
15682 setter/getter being null and returning silently, the reason being
15683 that I did not want to put the knowledge about this error in upper
15686 int old = Report.Errors;
15687 x = new PropertyExpr (...);
15688 if (old != Report.Errors)
15693 So the property expr is returned, but it is invalid, so the error
15694 will be flagged during the resolve process.
15696 * class.cs: Remove InheritablePropertySignatureCompare from the
15697 class, as we no longer depend on the property signature to compute
15698 whether it is possible to implement a method or not.
15700 The reason is that calling PropertyInfo.GetGetMethod will return
15701 null (in .NET, in Mono it works, and we should change this), in
15702 cases where the Get Method does not exist in that particular
15707 class X { public virtual int A { get { return 1; } } }
15709 class Z : Y { public override int A { get { return 2; } } }
15711 Would fail in Z because the parent (Y) would not have the property
15712 defined. So we avoid this completely now (because the alternative
15713 fix was ugly and slow), and we now depend exclusively on the
15716 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15717 reference method, instead of using the property.
15719 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15720 routines are gone now.
15722 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15723 names, they were incorrectly named.
15725 * cs-tokenizer.cs: Return are more gentle token on failure.
15727 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15728 had an out-of-sync index variable, which caused it to remove from
15729 the list of pending methods the wrong method sometimes.
15731 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15733 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15734 CanWrite, because those refer to this particular instance of the
15735 property, and do not take into account the fact that we can
15736 override single members of a property.
15738 Constructor requires an EmitContext. The resolution process does
15739 not happen here, but we need to compute the accessors before,
15740 because the resolution does not always happen for properties.
15742 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15743 subclass, before we did not update this flag, but we did update
15746 (GetAccessors): Drop this routine, as it did not work in the
15747 presence of partially overwritten set/get methods.
15749 Notice that this broke the cs1540 detection, but that will require
15752 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15756 * driver.cs: issue a warning instead of an error if we don't support
15757 debugging for the platform. Also ignore a couple of errors that may
15758 arise when trying to write the symbols. Undo my previous patch.
15760 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15762 * driver.cs: ignore /debug switch except for Unix platforms.
15764 2002-10-23 Nick Drochak <ndrochak@gol.com>
15766 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15768 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15770 * driver.cs: Do not make mcs-debug conditional, so we do not break
15771 builds that use it.
15773 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15774 review this patch. But basically after all the children variables
15775 have been merged, the value of "Breaks" was not being set to
15776 new_breaks for Switch blocks. I think that it should be set after
15777 it has executed. Currently I set this to the value of new_breaks,
15778 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15779 conservative, but I do not understand this code very well.
15781 I did not break anything in the build, so that is good ;-)
15783 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15785 2002-10-20 Mark Crichton <crichton@gimp.org>
15787 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15789 2002-10-20 Nick Drochak <ndrochak@gol.com>
15791 * cfold.cs: Fixed compile blocker.
15793 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15795 * driver.cs: I was chekcing the key, not the file.
15797 2002-10-19 Ravi Pratap <ravi@ximian.com>
15799 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15800 message that we were generating - we just need to silently return
15803 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15805 * class.cs (Event.Define): Change my previous commit, as this
15806 breaks the debugger. This is a temporary hack, as it seems like
15807 the compiler is generating events incorrectly to begin with.
15809 * expression.cs (Binary.ResolveOperator): Added support for
15810 "U operator - (E x, E y)"
15812 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15815 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15816 init-only variables, but this path did not take into account that
15817 there might be also instance readonly variables. Correct this
15820 This fixes bug 32253
15822 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15825 * driver.cs: Change the extension for modules to `netmodule'
15827 * cs-parser.jay: Improved slightly the location tracking for
15828 the debugger symbols.
15830 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15831 modifiers that were specified instead of the hardcoded value
15832 (FamAndAssem). This was basically ignoring the static modifier,
15833 and others. Fixes 32429.
15835 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15836 fixed a bug in the process (32476)
15838 * expression.cs (ArrayAccess.EmitAssign): Patch from
15839 hwang_rob@yahoo.ca that fixes bug 31834.3
15841 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15843 * driver.cs: Make the module extension .netmodule.
15845 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15847 * driver.cs: Report an error if the resource file is not found
15848 instead of crashing.
15850 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15851 false, like Emit does.
15853 2002-10-16 Nick Drochak <ndrochak@gol.com>
15855 * typemanager.cs: Remove unused private member. Also reported mcs
15856 bug to report this as a warning like csc.
15858 2002-10-15 Martin Baulig <martin@gnome.org>
15860 * statement.cs (Statement.Emit): Made this a virtual method; emits
15861 the line number info and calls DoEmit().
15862 (Statement.DoEmit): New protected abstract method, formerly knows
15863 as Statement.Emit().
15865 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15867 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15869 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15870 have fixed a remaining problem: not every AddXXXX was adding a
15871 fully qualified name.
15873 Now everyone registers a fully qualified name in the DeclSpace as
15874 being defined instead of the partial name.
15876 Downsides: we are slower than we need to be due to the excess
15877 copies and the names being registered this way.
15879 The reason for this is that we currently depend (on the corlib
15880 bootstrap for instance) that types are fully qualified, because
15881 we dump all the types in the namespace, and we should really have
15882 types inserted into the proper namespace, so we can only store the
15883 basenames in the defined_names array.
15885 2002-10-10 Martin Baulig <martin@gnome.org>
15887 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15888 from bug #31834, see the bug report for a testcase which is
15891 2002-10-10 Martin Baulig <martin@gnome.org>
15893 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15894 flow analysis code for this.
15896 * statement.cs (Do, While, For): Tell the flow analysis code about
15898 (FlowBranching.UsageVector): Added support for infinite loops.
15899 (Block.Resolve): Moved the dead code elimination here and use flow
15902 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15904 * class.cs (Field.Define): Catch cycles on struct type
15907 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15908 fields if the fields are static. We only need to check instance
15911 * expression.cs (As.DoResolve): Test for reference type.
15913 * statement.cs (Using.ResolveExpression): Use
15914 ConvertImplicitRequired, not ConvertImplicit which reports an
15916 (Using.ResolveLocalVariableDecls): ditto.
15918 * expression.cs (Binary.ResolveOperator): Report errors in a few
15919 places where we had to.
15921 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15923 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15925 * expression.cs: Use StoreFromPtr instead of extracting the type
15926 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15928 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15929 an enumeration value to a System.Enum, but System.Enum is not a
15930 value type, but an class type, so we need to box.
15932 (Expression.ConvertExplicit): One codepath could return
15933 errors but not flag them. Fix this. Fixes #31853
15935 * parameter.cs (Resolve): Do not allow void as a parameter type.
15937 2002-10-06 Martin Baulig <martin@gnome.org>
15939 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15940 if it's a class type and not a struct. Fixes #31815.
15942 2002-10-06 Martin Baulig <martin@gnome.org>
15944 * statement.cs: Reworked the flow analysis code a bit to make it
15945 usable for dead code elimination.
15947 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15949 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15951 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15953 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15954 to fix the test 165, will investigate deeper.
15956 2002-10-04 Martin Baulig <martin@gnome.org>
15958 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15959 finally blocks actually work.
15960 (Try.Resolve): We don't need to create a sibling for `finally' if
15961 there is no finally block.
15963 2002-10-04 Martin Baulig <martin@gnome.org>
15965 * class.cs (Constructor.Define): The default accessibility for a
15966 non-default constructor is private, not public.
15968 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15970 * class.cs (Constructor): Make AllowedModifiers public, add
15973 * cs-parser.jay: Perform the modifiers test here, as the
15974 constructor for the Constructor class usually receives a zero
15975 because of the way we create it (first we create, later we
15976 customize, and we were never checking the modifiers).
15978 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15979 is a version of LookupTypeReflection that includes the type-name
15980 cache. This can be used as a fast path for functions that know
15981 the fully qualified name and are only calling into *.GetType() to
15982 obtain a composed type.
15984 This is also used by TypeManager.LookupType during its type
15987 (LookupType): We now also track the real type name, as sometimes
15988 we can get a quey for the real type name from things like
15989 ComposedCast. This fixes bug 31422.
15991 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15992 complete type fullname, it does not have to go through the type
15993 resolution system to obtain the composed version of the type (for
15994 obtaining arrays or pointers).
15996 (Conditional.Emit): Use the EmitBoolExpression to
15997 generate nicer code, as requested by Paolo.
15999 (ArrayCreation.CheckIndices): Use the patch from
16000 hwang_rob@yahoo.ca to validate the array initializers.
16002 2002-10-03 Miguel de Icaza <miguel@ximian.com>
16004 * class.cs (ConstructorInitializer.Emit): simplify code by using
16005 Invocation.EmitCall, and at the same time, fix the bugs in calling
16006 parent constructors that took variable arguments.
16008 * ecore.cs (Expression.ConvertNumericExplicit,
16009 Expression.ImplicitNumericConversion): Remove the code that
16010 manually wrapped decimal (InternalTypeConstructor call is now gone
16013 * expression.cs (Cast.TryReduce): Also handle decimal types when
16014 trying to perform a constant fold on the type.
16016 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16018 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16019 that only turned off an error report, and did nothing else.
16021 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16023 * driver.cs: Handle and ignore /fullpaths
16025 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16027 * expression.cs (Binary.ResolveOperator): Catch the case where
16028 DoNumericPromotions returns true,
16030 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16032 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16034 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16037 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16039 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16040 conversion exists, but it is also required that the conversion be
16041 performed. This manifested in "(Type64Enum) 2".
16043 * class.cs (TypeManager.AddMethod): The fix is not to change
16044 AddEnum, because that one was using a fully qualified name (every
16045 DeclSpace derivative does), but to change the AddMethod routine
16046 that was using an un-namespaced name. This now correctly reports
16047 the duplicated name.
16049 Revert patch until I can properly fix it. The issue
16050 is that we have a shared Type space across all namespaces
16051 currently, which is wrong.
16053 Options include making the Namespace a DeclSpace, and merge
16054 current_namespace/current_container in the parser.
16056 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16058 * cs-parser.jay: Improve error reporting when we get a different
16059 kind of expression in local_variable_type and
16060 local_variable_pointer_type.
16062 Propagate this to avoid missleading errors being reported.
16064 * ecore.cs (ImplicitReferenceConversion): treat
16065 TypeManager.value_type as a target just like object_type. As
16070 Is valid, and needs to result in the int 1 being boxed before it
16071 is assigned to the value type v.
16073 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16074 to validate the enumeration name.
16076 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16077 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16078 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16080 * ecore.cs (TryImplicitIntConversion): When doing an
16081 implicit-enumeration-conversion, check if the type is 64-bits and
16082 perform a conversion before passing to EnumConstant.
16084 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16086 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16087 report ambiguous type references. Unlike the MS version, we
16088 report what the ambiguity is. Innovation at work ;-)
16090 (DeclSpace.FindType): Require a location argument to
16091 display when we display an ambiguous error.
16093 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16095 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16097 * expression.cs (EmitDynamicInitializers): Apply patch from
16098 hwang_rob@yahoo.ca that fixes the order in which we emit our
16101 2002-09-21 Martin Baulig <martin@gnome.org>
16103 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16104 delegate takes no arguments.
16106 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16108 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16111 * expression.cs: Extract the underlying type.
16113 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16115 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16117 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16119 * class.cs (TypeContainer.DefineType): We can not use the nice
16120 PackingSize with the size set to 1 DefineType method, because it
16121 will not allow us to define the interfaces that the struct
16124 This completes the fixing of bug 27287
16126 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16127 means also structs. This fixes part of the problem.
16128 (Expresion.ImplicitReferenceConversionExists): ditto.
16130 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16131 error if there were no errors reported during the type lookup
16132 process, to avoid duplicates or redundant errors. Without this
16133 you would get an ambiguous errors plus a type not found. We have
16134 beaten the user enough with the first error.
16136 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16139 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16140 during the resolution process, stop the lookup, this avoids
16141 repeated error reports (same error twice).
16143 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16145 * typemanager.cs (LookupType): Redo the type lookup code to match
16146 the needs of System.Reflection.
16148 The issue is that System.Reflection requires references to nested
16149 types to begin with a "+" sign instead of a dot. So toplevel
16150 types look like: "NameSpace.TopLevelClass", and nested ones look
16151 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16154 2002-09-19 Martin Baulig <martin@gnome.org>
16156 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16157 says that a method always returns or always throws an exception,
16158 don't report the CS0161.
16160 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16161 set `Returns = new_returns'.
16163 2002-09-19 Martin Baulig <martin@gnome.org>
16165 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16166 to an enum constant, check for a CS0176.
16168 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16170 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16171 for operators that must be in pairs and report errors.
16173 * ecore.cs (SimpleName.DoResolveType): During the initial type
16174 resolution process, when we define types recursively, we must
16175 check first for types in our current scope before we perform
16176 lookups in the enclosing scopes.
16178 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16180 (Invocation.VerifyArgumentsCompat): Call
16181 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16182 I thought we were supposed to always call this, but there are a
16183 few places in the code where we dont do it.
16185 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16187 * driver.cs: Add support in -linkres and -resource to specify the
16188 name of the identifier.
16190 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16192 * ecore.cs (StandardConversionExists): Sync with the conversion
16193 code: allow anything-* to void* conversions.
16195 (FindMostSpecificSource): Use an Expression argument
16196 instead of a Type, because we might be handed over a Literal which
16197 gets a few more implicit conversions that plain types do not. So
16198 this information was being lost.
16200 Also, we drop the temporary type-holder expression when not
16203 2002-09-17 Martin Baulig <martin@gnome.org>
16205 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16206 this is an explicit interface implementation.
16208 2002-09-17 Martin Baulig <martin@gnome.org>
16210 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16211 different `IndexerName' attributes.
16213 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16214 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16215 virtual CommonResolve().
16217 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16219 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16220 and convert that to the UnderlyingType.
16222 * statement.cs (Foreach.Resolve): Indexers are just like variables
16223 or PropertyAccesses.
16225 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16226 inside quoted strings, we were not doing this before.
16228 2002-09-16 Martin Baulig <martin@gnome.org>
16230 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16231 resolve it. This is needed for the definite assignment check of the
16232 instance expression, fixes bug #29846.
16233 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16235 2002-09-16 Nick Drochak <ndrochak@gol.com>
16237 * parameter.cs: Fix compile error. Cannot reference static member
16238 from an instance object. Is this an mcs bug?
16240 2002-09-14 Martin Baulig <martin@gnome.org>
16242 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16243 multiple times. Fixes bug #30295, added test-166.cs.
16245 2002-09-14 Martin Baulig <martin@gnome.org>
16247 * statement.cs (Block.Emit): Don't emit unreachable code.
16248 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16249 `break' statements.
16250 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16252 2002-09-14 Martin Baulig <martin@gnome.org>
16254 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16257 2002-09-14 Martin Baulig <martin@gnome.org>
16259 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16260 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16261 be false on the ms runtime.
16263 2002-09-13 Martin Baulig <martin@gnome.org>
16265 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16266 the CS0038 error message.
16268 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16270 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16271 constant inside, return it.
16273 2002-09-12 Martin Baulig <martin@gnome.org>
16275 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16276 implicit conversion can be done between enum types.
16278 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16279 check whether an implicit conversion to the current enum's UnderlyingType
16280 exists and report an error if not.
16282 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16283 without debugging support.
16285 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16286 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16288 2002-09-12 Martin Baulig <martin@gnome.org>
16290 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16292 * ecore.cs (IMemberExpr.DeclaringType): New property.
16293 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16294 nonstatic member of an outer type (CS0038).
16296 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16298 * driver.cs: Activate the using-error detector at warning level
16299 4 (at least for MS-compatible APIs).
16301 * namespace.cs (VerifyUsing): Small buglett fix.
16303 * pending.cs (PendingImplementation): pass the container pointer.
16305 * interface.cs (GetMethods): Allow for recursive definition. Long
16306 term, I would like to move every type to support recursive
16307 definitions, not the current ordering mechanism that we have right
16310 The situation is this: Attributes are handled before interfaces,
16311 so we can apply attributes to interfaces. But some attributes
16312 implement interfaces, we will now handle the simple cases
16313 (recursive definitions will just get an error).
16315 * parameter.cs: Only invalidate types at the end if we fail to
16318 2002-09-09 Martin Baulig <martin@gnome.org>
16320 * ecore.cs (PropertyExpr.Emit): Also check for
16321 TypeManager.system_int_array_get_length so this'll also work when
16322 compiling corlib. Fixes #30003.
16324 2002-09-09 Martin Baulig <martin@gnome.org>
16326 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16327 and throw an exception if we can't get the type's size. Fixed #30040,
16330 2002-09-09 Martin Baulig <martin@gnome.org>
16332 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16334 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16335 context. Fixes bug #30027.
16337 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16338 virtual functions. Fixes bug #30043, added test-164.cs.
16340 2002-09-08 Ravi Pratap <ravi@ximian.com>
16342 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16344 2002-09-08 Nick Drochak <ndrochak@gol.com>
16346 * driver.cs: Use an object to get the windows codepage since it's not a
16349 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16351 * statement.cs (For.Emit): for infinite loops (test == null)
16352 return whether there is a break inside, not always "true".
16354 * namespace.cs (UsingEntry): New struct to hold the name of the
16355 using definition, the location where it is defined, and whether it
16356 has been used in a successful type lookup.
16358 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16363 2002-09-06 Ravi Pratap <ravi@ximian.com>
16365 * attribute.cs : Fix incorrect code which relied on catching
16366 a NullReferenceException to detect a null being passed in
16367 where an object was expected.
16369 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16371 * statement.cs (Try): flag the catch variable as assigned
16373 * expression.cs (Cast): Simplified by using ResolveType instead of
16374 manually resolving.
16376 * statement.cs (Catch): Fix bug by using ResolveType.
16378 2002-09-06 Ravi Pratap <ravi@ximian.com>
16380 * expression.cs (BetterConversion): Special case for when we have
16381 a NullLiteral as the argument and we have to choose between string
16382 and object types - we choose string the way csc does.
16384 * attribute.cs (Attribute.Resolve): Catch the
16385 NullReferenceException and report error #182 since the Mono
16386 runtime no more has the bug and having this exception raised means
16387 we tried to select a constructor which takes an object and is
16390 2002-09-05 Ravi Pratap <ravi@ximian.com>
16392 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16393 message (1502, 1503) when we can't locate a method after overload
16394 resolution. This is much more informative and closes the bug
16397 * interface.cs (PopulateMethod): Return if there are no argument
16398 types. Fixes a NullReferenceException bug.
16400 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16401 expressions too. Previously we were checking only in one place for
16402 positional arguments leaving out named arguments.
16404 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16405 type to the enum type is not allowed. Remove code corresponding to
16408 (ConvertNumericExplicit): Allow explicit conversions from
16409 the underlying type to enum type. This precisely follows the spec
16410 and closes a bug filed by Gonzalo.
16412 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16415 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16417 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16419 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16420 it was important that we stored the right value after the
16421 reduction in `converted'.
16423 2002-09-04 Martin Baulig <martin@gnome.org>
16425 * location.cs (Location.SymbolDocument): Use full pathnames for the
16428 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16430 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16431 of the expression resolve mechanism, because that will catch the
16432 SimpleName error failures.
16434 (Conditional): If we can not resolve the
16435 expression, return, do not crash.
16437 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16440 (location): display token name instead of its number.
16442 2002-08-28 Martin Baulig <martin@gnome.org>
16444 * expression.cs (Binary.ResolveOperator): Don't silently return
16445 but return an error if an operator cannot be applied between two
16448 2002-08-28 Martin Baulig <martin@gnome.org>
16450 * class.cs (Constructor.Define): Set the permission attributes
16451 correctly instead of making all constructors public.
16453 2002-08-28 Martin Baulig <martin@gnome.org>
16455 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16456 for private members before reporting a CS0103; if we find anything,
16459 2002-08-28 Martin Baulig <martin@gnome.org>
16461 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16462 to check whether `closure_start_type == closure_invocation_type',
16463 we also need to check whether `m.DeclaringType == closure_invocation_type'
16464 before bypassing the permission checks. We might be accessing
16465 protected/private members from the base class.
16466 (TypeManager.RealMemberLookup): Only set private_ok if private
16467 members were requested via BindingFlags.NonPublic.
16469 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16471 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16472 MethodGroupExpr.IsExplicitImpl if appropriate.
16473 (Invocation.DoResolve): Don't report the CS0120 for explicit
16474 interface implementations.
16476 2002-08-27 Martin Baulig <martin@gnome.org>
16478 * expression.cs (Invocation.DoResolve): If this is a static
16479 method and we don't have an InstanceExpression, we must report
16482 2002-08-25 Martin Baulig <martin@gnome.org>
16484 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16485 `==' between a valuetype and an object.
16487 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16489 * ecore.cs (TypeExpr): Provide a ToString method.
16491 2002-08-24 Martin Baulig <martin@gnome.org>
16493 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16494 now called proggie.dbg and it's a binary file.
16496 2002-08-23 Martin Baulig <martin@gnome.org>
16498 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16500 2002-08-23 Martin Baulig <martin@gnome.org>
16502 * struct.cs (MyStructInfo.ctor): Make this work with empty
16503 structs; it's not allowed to use foreach() on null.
16505 2002-08-23 Martin Baulig <martin@gnome.org>
16507 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16508 writer the full pathname of the generated assembly.
16510 2002-08-23 Martin Baulig <martin@gnome.org>
16512 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16513 A `finally' block never returns or breaks; improved handling of
16516 2002-08-23 Martin Baulig <martin@gnome.org>
16518 * statement.cs (Throw.Resolve): Allow `throw null'.
16520 2002-08-23 Martin Baulig <martin@gnome.org>
16522 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16523 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16524 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16525 MemberLookup would return a wrong event if this is an explicit
16526 interface implementation and the class has an event with the same
16529 2002-08-23 Martin Baulig <martin@gnome.org>
16531 * statement.cs (Block.AddChildVariableNames): New public method.
16532 (Block.AddChildVariableName): Likewise.
16533 (Block.IsVariableNameUsedInChildBlock): Likewise.
16534 (Block.AddVariable): Check whether a variable name has already
16535 been used in a child block.
16537 * cs-parser.jay (declare_local_variables): Mark all variable names
16538 from the current block as being used in a child block in the
16541 2002-08-23 Martin Baulig <martin@gnome.org>
16543 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16544 find the symbol writer.
16546 * driver.cs: csc also allows the arguments to /define being
16547 separated by commas, not only by semicolons.
16549 2002-08-23 Martin Baulig <martin@gnome.org>
16551 * interface.cs (Interface.GetMembers): Added static check for events.
16553 2002-08-15 Martin Baulig <martin@gnome.org>
16555 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16556 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16558 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16559 why the MethodData.EmitDestructor() change was necessary.
16561 2002-08-20 Martin Baulig <martin@gnome.org>
16563 * class.cs (TypeContainer.FindMembers): Added static check for events.
16565 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16567 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16568 use Type.GetEvents(), not Type.FindMembers().
16570 2002-08-20 Martin Baulig <martin@gnome.org>
16572 * decl.cs (MemberCache): Added a special method cache which will
16573 be used for method-only searched. This ensures that a method
16574 search will return a MethodInfo with the correct ReflectedType for
16577 2002-08-20 Martin Baulig <martin@gnome.org>
16579 * decl.cs (DeclSpace.FindMembers): Made this public.
16581 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16583 * delegate.cs: fixed build on windows.
16584 [FIXME: Filed as bug #29150: MCS must report these errors.]
16586 2002-08-19 Ravi Pratap <ravi@ximian.com>
16588 * ecore.cs (StandardConversionExists): Return a false
16589 if we are trying to convert the void type to anything else
16590 since that is not allowed.
16592 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16593 we flag error 70 in the event an event is trying to be accessed
16594 directly from outside the declaring type.
16596 2002-08-20 Martin Baulig <martin@gnome.org>
16598 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16599 MemberCache from typemanager.cs to decl.cs.
16601 2002-08-19 Martin Baulig <martin@gnome.org>
16603 * class.cs (TypeContainer): Implement IMemberContainer.
16604 (TypeContainer.DefineMembers): Create the MemberCache.
16605 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16606 return public members if BindingFlags.Public was given, check
16607 whether members are static.
16609 2002-08-16 Martin Baulig <martin@gnome.org>
16611 * decl.cs (DeclSpace.Define): Splitted this in Define and
16612 DefineMembers. DefineMembers is called first and initializes the
16615 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16616 DefineMembers() on all our DeclSpaces.
16618 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16619 but call DefineMembers() on all nested interfaces. We call their
16620 Define() in our new Define() function.
16622 * interface.cs (Interface): Implement IMemberContainer.
16623 (Interface.Define): Moved all code except the attribute stuf to
16625 (Interface.DefineMembers): Initialize the member cache.
16627 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16628 need this anymore since we can use MemberCache.FindMembers directly.
16630 2002-08-19 Martin Baulig <martin@gnome.org>
16632 * typemanager.cs (MemberCache): When creating the cache for an
16633 interface type, add all inherited members.
16634 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16635 to `out bool used_cache' and documented it.
16636 (TypeManager.MemberLookup): If we already used the cache in the first
16637 iteration, we don't need to do the interfaces check.
16639 2002-08-19 Martin Baulig <martin@gnome.org>
16641 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16642 here from IMemberFinder and don't implement this interface anymore.
16643 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16645 * typemanager.cs (IMemberFinder): This interface is now only used by
16646 classes which actually support the member cache.
16647 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16648 since we only put DeclSpaces into this Hashtable.
16649 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16650 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16652 2002-08-16 Martin Baulig <martin@gnome.org>
16654 * typemanager.cs (ICachingMemberFinder): Removed.
16655 (IMemberFinder.MemberCache): New property.
16656 (TypeManager.FindMembers): Merged this with RealFindMembers().
16657 This function will never be called from TypeManager.MemberLookup()
16658 so we can't use the cache here, just the IMemberFinder.
16659 (TypeManager.MemberLookup_FindMembers): Check whether the
16660 IMemberFinder has a MemberCache and call the cache's FindMembers
16662 (MemberCache): Rewrote larger parts of this yet another time and
16663 cleaned it up a bit.
16665 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16667 * driver.cs (LoadArgs): Support quoting.
16669 (Usage): Show the CSC-like command line arguments.
16671 Improved a few error messages.
16673 2002-08-15 Martin Baulig <martin@gnome.org>
16675 * typemanager.cs (IMemberContainer.Type): New property.
16676 (IMemberContainer.IsInterface): New property.
16678 The following changes are conditional to BROKEN_RUNTIME, which is
16679 defined at the top of the file.
16681 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16682 class'es members, but add all members from TypeHandle.ObjectType
16683 if we're an interface.
16684 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16685 is the current type.
16686 (MemberCache.CacheEntry.Container): Removed this field.
16687 (TypeHandle.GetMembers): Include inherited members.
16689 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16691 * typemanager.cs: fixed compilation and added a comment on a field that
16694 2002-08-15 Martin Baulig <martin@gnome.org>
16696 * class.cs (ConstructorInitializer.Resolve): In the
16697 Expression.MemberLookup call, use the queried_type as
16700 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16701 declared' attribute, it's always true.
16702 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16703 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16704 temporary wrapper for FindMembers which tells MemberLookup whether
16705 members from the base classes are included in the return value.
16706 This will go away soon.
16707 (TypeManager.MemberLookup): Use this temporary hack here; once the
16708 new MemberCache is completed, we don't need to do the DeclaredOnly
16709 looping here anymore since the MemberCache will take care of this.
16710 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16711 (MemberCache): When creating the MemberCache for a class, get
16712 members from the current class and all its base classes.
16713 (MemberCache.CacheEntry.Container): New field. This is a
16714 temporary hack until the Mono runtime is fixed to distinguish
16715 between ReflectedType and DeclaringType. It allows us to use MCS
16716 with both the MS runtime and the unfixed Mono runtime without
16717 problems and without accecting performance.
16718 (MemberCache.SearchMembers): The DeclaredOnly looping from
16719 TypeManager.MemberLookup is now done here.
16721 2002-08-14 Martin Baulig <martin@gnome.org>
16723 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16724 Type.GetFields on dynamic types but get the fields from the
16725 corresponding TypeContainer.
16726 (MyStructInfo.GetStructInfo): Added check for enum types.
16728 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16729 (MemberList.SyncRoot): Implemented.
16730 (TypeManager.FilterWithClosure): No need to check permissions if
16731 closure_start_type == closure_invocation_type, don't crash if
16732 closure_invocation_type is null.
16734 2002-08-13 Martin Baulig <martin@gnome.org>
16736 Rewrote TypeContainer.FindMembers to use a member cache. This
16737 gives us a speed increase of about 35% for the self-hosting MCS
16738 build and of about 15-20% for the class libs (both on GNU/Linux).
16740 * report.cs (Timer): New class to get enhanced profiling. This
16741 whole class is "TIMER" conditional since it remarkably slows down
16744 * class.cs (MemberList): New class. This is an IList wrapper
16745 which we're now using instead of passing MemberInfo[]'s around to
16746 avoid copying this array unnecessarily.
16747 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16748 (ICachingMemberFinder, IMemberContainer): New interface.
16749 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16750 has already been checked, otherwise use it for the name comparision.
16751 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16752 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16753 if possible. Returns a MemberList, not a MemberInfo [].
16754 (TypeHandle): New class, implements IMemberContainer. We create
16755 one instance of this class per type, it contains a MemberCache
16756 which is used to do the member lookups.
16757 (MemberCache): New class. Each instance of this class contains
16758 all members of a type and a name-based hash table.
16759 (MemberCache.FindMembers): This is our new member lookup
16760 function. First, it looks up all members of the requested name in
16761 the hash table. Then, it walks this list and sorts out all
16762 applicable members and returns them.
16764 2002-08-13 Martin Baulig <martin@gnome.org>
16766 In addition to a nice code cleanup, this gives us a performance
16767 increase of about 1.4% on GNU/Linux - not much, but it's already
16768 half a second for the self-hosting MCS compilation.
16770 * typemanager.cs (IMemberFinder): New interface. It is used by
16771 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16772 Enum, Delegate or Interface.
16773 (TypeManager.finder_to_member_finder): New PtrHashtable.
16774 (TypeManager.finder_to_container): Removed.
16775 (TypeManager.finder_to_delegate): Removed.
16776 (TypeManager.finder_to_interface): Removed.
16777 (TypeManager.finder_to_enum): Removed.
16779 * interface.cs (Interface): Implement IMemberFinder.
16781 * delegate.cs (Delegate): Implement IMemberFinder.
16783 * enum.cs (Enum): Implement IMemberFinder.
16785 * class.cs (TypeContainer): Implement IMemberFinder.
16787 2002-08-12 Martin Baulig <martin@gnome.org>
16789 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16791 2002-08-12 Martin Baulig <martin@gnome.org>
16793 * ecore.cs (ITypeExpression): New interface for expressions which
16795 (TypeExpression): Renamed to TypeLookupExpression.
16796 (Expression.DoResolve): If we're doing a types-only lookup, the
16797 expression must implement the ITypeExpression interface and we
16798 call DoResolveType() on it.
16799 (SimpleName): Implement the new ITypeExpression interface.
16800 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16801 hack, the situation that we're only looking up types can't happen
16802 anymore when this method is called. Moved the type lookup code to
16803 DoResolveType() and call it.
16804 (SimpleName.DoResolveType): This ITypeExpression interface method
16805 is now doing the types-only lookup.
16806 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16807 (ResolveFlags): Added MaskExprClass.
16809 * expression.cs (MemberAccess): Implement the ITypeExpression
16811 (MemberAccess.DoResolve): Added support for a types-only lookup
16812 when we're called via ITypeExpression.DoResolveType().
16813 (ComposedCast): Implement the ITypeExpression interface.
16815 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16816 Expression.Resolve() with ResolveFlags.Type instead.
16818 2002-08-12 Martin Baulig <martin@gnome.org>
16820 * interface.cs (Interface.Define): Apply attributes.
16822 * attribute.cs (Attribute.ApplyAttributes): Added support for
16823 interface attributes.
16825 2002-08-11 Martin Baulig <martin@gnome.org>
16827 * statement.cs (Block.Emit): Only check the "this" variable if we
16828 do not always throw an exception.
16830 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16831 whether the property has a set accessor.
16833 2002-08-11 Martin Baulig <martin@gnome.org>
16835 Added control flow analysis support for structs.
16837 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16838 with control flow analysis turned off.
16839 (IVariable): New interface.
16840 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16841 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16842 (FieldExpr.DoResolve): Resolve the instance expression with flow
16843 analysis turned off and do the definite assignment check after the
16844 resolving when we know what the expression will resolve to.
16846 * expression.cs (LocalVariableReference, ParameterReference):
16847 Implement the new IVariable interface, only call the flow analysis
16848 code if ec.DoFlowAnalysis is true.
16849 (This): Added constructor which takes a Block argument. Implement
16850 the new IVariable interface.
16851 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16852 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16853 This does the definite assignment checks for struct members.
16855 * class.cs (Constructor.Emit): If this is a non-static `struct'
16856 constructor which doesn't have any initializer, call
16857 Block.AddThisVariable() to tell the flow analysis code that all
16858 struct elements must be initialized before control returns from
16861 * statement.cs (MyStructInfo): New public class.
16862 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16863 argument to this indexer. If non-zero, check an individual struct
16864 member, not the whole struct.
16865 (FlowBranching.CheckOutParameters): Check struct members.
16866 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16867 overloaded versions of these methods which take an additional
16868 `int field_idx' argument to check struct members.
16869 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16870 overloaded versions of these methods which take an additional
16871 `string field_name' argument to check struct member.s
16872 (VariableInfo): Implement the IVariable interface.
16873 (VariableInfo.StructInfo): New public property. Returns the
16874 MyStructInfo instance of the variable if it's a struct or null.
16875 (Block.AddThisVariable): New public method. This is called from
16876 Constructor.Emit() for non-static `struct' constructor which do
16877 not have any initializer. It creates a special variable for the
16878 "this" instance variable which will be checked by the flow
16879 analysis code to ensure that all of the struct's fields are
16880 initialized before control returns from the constructor.
16881 (UsageVector): Added support for struct members. If a
16882 variable/parameter is a struct with N members, we reserve a slot
16883 in the usage vector for each member. A struct is considered fully
16884 initialized if either the struct itself (slot 0) or all its
16885 members are initialized.
16887 2002-08-08 Martin Baulig <martin@gnome.org>
16889 * driver.cs (Driver.MainDriver): Only report an error CS5001
16890 if there were no compilation errors.
16892 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16893 `UnsafeContext' property to determine whether the parent is in
16894 unsafe context rather than checking the parent's ModFlags:
16895 classes nested in an unsafe class are unsafe as well.
16897 2002-08-08 Martin Baulig <martin@gnome.org>
16899 * statement.cs (UsageVector.MergeChildren): Distinguish between
16900 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16901 we return. Added test17() and test18() to test-154.cs.
16903 2002-08-08 Martin Baulig <martin@gnome.org>
16905 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16906 Family access, make sure the invoking type isn't a subclass of the
16907 queried type (that'd be a CS1540).
16909 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16910 this method which takes an additional `Type invocation_type'.
16912 * expression.cs (BaseAccess.DoResolve): Use the base type as
16913 invocation and query type.
16914 (MemberAccess.DoResolve): If the lookup failed and we're about to
16915 report a CS0122, try a lookup with the ec.ContainerType - if this
16916 succeeds, we must report a CS1540.
16918 2002-08-08 Martin Baulig <martin@gnome.org>
16920 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16921 (MethodGroupExpr): Implement the IMemberExpr interface.
16923 * expression (MemberAccess.ResolveMemberAccess): No need to have
16924 any special code for MethodGroupExprs anymore, they're now
16927 2002-08-08 Martin Baulig <martin@gnome.org>
16929 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16930 Family, FamANDAssem and FamORAssem permissions.
16931 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16933 2002-08-08 Martin Baulig <martin@gnome.org>
16935 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16936 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16939 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16941 * driver.cs: implemented /resource option to embed managed resources.
16943 2002-08-07 Martin Baulig <martin@gnome.org>
16945 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16946 (FieldBase.HasFieldInitializer): New public property.
16947 (FieldBase.GetInitializerExpression): New public method. Resolves and
16948 returns the field initializer and makes sure it is only resolved once.
16949 (TypeContainer.EmitFieldInitializers): Call
16950 FieldBase.GetInitializerExpression to get the initializer, this ensures
16951 that it isn't resolved multiple times.
16953 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16954 the resolving process (SimpleName/MemberLookup) that we're currently
16955 emitting a field initializer (which must not access any instance members,
16956 this is an error CS0236).
16958 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16959 argument, if the `IsFieldInitializer' flag is set, we must report and
16960 error CS0236 and not an error CS0120.
16962 2002-08-07 Martin Baulig <martin@gnome.org>
16964 * ecore.cs (IMemberExpr): New public interface.
16965 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16966 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16967 if the expression is an IMemberExpr.
16969 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16970 to be null, implicitly default to `this' if we're non-static in
16971 this case. Simplified the code a lot by using the new IMemberExpr
16972 interface. Also fixed bug #28176 here.
16974 2002-08-06 Martin Baulig <martin@gnome.org>
16976 * cs-parser.jay (SimpleLookup): Removed. We need to create
16977 ParameterReferences during semantic analysis so that we can do a
16978 type-only search when resolving Cast, TypeOf and SizeOf.
16979 (block): Pass the `current_local_parameters' to the Block's
16982 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16983 argument to the constructor.
16984 (ConstructorInitializer.Resolve): Create a temporary implicit
16985 block with the parameters.
16987 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16988 references here if we aren't doing a type-only search.
16990 * statement.cs (Block): Added constructor which takes a
16991 `Parameters parameters' argument.
16992 (Block.Parameters): New public property.
16994 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16995 to `Parameters' and made it public readonly.
16997 2002-08-06 Martin Baulig <martin@gnome.org>
16999 * ecore.cs (Expression.Warning): Made this public as well.
17001 * report.cs (Report.Debug): Print the contents of collections.
17003 2002-08-06 Martin Baulig <martin@gnome.org>
17005 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17006 used to tell Resolve() which kinds of expressions it may return.
17007 (Expression.Resolve): Added overloaded version of this method which
17008 takes a `ResolveFlags flags' argument. This can be used to tell
17009 Resolve() which kinds of expressions it may return. Reports a
17011 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17012 ResolveFlags.SimpleName.
17013 (Expression.Error118): Added overloaded version of this method which
17014 takes a `ResolveFlags flags' argument. It uses the flags to determine
17015 which kinds of expressions are allowed.
17017 * expression.cs (Argument.ResolveMethodGroup): New public method.
17018 Resolves an argument, but allows a MethodGroup to be returned.
17019 This is used when invoking a delegate.
17021 * TODO: Updated a bit.
17023 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17025 Fixed compilation with csc.
17027 * ecore.cs: Expression.Error made public. Is this correct? Should
17028 Warning be made public too?
17030 * expression.cs: use ea.Location instead of ea.loc.
17031 [FIXME: Filed as bug #28607: MCS must report these errors.]
17033 2002-08-06 Martin Baulig <martin@gnome.org>
17035 * ecore.cs (Expression.loc): Moved the location here instead of
17036 duplicating it in all derived classes.
17037 (Expression.Location): New public property.
17038 (Expression.Error, Expression.Warning): Made them non-static and
17039 removed the location argument.
17040 (Expression.Warning): Added overloaded version which takes an
17041 `int level' argument.
17042 (Expression.Error118): Make this non-static and removed the
17043 expression and location arguments.
17044 (TypeExpr): Added location argument to the constructor.
17046 * expression.cs (StaticCallExpr): Added location argument to
17048 (Indirection, PointerArithmetic): Likewise.
17049 (CheckedExpr, UnCheckedExpr): Likewise.
17050 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17051 (StringPtr): Likewise.
17054 2002-08-05 Martin Baulig <martin@gnome.org>
17056 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17058 * assign.cs (Assign.DoResolve): Check whether the source
17059 expression is a value or variable.
17061 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17062 while resolving the corresponding blocks.
17064 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17065 an error, don't silently return null.
17067 * statement.cs (Block.AddVariable): Do the error reporting here
17068 and distinguish between CS0128 and CS0136.
17069 (Block.DoResolve): Report all unused labels (warning CS0164).
17070 (LabeledStatement): Pass the location to the constructor.
17071 (LabeledStatement.HasBeenReferenced): New property.
17072 (LabeledStatement.Resolve): Set it to true here.
17074 * statement.cs (Return.Emit): Return success even after reporting
17075 a type mismatch error (CS0126 or CS0127), this is what csc does and
17076 it avoids confusing the users with any consecutive errors.
17078 2002-08-05 Martin Baulig <martin@gnome.org>
17080 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17082 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17084 * expression.cs (MemberAccess.DoResolve): Silently return if an
17085 error has already been reported.
17087 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17088 error has already been reported.
17090 2002-08-05 Martin Baulig <martin@gnome.org>
17092 * statement.cs (UsageVector): Only initialize the `parameters'
17093 vector if we actually have any "out" parameters.
17095 2002-08-05 Martin Baulig <martin@gnome.org>
17097 * expression.cs (Binary.ResolveOperator): When combining delegates,
17098 they must have the same type.
17100 2002-08-05 Martin Baulig <martin@gnome.org>
17102 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17103 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17104 work with the ms runtime and we also don't need it: if we're a
17105 PropertyBuilder and not in the `indexer_arguments' hash, then we
17106 are a property and not an indexer.
17108 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17109 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17110 since the latter one doesn't work with the ms runtime.
17112 2002-08-03 Martin Baulig <martin@gnome.org>
17114 Fixed bugs #27998 and #22735.
17116 * class.cs (Method.IsOperator): New public field.
17117 (Method.CheckBase): Report CS0111 if there's already a method
17118 with the same parameters in the current class. Report CS0508 when
17119 attempting to change the return type of an inherited method.
17120 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17121 and it's not marked abstract or extern.
17122 (PropertyBase): New abstract base class for Property and Indexer.
17123 (PropertyBase.CheckBase): Moved here from Property and made it work
17125 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17126 the same so we can reuse it there.
17127 (Property, Indexer): Derive from PropertyBase.
17128 (MethodSignature.inheritable_property_signature_filter): New delegate
17129 to find properties and indexers.
17131 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17132 argument and improved error reporting.
17134 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17135 EmptyReadOnlyParameters and made it a property.
17137 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17138 version of this method which takes a `PropertyInfo indexer'.
17139 (TypeManager.RegisterIndexer): New method.
17141 * class.cs: Added myself as author of this file :-)
17143 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17145 * class.cs: fixed compilation on windoze.
17147 2002-08-03 Martin Baulig <martin@gnome.org>
17149 * interface.cs (Interface.GetInterfaceBases): Check whether all
17150 base interfaces are at least as accessible than the current one.
17152 * class.cs (TypeContainer.GetClassBases): Check whether base types
17153 are at least as accessible than the current type.
17154 (TypeContainer.AsAccessible): Implemented and made non-static.
17155 (MemberBase.CheckParameters): Report errors if the accessibility
17158 * delegate.cs (Delegate.Delegate): The default visibility is
17159 internal for top-level types and private for nested types.
17160 (Delegate.Define): Report errors if the accessibility checks fail.
17162 * enum.cs (Enum.Enum): The default visibility is internal for
17163 top-level types and private for nested types.
17164 (Enum.DefineType): Compute the correct visibility.
17166 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17167 function which takes a `bool is_toplevel' instead of a TypeContainer.
17169 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17172 2002-08-02 Martin Baulig <martin@gnome.org>
17174 * expression.cs (LocalVariableReferenc): Added constructor which
17175 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17176 (LocalVariableReference.IsReadOnly): New property.
17177 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17178 variable is readonly, use our own readonly flag to do this; you can
17179 use the new constructor to get a writable reference to a read-only
17182 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17183 reference to the local variable.
17185 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17187 * rootcontext.cs (ResolveCore): Also include System.Exception
17189 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17190 we reach an EmptyStatement.
17192 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17195 * expression.cs (Binary.ResolveOperator): Check error result in
17198 use brtrue/brfalse directly and avoid compares to null.
17200 2002-08-02 Martin Baulig <martin@gnome.org>
17202 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17203 Fixes bug #28407, added test-155.cs.
17205 2002-08-01 Martin Baulig <martin@gnome.org>
17207 * class.cs (Event.EmitDefaultMethod): Make this work with static
17208 events. Fixes #28311, added verify-3.cs.
17210 2002-08-01 Martin Baulig <martin@gnome.org>
17212 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17213 `is_disposable' fields.
17214 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17215 `hm.is_disposable' if we're using the collection pattern.
17216 (Foreach.EmitCollectionForeach): Use the correct type for the
17217 enumerator's local variable, only emit the try/finally block if
17218 necessary (fixes #27713).
17220 2002-08-01 Martin Baulig <martin@gnome.org>
17222 * ecore.cs (Expression.report118): Renamed to Error118 and made
17225 * statement.cs (Throw.Resolve): Check whether the expression is of
17226 the correct type (CS0118) and whether the type derives from
17227 System.Exception (CS0155).
17228 (Catch.Resolve): New method. Do the type lookup here and check
17229 whether it derives from System.Exception (CS0155).
17230 (Catch.CatchType, Catch.IsGeneral): New public properties.
17232 * typemanager.cs (TypeManager.exception_type): Added.
17234 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17236 * driver.cs: Updated About function.
17238 2002-07-31 Martin Baulig <martin@gnome.org>
17240 Implemented Control Flow Analysis.
17242 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17243 (EmitContext.CurrentBranching): Added.
17244 (EmitContext.StartFlowBranching): Added.
17245 (EmitContext.EndFlowBranching): Added.
17246 (EmitContext.KillFlowBranching): Added.
17247 (EmitContext.IsVariableAssigned): Added.
17248 (EmitContext.SetVariableAssigned): Added.
17249 (EmitContext.IsParameterAssigned): Added.
17250 (EmitContext.SetParameterAssigned): Added.
17251 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17252 Added control flow analysis stuff here.
17254 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17255 resolve the expression as lvalue.
17256 (LocalVariableReference.DoResolve): Check whether the variable has
17257 already been assigned.
17258 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17259 the parameter as assigned here.
17260 (ParameterReference.DoResolve): Check whether the parameter has already
17262 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17263 expression as lvalue.
17265 * statement.cs (FlowBranching): New class for the flow analysis code.
17266 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17267 (LabeledStatement.IsDefined): New public property.
17268 (LabeledStatement.AddUsageVector): New public method to tell flow
17269 analyis that the label may be reached via a forward jump.
17270 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17272 (VariableInfo.Number): New public field. This is used by flow analysis
17273 to number all locals of a block.
17274 (Block.CountVariables): New public property. This is the number of
17275 local variables in this block (including the locals from all parent
17277 (Block.EmitMeta): Number all the variables.
17279 * statement.cs: Added flow analysis support to all classes.
17281 2002-07-31 Martin Baulig <martin@gnome.org>
17283 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17284 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17285 then use this argument.
17287 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17289 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17290 use this to specify /define options.
17292 2002-07-29 Martin Baulig <martin@gnome.org>
17294 * statement.cs (Fixed): Moved all code that does variable lookups
17295 and resolvings from Emit to Resolve.
17297 * statement.cs (For): Moved all code that does variable lookups
17298 and resolvings from Emit to Resolve.
17300 * statement.cs (Using): Moved all code that does variable lookups
17301 and resolvings from Emit to Resolve.
17303 2002-07-29 Martin Baulig <martin@gnome.org>
17305 * attribute.cs (Attribute.Resolve): Explicitly catch a
17306 System.NullReferenceException when creating the
17307 CustromAttributeBuilder and report a different warning message.
17309 2002-07-29 Martin Baulig <martin@gnome.org>
17311 * support.cs (ParameterData.ParameterName): Added method to
17312 get the name of a parameter.
17314 * typemanager.cs (TypeManager.IsValueType): New public method.
17316 2002-07-29 Martin Baulig <martin@gnome.org>
17318 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17319 is a flag which specifies that it's either ref or out.
17320 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17321 the out parameter to `out Parameter.Modifier mod', also set the
17322 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17324 * support.cs (InternalParameters.ParameterModifier): Distinguish
17325 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17326 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17328 * expression.cs (Argument.GetParameterModifier): Distinguish
17329 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17330 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17332 2002-07-29 Martin Baulig <martin@gnome.org>
17334 * expression.cs (ParameterReference.ParameterReference): Added
17335 `Location loc' argument to the constructor.
17337 * cs-parser.jay: Pass location to ParameterReference.
17339 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17341 * statement.cs (Try): Initialize the location.
17343 * cs-parser.jay: pass location to Try.
17345 * expression.cs (Unary.Reduce): Change the prototype to return
17346 whether a constant fold could be performed or not. The result is
17347 returned in an out parameters. In the case of Indirection and
17348 AddressOf, we want to perform the full tests.
17350 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17352 * statement.cs (Statement.Emit): Flag dead code.
17354 2002-07-27 Andrew Birkett <andy@nobugs.org>
17356 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17358 2002-07-27 Martin Baulig <martin@gnome.org>
17360 * class.cs (MethodData.Define): Put back call to
17361 TypeManager.AddMethod(), accidentally commented this out.
17363 * report.cs (Debug): New public method to print debugging information,
17364 this is `[Conditional ("DEBUG")]'.
17366 2002-07-26 Martin Baulig <martin@gnome.org>
17368 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17369 (switch_statement): Push the current_block to the switch_stack and
17370 pop it again when we're done with the switch.
17371 (switch_section): The new block is a child of the current_block.
17372 Fixes bug #24007, added test-152.cs.
17374 2002-07-27 Martin Baulig <martin@gnome.org>
17376 * expression.cs (Invocation.EmitArguments): When calling a varargs
17377 function with only its fixed arguments, we need to pass an empty
17380 2002-07-27 Martin Baulig <martin@gnome.org>
17382 Mono 0.13 has been released.
17384 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17386 * driver.cs: Rename --resource to --linkres, because that is what
17387 we do currently, we dont support --resource yet.
17389 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17391 2002-07-25 Martin Baulig <martin@gnome.org>
17393 * class.cs (MethodData): New public class. This is a `method builder'
17394 class for a method or one accessor of a Property/Indexer/Event.
17395 (MethodData.GetMethodFlags): Moved here from MemberBase.
17396 (MethodData.ApplyAttributes): Likewise.
17397 (MethodData.ApplyObsoleteAttribute): Likewise.
17398 (MethodData.ApplyConditionalAttribute): Likewise.
17399 (MethodData.ApplyDllImportAttribute): Likewise.
17400 (MethodData.CheckAbstractAndExternal): Likewise.
17401 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17402 (MethodData.Emit): Formerly known as Method.Emit().
17403 (MemberBase): Moved everything which was specific to a single
17404 accessor/method to MethodData.
17405 (Method): Create a new MethodData and call Define() and Emit() on it.
17406 (Property, Indexer, Event): Create a new MethodData objects for each
17407 accessor and call Define() and Emit() on them.
17409 2002-07-25 Martin Baulig <martin@gnome.org>
17411 Made MethodCore derive from MemberBase to reuse the code from there.
17412 MemberBase now also checks for attributes.
17414 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17415 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17417 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17418 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17419 (MemberBase.ApplyAttributes): New virtual method; applies the
17420 attributes to a method or accessor.
17421 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17422 (MemberBase.ApplyConditionalAttribute): Likewise.
17423 (MemberBase.ApplyDllImportAttribute): Likewise.
17424 (MemberBase.CheckAbstractAndExternal): Likewise.
17425 (MethodCore.ParameterTypes): This is now a property instead of a
17426 method, it's initialized from DoDefineParameters().
17427 (MethodCore.ParameterInfo): Removed the set accessor.
17428 (MethodCore.DoDefineParameters): New protected virtual method to
17429 initialize ParameterTypes and ParameterInfo.
17430 (Method.GetReturnType): We can now simply return the MemberType.
17431 (Method.GetMethodFlags): Override the MemberBase version and add
17432 the conditional flags.
17433 (Method.CheckBase): Moved some code from Define() here, call
17434 DoDefineParameters() here.
17435 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17436 here to avoid some larger code duplication.
17437 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17438 ensure that abstract and external accessors don't declare a body.
17440 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17441 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17442 lookup in the attribute's parent classes, so we need to abort as soon
17443 as we found the first match.
17444 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17445 the attribute has no arguments.
17447 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17450 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17452 * cs-parser.jay: reverted previous patch.
17454 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17456 * cs-parser.jay: fixed bug #22119.
17458 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17460 * attribute.cs: fixed compilation. The error was:
17461 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17462 be assigned to before control leaves the current method."
17463 [FIXME: Filed as bug #28186: MCS must report this error.]
17465 2002-07-25 Martin Baulig <martin@gnome.org>
17467 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17468 method to pull the condition name ouf of a Conditional attribute.
17469 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17470 the obsolete message and error flag out of an Obsolete attribute.
17472 * class.cs (Method.GetMethodFlags): New public method to get the
17473 TypeManager.MethodFlags for this method.
17474 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17476 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17477 if we're overriding a virtual function, set the new private variable
17478 `parent_method'; call the new TypeManager.AddMethod().
17480 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17481 the MethodBuilder and the Method in a PtrHashtable.
17482 (TypeManager.builder_to_method): Added for this purpose.
17483 (TypeManager.MethodFlags): Added IsObsoleteError.
17484 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17485 Obsolete and Conditional arguments in MethodBuilders. If we discover
17486 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17487 the message from the attribute.
17489 2002-07-24 Martin Baulig <martin@gnome.org>
17491 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17492 preprocessor directives, ensure that the argument to #define/#undef is
17493 exactly one identifier and that it's actually an identifier.
17495 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17498 2002-07-24 Martin Baulig <martin@gnome.org>
17500 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17501 initialize it to TypeManager.object_type in the constructor.
17502 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17503 of the `hm.get_current' method if we're using the collection pattern.
17504 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17505 for the explicit conversion to make it work when we're using the collection
17506 pattern and the `Current' property has a different return type than `object'.
17509 2002-07-24 Martin Baulig <martin@gnome.org>
17511 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17512 does not match, but don't report any errors. This method is called in
17513 order for all methods in a MethodGroupExpr until a matching method is
17514 found, so we don't want to bail out if the first method doesn't match.
17515 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17516 matches, report the 123. Fixes #28070.
17518 2002-07-24 Martin Baulig <martin@gnome.org>
17520 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17521 TypeManager.TypeToCoreType() to the top of the method so the
17522 following equality checks will work. Fixes #28107.
17524 2002-07-24 Martin Baulig <martin@gnome.org>
17526 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17527 operand is of type uint, and the other operand is of type sbyte,
17528 short or int, the operands are converted to type long." -
17529 Actually do what this comment already told us. Fixes bug #28106,
17532 2002-07-24 Martin Baulig <martin@gnome.org>
17534 * class.cs (MethodBase): New abstract class. This is now a base
17535 class for Property, Indexer and Event to avoid some code duplication
17536 in their Define() and DefineMethods() methods.
17537 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17538 generic methods for Define() and DefineMethods().
17539 (FieldBase): Derive from MemberBase, not MemberCore.
17540 (Property): Derive from MemberBase, not MemberCore.
17541 (Property.DefineMethod): Moved all the code from this method to the
17542 new MethodBase.DefineAccessor(), just call it with appropriate
17544 (Property.Define): Call the new Property.DoDefine(), this does some
17545 sanity checks and we don't need to duplicate the code everywhere.
17546 (Event): Derive from MemberBase, not MemberCore.
17547 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17548 accessors, this will also make them work with interface events.
17549 (Indexer): Derive from MemberBase, not MemberCore.
17550 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17551 (Indexer.Define): Use the new MethodBase functions.
17553 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17554 argument to the constructor.
17555 (Interface.FindMembers): Added support for interface events.
17556 (Interface.PopluateEvent): Implemented.
17558 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17560 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17562 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17563 but this is required to check for a method name being the same as
17564 the containing class.
17568 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17570 * interface.cs: initialize variable.
17572 2002-07-23 Martin Baulig <martin@gnome.org>
17574 Implemented the IndexerName attribute in interfaces.
17576 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17577 name if this is an explicit interface implementation.
17578 (Indexer.InterfaceIndexerName): New public variable. If we're
17579 implementing an interface indexer, this is the IndexerName in that
17580 interface. Otherwise, it's the IndexerName.
17581 (Indexer.DefineMethod): If we're implementing interface indexer,
17582 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17583 and Pending.ImplementIndexer methods.
17584 (Indexer.Define): Also define the PropertyBuilder if we're
17585 implementing an interface indexer and this is neither an explicit
17586 interface implementation nor do the IndexerName match the one in
17589 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17590 If a method is defined here, then we always need to create a proxy
17591 for it. This is used when implementing interface indexers.
17592 (Pending.IsInterfaceIndexer): New public method.
17593 (Pending.ImplementIndexer): New public method.
17594 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17595 This is used when implementing interface indexers to define a proxy
17597 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17598 define a proxy if necessary.
17600 * interface.cs (Interface.IndexerName): New public variable.
17601 (Interface.PopulateIndexer): Set the IndexerName.
17602 (Interface.DefineIndexers): New private method. Populate all the
17603 indexers and make sure their IndexerNames match.
17605 * typemanager.cs (IndexerPropertyName): Added support for interface
17608 2002-07-22 Martin Baulig <martin@gnome.org>
17610 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17611 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17612 ret if HasReturnLabel.
17613 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17616 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17617 and set the ec.LoopBeginTryCatchLevel.
17618 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17619 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17620 the current ec.TryCatchLevel, the branch goes out of an exception
17621 block. In this case, we need to use Leave and not Br.
17623 2002-07-22 Martin Baulig <martin@gnome.org>
17625 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17626 block unless the block does not always return or it is contained in
17627 another try { ... } catch { ... } block. Fixes bug #26506.
17628 Added verify-1.cs to the test suite.
17630 2002-07-22 Martin Baulig <martin@gnome.org>
17632 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17633 then we do not always return. Fixes bug #24985.
17635 2002-07-22 Martin Baulig <martin@gnome.org>
17637 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17638 lookup on a per-class level; ie. walk up the class hierarchy until we
17639 found at least one applicable method, then choose the best among them.
17640 Fixes bug #24463 and test-29.cs.
17642 2002-07-22 Martin Baulig <martin@gnome.org>
17644 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17645 return types of the methods. The return type is not part of the
17646 signature and we must not check it to make the `new' modifier work.
17647 Fixes bug #27999, also added test-147.cs.
17648 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17650 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17651 on the method's return type.
17653 2002-07-21 Martin Baulig <martin@gnome.org>
17655 * assign.cs: Make this work if the rightmost source is a constant and
17656 we need to do an implicit type conversion. Also adding a few more tests
17657 to test-38.cs which should have caught this.
17659 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17660 target in the makefile for this. The makefile.gnu is primarily intended
17661 for end-users who don't want to debug the compiler.
17663 2002-07-21 Martin Baulig <martin@gnome.org>
17665 * assign.cs: Improved the Assign class so it can now handle embedded
17666 assignments (X = Y = Z = something). As a side-effect this'll now also
17667 consume less local variables. test-38.cs now passes with MCS, added
17668 a few new test cases to that test.
17670 2002-07-20 Martin Baulig <martin@gnome.org>
17672 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17673 instructions. Fixes bug #27977, also added test-146.cs.
17675 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17677 * cs-tokenizer.cs: fixed getHex ().
17679 2002-07-19 Martin Baulig <martin@gnome.org>
17681 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17682 not Type.GetType() to lookup the array type. This is needed when
17683 we're constructing an array of a user-defined type.
17684 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17685 single-dimensional arrays, but also for single-dimensial arrays of
17688 2002-07-19 Martin Baulig <martin@gnome.org>
17690 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17691 this function is called, it's not allowed to share LocalBuilders
17692 among ILGenerators.
17694 2002-07-19 Martin Baulig <martin@gnome.org>
17696 * expression.cs (Argument.Resolve): Report an error 118 when trying
17697 to pass a type as argument.
17699 2002-07-18 Martin Baulig <martin@gnome.org>
17701 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17702 Conv_R_Un for the signed `long' type.
17704 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17706 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17707 `expr' for the temporary result, as that will fail if we do
17708 multiple resolves on the same expression.
17710 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17712 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17713 ec.TypeContainer for looking up aliases.
17715 * class.cs (TypeContainer): Remove LookupAlias from here.
17717 * decl.cs (DeclSpace); Move here.
17719 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17721 * class.cs (FindMembers): Only call filter if the constructor
17722 bulider is not null.
17724 Also handle delegates in `NestedTypes' now. Now we will perform
17725 type lookups using the standard resolution process. This also
17728 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17729 This uses Expressions (the limited kind that can be parsed by the
17730 tree) instead of strings.
17732 * expression.cs (ComposedCast.ToString): Implement, used to flag
17733 errors since now we have to render expressions.
17735 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17738 * ecore.cs (SimpleName.ToString): ditto.
17740 * cs-parser.jay: Instead of using strings to assemble types, use
17741 Expressions to assemble the type (using SimpleName, ComposedCast,
17742 MemberAccess). This should fix the type lookups in declarations,
17743 because we were using a different code path for this.
17745 * statement.cs (Block.Resolve): Continue processing statements
17746 even when there is an error.
17748 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17750 * class.cs (Event.Define): Also remove the `remove' method from
17751 the list of pending items.
17753 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17754 generate more compact code.
17756 2002-07-17 Martin Baulig <martin@gnome.org>
17758 * const.cs (Const.LookupConstantValue): Add support for constant
17759 `unchecked' and `checked' expressions.
17760 Also adding test case test-140.cs for this.
17762 2002-07-17 Martin Baulig <martin@gnome.org>
17764 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17765 check whether mi.ReturnType implements the IEnumerator interface; the
17766 `==' and the IsAssignableFrom() will fail in this situation.
17768 2002-07-16 Ravi Pratap <ravi@ximian.com>
17770 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17773 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17775 * expression.cs: fixed bug #27811.
17777 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17779 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17780 Molaro: when we are a ref, the value already contains a pointer
17781 value, do not take the address of it.
17783 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17784 * removed mb-parser.jay and mb-tokenizer.cs
17786 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17788 * expression.cs: check against the building corlib void type.
17790 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17792 * ecore.cs: fix for valuetype static readonly fields: when
17793 initializing them, we need their address, not the address of a copy.
17795 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17797 * typemanager.cs: register also enum_type in corlib.
17799 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17801 * class.cs: allow calling this (but not base) initializers in structs.
17803 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17805 * ecore.cs: make sure we compare against the building base types
17808 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17810 * typemanager.cs: fix TypeToCoreType() to handle void and object
17811 (corlib gets no more typerefs after this change).
17813 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17815 * expression.cs (ArrayCreation.EmitArrayArguments): use
17816 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17818 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17819 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17820 array indexes, the runtime actually forbids them.
17822 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17823 for array arguments here.
17825 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17826 instead of the default for ValueTypes.
17828 (New.DoEmit): Use IsValueType instead of
17829 IsSubclassOf (value_type)
17830 (New.DoResolve): ditto.
17831 (Invocation.EmitCall): ditto.
17833 * assign.cs (Assign): ditto.
17835 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17836 Statements *are* currently doing part of their resolution during
17839 Expressions do always resolve during resolve, but statements are
17840 only required to propagate resolution to their children.
17842 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17844 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17846 (LoadAssembly): Do not add the dll if it is already specified
17848 (MainDriver): Add the System directory to the link path at the end,
17849 after all the other -L arguments.
17851 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17852 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17853 ldelem.u1) and using the opposite for sbytes.
17855 This fixes Digger, and we can finally run it.
17857 * driver.cs (UnixParseOption): Move the option parsing here.
17858 (CSCParseOption): Implement CSC-like parsing of options.
17860 We now support both modes of operation, the old Unix way, and the
17861 new CSC-like way. This should help those who wanted to make cross
17862 platform makefiles.
17864 The only thing broken is that /r:, /reference: and /lib: are not
17865 implemented, because I want to make those have the same semantics
17866 as the CSC compiler has, and kill once and for all the confussion
17867 around this. Will be doing this tomorrow.
17869 * statement.cs (Unsafe.Resolve): The state is checked during
17870 resolve, not emit, so we have to set the flags for IsUnsfe here.
17872 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17874 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17875 not catch the Error_ObjectRefRequired in SimpleName (as it is
17876 possible to have a class/instance variable name that later gets
17877 deambiguated), we have to check this here.
17879 2002-07-10 Ravi Pratap <ravi@ximian.com>
17881 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17882 make static and put into Expression.
17884 (Event.Define): Register the private field of the event with the
17885 TypeManager so that GetFieldFromEvent can get at it.
17887 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17888 keep track of the private field associated with an event which
17891 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17894 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17896 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17898 * expression.cs (Binary.EmitBranchable): this routine emits the
17899 Binary expression in a branchable context. This basically means:
17900 we need to branch somewhere, not just get the value on the stack.
17902 This works together with Statement.EmitBoolExpression.
17904 * statement.cs (Statement.EmitBoolExpression): Use
17907 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17909 * statement.cs (For): Reduce the number of jumps in loops.
17911 (For): Implement loop inversion for the For statement.
17913 (Break): We can be breaking out of a Try/Catch controlled section
17914 (foreach might have an implicit try/catch clause), so we need to
17915 use Leave instead of Br.
17917 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17918 now). If the instace expression supports IMemoryLocation, we use
17919 the AddressOf method from the IMemoryLocation to extract the
17920 address instead of emitting the instance.
17922 This showed up with `This', as we were emitting the instance
17923 always (Emit) instead of the Address of This. Particularly
17924 interesting when This is a value type, as we dont want the Emit
17925 effect (which was to load the object).
17927 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17929 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17931 * statement.cs (Checked): Set the CheckedState during the resolve
17932 process too, as the ConvCast operations track the checked state on
17933 the resolve process, and not emit.
17935 * cs-parser.jay (namespace_member_declaration): Flag that we have
17936 found a declaration when we do. This is used to flag error 1529
17938 * driver.cs: Report ok when we display the help only.
17940 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17942 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17944 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17946 * cs-tokenizer.cs (define): We also have to track locally the
17947 defines. AllDefines is just used for the Conditional Attribute,
17948 but we also need the local defines for the current source code.
17950 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17952 * statement.cs (While, For, Do): These loops can exit through a
17953 Break statement, use this information to tell whether the
17954 statement is the last piece of code.
17956 (Break): Flag that we break.
17958 * codegen.cs (EmitContexts): New `Breaks' state variable.
17960 2002-07-03 Martin Baulig <martin@gnome.org>
17962 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17963 modifiers in method declarations in structs. Otherwise, you won't
17964 be able to override things like Object.Equals().
17966 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17968 * class.cs (Method, Property, Indexer): Do not allow the public
17969 modifier to be used in explicit interface implementations.
17971 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17972 override modifiers in method declarations in structs
17974 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17976 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17977 integer or real overflow, report an error
17979 2002-07-02 Martin Baulig <martin@gnome.org>
17981 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17982 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17983 to tell the runtime about our newly created System.Object and
17984 System.ValueType types.
17986 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17988 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17989 struct instead of Ldarg/Starg.
17991 2002-07-02 Martin Baulig <martin@gnome.org>
17993 * expression.cs (Indirection.Indirection): Call
17994 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17996 2002-07-02 Martin Baulig <martin@gnome.org>
17998 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17999 ValueType, call TypeManager.TypeToCoreType() on it.
18000 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18001 the OpCodes.Newarr argument.
18003 2002-07-02 Martin Baulig <martin@gnome.org>
18005 * expression.cs (Invocation.EmitCall): When compiling corlib,
18006 replace all calls to the system's System.Array type to calls to
18007 the newly created one.
18009 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18010 System.Array methods.
18011 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18012 from the system's System.Array type which must be replaced.
18014 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18016 * typemanager.cs: load unverifiable_code_ctor so we can build
18017 corlib using the correct type. Avoid using GetTypeCode() with
18019 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18020 TypeManager.object_type to allow building corlib.
18022 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18024 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18026 2002-07-01 Martin Baulig <martin@gnome.org>
18028 * class.cs: Make the last change actually work, we need to check
18029 whether `ifaces != null' to avoid a crash.
18031 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18033 * class.cs: when we build structs without fields that implement
18034 interfaces, we need to add the interfaces separately, since there is
18035 no API to both set the size and add the interfaces at type creation
18038 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18040 * expression.cs: the dimension arguments to the array constructors
18041 need to be converted if they are a long.
18043 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18045 * class.cs: don't emit ldarg.0 if there is no parent constructor
18046 (fixes showstopper for corlib).
18048 2002-06-29 Martin Baulig <martin@gnome.org>
18050 MCS now compiles corlib on GNU/Linux :-)
18052 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18053 ie. check for MethodImplOptions.InternalCall.
18055 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18056 and TypeManager.attribute_type are null, so we must explicitly check
18057 whether parent is not null to find out whether it's an attribute type.
18058 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18059 and SetBuilder, not only if the property is neither abstract nor external.
18060 This is necessary to set the MethodImplOptions on the accessor methods.
18061 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18062 SetBuilder, see Property.Emit().
18064 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18065 populate "System.Object", "System.ValueType" and "System.Attribute" since
18066 they've already been populated from BootCorlib_PopulateCoreTypes().
18068 2002-06-29 Martin Baulig <martin@gnome.org>
18070 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18071 is the NullLiteral, we also need to make sure that target_type is not
18074 2002-06-29 Martin Baulig <martin@gnome.org>
18076 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18077 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18078 before calling BootstrapCorlib_ResolveDelegate ().
18080 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18082 * statement.cs: fixed build-breaker. All tests passed ok.
18084 2002-06-27 Martin Baulig <martin@gnome.org>
18086 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18087 for System.Decimal when compiling corlib.
18089 2002-06-27 Martin Baulig <martin@gnome.org>
18091 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18092 switch blocks which contain nothing but a default clause.
18094 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18096 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18098 2002-06-27 Martin Baulig <martin@gnome.org>
18100 * ecore.cs (PropertyExpr.PropertyExpr): Call
18101 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18103 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18104 is already a TypeBuilder.
18106 2002-06-27 Martin Baulig <martin@gnome.org>
18108 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18109 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18110 the "from an array-type to System.Array" case. This makes it work
18111 when compiling corlib.
18113 2002-06-27 Martin Baulig <martin@gnome.org>
18115 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18116 non-static PropertyExpr, set its InstanceExpression. This makes
18117 the `ICollection.Count' property work in System/Array.cs.
18119 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18121 * driver.cs: Made error handling more consistent. Errors now
18122 tracked by Report class, so many methods which used to return int
18123 now return void. Main() now prints success/failure and
18124 errors/warnings message.
18126 Renamed '--probe' compiler argument to '--expect-error'. Removed
18127 the magic number return values (123 and 124). Now, if the
18128 expected error occurs, the compiler exits with success (exit value
18129 0). If the compilation completes without seeing that particular
18130 error, the compiler exits with failure (exit value 1). The
18131 makefile in mcs/errors has been changed to handle the new behaviour.
18133 * report.cs: Made 'expected error' number a property and renamed
18134 it from 'Probe' to 'ExpectedError'.
18136 * genericparser.cs: Removed error handling support, since it is
18137 now all done by Report class.
18139 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18140 class, so parse() no longer returns an int.
18142 * namespace.cs: Use Report.Error instead of GenericParser.error
18144 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18146 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18147 TypeContainer.AddOperator): At the front of the list put the
18148 explicit implementations, so they get resolved/defined first.
18150 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18152 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18153 interface type is implemented by this TypeContainer. Used during
18154 explicit interface implementation.
18156 (Property.Define, Indexer.Define, Method.Define): Validate that
18157 the given interface in the explicit implementation is one of the
18158 base classes for the containing type.
18160 Also if we are explicitly implementing an interface, but there is
18161 no match in the pending implementation table, report an error.
18163 (Property.Define): Only define the property if we are
18164 not explicitly implementing a property from an interface. Use the
18165 correct name also for those properties (the same CSC uses,
18166 although that is really not needed).
18168 (Property.Emit): Do not emit attributes for explicitly implemented
18169 properties, as there is no TypeBuilder.
18171 (Indexer.Emit): ditto.
18173 Hiding then means that we do not really *implement* a pending
18174 implementation, which makes code fail.
18176 2002-06-22 Martin Baulig <martin@gnome.org>
18178 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18179 the return value of Object.GetType(). [FIXME: we need to do this whenever
18180 we get a type back from the reflection library].
18182 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18184 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18186 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18188 * attribute.cs: Return null if we can not look up the type.
18190 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18191 the interface types found.
18193 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18194 interface types found.
18196 * typemanager.cs (GetInterfaces): Make this routine returns alll
18197 the interfaces and work around the lame differences between
18198 System.Type and System.Reflection.Emit.TypeBuilder in the results
18199 result for GetInterfaces.
18201 (ExpandInterfaces): Given an array of interface types, expand and
18202 eliminate repeated ocurrences of an interface. This expands in
18203 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18206 2002-06-21 Martin Baulig <martin@gnome.org>
18208 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18211 2002-06-21 Martin Baulig <martin@gnome.org>
18213 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18214 and called with one of the core types, return the corresponding typebuilder for
18217 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18220 2002-06-21 Martin Baulig <martin@gnome.org>
18222 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18223 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18224 (Expression.ConvertReferenceExplicit): Likewise.
18226 * expression.cs (ElementAccess.DoResolve): Likewise.
18227 (ElementAccess.DoResolveLValue): Likewise.
18229 2002-06-10 Martin Baulig <martin@gnome.org>
18231 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18232 add the "value" parameter to the parameter list.
18234 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18237 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18239 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18240 the argument to an int, uint, long or ulong, per the spec. Also
18241 catch negative constants in array creation.
18243 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18245 * class.cs: do not allow the same interface to appear twice in
18246 the definition list.
18248 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18250 * ecore.cs: don't use ldlen with System.Array.
18252 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18254 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18256 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18258 * modifiers.cs: produce correct field attributes for protected
18259 internal. Easy fix so miguel can work on ther harder stuff:-)
18261 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18263 * pending.cs: New file. Move the code from class.cs here.
18264 Support clearning the pending flag for all methods (when not doing
18265 explicit interface implementation).
18267 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18269 * rootcontext.cs: added a couple more types needed to bootstrap.
18271 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18273 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18274 constructor in the type, instead of any constructor in the type
18275 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18276 a bug in the Mono runtime when applying the params attribute).
18278 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18279 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18281 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18283 * expression.cs (Unary.ResolveOperator): Use TypeManager
18284 to resolve the type.
18286 2002-06-13 Ravi Pratap <ravi@ximian.com>
18288 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18291 * enum.cs (AddEnumMember): Add support to store the attributes associated
18292 with each member too.
18294 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18295 field builders too - this takes care of the enum member case.
18297 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18299 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18300 address-of operator on both value types and pointers.
18302 2002-06-10 Martin Baulig <martin@gnome.org>
18304 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18305 PropertyBuilder to the `property_builders' list.
18307 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18308 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18309 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18310 find any indexers which are inherited from an interface.
18312 2002-06-09 Martin Baulig <martin@gnome.org>
18314 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18315 the same type as the constant if necessary. There's also a test-130.cs
18318 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18320 * typemanager.cs (TypeManager.ChangeType): Previously known as
18321 Enum.ChangeEnumType().
18323 2002-06-09 Martin Baulig <martin@gnome.org>
18325 * expression.cs (Cast.TryReduce): Added support for consts.
18327 2002-06-08 Ravi Pratap <ravi@ximian.com>
18329 * class.cs (Accessor): Hold attributes information so we can pass
18332 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18333 Modify to pass in attributes attached to the methods.
18335 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18337 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18338 to handle the Accessor kind :-)
18340 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18342 2002-06-08 Martin Baulig <martin@gnome.org>
18344 * expression.cs (Unary.TryReduceNegative): Added support for
18347 2002-06-08 Martin Baulig <martin@gnome.org>
18349 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18350 name can't be found in the `defined_names' - the caller will do a
18351 MemberLookup in this case and thus find methods in System.Enum
18352 such as Enum.IsDefined().
18354 2002-06-08 Martin Baulig <martin@gnome.org>
18356 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18357 Convert.ChangeType() which works with TypeBuilder created types.
18358 (Enum.LookupEnumValue, Enum.Define): Use it here.
18360 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18361 `TypeBuilder.BaseType != null' check.
18362 (TypeContainer.FindMembers): Only lookup parent members if we
18363 actually have a parent.
18364 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18365 (ConstructorInitializer.Resolve): Likewise.
18367 * interface.cs (Interface.FindMembers): Added
18368 `TypeBuilder.BaseType != null' check.
18370 * rootcontext.cs (RootContext.ResolveCore): Added
18371 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18372 classes_second_stage.
18374 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18375 debug_type and trace_type when compiling with --nostdlib.
18377 2002-06-07 Martin Baulig <martin@gnome.org>
18379 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18380 (AddField): Set it to true when adding a non-static field.
18381 (DefineType): Use `have_nonstatic_fields' to find out whether we
18382 have non-static fields, not `Fields != null'.
18384 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18386 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18387 dereferencing a null on the static-field code path)
18389 2002-05-30 Martin Baulig <martin@gnome.org>
18391 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18392 to take command line arguments. Use reflection to call the new
18393 custom `Initialize' function on the symbol writer and pass it the
18394 command line arguments.
18396 * driver.cs (--debug-args): New command line argument to pass command
18397 line arguments to the symbol writer.
18399 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18401 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18402 the target type for indexers and properties. Thanks to Joe for
18405 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18407 * typemanager.cs (MethodFlags): returns the method flags
18408 (Obsolete/ShouldIgnore) that control warning emission and whether
18409 the invocation should be made, or ignored.
18411 * expression.cs (Invocation.Emit): Remove previous hack, we should
18412 not do this on matching a base type, we should do this based on an attribute
18414 Only emit calls to System.Diagnostics.Debug and
18415 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18416 on the command line.
18418 * rootcontext.cs: Global settings for tracing and debugging.
18420 * cs-tokenizer.cs (define): New utility function to track
18421 defines. Set the global settings for TRACE and DEBUG if found.
18423 2002-05-25 Ravi Pratap <ravi@ximian.com>
18425 * interface.cs (Populate*): Pass in the TypeContainer as well as
18426 the DeclSpace as parameters so that we can create EmitContexts and
18427 then use that to apply attributes etc.
18429 (PopulateMethod, PopulateEvent, PopulateProperty)
18430 (PopulateIndexer): Apply attributes everywhere.
18432 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18435 (ApplyAttributes): Update accordingly.
18437 We now apply interface attributes for all members too.
18439 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18441 * class.cs (Indexer.Define); Correctly check if we are explicit
18442 implementation (instead of checking the Name for a ".", we
18443 directly look up if the InterfaceType was specified).
18445 Delay the creation of the PropertyBuilder.
18447 Only create the PropertyBuilder if we are not an explicit
18448 interface implementation. This means that explicit interface
18449 implementation members do not participate in regular function
18450 lookups, and hence fixes another major ambiguity problem in
18451 overload resolution (that was the visible effect).
18453 (DefineMethod): Return whether we are doing an interface
18456 * typemanager.cs: Temporary hack until we get attributes in
18457 interfaces (Ravi is working on that) and we get IndexerName
18458 support in interfaces.
18460 * interface.cs: Register the indexers as properties.
18462 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18463 warning, I have verified that this is a bug in the .NET runtime
18464 (JavaScript suffers of the same problem).
18466 * typemanager.cs (MemberLookup): When looking up members for
18467 interfaces, the parent of an interface is the implicit
18468 System.Object (so we succeed in searches of Object methods in an
18469 interface method invocation. Example: IEnumerable x; x.ToString
18472 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18474 * class.cs (Event): Events should also register if they do
18475 implement the methods that an interface requires.
18477 * typemanager.cs (MemberLookup); use the new GetInterfaces
18480 (GetInterfaces): The code used to lookup interfaces for a type is
18481 used in more than one place, factor it here.
18483 * driver.cs: Track the errors at the bottom of the file, we kept
18486 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18487 instance if the method we are calling is static!
18489 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18491 * attribute.cs (ApplyAttributes): Make this function filter out
18492 the IndexerName attribute (as that attribute in reality is never
18493 applied) and return the string constant for the IndexerName
18496 * class.cs (TypeContainer.Emit): Validate that all the indexers
18497 have the same IndexerName attribute, and if so, set the
18498 DefaultName attribute on the class.
18500 * typemanager.cs: The return value might contain other stuff (not
18501 only methods). For instance, consider a method with an "Item"
18502 property and an Item method.
18504 * class.cs: If there is a problem with the parameter types,
18507 2002-05-24 Ravi Pratap <ravi@ximian.com>
18509 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18510 looks at user defined conversion after making a call to
18511 StandardConversionExists - we need this for overload resolution.
18513 * expression.cs : Update accordingly the various method calls.
18515 This fixes 2 bugs filed against implicit user defined conversions
18517 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18519 * statement.cs: Track the result of the assignment.
18521 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18523 * expression.cs (MemberAccess): Improved error reporting for
18524 inaccessible members.
18526 2002-05-22 Martin Baulig <martin@gnome.org>
18528 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18529 itself with debugging support.
18531 2002-05-22 Martin Baulig <martin@gnome.org>
18533 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18534 Removed, this isn't needed anymore.
18536 2002-05-20 Martin Baulig <martin@gnome.org>
18538 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18539 be underlying type for an enum.
18541 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18543 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18544 that splits out the loading of just the core types.
18546 * rootcontext.cs (ResolveCore): Split the struct resolution in
18547 two, so we can load the enumeration underlying types before any
18550 * expression.cs (Is): Bandaid until we fix properly Switch (see
18551 bug #24985 for details).
18553 * typemanager.cs (ImplementsInterface): The hashtable will contain
18554 a null if there are no interfaces implemented.
18556 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18558 * cs-parser.jay (indexer_declarator): It is fine to have array
18561 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18563 * typemanager.cs: (RegisterBuilder): New function used to register
18564 TypeBuilders that implement interfaces. Since
18565 TypeBuilder.GetInterfaces (as usual) does not work with lame
18567 (AddUserType): register interfaces.
18569 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18570 dealing with TypeBuilder. Also, arrays are showing up as
18571 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18572 methods can not be invoked on them!
18574 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18575 (ImplicitReferenceConversionExists): Split out from
18576 StandardConversionExists.
18578 * expression.cs (As): We were only implementing one of the three
18579 cases for the as operator. We now implement them all.
18580 (Is): Implement the various other cases for Is as well.
18582 * typemanager.cs (CACHE): New define used to control if we want or
18583 not the FindMembers cache. Seems to have a negative impact on
18584 performance currently
18586 (MemberLookup): Nested types have full acess to
18587 enclosing type members
18589 Remove code that coped with instance/static returns for events, we
18590 now catch this in RealFindMembers.
18592 (RealFindMembers): only perform static lookup if the instance
18593 lookup did not return a type or an event.
18595 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18597 * assign.cs (CompoundAssign): We pass more semantic information
18598 now to Compound Assignments than we did before: now we have all
18599 the information at hand, and now we resolve the target *before* we
18600 do the expression expansion, which allows the "CacheValue" method
18601 to have the effect we intended (before, a [x] += 1 would generate
18602 two differen ArrayAccess expressions from the ElementAccess,
18603 during the resolution process).
18605 (CompoundAssign.DoResolve): Resolve target and original_source here.
18607 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18609 * expression.cs (ArrayAccess): dropped debugging information.
18611 * typemanager.cs: Small bug fix: I was always returning i_members,
18612 instead of one of i_members or s_members (depending on which had
18615 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18616 method is invoked before any code generation takes place, and it
18617 is a mechanism to inform that the expression will be invoked more
18618 than once, and that the method should use temporary values to
18619 avoid having side effects
18621 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18623 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18626 * expression.cs (Indirection, ArrayAccess): Add support for
18627 CacheTemporaries in these two bad boys.
18629 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18630 ldobj or ldind_ref.
18631 (StoreFromPtr): Handle stobj as well.
18633 * expression.cs (UnaryMutator): Share more code.
18635 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18636 down: I was not tracking the Filter function as well, which
18637 was affecting the results of the cache.
18639 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18641 * attribute.cs: Remove the hack to handle the CharSet property on
18644 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18646 * attribute.cs (DoResolve): More uglyness, we now only try to
18647 resolve the attribute partially, to extract the CharSet
18648 information (only if we are a StructLayout attribute). Otherwise
18650 (GetExtraTypeInfo): Add some code to conditionally kill in the
18651 future this. I am more and more convinced that the .NET
18652 framework has special code to handle the attribute setting on
18655 * expression.cs (IsParamsMethodApplicable): Revert my previous
18656 foreach change here, it was wrong.
18658 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18660 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18661 (pp_expr): do not abort on unknown input, just return.
18662 (eval): abort if there are pending chars.
18664 * attribute.cs (Attribute.Resolve): Positional parameters are
18665 optional. Deal with that case.
18667 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18668 the Ansi/Unicode/Auto information for the type.
18670 (TypeContainer.DefineType): instantiate the EmitContext here, as
18671 we will be using it during the type definition (to resolve
18672 attributes) and during the emit phase.
18674 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18675 to pull type information out of the attributes
18677 (Attribute.Resolve): track the constructor builder, and allow for
18678 multiple invocations (structs and classes will use this).
18680 * ecore.cs (MemberLookupFinal): new version with all the
18681 parameters customizable.
18683 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18684 constructors. Return if the result value is null (as the error
18685 would have been flagged already by MemberLookupFinal)
18687 Do not allow instances of abstract classes or interfaces to be
18690 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18691 We have to compare the assembly property here when dealing with
18692 FamANDAssem and Assembly access modifiers, because we might be
18693 creating an assembly from *modules* (that means that we are not
18694 getting TypeBuilders for types defined in other modules that are
18695 part of this assembly).
18697 (Method.Emit): If the method is marked abstract and has a body,
18700 (TypeContainer.DefineMembers): If both the defined member and the
18701 parent name match are methods, then do not emit any warnings: let
18702 the Method.Define routine take care of flagging warnings. But if
18703 there is a mismatch (method overrides something else, or method is
18704 overriwritten by something, then emit warning).
18706 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18707 set to null, this means `do not check for the return type on the
18710 (Method.Define): set the return type for the method signature to
18711 null, so that we get methods with the same name and parameters and
18712 different return types. This is used to flag warning 114 (you are
18713 hiding a method, and you probably want to use the new/override
18716 * typemanager.cs (MemberLookup): Implemented proper access
18717 control, closing a long standing set of bug reports. The problem
18718 was that the Framework only has two bits: Public and NonPublic,
18719 and NonPublic includes private and protected methods, but we need
18720 to enforce the FamANDAssem, FamOrAssem and Family.
18722 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18724 * statement.cs (GotoCase): Return true: Ammounts to giving up
18725 knowledge on whether we return or not, and letting the other case
18726 be responsible for it.
18728 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18730 * driver.cs: Do not load directories for each file processed, only
18731 do it if there is a pattern.
18733 * ecore.cs: Report readonly assigns here as well, as we might have
18734 been resolved only by MemberAccess.
18736 (SimpleName.SimpleNameResolve): Also be useful for LValue
18737 resolution. We need this to propagate assign to local readonly variables
18739 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18740 do not want to reuse potential criteria memory.
18742 * class.cs (MyEventBuilder): Set reflected_type;
18744 * ecore.cs (Constantify): Added support for constifying bools.
18746 (RootContext.LookupType): Added a cache for values looked up in
18747 the declaration space.
18749 * typemanager.cs (FindMembers): Now is a front-end to
18750 RealFindMembers, and provides a two-level hashtable-based cache to
18753 15% performance improvement: from 22.5 to 19.2 seconds.
18755 * expression.cs (IsParamsMethodApplicable): use foreach.
18756 (Invocation.DoResolve): ditto.
18757 (New.DoResolve): ditto.
18758 (ArrayCreation.DoResolve): ditto.
18760 * ecore.cs (FindMostEncompassingType): use foreach.
18762 * delegate.cs (NewDelegate.DoResolve): Use foreach
18764 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18765 (RemoveMethods): use foreach.
18767 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18768 nested foreach statements instead of for, and also break out of
18769 the inner loop once a match is found.
18771 (Invocation.OverloadResolve): Use foreach, simplify the code.
18773 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18775 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18776 we actually unwrap the expression to allow for extra information
18779 * expression.cs: Use Shr_Un on unsigned operations.
18781 2002-05-08 Ravi Pratap <ravi@ximian.com>
18783 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18784 applicable operators was not being considered correctly. This closes
18785 the bug Miguel reported.
18787 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18789 * attribute.cs: check that the type derives from System.Attribute
18790 and report the correct error in that case (moved the duplicate code to
18791 its own method, too).
18793 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18795 * attribute.cs: lookup attribute type name as the spec says: first the
18796 bare attribute name and then name + "Attribute" (nant compiles with
18797 mcs after this fix).
18799 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18801 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18802 Because of the way we parse things, we should try to see if a
18803 UIntConstant can fit in an integer.
18805 2002-05-07 Ravi Pratap <ravi@ximian.com>
18807 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18808 when we are in an explicit context.
18810 (ConvertReferenceExplicit): When converting from Iface type S to Class
18811 T make sure the rules are implemented as an OR.
18813 * parameter.cs (ParameterType): Make it a property for now although the
18814 purpose really isn't anything immediate.
18816 * expression.cs (Is*Applicable): Do better checking on the parameter type
18817 of a ref/out parameter. The ones from the system assemblies are already
18818 marked with the correct type so we don't need to do any correction.
18820 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18821 the object type is standard too so include that.
18823 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18825 * ecore.cs (StandardConversionExists): Augment with missing code:
18826 deal with IntConstant, LongConstants and Enumerations.
18828 * assign.cs: Report the error, instead of failing silently
18830 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18831 typecontainer that they are declared, because the
18832 typecontainer/namespace will have the list of using clauses that
18833 need to be applied.
18835 Assembly Attributes were escaping the normal registration
18838 (EmitCode): Apply attributes within an EmitContext that represents
18839 the container they were declared on.
18841 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18843 2002-05-06 Ravi Pratap <ravi@ximian.com>
18845 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18846 Revamp completely - make much cleaner as we now operate only
18849 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18850 to implement the logic detailed in the spec more correctly.
18852 (UserDefinedConversion): Update accordingly.
18854 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18856 * statement.cs: Return flow analysis information up.
18858 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18861 (token): Do not consume an extra character before calling
18864 2002-05-06 Piers Haken <piersh@friskit.com>
18866 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18868 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18870 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18871 EmitContext during the instance constructor initializer
18872 resolution, to stop access to instance variables.
18874 This is mandated by the spec, last paragraph of the `constructor
18875 initializers' section.
18877 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18879 * cs-parser.jay, class.cs (Accessor): new class used to represent
18880 an accessor (get or set). In the past we used `null' to represent
18881 a missing accessor. But this is ambiguous because there was no
18882 way to tell in abstract indexers/properties if one of them was
18885 Now there is a way of addressing that.
18887 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18888 instead of FindMembers.
18890 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18891 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18893 * attribute.cs: Treat indexers and properties as the same in terms
18894 of applying attributes
18896 * ecore.cs (FindMostEncompassedType): Use statically initialized
18897 EmptyExpressions()s like we do elsewhere to avoid creating useless
18898 objects (and we take this out of the tight loop).
18900 (GetConversionOperators): Move the code to extract the actual
18901 operators to a separate routine to clean things up.
18903 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18905 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18906 events are always registered FieldBuilders.
18908 * class.cs (FieldBase): New class shared by Fields
18910 * delegate.cs: If we are a toplevel delegate, use our full name.
18911 If we are a nested delegate, then only use our tail name.
18913 2002-05-02 Ravi Pratap <ravi@ximian.com>
18915 * expression.cs (IsApplicable): Ensure that we add the "&" to
18916 ref/out types before comparing it with the type of the argument.
18918 (IsParamsMethodApplicable): Ditto.
18920 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18923 * delegate.cs : Handle the case when we have more than one applicable
18924 method. Flag an error only when we finish checking all.
18926 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18928 * expression.cs: Add support for boolean static initializers.
18930 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18932 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18934 * parameter.cs (ComputeParameterTypes,
18935 ComputeAndDefineParameterTypes): Better error handling: now we
18936 clear the `types' cache if we fail during any of the type lookups.
18937 We also return the status code correctly to our caller
18939 * delegate.cs: If we fail to define a delegate, abort the extra
18942 * expression.cs (Binary.ResolveOperator): for
18943 operator==(object,object) and operator !=(object, object) we also
18944 have to verify that there is an implicit conversion from one to
18947 (ArrayAccess.DoResolve): Array Access can operate on
18950 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18952 * assign.cs (CompoundAssign): A new class used as a "flag" that
18953 the assignment actually is happening as part of a compound
18954 assignment operator.
18956 During compound assignment, a few new rules exist to enable things
18963 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18964 to the type of x) if y is implicitly convertible to the type of x,
18965 and the operator is a builtin operator and the return type of the
18966 operator is explicitly convertible to the type of x.
18968 * rootcontext.cs: Reset warning level to 2. 4 catches various
18969 "interesting" features in mcs, we must clean this up at some
18970 point, but currently am trying to kill other bugs ;-)
18972 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18973 in container classes as well.
18975 * expression.cs (Binary.ResolveOperator): Handle string case
18976 before anything else (as operator overloading does emit an error
18977 before doing anything else).
18979 This code could go away when we move to a table driven model, but
18980 i could not come up with a good plan last night.
18982 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18984 * typemanager.cs (CSharpName): reimplementation using regex.
18985 * class.cs: added null check for fields in Emit
18986 * rootcontext.cs: set warninglevel to 4
18988 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18990 * typemanager.cs (CSharpName): reimplemented with Lupus
18993 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18995 * statement.cs (If): correclty implement Resolve, because we were
18996 not catching sem errors in there. The same process is needed
18998 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19001 (Statement.Warning_DeadCodeFound): Factorize code.
19002 (While): Report dead code here too.
19004 (Statement): Added Resolve virtual method to allow
19005 for resolution split from the emit code.
19007 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19009 * statement.cs (EmitBoolExpression): No longer try to resolve the
19011 (MakeBoolean): New utility function that resolve, implicitly
19012 converts to boolean and tags the expression.
19015 (If, Do): Implement dead code elimination.
19016 (While): Implement loop inversion
19018 (Do, While, For, If): Resolve the expression prior to calling our
19021 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19024 - added method Report28 (warning: program has more than one entry point)
19025 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19026 - modified method Method.Define, the part at the end of the method
19028 * rootcontext.cs: added static public Location EntryPointLocation;
19030 * ../errors/cs0028.cs : Add test case for the above warning.
19033 - modified method CSharpName to allow arrays of primitive type to
19034 be printed nicely (e.g. instead of System.Int32[][] it now prints
19036 - added method CSharpSignature: returns the signature of a method
19037 in string format to be used in reporting errors, warnings, etc.
19039 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19042 2002-04-26 Ravi Pratap <ravi@ximian.com>
19044 * delegate.cs (Define): Fix extremely silly bug where I was
19045 setting the type of the 'object' parameter of the BeginInvoke
19046 method to System.IAsyncResult instead of System.Object ;-)
19048 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19050 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19053 (Constructor.Emit): return if we fail to initialize the
19054 constructor. Another door closed!
19056 * expression.cs (New.DoResolve): Improve error message (from -6 to
19057 1501). Use DeclaredOnly lookup to find the exact constructor.
19059 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19060 loop. This is useful.
19062 * cs-parser.jay: Adjust the default parameters so that destructors
19063 have the proper signature.
19065 2002-04-26 Martin Baulig <martin@gnome.org>
19067 * driver.cs (LoadAssembly): If `assembly' contains any characters
19068 which are only valid in path names and not in assembly names
19069 (currently slash, backslash and point), use Assembly.LoadFrom ()
19070 instead of Assembly.Load () on the `assembly' (before iteration
19071 over the link_paths).
19073 2002-04-26 Martin Baulig <martin@gnome.org>
19075 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19077 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19079 * class.cs (Property): use the new typemanager.MemberLookup
19081 (TypeContainer.MemberLookup): Implement using the
19082 TypeManager.MemberLookup now.
19084 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19085 and return MemberInfos, so that these can be used without an
19086 EmitContext (what we had before).
19088 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19090 * expression.cs: Fix the case where the argument to params if the
19091 type of the params. I omitted handling this before. Fixed
19093 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19095 * driver.cs: Call BootCorlib_PopulateCoreType
19097 * class.cs (Property.CheckBase): Check for properties only, not
19100 * interface.cs: Temporary hack: try/catch around the
19101 CustomAttributeBuilder, because I am getting an exception that I
19104 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19105 types whose definitions are required to be there (attributes are
19106 defined before standard types).
19108 Compute definitions as we boot the various types, as they are used
19109 immediately (value_type class will need object_type, but if we do
19110 not initialize object_type, we will pass a null, which will let
19111 the runtime pick the System.Object from the existing corlib, which
19112 is not what we want).
19114 2002-04-22 Patrik Torstensson <totte@labs2.com>
19116 * cs-tokenizer.cs: fixed a number of trim() issues.
19118 2002-04-22 Ravi Pratap <ravi@ximian.com>
19120 * expression.cs (Argument.Type): Ensure that we return the correct
19121 type when we have out or ref parameters [in which case we
19124 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19126 * class.cs (Property, Indexer): Allow extern modifier in there.
19128 * typemanager.cs (InitBaseTypes): Initializes object_type and
19129 value_type, since those will be used early on during the bootstrap
19130 process to compile corlib.
19132 (InitCoreTypes): Move code from here to InitBaseTypes.
19134 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19136 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19137 single-dimension arrays as using the ldlen opcode.
19139 Daniel Lewis discovered this optimization.
19141 * typemanager.cs: Add signature for System.Array::get_Length
19143 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19145 * statement.cs: report the error when the foreach does not apply to an
19146 array nor a collection.
19148 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19150 * expression.cs: Add implicit conversions to the operator ~.
19152 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19154 * typemanager.cs: Locate the decimal constructor.
19156 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19158 * attribute.cs: use the new property of TypeOf.
19159 * expression.cs: added 'get' property around typearg.
19161 These changes fix a build breaker reported by NickD. Is this the
19162 correct way to fix? If not, please, revert my changes and make it
19165 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19167 * attribute.cs: Add support for typeof in attribute invocations.
19168 I am not sure that this is right though.
19170 2002-04-14 Duncan Mak <duncan@ximian.com>
19172 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19173 Binary.Operator.Division case.
19175 2002-04-13 Ravi Pratap <ravi@ximian.com>
19177 * class.cs (DefineType): Ensure that we do a proper check on
19178 attribute types and also register it with the TypeManager.
19180 (TypeContainer.Targets): The default for attribute types is
19181 AttributeTargets.All.
19183 * attribute.cs (ApplyAttributes): Registering the attribute type
19184 is done elsewhere, not when we discover we have a Usage attribute.
19186 2002-04-12 Ravi Pratap <ravi@ximian.com>
19188 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19189 and get rid of is_delegate parameter.
19191 * everywhere : update.
19193 2002-04-12 Ravi Pratap <ravi@ximian.com>
19195 * cs-parser.jay (compilation_unit): Revamp completely to use
19196 some new ideas that I got from Rhys' grammar to solve the problems
19197 with assembly level attributes.
19199 (outer_declaration): New grammar production.
19201 (attribute_sections): Add.
19203 (opt_attributes): Base on attribute_sections
19205 (namespace_declaration): Allow opt_attributes to tackle the case
19206 when we have assembly level attributes - we are clever in this
19209 * attribute.cs (ApplyAttributes): Do not worry about assembly
19210 attributes in the non-global context.
19212 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19213 instead of SetGlobalAttributes.
19215 * class.cs, rootcontext.cs : Ensure we define and generate
19216 attribute types before anything else.
19218 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19219 and flag the new error -20 for the case when the attribute type
19220 does not have valid targets specified. csc does not catch this.
19222 * ../errors/errors.txt : update for error # -20
19224 2002-04-11 Ravi Pratap <ravi@ximian.com>
19226 * support.cs (InternalParameters.ParameterModifier): Do some null
19227 checking and return sane values.
19229 * class.cs (Method.Define): If we are a PInvoke method, ensure
19230 that we are static and extern. Report error # 601
19232 * ../errors/cs0601.cs : Add test case for the above error.
19234 2002-04-07 Ravi Pratap <ravi@ximian.com>
19236 * rootcontext.cs (attribute_types): We need to keep type of
19237 all attribute types separately and emit code for them first.
19239 (RegisterAttribute) : Implement.
19241 * class.cs (DefineType): Check if the current Type is a custom
19242 attribute type and register it accordingly.
19244 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19245 adding the first attribute twice and rename to
19247 (SetGlobalAttributes): this.
19249 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19252 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19253 if we are processing global arguments. Hmm, I am unsure of this.
19255 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19257 * expression.cs: added static array of strings to avoid calling
19258 Enum.ToString () for Operator in Binary. Significant recover of
19261 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19263 * class.cs (FindMembers): Allow the Builders of the various
19264 members to be null. If they are skip them. This only happens
19265 during the PInvoke declaration.
19267 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19269 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19270 failure, so we do not keep going afterwards.
19272 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19273 wanted to pass `false' as the `is_delegate' argument. If this is
19274 the case, why not use delegate_type == null to mean `is_delegate =
19275 false' and anything else as is_delegate = true.
19277 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19279 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19280 code for the section, not the beginning of the tests.
19282 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19284 * cfold.cs: Handle operator + (Enum x, Underlying x)
19286 * expression.cs (Binary): same. Warn about errors where we have
19287 Enum/Enum in operator + as well.
19289 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19292 - added support for switch(bool)
19293 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19294 - add TableSwitchEmit() to handle table-based switch statements
19296 2002-04-05 Ravi Pratap <ravi@ximian.com>
19298 * expression.cs (Invocation.OverloadResolve): Factor out code which
19299 does parameter compatibility checking with arguments so that we can
19300 re-use the code even from Delegate.VerifyApplicability
19302 (VerifyArgumentsCompat): Move above code here.
19304 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19305 and instead make a call to the above method.
19307 2002-03-31 Ravi Pratap <ravi@ximian.com>
19309 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19310 We use it to keep track of classes which are attribute types.
19312 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19314 * delegate.cs (Delegate.Define): Correctly define the types in the
19315 presence of fixed and array parameters.
19317 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19320 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19321 include NonPublic after the first iteration.
19323 * class.cs (Indexer.CheckBase): Only check if both parents are
19326 * cs-parser.jay (accessor_body): If empty, set to null.
19328 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19329 same code path here to resolve constants names that we did have in
19330 MemberAccess.DoResolve. There is too much code duplicated here.
19332 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19334 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19336 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19339 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19340 tokens, numbers and strings.
19342 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19345 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19346 asyncronous parameters and the regular parameters.
19348 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19349 specify the target directory.
19351 * expression.cs: (This.DoResolve): Simplify
19352 (As.Emit): Optimize, do not generate IsInst if the expression is
19353 always of the given type.
19355 (Is.DoResolve): Bug fix, we were reporting both always/never for
19358 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19359 creating too many unnecessary arrays.
19361 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19363 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19364 fields instead of rolling our own initializer. Takes care of all
19365 implicit conversions, and drops unnecessary static checks/argument.
19367 2002-03-31 Dick Porter <dick@ximian.com>
19369 * driver.cs: use the GetDirectories() return values properly, and
19370 use "/" as path separator.
19372 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19374 * expression.cs (Unary): Optimize - - expr into expr.
19375 (Binary): Optimize a + (-b) into a -b.
19377 * codegen.cs (CodeGen): Made all methods static.
19379 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19383 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19384 TypeBuilder property.
19386 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19389 * tree.cs: Removed the various RecordXXXX, and replaced with a
19390 single RecordDecl. Removed all the accessor methods, and just
19391 left a single access point Type
19393 * enum.cs: Rename DefineEnum to DefineType.
19395 * decl.cs: New abstract method `DefineType' used to unify the
19396 Defines for Enumerations, Interfaces, TypeContainers and
19399 (FindType): Moved LookupInterfaceOrClass here. Moved the
19400 LookupBaseClasses method that used to live in class.cs and
19401 interface.cs here, and renamed to FindType.
19403 * delegate.cs: Implement DefineType. Take advantage of the
19404 refactored pattern for locating the parent builder without taking
19405 the parent_builder argument (which we know does not work if we are
19406 nested, and triggering a toplevel definition).
19408 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19410 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19411 accessibility of a member has changed during override and report
19414 * class.cs (Method.Define, Property.Define): Only complain on
19415 overrides if the method is private, any other accessibility is
19416 fine (and since we just checked the permission is the same, we are
19419 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19420 and elif are processed always. The other pre-processing
19421 directives are only processed if we are "taking" the path
19423 2002-03-29 Martin Baulig <martin@gnome.org>
19425 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19426 current location is not Null.
19428 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19429 a separate method so we can profile it.
19431 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19432 `span.Seconds' are just seconds, but no minutes or hours.
19433 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19435 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19437 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19438 Remove the gratuitous set of Final:
19440 // If an interface implementation, then we can set Final.
19441 if (((flags & MethodAttributes.Abstract) == 0) &&
19442 implementing.DeclaringType.IsInterface)
19443 flags |= MethodAttributes.Final;
19445 I do not know what I was smoking when I used that.
19448 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19449 step into fixing the name resolution issues for delegates and
19450 unifying the toplevel name resolution.
19452 2002-03-28 Martin Baulig <martin@gnome.org>
19454 * class.cs (Method.Emit): If we have a symbol writer, call its
19455 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19456 tell it about the current method.
19458 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19459 writer that we're going to emit the first byte of IL code for a new
19460 statement (a new source line).
19461 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19462 EmitContext.Mark() before emitting any code.
19464 * location.cs (SymbolDocument): Return null when we're Null.
19466 * statement.cs (Statement): Moved the `Location loc' variable here.
19467 (Statement.EmitBoolExpression): If we have a symbol writer, call
19468 ec.Mark() before emitting any code to tell it that we're at the
19469 beginning of a new statement.
19470 (StatementExpression): Added `Location' argument to the constructor.
19471 (Block): Added public readonly variable `StartLocation' and public
19472 variable `EndLocation'. The latter is to be set using SetEndLocation().
19473 (Block): Added constructor which takes a start and end location.
19474 (Block.SetEndLocation): New method. This sets the end location.
19475 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19476 local variables we create.
19477 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19478 each statement and do also mark the begin and end of the block.
19480 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19481 tell it the current lexer.Location, use Location.Null for the end of the
19483 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19484 current block, set its end location using SetEndLocation().
19485 (statement_expression): StatementExpression constructor now takes the
19486 lexer.Location as additional argument.
19487 (for_statement, declare_local_variables): Likewise.
19488 (declare_local_variables): When creating a new implicit block, use the
19489 new Block constructor and pass it the lexer.Location.
19491 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19493 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19494 members also on the parent interfaces recursively.
19496 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19498 * report.cs: Use new formats, since Gonzalo finished the missing
19501 * expression.cs (Binary.ResolveOperator): added missing operator|
19502 operator& and operator^ for bool/bool.
19504 * cs-parser.jay: CheckDef now takes a Location argument that is
19505 used to report errors more precisly (instead of reporting the end
19506 of a definition, we try to track something which is a lot closer
19507 to the source of the problem).
19509 * cs-tokenizer.cs: Track global token use, so we can properly flag
19510 the use of #define/#undef after the first token has been seen.
19512 Also, rename the reportXXXX to Error_DescriptiveName
19514 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19515 TypeContainer, so that Enum and Interface can use this too.
19517 * class.cs (TypeContainer.LookupInterfaceOrClass,
19518 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19519 `builder' argument. Typically this was used to pass the parent
19520 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19523 The problem is that a nested class could trigger the definition of
19524 a toplevel class, and the builder would be obviously wrong in that
19527 So we drop this argument, and we compute dynamically the
19528 TypeBuilder/ModuleBuilder (the correct information was available
19529 to us anyways from DeclSpace.Parent)
19531 * interface.cs (Interface.DefineInterface): Drop builder
19532 parameter cleanup like class.cs
19534 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19537 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19540 (Try.Emit): Propagate the returns value from the statement.
19542 (Return.Emit): Even if we are leavning
19544 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19546 * modifiers.cs: Fix the computation of MethodAttributes flags.
19548 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19550 * driver.cs: allow compilation of files that start with '/'.
19551 Add a default case when checking the argument of --target.
19553 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19555 * interface.cs: Implement the same search algorithm for types in
19556 the interface code.
19558 * delegate.cs: Do not allow multiple definition.
19560 * Recovered ChangeLog that got accidentally amputated
19562 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19564 * rootcontext.cs: Load manually enum to allow core classes to
19565 contain enumerations.
19567 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19568 Update to new static methods in TypeManager.
19570 * typemanager.cs (GetMethod, GetConstructor): Use our
19571 implementation of FindMembers to find the members, since during
19572 corlib compilation, the types are TypeBuilders and GetMethod and
19573 GetConstructor do not work.
19575 Make all methods in TypeManager static.
19577 (InitCodeHelpers): Split the functionality from
19578 the InitCodeTypes function.
19580 * driver.cs: Call InitCodeHelpers after we have populated the
19583 * cs-parser.jay (delegate_declaration): we did not used to compute
19584 the delegate name correctly for void delegates.
19586 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19588 * rootcontext.cs (RootContext): Init the interface_resolve_order
19589 and type_container_resolve_order always.
19591 (ResolveCore, BootstrapCorlib_ResolveClass,
19592 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19593 compiler when compiling with --nostdlib
19595 * class.cs (TypeContainer.DefineType): Check that our parent is
19596 not null. This test is most important when we are bootstraping
19599 * codegen.cs: Split out the symbol writing code.
19601 2002-03-25 Martin Baulig <martin@gnome.org>
19603 * driver.cs (-g): Made -g an alias for --debug.
19605 2002-03-24 Martin Baulig <martin@gnome.org>
19607 * codegen.cs (SymbolWriter): New public variable. Returns the
19608 current symbol writer.
19609 (CodeGen): Added `bool want_debugging_support' argument to the
19610 constructor. If true, tell the ModuleBuild that we want debugging
19611 support and ask it for the ISymbolWriter.
19612 (Save): If we have a symbol writer, call it's Close() method after
19613 saving the assembly.
19615 * driver.c (--debug): New command line argument to create a
19616 debugger information file.
19618 * location.cs (SymbolDocument): New public property. Returns an
19619 ISymbolDocumentWriter object for the current source file or null
19620 if we don't have a symbol writer.
19622 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19624 * driver.cs (LoadAssembly): Correctly return when all the paths
19625 have been tried and not before.
19627 * statement.cs (Switch.Emit): return the actual coverage for this
19628 statement (returns/not-returns)
19630 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19631 switch of the statement if we are the last switch section. That
19632 kills two problems: try/catch problems (we used to emit an empty
19633 nop at the end) and switch statements where all branches would
19636 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19638 * driver.cs: Add default assemblies (the equivalent to the
19639 Microsoft CSC.RSP file)
19641 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19642 also update tokens_seen and set it to false.
19644 * driver.cs: Implement --recurse for Mike.
19646 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19647 correctly splitting out the paths.
19649 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19651 * interface.cs (Interface.PopulateProperty): Instead of using
19652 `parent' as the declaration space for the set parameters, use
19655 * support.cs (InternalParameters): InternalParameters constructor
19656 takes a DeclSpace instead of a TypeContainer.
19658 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19659 types are being initialized, load the address of it before calling
19662 (New): Provide a mechanism to disable the generation of local
19663 value type temporaries when the caller will be providing us with
19664 an address to store it.
19666 (ArrayCreation.EmitDynamicInitializers): Use it.
19668 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19670 * expression.cs (Invocation.EmitArguments): Only probe for array
19671 property if there is more than one argument. Sorry about that.
19673 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19674 empty param arrays.
19676 * class.cs (Method.LabelParameters): Fix incorrect code path that
19677 prevented the `ParamArrayAttribute' from being applied to the
19680 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19682 * support.cs (ReflectionParameters): Correctly compute whether the
19683 last argument is a params array. Fixes the problem with
19686 * typemanager.cs: Make the assemblies array always be non-null
19687 (empty, but non-null)
19689 * tree.cs (RecordDecl): New function that abstracts the recording
19690 of names. This reports error 101, and provides a pointer to the
19691 previous declaration. Fixes a crash in the compiler.
19693 * cs-parser.jay (constructor_declaration): Update to new grammar,
19694 and provide a constructor_body that can be empty.
19696 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19698 * driver.cs: Add support for --resources.
19700 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19701 Make all types for the various array helper methods be integer.
19703 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19704 CheckState to ConvCast.
19706 (ConvCast): Now it takes a `checked' state argument, to avoid
19707 depending on the emit context for the conversion, and just using
19708 the resolve time setting.
19710 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19711 instead of Invocation.EmitArguments. We do not emit the original
19712 arguments, instead we emit those which have been converted to
19713 unsigned int expressions.
19715 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19717 * codegen.cs: ditto.
19719 * expression.cs (LocalVariableReference): Drop the use of the
19720 Store function that depended on the variable index.
19722 * statement.cs (VariableInfo): Drop the `Idx' property from this
19723 class, as this is not taking into account the indexes for
19724 temporaries tat we generate during the execution, getting the
19727 * class.cs: First emit class initializers, then call the parent
19730 * expression.cs (Binary): Fix opcode emision.
19731 (UnaryMutator.EmitCode): Support checked code generation
19733 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19734 matches for events for both the Static and Instance scans,
19735 pointing to the same element. Fix that.
19737 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19739 * rootcontext.cs (ResolveTree): Always set the
19740 interface_resolve_order, because nested interfaces will be calling
19743 * class.cs (GetInterfaceOrClass): Track the same resolution
19744 process used by TypeManager.LookupType. This fixes the nested
19745 type lookups in class declarations (separate path from
19748 (TypeContainer.DefineType): Also define nested interfaces.
19749 (TypeContainer.RegisterOrder): New public function used to
19750 register the order in which child interfaces need to be closed.
19752 Nested interfaces need to be closed after their parents have been
19755 * interface.cs (InterfaceAttr): Put all the logic for computing
19756 the interface attribute here.
19758 (DefineInterface): Register our interface order with the
19759 RootContext or with the TypeContainer depending on the case.
19761 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19763 * cs-parser.jay: rework foreach statement to work with the new
19764 changes to the policy on SimpleNames.
19766 * report.cs: support Stacktrace on warnings as well.
19768 * makefile: drop --unsafe and /unsafe from the compile.
19770 2002-03-13 Ravi Pratap <ravi@ximian.com>
19772 * ecore.cs (StandardConversionExists): Modify to take an Expression
19773 as the first parameter. Ensure we do null -> reference type conversion
19776 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19777 temporary Expression objects.
19779 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19781 * interface.cs: workaround bug in method overloading resolution
19782 (there is already a bugzilla bug for it).
19784 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19786 We could also solve this problem by having a separate path for
19787 performing type lookups, instead of DoResolve, we could have a
19788 ResolveType entry point, and only participating pieces of the
19789 production (simplename, deref, array) would implement this.
19791 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19792 signal SimpleName to only resolve type names and not attempt to
19793 resolve anything else.
19795 * expression.cs (Cast): Set the flag.
19797 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19799 * class.cs: Only report 108 if there is no `new' modifier.
19801 * cs-parser.jay: rework foreach statement to work with the new
19802 changes to the policy on SimpleNames.
19804 * report.cs: support Stacktrace on warnings as well.
19806 * makefile: drop --unsafe and /unsafe from the compile.
19808 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19810 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19811 lookups here, instead of doing that at parse time. This means
19812 that our grammar will not introduce `LocalVariableReferences' as
19813 expressions at this point. That solves the problem of code like
19817 static void Main ()
19821 This is only half the fix. The full fix requires parameters to
19822 also be handled in this way.
19824 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19825 makes the use more obvious of the DeclSpace. The
19826 ec.TypeContainer.TypeBuilder is now only used to pull the
19827 TypeBuilder for it.
19829 My theory is that I can get rid of the TypeBuilder completely from
19830 the EmitContext, and have typecasts where it is used (from
19831 DeclSpace to where it matters).
19833 The only pending problem is that the code that implements Aliases
19834 is on TypeContainer, and probably should go in DeclSpace.
19836 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19837 lookups here, instead of doing that at parse time. This means
19838 that our grammar will not introduce `LocalVariableReferences' as
19839 expressions at this point. That solves the problem of code like
19843 static void Main ()
19847 This is only half the fix. The full fix requires parameters to
19848 also be handled in this way.
19850 * class.cs (Property.DefineMethod): When implementing an interface
19851 method, set newslot, when implementing an abstract method, do not
19852 set the flag (before we tried never setting it, or always setting
19853 it, which is the difference).
19854 (Indexer.DefineMethod): same.
19855 (Method.DefineMethod): same.
19857 * ecore.cs: Only set the status used flag if we get back a Field.
19859 * attribute.cs: Temporary hack, so Paolo can keep working.
19861 2002-03-08 Ravi Pratap <ravi@ximian.com>
19863 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19864 the unmanaged type in the case we have a MarshalAs attribute.
19866 (Resolve): Handle the case when we are parsing the special MarshalAs
19867 attribute [we need to store the unmanaged type to use later]
19869 * typemanager.cs (marshal_as_attr_type): Built in type for the
19870 MarshalAs Attribute.
19872 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19873 on parameters and accordingly set the marshalling info.
19875 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19877 * class.cs: Optimizing slightly by removing redundant code after
19878 we switched to the `NoTypes' return value.
19879 (Property.DefineMethod): use NoTypes here too.
19881 This fixes the bug I introduced in my last batch of changes.
19883 2002-03-05 Ravi Pratap <ravi@ximian.com>
19885 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19887 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19888 Enums since those are types too.
19890 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19892 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19893 thanks to a call during the lookup process.
19895 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19897 * statement.cs (Foreach): Lots of work to accomodate a particular
19898 kind of foreach statement that I had not kept in mind. It is
19899 possible to have foreachs on classes that provide a GetEnumerator
19900 method that return objects that implement the "pattern" for using
19901 a foreach, there is no need to support GetEnumerator
19904 This is needed to compile nant.
19906 * decl.cs: Only report 114 if the member is not `Finalize' and if
19907 the warning level is at least 2.
19909 * class.cs: Moved the compare function from Method to
19912 (MethodSignature.InheritableMemberSignatureCompare): Add new
19913 filter function that is used to extract inheritable methods from a
19916 (Method.Define): Use the new `inheritable_method_signature_filter'
19919 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19922 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19924 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19926 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19928 * expression.cs: Pass location information to
19929 ConvertImplicitStandard.
19931 * class.cs: Added debugging code to track return values from
19934 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19936 * expression.cs (Is.DoResolve): If either side of the `is' is an
19937 interface, do not flag the warning.
19939 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19942 * report.cs: Allow for --fatal to be used with --probe.
19944 * typemanager.cs (NoTypes): Move the definition for the empty Type
19947 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19949 (TypeContainer.DefineProxy): New function used to proxy to parent
19950 implementations when implementing interfaces.
19951 (TypeContainer.ParentImplements): used to lookup if our parent
19952 implements a public function that is required by an interface.
19953 (TypeContainer.VerifyPendingMethods): Hook this up.
19955 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19956 `modules' and `assemblies' arraylists into arrays. We only grow
19957 these are the very early start up of the program, so this improves
19958 the speedof LookupType (nicely measured).
19960 * expression.cs (MakeByteBlob): Replaced unsafe code with
19961 BitConverter, as suggested by Paolo.
19963 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19964 folding of string concatenation, but if either side is a string,
19965 and the other is not, then return null, and let the runtime use
19966 the concatenation on the string plus the object (using
19967 `Object.ToString').
19969 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19971 Constant Folding has been implemented now.
19973 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19974 the error instead on types that are not supported in one's
19977 * constant.cs (Constant and all children): New set of functions to
19978 perform implict and explicit conversions.
19980 * ecore.cs (EnumConstant): Implement the new functions to perform
19981 conversion by proxying to the child expression.
19983 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19984 own separate setting that can not be turned off from the command
19985 line using --unchecked or --checked and is only controlled using
19986 the checked/unchecked statements and expressions. This setting is
19987 used by the constant folder to flag errors.
19989 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19990 ConstantCheckState as well.
19992 During Resolve, they also have to flag the state, because the
19993 constant folder runs completely in the Resolve phase.
19995 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19998 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20000 * cfold.cs: New file, this file contains the constant folder.
20002 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20003 argument to track whether we are using the resulting address to
20004 load or store a value and provide better error messages.
20006 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20007 new AddressOf arguments.
20009 * statement.cs (Foreach.EmitCollectionForeach): Update
20011 * expression.cs (Argument.Emit): Call AddressOf with proper
20012 arguments to track usage.
20014 (New.DoEmit): Call AddressOf with new arguments.
20016 (Unary.Emit): Adjust AddressOf call.
20018 2002-03-01 Ravi Pratap <ravi@ximian.com>
20020 * cs-parser.jay (member_access): Change the case for pre-defined types
20021 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20024 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20027 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20028 essentially like methods and apply attributes like MethodImplOptions to them too.
20030 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20033 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20034 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20037 * Update code everywhere accordingly.
20039 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20041 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20043 2002-02-28 Ravi Pratap <ravi@ximian.com>
20045 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20046 try performing lookups against those instead of jumping straight into using
20047 the 'using' clauses.
20049 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20051 (LookupType): Perform lookups in implicit parents too.
20053 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20054 sequence as RootContext.LookupType.
20056 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20057 the various cases of namespace lookups into this method.
20059 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20061 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20062 in positional arguments)
20064 * class.cs (Operator): Update the AllowedModifiers to contain
20067 * cs-parser.jay: Update operator declaration to allow for the
20068 operator body to be empty.
20070 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20073 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20075 * class.cs (Method.Emit): Label parameters.
20077 * driver.cs: Return 1 or 0 as the program exit code.
20079 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20081 * expression.cs: Special case the `null' object when trying to
20082 auto-compute the type, as anything can be explicitly converted to
20085 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20086 spotting this Paolo.
20088 (Expression.ImplicitNumericConversion): Perform comparissions of
20089 the type using the underlying type in the case of an enumeration
20090 rather than using the enumeration type for the compare.
20092 Cope with the underlying == type case, which is not possible to
20095 (Expression.ConvertNumericExplicit): Perform comparissions of
20096 the type using the underlying type in the case of an enumeration
20097 rather than using the enumeration type for the compare.
20099 * driver.cs: If the user does not supply an extension, assume .exe
20101 * cs-parser.jay (if_statement): Rewrote so that we can track the
20102 location for the if statement.
20104 * expression.cs (Binary.ConstantFold): Only concat strings when
20105 the operation is "+", not everything ;-)
20107 * statement.cs (Statement.EmitBoolExpression): Take a location
20109 (If, While, Do): Track location.
20111 * expression.cs (Binary.ResolveOperator): In the object + string
20112 case, I was missing a call to ConvertImplicit
20114 2002-02-25 Ravi Pratap <ravi@ximian.com>
20116 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20117 Location arguments. Ensure we use RootContext.LookupType to do our work
20118 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20120 * interface.cs (PopulateMethod): Handle the type of the parameter being
20123 * expression.cs (Invocation.BetterFunction): Handle the case when we
20124 have a params method with no fixed arguments and a call is made with no
20127 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20129 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20130 the verbatim-string-literal
20132 * support.cs (InternalParameters.ParameterModifier): handle null
20134 (InternalParameters.ParameterType): ditto.
20136 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20137 duplicating the name of the variable parameter.
20138 (GetParameterByName): Fix bug where we were not looking up array
20139 paramters if they were the only present (thanks Paolo!).
20140 (GetParameterInfo): We only have an empty set of types if both
20141 fixed and array are set to null.
20142 (GetParameterInfo-idx): Handle FixedParameter == null
20144 * cs-parser.jay: Handle the case where there is no catch
20145 statements (missing null test).
20147 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20149 * driver.cs (MainDriver): Be conservative on our command line
20152 Catch DirectoryNotFoundException when calling GetFiles.
20154 (SplitPathAndPattern): Used to split the input specification into
20155 a path and a pattern that we can feed to Directory.GetFiles.
20157 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20159 * statement.cs (Fixed): Implement the last case of the Fixed
20160 statement (string handling).
20162 * expression.cs (StringPtr): New class used to return a char * to
20163 a string; Used by the Fixed statement.
20165 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20167 * expression.cs (Binary.ResolveOperator): Remove redundant
20168 MemberLookup pn parent type.
20169 Optimize union call, we do not need a union if the types are the same.
20170 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20173 Specialize the use of MemberLookup everywhere, instead of using
20174 the default settings.
20176 (StackAlloc): Implement stackalloc keyword.
20178 * cs-parser.jay: Add rule to parse stackalloc.
20180 * driver.cs: Handle /h, /help, /?
20182 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20183 before we supported unsafe code.
20185 * makefile: add --unsafe to the self compilation of mcs.
20187 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20189 * expression.cs (PointerArithmetic): New class that is used to
20190 perform pointer arithmetic.
20191 (Binary.Resolve): Handle pointer arithmetic
20192 Handle pointer comparission.
20193 (ArrayPtr): Utility expression class that is used to take the
20194 address of an array.
20196 (ElementAccess): Implement array access for pointers
20198 * statement.cs (Fixed): Implement fixed statement for arrays, we
20199 are missing one more case before we are done.
20201 * expression.cs (Indirection): Implement EmitAssign and set the
20202 ExprClass to Variable. This allows pointer dereferences to be
20203 treated as variables, and to have values assigned to them.
20205 * ecore.cs (Expression.StoreFromPtr): New utility function to
20206 store values dereferencing.
20208 2002-02-20 Ravi Pratap <ravi@ximian.com>
20210 * expression.cs (Binary.ResolveOperator): Ensure that we are
20211 not trying to operate on a void type - this fixes the reported
20214 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20215 the parent implementation is sealed.
20217 * ../errors/cs0239.cs : Add.
20219 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20221 * typemanager.cs (unverifiable_code_type): Corresponds to
20222 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20223 which have unsafe code in them.
20225 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20228 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20230 * cs-tokenizer.cs: Add support for @"litreal strings"
20232 Make tokenizer accept pre-processor directives
20233 on any column (remove the old C-like limitation).
20235 * rootcontext.cs (EmitCode): Emit any global attributes.
20236 (AddGlobalAttributes): Used to keep track of assembly attributes.
20238 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20240 * cs-parser.jay: Add support for global attributes.
20242 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20244 * expression.cs (Indirection): New helper class. Unary will
20245 create Indirection classes to be able to implement the
20246 IMemoryLocation interface on it.
20248 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20250 * cs-parser.jay (fixed_statement): reference the right statement.
20252 * statement.cs (Fixed.Emit): Finish implementing the fixed
20253 statement for the &x case.
20255 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20257 * class.cs (Property.Define, Method.Define): Remove newslot when
20260 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20261 wrong. NewSlot should only be used if the `new' keyword is present.
20263 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20264 locating our system dir. Sorry about this.
20266 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20268 * driver.cs (GetSystemDir): Compute correctly the location of our
20269 system assemblies. I was using the compiler directory instead of
20270 the library directory.
20272 2002-02-13 Ravi Pratap <ravi@ximian.com>
20274 * expression.cs (BetterFunction): Put back in what Miguel commented out
20275 since it is the correct fix. The problem is elsewhere ;-)
20277 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20278 parameters of the parms method are themselves compatible or not !
20280 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20281 to check that a class implements an interface before saying that an implicit
20282 conversion was allowed. Use ImplementsInterface to do the checking.
20284 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20286 * class.cs (Method.Define): Track whether we are an explicit
20287 implementation or not. And only call DefineMethodOverride if we
20288 are an explicit implementation.
20290 (Property.DefineMethod): Ditto.
20292 2002-02-11 Ravi Pratap <ravi@ximian.com>
20294 * expression.cs (BetterFunction): Catch hideous bug which was
20295 preventing us from detecting ambiguous calls due to implicit casts i.e
20298 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20300 * support.cs (Pair): Remove un-needed method. I figured why I was
20301 getting the error in cs-parser.jay, the variable in a foreach loop
20302 is readonly, and the compiler does not really treat this as a variable.
20304 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20305 instead of EQUALS in grammar.
20307 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20309 * expression.cs (Unary.DoResolve): Check whether the argument is
20312 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20314 * support.cs: Api for Pair to set a value. Despite the fact that
20315 the variables are public the MS C# compiler refuses to compile
20316 code that accesses the field if the variable is part of a foreach
20319 * statement.cs (Fixed): Begin implementation of the fixed
20322 (Block.AddVariable): Return the VariableInfo on success and null
20323 on failure instead of true/false.
20325 * cs-parser.jay (foreach): Catch errors on variables already
20326 defined (we were ignoring this value before) and properly unwind
20327 the block hierarchy
20329 (fixed_statement): grammar for the fixed statement.
20331 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20333 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20334 pointer types to be incretemented.
20336 (SizeOf): Implement.
20338 * cs-parser.jay (pointer_member_access): Implement
20339 expr->IDENTIFIER production.
20341 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20342 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20345 (Unary): Implement indirection.
20347 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20348 use in non-unsafe context).
20350 (SimpleName.DoResolve): Check for pointers in field access on safe
20353 (Expression.LoadFromPtr): Factor the load-indirect code in this
20354 function. This was duplicated in UnboxCast and ParameterReference
20356 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20358 * expression.cs (ComposedCast): report an error if a pointer cast
20359 is used in a safe region.
20361 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20362 pointer type casts in unsafe context.
20364 * codegen.cs (EmitContext): Set up IsUnsafe.
20366 * cs-parser.jay (non_expression_type): Add productions for pointer
20369 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20370 code. We should not use force into static mode if the method is
20371 not virtual. Fixes bug in MIS
20373 * statement.cs (Do.Emit, While.Emit, For.Emit,
20374 Statement.EmitBoolExpression): Add support to Do and While to
20375 propagate infinite loop as `I do return' semantics.
20377 Improve the For case to also test for boolean constants.
20379 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20380 to the list of attributes we can add.
20382 Remove `EmitContext' argument.
20384 * class.cs (Method.Define): Apply parameter attributes.
20385 (Constructor.Define): Apply parameter attributes.
20386 (MethodCore.LabelParameters): Move here the core of labeling
20389 * support.cs (ReflectionParameters.ParameterModifier,
20390 InternalParameters.ParameterModifier): Use IsByRef on the type and
20391 only return the OUT bit for these parameters instead of in/out/ref
20394 This is because I miss-understood things. The ParameterInfo.IsIn
20395 and IsOut represent whether the parameter has the [In] and [Out]
20398 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20400 * ecore.cs (FieldExpr.Emit): Release temporaries.
20402 * assign.cs (LocalTemporary.Release): new function.
20404 * codegen.cs (EmitContext.GetTemporaryStorage,
20405 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20406 temporary storage. Now we can "put back" localbuilders when we
20409 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20411 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20412 need to make a copy of the variable to generate verifiable code.
20414 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20416 * driver.cs: Compute dynamically the system directory.
20418 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20419 Slower, but more generally useful. Used by the abstract
20420 registering implementation.
20422 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20423 the rules for the special rule on Type/instances. First check if
20424 we have the same name, and if so, try that special static path
20425 rather than the instance path.
20427 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20429 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20432 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20433 Enum, ValueType, Delegate or Array for non-corlib compiles.
20435 * cs-tokenizer.cs: Catch long identifiers (645)
20437 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20440 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20441 fix, we were returning too early, so we were not registering
20442 pending methods from abstract classes.
20444 Do not register pending methods if the class is abstract.
20446 * expression.cs (Conditional.DoResolve): Report circular implicit
20447 conversions when we neecd to compute it for conditional
20450 (Is.DoResolve): If the expression is always of the provided type,
20451 flag warning 183. If the expression can not ever be of the
20452 provided type flag warning 184.
20454 * class.cs: Catch 169 as well.
20456 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20459 2002-01-18 Nick Drochak <ndrochak@gol.com>
20461 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20463 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20465 * interface.cs: (PopulateMethod): Check for pointers being defined
20466 only if the unsafe context is active.
20467 (PopulateProperty): ditto.
20468 (PopulateIndexer): ditto.
20470 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20471 specified. If pointers are present, make sure that they are
20472 present in an unsafe context.
20473 (Constructor, Constructor.Define): ditto.
20474 (Field, Field.Define): ditto.
20475 (Property, Property.Define): ditto.
20476 (Event, Event.Define): ditto.
20478 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20479 hashtable if there are classes or structs defined.
20481 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20482 code, as the constant resolution moved.
20484 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20485 the metadata, so we can flag error 133.
20487 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20488 pointer is being declared in an unsafe context.
20490 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20492 * modifiers.cs (Modifiers.Check): Require a Location argument.
20493 Report error 227 for Unsafe use.
20495 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20497 * statement.cs (For.Emit): If the test is null, then report that
20498 we do `return', as we wont reach anything afterwards.
20500 (Switch.SwitchGoverningType): Track the expression that matched
20503 * driver.cs: Allow negative numbers as an error code to flag.
20505 * cs-parser.jay: Handle 1551.
20507 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20509 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20511 * cs-parser.jay: Report 1518 (type declaration can only contain
20512 class, struct, interface, enum or delegate)
20514 (switch_label): Report 1523 (keywords `case' or `default' must
20517 (opt_switch_sections): Report 1522 (empty switch)
20519 * driver.cs: Report 1515 (response file specified multiple times)
20520 Report 1516 (Source file specified multiple times).
20522 * expression.cs (Argument.Resolve): Signal 1510
20524 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20525 access not allowed in static code)
20527 2002-01-11 Ravi Pratap <ravi@ximian.com>
20529 * typemanager.cs (IsPointerType): Utility method which we are going
20532 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20533 the object type, so we take care of that.
20535 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20537 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20538 added to non-params parameters :-)
20540 * typemanager.cs (CSharpName): Include 'void' type too.
20542 (void_ptr_type): Include in the set of core types.
20544 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20547 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20550 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20551 completely forgotten about it.
20553 2002-01-10 Ravi Pratap <ravi@ximian.com>
20555 * cs-parser.jay (pointer_type): Add. This begins our implementation
20556 of parsing rules for unsafe code.
20558 (unsafe_statement): Implement.
20560 (embedded_statement): Modify to include the above.
20562 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20564 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20565 if the current context is an unsafe one.
20567 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20568 are handled differently, we need separate rules for them.
20570 (local_variable_declaration): Update to use local_variable_pointer_type
20571 to allow variable declarations of unmanaged pointer types.
20573 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20574 in unsafe contexts.
20576 * ../errors/cs0214.cs : Add.
20578 2002-01-16 Nick Drochak <ndrochak@gol.com>
20580 * makefile: remove 'response' file when cleaning.
20582 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20584 * cs-parser.jay: Report 1524.
20586 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20588 * typemanager.cs (RegisterMethod): drop checking if we have
20589 registered this from here
20591 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20593 * class.cs (Method.EmitDestructor): Implement calling our base
20596 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20597 value of InFinally.
20599 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20600 this routine and will wrap the call in a try/catch block. Deal
20603 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20605 * ecore.cs (Expression.MemberLookup): instead of taking a
20606 parameter `same_type' that was used to tell whether we could
20607 access private members we compute our containing type from the
20610 (FieldExpr): Added partial support for volatile fields. This does
20611 not work for volatile fields exposed from assemblies, as I can not
20612 figure out how to extract the modreq from it.
20614 Updated all the source files to use this.
20616 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20617 because it is referenced by MemberLookup very often.
20619 2002-01-09 Ravi Pratap <ravi@ximian.com>
20621 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20622 TypeBuilder.GetCustomAttributes to retrieve what we need.
20624 Get rid of redundant default_member_attr_type as this is the same as
20625 default_member_type which already exists.
20627 * interface.cs, attribute.cs : Update accordingly.
20629 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20631 * typemanager.cs: Enable IndexerPropertyName again. It does not
20632 work for TYpeBuilders though. Ravi, can you please fix this?
20634 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20636 * expression.cs (Argument.Emit): Handle the case of ref objects
20637 being passed to ref functions;
20639 (ParameterReference.EmitLoad): Loads the content of the pointer
20640 without dereferencing.
20642 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20644 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20646 2002-01-08 Ravi Pratap <ravi@ximian.com>
20648 * class.cs (Indexer.DefineMethod): Incorporate the interface
20649 type in the name of the method if we are doing explicit interface
20652 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20654 (BetterConversion): Fix extremely trivial bug where we were referring to
20655 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20658 * ../errors/bug16.cs : Add although we have fixed it.
20660 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20662 * expression.cs (BaseIndexer): Begin implementation.
20664 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20666 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20667 production directly to remove a shift/reduce, and implement
20668 explicit interface implementation.
20670 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20671 after a floating point suffix.
20673 * expression.cs (DoNumericPromotions): Improved the conversion for
20674 uint/uint. If we have a constant, we avoid doing a typecast to a
20677 * class.cs (Indexer): Implement explicit interface implementation
20680 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20682 * class.cs: make the default instance constructor public and hidebysig.
20684 2001-01-03 Ravi Pratap <ravi@ximian.com>
20686 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20687 so we can call it from elsewhere.
20689 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20690 we emit it internally if the class has a defined indexer; otherwise the user
20691 emits it by decorating the class definition with the DefaultMemberAttribute.
20693 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20694 attribute is not used on a type which defines an indexer.
20696 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20697 character when we skip whitespace.
20699 * ../errors/cs0646.cs : Add.
20701 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20703 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20706 * makefile: Add practical target `mcs3.exe' which builds the third
20707 generation compiler.
20709 * expression.cs (New): Fix structures constructor calling.
20711 * class.cs (Property, Method, Indexer): Emit Final flag on the
20712 method if we are an interface implementation and we are not
20715 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20716 whether this property is referencing a `base' method.
20718 * expression.cs (Invocation.EmitCall): take an extra argument:
20719 is_base, this is used to determine whether the `call' or
20720 `callvirt' opcode should be used.
20723 * delegate.cs: update EmitCall.
20725 * class.cs (Method.Define): Set NewSlot for the cases where we are
20726 not implementing an interface method.
20728 (Property.Define): ditto.
20730 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20732 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20733 'r'. Allows mcs to parse itself fully.
20735 2002-01-02 Ravi Pratap <ravi@ximian.com>
20737 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20738 of the number of initializers that require the InitializeArray method.
20740 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20741 update the above field where necessary.
20743 (MakeByteBlob): Update accordingly.
20745 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20748 (EmitDynamicInitializers): Update in accordance with the new optimization.
20750 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20751 same OpCode applies.
20753 * cs-parser.jay : Fix some glaring errors I introduced.
20755 2002-01-01 Ravi Pratap <ravi@ximian.com>
20757 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20758 so that we can check for name clashes there too.
20760 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20761 for interface indexers.
20763 * interfaces.cs (Define): Emit the default member attribute.
20765 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20766 variable was being referred to while setting the value ;-)
20768 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20770 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20771 byte-by-byte information when we know the data is zero.
20773 Make the block always a multiple of 4, because
20774 DefineInitializedData has a bug.
20776 * assign.cs: Fix, we should assign from the temporary, not from
20779 * expression.cs (MakeByteBlob): Fix my incorrect code.
20781 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20783 * typemanager.cs (EnumToUnderlying): This function is used to get
20784 the underlying type from an enumeration, because it does not
20787 * constant.cs: Use the I4_S form for values between -128 and 127.
20789 * statement.cs (Block.LookupLabel): Looks up a label.
20790 (Block): Drop support for labeled blocks.
20792 (LabeledStatement): New kind of statement that represents a label
20795 (Goto): Finally implement this bad boy.
20797 * cs-parser.jay: Update to reflect new mechanism to implement
20800 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20802 * codegen.cs (EmitContext.This): a codegen property that keeps the
20803 a single instance of this instead of creating many different this
20806 * delegate.cs (Delegate.DoResolve): Update to use the property;
20808 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20810 * expression.cs (BaseAccess.DoResolve): Ditto.
20812 2001-12-29 Ravi Pratap <ravi@ximian.com>
20814 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20815 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20817 (InitCoreTypes): Update accordingly.
20819 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20820 so we can quickly store the state.
20822 (ApplyAttributes): Set the correct implementation flags
20823 for InternalCall methods.
20825 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20827 * expression.cs (EmitCall): if a method is not virtual, then do
20828 not use callvirt on it.
20830 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20831 user defined stuff) requires the use of stobj, which takes an
20832 address on the stack instead of an array and an index. So emit
20833 the Ldelema operation for it.
20835 (EmitStoreOpcode): Use stobj for valuetypes.
20837 (UnaryMutator.EmitCode): Use the right 1 value depending on
20838 whether we are dealing with int64/uint64, float or doubles.
20840 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20841 constructors that I implemented last night.
20843 (Constructor.IsDefault): Fix to work properly for static
20846 * cs-parser.jay (CheckDef): report method signature errors.
20847 Update error number 103 to be 132.
20849 * decl.cs: New AdditionResult enumeration value: MethodExists.
20850 Although we do this check for methods later on in the semantic
20851 analysis, catching repeated default constructors is so easy that
20852 we catch these here.
20854 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20857 (ParameterReference.EmitAssign, Emit): handle
20860 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20861 (ArrayAccess.EmitStoreOpcode): ditto.
20863 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20865 * expression.cs (MakeByteBlob): Complete all the missing types
20866 (uint, short, ushort, byte, sbyte)
20868 * class.cs: Only init instance field initializers on instance
20871 Rename `constructors' to instance_constructors.
20873 (TypeContainer.AddConstructor): Only add constructors to the list
20874 if it is not static.
20876 Make sure that we handle default_static_constructor independently
20877 everywhere where we handle instance_constructors
20879 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20881 * class.cs: Do not lookup or create a base initializer for a
20882 static constructor.
20884 (ConstructorInitializer.Resolve): use the proper type to lookup
20887 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20889 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20892 * decl.cs: CloseType is now an virtual method, the default
20893 implementation just closes this type.
20895 2001-12-28 Ravi Pratap <ravi@ximian.com>
20897 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20898 to PreserveSig by default. Also emit HideBySig on such methods.
20900 Basically, set the defaults to standard values.
20902 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20903 argument, if candidate is better, it can't be worse than the best !
20905 (Invocation): Re-write bits to differentiate between methods being
20906 applicable in their expanded form and their normal form - for params
20909 Get rid of use_standard everywhere as only standard conversions are allowed
20910 in overload resolution.
20912 More spec conformance.
20914 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20916 * driver.cs: Add --timestamp, to see where the compiler spends
20919 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20920 `this' in static code.
20922 (SimpleName.DoResolve): Implement in terms of a helper function
20923 that allows static-references to be passed upstream to
20926 (Expression.ResolveWithSimpleName): Resolve specially simple
20927 names when called by MemberAccess to implement the special
20930 (Expression.ImplicitReferenceConversion): Handle conversions from
20931 Null to reference types before others, as Null's type is
20934 * expression.cs (Invocation.EmitCall): Handle the special case of
20935 calling methods declared on a reference type from a ValueType
20936 (Base classes System.Object and System.Enum)
20938 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20939 the left hand side is a TypeExpr, not on every enumeration.
20941 (Binary.Resolve): If types are reference types, then do a cast to
20942 object on operators != and == of both arguments.
20944 * typemanager.cs (FindMembers): Extract instance and static
20945 members if requested.
20947 * interface.cs (PopulateProperty): Use void_type instead of null
20948 as the return type for the setter method.
20950 (PopulateIndexer): ditto.
20952 2001-12-27 Ravi Pratap <ravi@ximian.com>
20954 * support.cs (ReflectionParameters): Fix minor bug where we
20955 were examining the wrong parameter for the ParamArray attribute.
20957 Cope with requests for the type of the parameter at position
20958 greater than the params parameter's. We now return the element
20959 type of the params array as that makes more sense.
20961 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20962 accordingly as we no longer have to extract the element type
20965 (Invocation.OverloadResolve): Update.
20967 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20969 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20970 against IEnumerator, test whether the return value is a descendant
20971 of the IEnumerator interface.
20973 * class.cs (Indexer.Define): Use an auxiliary method to implement
20974 the other bits of the method definition. Begin support for
20975 explicit interface implementation.
20977 (Property.DefineMethod): Use TypeManager.void_type instead of null
20978 for an empty return value.
20980 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20982 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20983 dealing with a FieldExpr which is composed of a FieldBuilder, in
20984 the code path we did extract the constant, but we should have
20985 obtained the underlying value to be able to cast it (otherwise we
20986 end up in an infinite loop, this is what Ravi was running into).
20988 (ArrayCreation.UpdateIndices): Arrays might be empty.
20990 (MemberAccess.ResolveMemberAccess): Add support for section
20991 14.5.4.1 that deals with the special case of E.I when E is a type
20992 and something else, that I can be a reference to a static member.
20994 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20995 handle a particular array type to create byte blobs, it is just
20996 something we dont generate byteblobs for.
20998 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21001 * location.cs (Push): remove the key from the hashtable that we
21002 are about to add. This happens for empty files.
21004 * driver.cs: Dispose files after we have parsed them.
21006 (tokenize): new function that only runs the tokenizer on its
21007 input, for speed testing.
21009 2001-12-26 Ravi Pratap <ravi@ximian.com>
21011 * class.cs (Event.Define): Define the private field only if there
21012 are no accessors defined.
21014 * expression.cs (ResolveMemberAccess): If there is no associated
21015 field with the event, that means we have an event defined with its
21016 own accessors and we should flag error cs0070 since transforming
21017 ourselves into a field is not valid in that case.
21019 * ecore.cs (SimpleName.DoResolve): Same as above.
21021 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21022 and charset to sane values.
21024 2001-12-25 Ravi Pratap <ravi@ximian.com>
21026 * assign.cs (DoResolve): Perform check on events only if they
21027 are being accessed outside the declaring type.
21029 * cs-parser.jay (event_declarations): Update rules to correctly
21030 set the type of the implicit parameter etc.
21032 (add_accessor, remove_accessor): Set current local parameters.
21034 * expression.cs (Binary): For delegate addition and subtraction,
21035 cast the return value from the method into the appropriate delegate
21038 2001-12-24 Ravi Pratap <ravi@ximian.com>
21040 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21041 of these as the workaround is unnecessary.
21043 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21044 delegate data - none of that is needed at all.
21046 Re-write bits to extract the instance expression and the delegate method
21049 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21052 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21053 of attaching attributes instead of duplicating code everywhere.
21055 * everywhere : Update code to do attribute emission using the above method.
21057 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21059 * expression.cs (IsParamsMethodApplicable): if there are not
21060 parameters, return immediately.
21062 * ecore.cs: The 0 literal can be implicity converted to an enum
21065 (SimpleName.DoResolve): First lookup the type, then lookup the
21068 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21069 want to get its address. If the InstanceExpression is not
21070 addressable, store the result in a temporary variable, then get
21073 * codegen.cs: Only display 219 errors on warning level or above.
21075 * expression.cs (ArrayAccess): Make it implement the
21076 IMemoryLocation interface.
21078 (Binary.DoResolve): handle the operator == (object a, object b)
21079 and operator != (object a, object b) without incurring into a
21080 BoxedCast (because 5 != o should never be performed).
21082 Handle binary enumerator operators.
21084 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21085 value type, otherwise use Ldelem_ref.
21087 Use precomputed names;
21089 (AddressOf): Implement address of
21091 * cs-parser.jay (labeled_statement): Fix recursive block
21092 addition by reworking the production.
21094 * expression.cs (New.DoEmit): New has a special case:
21096 If we are dealing with a ValueType, we have a few
21097 situations to deal with:
21099 * The target of New is a ValueType variable, that is
21100 easy, we just pass this as the variable reference
21102 * The target of New is being passed as an argument,
21103 to a boxing operation or a function that takes a
21106 In this case, we need to create a temporary variable
21107 that is the argument of New.
21110 2001-12-23 Ravi Pratap <ravi@ximian.com>
21112 * rootcontext.cs (LookupType): Check that current_type is not null before
21113 going about looking at nested types.
21115 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21116 not implement the IAssignMethod interface any more.
21118 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21119 where we tranform them into FieldExprs if they are being resolved from within
21120 the declaring type.
21122 * ecore.cs (SimpleName.DoResolve): Do the same here.
21124 * assign.cs (DoResolve, Emit): Clean up code considerably.
21126 * ../errors/bug10.cs : Add.
21128 * ../errors/cs0070.cs : Add.
21130 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21132 * assign.cs : Get rid of EventIsLocal everywhere.
21134 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21136 * ecore.cs (ConvertIntLiteral): finished the implementation.
21138 * statement.cs (SwitchLabel): Convert the value we are using as a
21139 key before looking up the table.
21141 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21143 * codegen.cs (EmitTopBlock): Require a Location argument now.
21145 * cs-parser.jay (constructor_declarator): We need to setup
21146 current_local_parameters before we parse the
21147 opt_constructor_initializer, to allow the variables to be bound
21148 to the constructor arguments.
21150 * rootcontext.cs (LookupType): First lookup nested classes in our
21151 class and our parents before we go looking outside our class.
21153 * expression.cs (ConstantFold): Extract/debox the values at the
21156 * rootcontext.cs (EmitCode): Resolve the constants first before we
21157 resolve the types. This is not really needed, but it helps debugging.
21159 * statement.cs: report location.
21161 * cs-parser.jay: pass location to throw statement.
21163 * driver.cs: Small bug fix.
21165 * report.cs: Updated format to be 4-zero filled digits.
21167 2001-12-22 Ravi Pratap <ravi@ximian.com>
21169 * expression.cs (CheckIndices): Fix minor bug where the wrong
21170 variable was being referred to ;-)
21172 (DoEmit): Do not call EmitStaticInitializers when the
21173 underlying type is System.Object.
21175 2001-12-21 Ravi Pratap <ravi@ximian.com>
21177 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21178 and do the usual workaround for SRE.
21180 * class.cs (MyEventBuilder.EventType): New member to get at the type
21181 of the event, quickly.
21183 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21185 * assign.cs (Assign.DoResolve): Handle the case when the target
21186 is an EventExpr and perform the necessary checks.
21188 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21191 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21193 (EventExpr): Set the type in the constructor itself since we
21194 are meant to be born fully resolved.
21196 (EventExpr.Define): Revert code I wrote earlier.
21198 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21199 instance expression is null. The instance expression is a This in that case
21200 or a null, depending on whether it is a static method or not.
21202 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21203 refers to more than one method.
21205 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21206 and accordingly flag errors.
21208 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21210 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21212 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21214 * location.cs (ToString): Provide useful rutine.
21216 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21218 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21219 objects, return the actual integral boxed.
21221 * statement.cs (SwitchLabel): define an ILLabel for each
21224 (Switch.CheckSwitch): If the value is a Literal, extract
21225 the underlying literal.
21227 Also in the unused hashtable we had, add the SwitchLabel so we can
21228 quickly look this value up.
21230 * constant.cs: Implement a bunch of new constants. Rewrite
21231 Literal based on this. Made changes everywhere to adapt to this.
21233 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21234 dereferencing array only once, and also copes with enumrations.
21236 bytes are two bytes wide, not one.
21238 (Cast): Perform constant conversions.
21240 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21241 wrappers to the literals here.
21243 * expression.cs (DoNumericPromotions): long literals can converted
21244 to ulong implicity (this is taken care of elsewhere, but I was
21245 missing this spot).
21247 * ecore.cs (Expression.Literalize): Make the return type Literal,
21248 to improve type checking.
21250 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21252 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21254 * literal.cs: Revert code from ravi that checked the bounds. The
21255 bounds are sane by the definition of the type itself.
21257 * typemanager.cs: Fix implementation of ImplementsInterface. We
21258 need to actually look up in our parent hierarchy for interfaces
21261 * const.cs: Use the underlying type for enumerations
21263 * delegate.cs: Compute the basename for the delegate creation,
21264 that should fix the delegate test case, and restore the correct
21265 Type Lookup semantics in rootcontext
21267 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21268 referencing a nested type with the Reflection API is using the "+"
21271 * cs-parser.jay: Do not require EOF token at the end.
21273 2001-12-20 Ravi Pratap <ravi@ximian.com>
21275 * rootcontext.cs (LookupType): Concatenate type names with
21276 a '.' instead of a '+' The test suite passes again.
21278 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21279 field of the enumeration.
21281 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21282 the case when the member is an EventExpr.
21284 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21285 static has an associated instance expression.
21287 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21289 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21291 * class.cs (Event.Define): Register event and perform appropriate checks
21294 We define the Add and Remove methods even if the use provides none because
21295 in that case, we provide default implementations ourselves.
21297 Define a private field of the type of the event. This is done by the CSC compiler
21298 and we should be doing it too ;-)
21300 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21301 More methods we use in code we generate.
21303 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21306 (InitCoreTypes): Update accordingly for the above.
21308 * class.cs (Event.Emit): Generate code for default accessors that we provide
21310 (EmitDefaultMethod): Do the job in the above.
21312 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21315 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21317 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21318 builders even if we were missing one.
21320 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21321 pass the Basename as our class name instead of the Name. The
21322 basename will be correctly composed for us.
21324 * parameter.cs (Paramters): Now takes a Location argument.
21326 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21327 make all the code call directly LookupType in RootContext and take
21328 this chance to pass the Location information everywhere.
21330 * Everywhere: pass Location information.
21332 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21334 * class.cs (Constructor.Define): Updated way of detecting the
21335 length of the parameters.
21337 (TypeContainer.DefineType): Use basename as the type name for
21340 (TypeContainer.Define): Do not recursively define types here, as
21341 definition is taken care in order by the RootContext.
21343 * tree.cs: Keep track of namespaces in a per-file basis.
21345 * parameter.cs (Parameter.ComputeSignature): Update to use
21348 (Parameters.GetSignature): ditto.
21350 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21351 instead of a TypeContainer.
21353 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21354 resolve names. Because we need to be resolve in our context, not
21357 * driver.cs: Implement response files.
21359 * class.cs (TypeContainer.DefineType): If we are defined, do not
21360 redefine ourselves.
21362 (Event.Emit): Emit the code for add/remove handlers.
21363 (Event.Define): Save the MethodBuilders for add/remove.
21365 * typemanager.cs: Use pair here too.
21367 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21368 DictionaryEntry requires the first argument to be non-null.
21370 (enum_declaration): Compute full name for registering the
21373 (delegate_declaration): Instead of using
21374 formal_parameter_list, use opt_formal_parameter_list as the list
21377 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21378 (EventParsing): New property that controls whether `add' and
21379 `remove' are returned as tokens or identifiers (for events);
21381 2001-12-19 Ravi Pratap <ravi@ximian.com>
21383 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21384 use MyEventBuilder only and let it wrap the real builder for us.
21386 (MyEventBuilder): Revamp constructor etc.
21388 Implement all operations that we perform on EventBuilder in precisely the same
21391 (FindMembers): Update to use the EventBuilder member.
21393 (Event.Emit): Update accordingly.
21395 2001-12-18 Ravi Pratap <ravi@ximian.com>
21397 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21398 by calling the appropriate methods.
21400 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21403 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21405 2001-12-17 Ravi Pratap <ravi@ximian.com>
21407 * delegate.cs (Delegate.Populate): Check that the return type
21408 and various parameters types are indeed accessible.
21410 * class.cs (Constructor.Define): Same here.
21412 (Field.Define): Ditto.
21414 (Event.Define): Ditto.
21416 (Operator.Define): Check that the underlying Method defined itself
21417 correctly - so it's MethodBuilder should not be null.
21419 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21420 expression happens to be null.
21422 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21423 members but as of now we don't seem to be able to do anything really useful with it.
21425 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21426 not the EventBuilder.
21428 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21430 * cs-tokenizer.cs: Add support for defines.
21431 Add support for #if, #elif, #else, #endif
21433 (eval_var): evaluates a variable.
21434 (eval): stubbed for evaluating functions.
21436 * cs-parser.jay: Pass the defines information
21438 * driver.cs: Add --define command line option.
21440 * decl.cs: Move MemberCore here.
21442 Make it the base class for DeclSpace. This allows us to catch and
21443 report 108 and 109 for everything now.
21445 * class.cs (TypeContainer.Define): Extract all the members
21446 before populating and emit the warning 108 (new keyword required
21447 to override) instead of having each member implement this.
21449 (MemberCore.Define): New abstract method, we will be using this in
21450 the warning reporting engine in Populate.
21452 (Operator.Define): Adjust to new MemberCore protocol.
21454 * const.cs (Const): This does not derive from Expression, it is a
21455 temporary object we use to create fields, it is a MemberCore.
21457 * class.cs (Method.Define): Allow the entry point to be in a
21460 * driver.cs: Rewrite the argument handler to clean it up a bit.
21462 * rootcontext.cs: Made it just an auxiliary namespace feature by
21463 making everything static.
21465 * driver.cs: Adapt code to use RootContext type name instead of
21468 * delegate.cs: Remove RootContext argument.
21470 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21473 * class.cs (Event.Define): The lookup can fail.
21475 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21477 * expression.cs: Resolve the this instance before invoking the code.
21479 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21481 * cs-parser.jay: Add a production in element_access that allows
21482 the thing to become a "type" reference. This way we can parse
21483 things like "(string [])" as a type.
21485 Note that this still does not handle the more complex rules of
21489 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21491 * ecore.cs: (CopyNewMethods): new utility function used to
21492 assemble the list of methods from running FindMembers.
21494 (MemberLookup): Rework FindMembers so that
21496 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21498 * class.cs (TypeContainer): Remove Delegates who fail to be
21501 * delegate.cs (Populate): Verify that we dont get null return
21502 values. TODO: Check for AsAccessible.
21504 * cs-parser.jay: Use basename to emit error 574 (destructor should
21505 have the same name as container class), not the full name.
21507 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21508 possible representation.
21510 Also implements integer type suffixes U and L.
21512 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21514 * expression.cs (ArrayCreation.DoResolve): We need to do the
21515 argument resolution *always*.
21517 * decl.cs: Make this hold the namespace. Hold the root context as
21519 (LookupType): Move here.
21521 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21523 * location.cs (Row, Name): Fixed the code, it was always returning
21524 references to the first file.
21526 * interface.cs: Register properties defined through interfaces.
21528 * driver.cs: Add support for globbing on the command line
21530 * class.cs (Field): Make it derive from MemberCore as well.
21533 2001-12-15 Ravi Pratap <ravi@ximian.com>
21535 * class.cs (Event::Define): Check that the type of the event is a delegate
21536 type else flag error #66.
21538 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21541 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21542 values of EntryPoint, CharSet etc etc.
21544 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21546 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21547 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21548 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21549 which needs this to do its work.
21551 * ../errors/cs0066.cs : Add.
21553 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21555 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21558 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21559 clears out the parameters field.
21560 (MemberSignatureCompare): Cleanup
21562 (MemberCore): New base class used to share code between MethodCore
21565 (RegisterRequiredImplementations) BindingFlags.Public requires
21566 either BindingFlags.Instace or Static. Use instance here.
21568 (Property): Refactored code to cope better with the full spec.
21570 * parameter.cs (GetParameterInfo): Return an empty array instead
21573 * class.cs (Property): Abstract or extern properties have no bodies.
21575 * parameter.cs (GetParameterInfo): return a zero-sized array.
21577 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21578 method modifier validation to the typecontainer so we can reuse
21579 this on properties.
21581 (MethodCore.ParameterTypes): return an empty sized array of types.
21583 (Property.Define): Test property modifier validity.
21585 Add tests for sealed/override too.
21587 (Method.Emit): abstract or extern methods have no bodies.
21589 2001-12-14 Ravi Pratap <ravi@ximian.com>
21591 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21594 (Method::Define, ::Emit): Modify accordingly.
21596 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21598 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21600 * makefile: Pass in /unsafe.
21602 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21604 * class.cs (MakeKey): Kill routine.
21606 * class.cs (TypeContainer.Define): Correctly define explicit
21607 method implementations (they require the full interface name plus
21610 * typemanager.cs: Deply the PtrHashtable here and stop using the
21611 lame keys. Things work so much better.
21613 This of course broke everyone who depended on `RegisterMethod' to
21614 do the `test for existance' test. This has to be done elsewhere.
21616 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21617 the object stupid Equals method (because, that like fails all over
21618 the place). We still do not use it.
21620 * class.cs (TypeContainer.SetRequiredInterface,
21621 TypeContainer.RequireMethods): Killed these two routines and moved
21622 all the functionality to RegisterRequiredImplementations.
21624 (TypeContainer.RegisterRequiredImplementations): This routine now
21625 registers all the implementations required in an array for the
21626 interfaces and abstract methods. We use an array of structures
21627 which can be computed ahead of time to reduce memory usage and we
21628 also assume that lookups are cheap as most classes will not
21629 implement too many interfaces.
21631 We also avoid creating too many MethodSignatures.
21633 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21634 clear the "pending" bit if we find that there are problems with
21637 (TypeContainer.VerifyPendingMethods): Update to report errors of
21638 methods that look like implementations but are not.
21640 (TypeContainer.Define): Add support for explicit interface method
21643 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21645 * typemanager.cs: Keep track of the parameters here instead of
21646 being a feature of the TypeContainer.
21648 * class.cs: Drop the registration of parameters here, as
21649 InterfaceMethods are also interface declarations.
21651 * delegate.cs: Register methods with the TypeManager not only with
21652 the TypeContainer. This code was buggy.
21654 * interface.cs: Full registation here.
21656 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21658 * expression.cs: Remove reducer for binary expressions, it can not
21661 * const.cs: Put here the code that used to go into constant.cs
21663 * constant.cs: Put here the code for constants, this is a new base
21664 class for Literals.
21666 * literal.cs: Make Literal derive from Constant.
21668 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21670 * statement.cs (Return.Emit): Report error 157 if the user
21671 attempts to return from a finally block.
21673 (Return.Emit): Instead of emitting a return, jump to the end of
21676 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21677 LocalBuilder to store the result of the function. ReturnLabel is
21678 the target where we jump.
21681 2001-12-09 Radek Doulik <rodo@ximian.com>
21683 * cs-parser.jay: remember alias in current namespace
21685 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21688 * class.cs (LookupAlias): lookup alias in my_namespace
21690 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21692 (LookupAlias): lookup alias in this and if needed in parent
21695 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21699 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21700 making things static. I need this to avoid passing the
21701 TypeContainer when calling ParameterType.
21703 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21704 that did string manipulation to compute the type and then call
21705 GetType. Use Parameter.ParameterType instead.
21707 * cs-tokenizer.cs: Consume the suffix for floating values.
21709 * expression.cs (ParameterReference): figure out whether this is a
21710 reference parameter or not. Kill an extra variable by computing
21711 the arg_idx during emission.
21713 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21714 function that returns whether a parameter is an out/ref value or not.
21716 (Parameter.ParameterType): The type of the parameter (base,
21717 without ref/out applied).
21719 (Parameter.Resolve): Perform resolution here.
21720 (Parameter.ExternalType): The full type (with ref/out applied).
21722 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21723 support for expressions on the using statement.
21725 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21727 * statement.cs (Using.EmitLocalVariableDecls): Split the
21728 localvariable handling of the using statement.
21730 (Block.EmitMeta): Keep track of variable count across blocks. We
21731 were reusing slots on separate branches of blocks.
21733 (Try.Emit): Emit the general code block, we were not emitting it.
21735 Check the type of the declaration to be an IDisposable or
21736 something that can be implicity converted to it.
21738 Emit conversions if required.
21740 * ecore.cs (EmptyExpression): New utility class.
21741 (Expression.ImplicitConversionExists): New utility function.
21743 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21745 * statement.cs (Using): Implement.
21747 * expression.cs (LocalVariableReference): Support read only variables.
21749 * statement.cs: Remove the explicit emit for the Leave opcode.
21750 (VariableInfo): Add a readonly field.
21752 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21754 * ecore.cs (ConvCast): new class used to encapsulate the various
21755 explicit integer conversions that works in both checked and
21756 unchecked contexts.
21758 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21759 properly generate the overflow opcodes.
21761 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21763 * statement.cs: The correct type for the EmptyExpression is the
21764 element_type, not the variable type. Ravi pointed this out.
21766 2001-12-04 Ravi Pratap <ravi@ximian.com>
21768 * class.cs (Method::Define): Handle PInvoke methods specially
21769 by using DefinePInvokeMethod instead of the usual one.
21771 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21772 above to do the task of extracting information and defining the method.
21774 2001-12-04 Ravi Pratap <ravi@ximian.com>
21776 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21777 of the condition for string type.
21779 (Emit): Move that here.
21781 (ArrayCreation::CheckIndices): Keep string literals in their expression
21784 (EmitDynamicInitializers): Handle strings appropriately.
21786 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21788 * codegen.cs (EmitContext): Replace multiple variables with a
21789 single pointer to the current Switch statement.
21791 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21794 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21798 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21801 (Foreach.Emit): Foreach on arrays was not setting
21802 up the loop variables (for break/continue).
21804 (GotoCase): Semi-implented.
21806 2001-12-03 Ravi Pratap <ravi@ximian.com>
21808 * attribute.cs (CheckAttribute): Handle system attributes by using
21809 Attribute.GetAttributes to examine information we need.
21811 (GetValidPlaces): Same here.
21813 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21815 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21817 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21819 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21821 (Method::Emit): Handle the case when we are a PInvoke method.
21823 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21825 * expression.cs: Use ResolveWithSimpleName on compound names.
21827 2001-12-02 Ravi Pratap <ravi@ximian.com>
21829 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21830 before trying to reduce it.
21832 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21834 * constant.cs (LookupConstantValue): Implement.
21836 (EmitConstant): Use the above in emitting the constant.
21838 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21839 that are user-defined by doing a LookupConstantValue on them.
21841 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21844 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21846 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21848 (BaseAccess.DoResolve): Implement.
21850 (MemberAccess.DoResolve): Split this routine into a
21851 ResolveMemberAccess routine that can be used independently
21853 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21855 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21856 As that share bits of the implementation. Is returns a boolean,
21857 while As returns the Type that is being probed.
21859 2001-12-01 Ravi Pratap <ravi@ximian.com>
21861 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21862 instead of a Literal - much easier.
21864 (EnumInTransit): Remove - utterly useless :-)
21866 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21868 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21870 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21871 chain when we have no associated expression.
21873 2001-11-30 Ravi Pratap <ravi@ximian.com>
21875 * constant.cs (Define): Use Location while reporting the errror.
21877 Also emit a warning when 'new' is used and there is no inherited
21880 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21883 (LookupEnumValue): Implement to lookup an enum member's value and define it
21886 (Populate): Re-write accordingly to use the above routine.
21888 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21890 * expression.cs (This): Fix prototype for DoResolveLValue to
21891 override the base class DoResolveLValue.
21893 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21896 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21897 (we need to load the address of the field here). This fixes
21900 (FieldExpr.DoResolveLValue): Call the DoResolve
21901 function to initialize the Instance expression.
21903 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21904 correctly the GetEnumerator operation on a value type.
21906 * cs-parser.jay: Add more simple parsing error catches.
21908 * statement.cs (Switch): Add support for string switches.
21909 Handle null specially.
21911 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21913 2001-11-28 Ravi Pratap <ravi@ximian.com>
21915 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21917 (declare_local_constant): New helper function.
21919 * statement.cs (AddConstant): Keep a separate record of constants
21921 (IsConstant): Implement to determine if a variable is a constant.
21923 (GetConstantExpression): Implement.
21925 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21927 * statement.cs (IsVariableDefined): Re-write.
21929 2001-11-27 Ravi Pratap <ravi@ximian.com>
21931 * class.cs (TypeContainer::FindMembers): Look for constants
21932 in the case when we are looking for MemberTypes.Field
21934 * expression.cs (MemberAccess::DoResolve): Check that in the
21935 case we are a FieldExpr and a Literal, we are not being accessed
21936 by an instance reference.
21938 * cs-parser.jay (local_constant_declaration): Implement.
21940 (declaration_statement): Implement for constant declarations.
21942 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21944 * statement.cs (Switch): Catch double defaults.
21946 (Switch): More work on the switch() statement
21947 implementation. It works for integral values now, need to finish
21951 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21953 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21954 integer literals into other integer literals. To be used by
21957 2001-11-24 Ravi Pratap <ravi@ximian.com>
21959 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21962 (EmitDynamicInitializers): Cope with the above since we extract data
21963 directly from ArrayData now.
21965 (ExpectInitializers): Keep track of whether initializers are mandatory
21968 (Bounds): Make it a hashtable to prevent the same dimension being
21969 recorded for every element in that dimension.
21971 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21974 Also fix bug which was causing the indices to be emitted in the reverse
21977 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21979 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21980 unfinished. They do not work, because the underlying code is
21983 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21985 * cs-parser.jay: Remove bogus fixme.
21987 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21988 on Switch statement.
21990 2001-11-23 Ravi Pratap <ravi@ximian.com>
21992 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21995 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21996 parameter. Apparently, any expression is allowed.
21998 (ValidateInitializers): Update accordingly.
22000 (CheckIndices): Fix some tricky bugs thanks to recursion.
22002 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
22003 I was being completely brain-dead.
22005 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22006 and re-write acordingly.
22008 (DelegateInvocation): Re-write accordingly.
22010 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22012 (MakeByteBlob): Handle types more correctly.
22014 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22015 initialization from expressions but it is incomplete because I am a complete
22018 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22020 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22021 on If. Basically, we have to return `true' (ie, we do return to
22022 our caller) only if both branches of the if return.
22024 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22025 short-circuit operators, handle them as short circuit operators.
22027 (Cast.DoResolve): Resolve type.
22028 (Cast.Cast): Take an expression as the target type.
22030 * cs-parser.jay (cast_expression): Remove old hack that only
22031 allowed a limited set of types to be handled. Now we take a
22032 unary_expression and we resolve to a type during semantic
22035 Use the grammar productions from Rhys to handle casts (this is
22036 not complete like Rhys syntax yet, we fail to handle that corner
22037 case that C# has regarding (-x), but we will get there.
22039 2001-11-22 Ravi Pratap <ravi@ximian.com>
22041 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22042 field which is an array type.
22044 * cs-parser.jay (declare_local_variables): Support array initialization too.
22046 * typemanager.cs (MakeKey): Implement.
22048 (everywhere): Use the above appropriately.
22050 * cs-parser.jay (for_statement): Update for array initialization while
22051 declaring variables.
22053 * ecore.cs : The error message was correct, it's the variable's names that
22054 were misleading ;-) Make the code more readable.
22056 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22057 the correct type etc.
22059 (ConvertExplicit): Handle Enum types by examining the underlying type.
22061 2001-11-21 Ravi Pratap <ravi@ximian.com>
22063 * parameter.cs (GetCallingConvention): Always return
22064 CallingConventions.Standard for now.
22066 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22068 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22069 and `r' after calling DoNumericPromotions.
22071 * ecore.cs: Fix error message (the types were in the wrong order).
22073 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22074 BindingFlags.Instance as well
22076 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22077 implicit int literal conversion in an empty cast so that we
22078 propagate the right type upstream.
22080 (UnboxCast): new class used to unbox value types.
22081 (Expression.ConvertExplicit): Add explicit type conversions done
22084 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22085 the target type before applying the implicit LongLiterals to ULong
22088 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22090 * cs-parser.jay (for_statement): Reworked the way For works: now
22091 we declare manually any variables that are introduced in
22092 for_initializer to solve the problem of having out-of-band code
22093 emition (that is what got for broken).
22095 (declaration_statement): Perform the actual variable declaration
22096 that used to be done in local_variable_declaration here.
22098 (local_variable_declaration): Do not declare anything, just pass
22099 the information on a DictionaryEntry
22101 2001-11-20 Ravi Pratap <ravi@ximian.com>
22103 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22104 re-write of the logic to now make it recursive.
22106 (UpdateIndices): Re-write accordingly.
22108 Store element data in a separate ArrayData list in the above methods.
22110 (MakeByteBlob): Implement to dump the array data into a byte array.
22112 2001-11-19 Ravi Pratap <ravi@ximian.com>
22114 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22117 * constant.cs (Define): Implement.
22119 (EmitConstant): Re-write fully.
22121 Pass in location info.
22123 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22126 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22127 DictionaryEntry since we need location info too.
22129 (constant_declaration): Update accordingly.
22131 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22132 code into another method : UpdateIndices.
22134 2001-11-18 Ravi Pratap <ravi@ximian.com>
22136 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22137 some type checking etc.
22139 2001-11-17 Ravi Pratap <ravi@ximian.com>
22141 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22142 bits to provide dimension info if the user skips doing that.
22144 Update second constructor to store the rank correctly.
22146 2001-11-16 Ravi Pratap <ravi@ximian.com>
22148 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22149 and try to implement.
22151 * ../errors/cs0150.cs : Add.
22153 * ../errors/cs0178.cs : Add.
22155 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22157 * statement.cs: Implement foreach on multi-dimensional arrays.
22159 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22160 name of the params argument.
22162 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22163 initializing the array.
22165 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22166 we can use this elsewhere.
22168 * statement.cs: Finish implementation of foreach for single
22171 * cs-parser.jay: Use an out-of-band stack to pass information
22172 around, I wonder why I need this.
22174 foreach_block: Make the new foreach_block the current_block.
22176 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22177 function used to return a static Parameters structure. Used for
22178 empty parameters, as those are created very frequently.
22180 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22182 2001-11-15 Ravi Pratap <ravi@ximian.com>
22184 * interface.cs : Default modifier is private, not public. The
22185 make verify test passes again.
22187 2001-11-15 Ravi Pratap <ravi@ximian.com>
22189 * support.cs (ReflectionParameters): Fix logic to determine
22190 whether the last parameter is a params one. Test 9 passes again.
22192 * delegate.cs (Populate): Register the builders we define with
22193 RegisterParameterForBuilder. Test 19 passes again.
22195 * cs-parser.jay (property_declaration): Reference $6 instead
22196 of $$ to get at the location.
22198 (indexer_declaration): Similar stuff.
22200 (attribute): Ditto.
22202 * class.cs (Property): Register parameters for the Get and Set methods
22203 if they exist. Test 23 passes again.
22205 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22206 call to EmitArguments as we are sure there aren't any params arguments.
22207 Test 32 passes again.
22209 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22210 IndexOutOfRangeException.
22212 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22213 Test 33 now passes again.
22215 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22217 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22218 broke a bunch of things. Will have to come up with a better way
22219 of tracking locations.
22221 * statement.cs: Implemented foreach for single dimension arrays.
22223 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22225 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22226 an error. This removes the lookup from the critical path.
22228 * cs-parser.jay: Removed use of temporary_loc, which is completely
22231 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22233 * support.cs (ReflectionParameters.ParameterModifier): Report
22234 whether the argument is a PARAMS argument or not.
22236 * class.cs: Set the attribute `ParamArrayAttribute' on the
22237 parameter argument.
22239 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22240 and cons_param_array_attribute (ConstructorInfo for
22241 ParamArrayAttribute).,
22243 * codegen.cs: Emit the return using the `Return' statement, that
22244 way we can report the error correctly for missing return values.
22246 * class.cs (Method.Emit): Clean up.
22248 * expression.cs (Argument.Resolve): Take another argument: the
22249 location where this argument is used. Notice that this is not
22250 part of the "Argument" class as to reduce the size of the
22251 structure (we know the approximate location anyways).
22253 Test if the argument is a variable-reference, if not, then
22254 complain with a 206.
22256 (Argument.Emit): Emit addresses of variables.
22258 (Argument.FullDesc): Simplify.
22260 (Invocation.DoResolve): Update for Argument.Resolve.
22262 (ElementAccess.DoResolve): ditto.
22264 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22265 method should be virtual, as this method is always virtual.
22267 (NewDelegate.DoResolve): Update for Argument.Resolve.
22269 * class.cs (ConstructorInitializer.DoResolve): ditto.
22271 * attribute.cs (Attribute.Resolve): ditto.
22273 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22275 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22277 * expression.cs (ParameterReference): Drop IStackStorage and implement
22278 IAssignMethod instead.
22280 (LocalVariableReference): ditto.
22282 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22283 IAssignMethod instead.
22285 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22287 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22288 enumerations that are used in heavily used structures derive from
22289 byte in a laughable and pathetic attempt to reduce memory usage.
22290 This is the kind of pre-optimzations that you should not do at
22291 home without adult supervision.
22293 * expression.cs (UnaryMutator): New class, used to handle ++ and
22294 -- separatedly from the other unary operators. Cleans up the
22295 code, and kills the ExpressionStatement dependency in Unary.
22297 (Unary): Removed `method' and `Arguments' from this class, making
22298 it smaller, and moving it all to SimpleCall, so I can reuse this
22299 code in other locations and avoid creating a lot of transient data
22300 strucutres when not required.
22302 * cs-parser.jay: Adjust for new changes.
22304 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22306 * enum.cs (Enum.Populate): If there is a failure during
22309 * cs-parser.jay (opt_enum_base): we used to catch type errors
22310 here, but this is really incorrect. The type error should be
22311 catched during semantic analysis.
22313 2001-12-11 Ravi Pratap <ravi@ximian.com>
22315 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22316 current_local_parameters as expected since I, in my stupidity, had forgotten
22319 * attribute.cs (GetValidPlaces): Fix stupid bug.
22321 * class.cs (Method::Emit): Perform check on applicability of attributes.
22323 (Constructor::Emit): Ditto.
22325 (Field::Emit): Ditto.
22327 (Field.Location): Store location information.
22329 (Property, Event, Indexer, Operator): Ditto.
22331 * cs-parser.jay (field_declaration): Pass in location for each field.
22333 * ../errors/cs0592.cs : Add.
22335 2001-11-12 Ravi Pratap <ravi@ximian.com>
22337 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22339 (InitCoreTypes): Update accordingly.
22341 (RegisterAttrType, LookupAttr): Implement.
22343 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22344 info about the same.
22346 (Resolve): Update to populate the above as necessary.
22348 (Error592): Helper.
22350 (GetValidPlaces): Helper to the above.
22352 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22354 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22356 2001-11-12 Ravi Pratap <ravi@ximian.com>
22358 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22360 * ../errors/cs0617.cs : Add.
22362 2001-11-11 Ravi Pratap <ravi@ximian.com>
22364 * enum.cs (Emit): Rename to Populate to be more consistent with what
22365 we expect it to do and when exactly it is called.
22367 * class.cs, rootcontext.cs : Update accordingly.
22369 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22370 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22372 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22374 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22375 of a fieldinfo using the above, when dealing with a FieldBuilder.
22377 2001-11-10 Ravi Pratap <ravi@ximian.com>
22379 * ../errors/cs0031.cs : Add.
22381 * ../errors/cs1008.cs : Add.
22383 * ../errrors/cs0543.cs : Add.
22385 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22388 (FindMembers): Implement.
22390 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22391 enums and delegates too.
22393 (enum_types): Rename to builder_to_enum.
22395 (delegate_types): Rename to builder_to_delegate.
22397 * delegate.cs (FindMembers): Implement.
22399 2001-11-09 Ravi Pratap <ravi@ximian.com>
22401 * typemanager.cs (IsEnumType): Implement.
22403 * enum.cs (Emit): Re-write parts to account for the underlying type
22404 better and perform checking etc.
22406 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22407 of the underlying type.
22409 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22412 * enum.cs (error31): Helper to report error #31.
22414 * cs-parser.jay (enum_declaration): Store location of each member too.
22416 * enum.cs (member_to_location): New hashtable.
22418 (AddEnumMember): Update location hashtable.
22420 (Emit): Use the location of each member while reporting errors.
22422 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22424 * cs-parser.jay: A for_initializer if is a
22425 local_variable_declaration really ammount to have an implicit
22426 block with the variable declaration and no initializer for for.
22428 * statement.cs (For.Emit): Cope with null initializers.
22430 This fixes the infinite loop on for initializers.
22432 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22434 * enum.cs: More cleanup.
22436 * ecore.cs: Remove dead code.
22438 * class.cs (Property.Emit): More simplification.
22439 (Event.Emit): ditto.
22441 Reworked to have less levels of indentation.
22443 2001-11-08 Ravi Pratap <ravi@ximian.com>
22445 * class.cs (Property): Emit attributes.
22455 * enum.cs (Emit): Ditto.
22457 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22460 * class.cs (Field, Event, etc.): Move attribute generation into the
22461 Emit method everywhere.
22463 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22464 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22465 as we had no way of defining nested enums !
22467 * rootcontext.cs : Adjust code accordingly.
22469 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22471 2001-11-07 Ravi Pratap <ravi@ximian.com>
22473 * expression.cs (EvalConstantExpression): Move into ecore.cs
22475 * enum.cs (Enum): Rename some members and make them public and readonly
22476 according to our convention.
22478 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22481 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22483 (Enum::Emit): Write a simple version for now which doesn't try to compute
22484 expressions. I shall modify this to be more robust in just a while.
22486 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22488 (TypeContainer::CloseType): Create the Enum types too.
22490 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22492 * expression.cs (EvalConstantExpression): Get rid of completely.
22494 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22495 user-defined values and other cases.
22497 (IsValidEnumLiteral): Helper function.
22499 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22500 out there in the case we had a literal FieldExpr.
22502 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22504 (Literalize): Revamp a bit to take two arguments.
22506 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22508 2001-11-06 Ravi Pratap <ravi@ximian.com>
22510 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22512 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22514 (Resolve): Use the above to ensure we have proper initializers.
22516 2001-11-05 Ravi Pratap <ravi@ximian.com>
22518 * expression.cs (Expression::EvalConstantExpression): New method to
22519 evaluate constant expressions.
22521 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22523 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22525 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22528 (Binary.ResolveOperator): Handle operator != (object a, object b)
22529 and operator == (object a, object b);
22531 (Binary.DoNumericPromotions): Indicate whether the numeric
22532 promotion was possible.
22534 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22537 Made the ArrayAccess implement interface IAssignMethod instead of
22538 IStackStore as the order in which arguments are passed reflects
22541 * assign.cs: Instead of using expr.ExprClass to select the way of
22542 assinging, probe for the IStackStore/IAssignMethod interfaces.
22544 * typemanager.cs: Load InitializeArray definition.
22546 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22547 static data that can be used to initialize arrays.
22549 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22551 * expression.cs: Handle operator== and operator!= for booleans.
22553 (Conditioal.Reduce): Implement reducer for the ?: operator.
22555 (Conditional.Resolve): Implement dead code elimination.
22557 (Binary.Resolve): Catch string literals and return a new
22558 concatenated string.
22560 (Unary.Reduce): Implement reduction of unary expressions.
22562 * ecore.cs: Split out the expression core handling here.
22564 (Expression.Reduce): New method used to perform constant folding
22565 and CSE. This is needed to support constant-expressions.
22567 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22568 targets, and optimize for !x.
22570 2001-11-04 Ravi Pratap <ravi@ximian.com>
22572 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22573 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22574 set custom atttributes.
22576 * literal.cs (Literal::GetValue): New abstract method to return the actual
22577 value of the literal, cast as an object.
22579 (*Literal): Implement GetValue method.
22581 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22582 expressions to the arraylist but objects of type Argument.
22584 * class.cs (TypeContainer::Emit): Emit our attributes too.
22586 (Method::Emit, Constructor::Emit): Ditto.
22588 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22589 to be ignoring earlier.
22591 2001-11-03 Ravi Pratap <ravi@ximian.com>
22593 * attribute.cs (AttributeSection::Define): Implement to do the business
22594 of constructing a CustomAttributeBuilder.
22596 (Attribute): New trivial class. Increases readability of code.
22598 * cs-parser.jay : Update accordingly.
22600 (positional_argument_list, named_argument_list, named_argument): New rules
22602 (attribute_arguments): Use the above so that we are more correct.
22604 2001-11-02 Ravi Pratap <ravi@ximian.com>
22606 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22607 to perform all checks for a method with a params parameter.
22609 (Invocation::OverloadResolve): Update to use the above method and therefore
22610 cope correctly with params method invocations.
22612 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22615 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22616 constructors in our parent too because we can't afford to miss out on
22619 * attribute.cs (AttributeSection): New name for the class Attribute
22621 Other trivial changes to improve readability.
22623 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22624 use the new class names.
22626 2001-11-01 Ravi Pratap <ravi@ximian.com>
22628 * class.cs (Method::Define): Complete definition for params types too
22630 (Indexer::Define): Ditto.
22632 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22633 Cope everywhere with a request for info about the array parameter.
22635 2001-11-01 Ravi Pratap <ravi@ximian.com>
22637 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22639 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22640 local_variable_type to extract the string corresponding to the type.
22642 (local_variable_type): Fixup the action to use the new helper method.
22644 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22647 * expression.cs : Clean out code which uses the above.
22649 2001-10-31 Ravi Pratap <ravi@ximian.com>
22651 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22652 and bale out if necessary by returning a false.
22654 (RegisterProperty): Ditto.
22656 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22657 and print out appropriate error messages.
22659 * interface.cs (everywhere): Ditto.
22661 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22662 location to constructor.
22664 * class.cs (Property, Event, Indexer): Update accordingly.
22666 * ../errors/cs111.cs : Added.
22668 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22669 of a method, as laid down by the spec.
22671 (Invocation::OverloadResolve): Use the above method.
22673 2001-10-31 Ravi Pratap <ravi@ximian.com>
22675 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22676 now take a TypeContainer and a Parameters object.
22678 (ParameterData): Modify return type of ParameterModifier method to be
22679 Parameter.Modifier and not a string.
22681 (ReflectionParameters, InternalParameters): Update accordingly.
22683 * expression.cs (Argument::GetParameterModifier): Same here.
22685 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22686 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22687 symbol in it at all so maybe this is only for now.
22689 2001-10-30 Ravi Pratap <ravi@ximian.com>
22691 * support.cs (InternalParameters): Constructor now takes an extra argument
22692 which is the actual Parameters class.
22694 (ParameterDesc): Update to provide info on ref/out modifiers.
22696 * class.cs (everywhere): Update call to InternalParameters to pass in
22697 the second argument too.
22699 * support.cs (ParameterData): Add ParameterModifier, which is a method
22700 to return the modifier info [ref/out etc]
22702 (InternalParameters, ReflectionParameters): Implement the above.
22704 * expression.cs (Argument::ParameterModifier): Similar function to return
22705 info about the argument's modifiers.
22707 (Invocation::OverloadResolve): Update to take into account matching modifiers
22710 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22711 a new SetFormalParameters object which we pass to InternalParameters.
22713 2001-10-30 Ravi Pratap <ravi@ximian.com>
22715 * expression.cs (NewArray): Merge into the ArrayCreation class.
22717 2001-10-29 Ravi Pratap <ravi@ximian.com>
22719 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22720 NewUserdefinedArray into one as there wasn't much of a use in having
22723 * expression.cs (Argument): Change field's name to ArgType from Type.
22725 (Type): New readonly property which returns the proper type, taking into
22726 account ref/out modifiers.
22728 (everywhere): Adjust code accordingly for the above.
22730 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22731 whether we are emitting for a ref or out parameter.
22733 * expression.cs (Argument::Emit): Use the above field to set the state.
22735 (LocalVariableReference::Emit): Update to honour the flag and emit the
22738 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22740 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22742 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22744 (ReflectionParameters, InternalParameters): Implement the above method.
22746 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22749 (Invocation::FullMethodDesc): Ditto.
22751 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22753 * cs-parser.jay: Add extra production for the second form of array
22756 * expression.cs (ArrayCreation): Update to reflect the above
22759 * Small changes to prepare for Array initialization.
22761 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22763 * typemanager.cs (ImplementsInterface): interface might be null;
22764 Deal with this problem;
22766 Also, we do store negative hits on the cache (null values), so use
22767 this instead of calling t.GetInterfaces on the type everytime.
22769 2001-10-28 Ravi Pratap <ravi@ximian.com>
22771 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22773 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22774 split functionality out into different classes.
22776 (New::FormArrayType): Move into NewBuiltinArray.
22778 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22781 (NewBuiltinArray): New class to handle creation of built-in arrays.
22783 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22784 account creation of one-dimensional arrays.
22786 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22788 (NewUserdefinedArray::DoResolve): Implement.
22790 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22792 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22793 we maintain inside the TypeManager. This is necessary to perform lookups on the
22796 (LookupType): Update to perform GetType on the module builders too.
22798 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22800 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22802 2001-10-23 Ravi Pratap <ravi@ximian.com>
22804 * expression.cs (New::DoResolve): Implement guts of array creation.
22806 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22808 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22810 * expression.cs: Fix bug I introduced lsat night that broke
22813 (Expression.Resolve): Report a 246 error (can not resolve name)
22814 if we find a SimpleName in the stream.
22816 (Expression.ResolveLValue): Ditto.
22818 (Expression.ResolveWithSimpleName): This function is a variant of
22819 ResolveName, this one allows SimpleNames to be returned without a
22820 warning. The only consumer of SimpleNames is MemberAccess
22822 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22824 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22825 might arrive here. I have my doubts that this is correct.
22827 * statement.cs (Lock): Implement lock statement.
22829 * cs-parser.jay: Small fixes to support `lock' and `using'
22831 * cs-tokenizer.cs: Remove extra space
22833 * driver.cs: New flag --checked, allows to turn on integer math
22836 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22837 Threading.Monitor.Exit
22839 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22841 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22842 Expression Class to be IndexerAccess.
22844 Notice that Indexer::DoResolve sets the eclass to Value.
22846 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22848 * class.cs (TypeContainer::Emit): Emit code for indexers.
22850 * assign.cs (IAssignMethod): New interface implemented by Indexers
22851 and Properties for handling assignment.
22853 (Assign::Emit): Simplify and reuse code.
22855 * expression.cs (IndexerAccess, PropertyExpr): Implement
22856 IAssignMethod, clean up old code.
22858 2001-10-22 Ravi Pratap <ravi@ximian.com>
22860 * typemanager.cs (ImplementsInterface): New method to determine if a type
22861 implements a given interface. Provides a nice cache too.
22863 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22866 (ConvertReferenceExplicit): Ditto.
22868 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22869 various methods, with correct names etc.
22871 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22872 Operator.UnaryNegation.
22874 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22875 we have a unary plus or minus operator.
22877 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22880 * everywhere : update accordingly.
22882 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22885 * class.cs (Method::Define): For the case where we are implementing a method
22886 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22887 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22889 2001-10-21 Ravi Pratap <ravi@ximian.com>
22891 * interface.cs (FindMembers): Implement to work around S.R.E
22894 * typemanager.cs (IsInterfaceType): Implement.
22896 (FindMembers): Update to handle interface types too.
22898 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22899 use IsAssignableFrom as that is not correct - it doesn't work.
22901 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22902 and accordingly override EmitStatement.
22904 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22905 using the correct logic :-)
22907 2001-10-19 Ravi Pratap <ravi@ximian.com>
22909 * ../errors/cs-11.cs : Add to demonstrate error -11
22911 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22913 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22914 then pass this as a hint to ResolveLValue.
22916 * expression.cs (FieldExpr): Add Location information
22918 (FieldExpr::LValueResolve): Report assignment to readonly
22921 (Expression::ExprClassFromMemberInfo): Pass location information.
22923 (Expression::ResolveLValue): Add new method that resolves an
22926 (Expression::DoResolveLValue): Default invocation calls
22929 (Indexers): New class used to keep track of indexers in a given
22932 (IStackStore): Renamed from LValue, as it did not really describe
22933 what this did. Also ResolveLValue is gone from this interface and
22934 now is part of Expression.
22936 (ElementAccess): Depending on the element access type
22938 * typemanager.cs: Add `indexer_name_type' as a Core type
22939 (System.Runtime.CompilerServices.IndexerNameAttribute)
22941 * statement.cs (Goto): Take a location.
22943 2001-10-18 Ravi Pratap <ravi@ximian.com>
22945 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22946 if two delegates are compatible.
22948 (NewDelegate::DoResolve): Update to take care of the case when
22949 we instantiate a delegate from another delegate.
22951 * typemanager.cs (FindMembers): Don't even try to look up members
22952 of Delegate types for now.
22954 2001-10-18 Ravi Pratap <ravi@ximian.com>
22956 * delegate.cs (NewDelegate): New class to take care of delegate
22959 * expression.cs (New): Split the delegate related code out into
22960 the NewDelegate class.
22962 * delegate.cs (DelegateInvocation): New class to handle delegate
22965 * expression.cs (Invocation): Split out delegate related code into
22966 the DelegateInvocation class.
22968 2001-10-17 Ravi Pratap <ravi@ximian.com>
22970 * expression.cs (New::DoResolve): Implement delegate creation fully
22971 and according to the spec.
22973 (New::DoEmit): Update to handle delegates differently.
22975 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22976 because of which we were printing out arguments in reverse order !
22978 * delegate.cs (VerifyMethod): Implement to check if the given method
22979 matches the delegate.
22981 (FullDelegateDesc): Implement.
22983 (VerifyApplicability): Implement.
22985 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22986 delegate invocations too.
22988 (Invocation::Emit): Ditto.
22990 * ../errors/cs1593.cs : Added.
22992 * ../errors/cs1594.cs : Added.
22994 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22996 2001-10-16 Ravi Pratap <ravi@ximian.com>
22998 * typemanager.cs (intptr_type): Core type for System.IntPtr
23000 (InitCoreTypes): Update for the same.
23002 (iasyncresult_type, asynccallback_type): Ditto.
23004 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23007 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23010 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23011 the builders for the 4 members of a delegate type :-)
23013 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23016 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23018 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23020 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23022 * statement.cs (Break::Emit): Implement.
23023 (Continue::Emit): Implement.
23025 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23026 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23027 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23028 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23031 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23032 properties that track the label for the current loop (begin of the
23033 loop and end of the loop).
23035 2001-10-15 Ravi Pratap <ravi@ximian.com>
23037 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23038 use of emitting anything at all.
23040 * class.cs, rootcontext.cs : Get rid of calls to the same.
23042 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23044 (Populate): Define the constructor correctly and set the implementation
23047 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23050 (AddDelegateType): Implement.
23052 (IsDelegateType): Implement helper method.
23054 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23056 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23057 and accordingly handle it.
23059 * delegate.cs (Populate): Take TypeContainer argument.
23060 Implement bits to define the Invoke method. However, I still haven't figured out
23061 how to take care of the native int bit :-(
23063 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23064 Qualify the name of the delegate, not its return type !
23066 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23069 (StandardConversionExists): Checking for array types turns out to be recursive.
23071 (ConvertReferenceExplicit): Implement array conversion.
23073 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23075 2001-10-12 Ravi Pratap <ravi@ximian.com>
23077 * cs-parser.jay (delegate_declaration): Store the fully qualified
23078 name as it is a type declaration.
23080 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23083 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23084 as TypeContainer::DefineType.
23086 (Populate): Method in which all the definition of the various methods (Invoke)
23089 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23092 (CloseDelegate): Finally creates the delegate.
23094 * class.cs (TypeContainer::DefineType): Update to define delegates.
23095 (Populate, Emit and CloseType): Do the same thing here too.
23097 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23098 delegates in all these operations.
23100 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23102 * expression.cs: LocalTemporary: a new expression used to
23103 reference a temporary that has been created.
23105 * assign.cs: Handle PropertyAccess back here, so that we can
23106 provide the proper semantic access to properties.
23108 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23109 a few more explicit conversions.
23111 * modifiers.cs: `NEW' modifier maps to HideBySig.
23113 * expression.cs (PropertyExpr): Make this into an
23114 ExpressionStatement, and support the EmitStatement code path.
23116 Perform get/set error checking, clean up the interface.
23118 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23119 them into toplevel access objects.
23121 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23123 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23126 * typemanager.cs: Keep track here of our PropertyBuilders again to
23127 work around lameness in SRE.
23129 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23131 * expression.cs (LValue::LValueResolve): New method in the
23132 interface, used to perform a second resolution pass for LValues.
23134 (This::DoResolve): Catch the use of this in static methods.
23136 (This::LValueResolve): Implement.
23138 (This::Store): Remove warning, assigning to `this' in structures
23141 (Invocation::Emit): Deal with invocation of
23142 methods on value types. We need to pass the address to structure
23143 methods rather than the object itself. (The equivalent code to
23144 emit "this" for structures leaves the entire structure on the
23145 stack instead of a pointer to it).
23147 (ParameterReference::DoResolve): Compute the real index for the
23148 argument based on whether the method takes or not a `this' pointer
23149 (ie, the method is static).
23151 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23152 value types returned from functions when we need to invoke a
23153 method on the sturcture.
23156 2001-10-11 Ravi Pratap <ravi@ximian.com>
23158 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23159 defining the type in the Modulebuilder or Typebuilder. This is to take
23160 care of nested types which need to be defined on the TypeBuilder using
23161 DefineNestedMethod.
23163 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23164 methods in RootContext, only ported to be part of TypeContainer.
23166 (TypeContainer::GetInterfaceOrClass): Ditto.
23168 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23170 * interface.cs (Interface::DefineInterface): New method. Does exactly
23171 what RootContext.CreateInterface did earlier, only it takes care of nested types
23174 (Interface::GetInterfaces): Move from RootContext here and port.
23176 (Interface::GetInterfaceByName): Same here.
23178 * rootcontext.cs (ResolveTree): Re-write.
23180 (PopulateTypes): Re-write.
23182 * class.cs (TypeContainer::Populate): Populate nested types too.
23183 (TypeContainer::Emit): Emit nested members too.
23185 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23186 instead just use the name argument passed in as it is already fully
23189 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23190 to TypeContainer mapping to see if a type is user-defined.
23192 * class.cs (TypeContainer::CloseType): Implement.
23194 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23195 the default constructor.
23197 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23200 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23202 * interface.cs (CloseType): Create the type here.
23204 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23207 Remove all the methods which are now in TypeContainer.
23209 2001-10-10 Ravi Pratap <ravi@ximian.com>
23211 * delegate.cs (Define): Re-write bits to define the delegate
23214 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23216 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23218 * expression.cs (ImplicitReferenceConversion): handle null as well
23219 as a source to convert to any reference type.
23221 * statement.cs (Return): Perform any implicit conversions to
23222 expected return type.
23224 Validate use of return statement.
23226 * codegen.cs (EmitContext): Pass the expected return type here.
23228 * class.cs (Method, Constructor, Property): Pass expected return
23229 type to EmitContext.
23231 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23233 * expression.cs: Make DoResolve take an EmitContext instead of a
23236 Replaced `l' and `location' for `loc', for consistency.
23238 (Error, Warning): Remove unneeded Tc argument.
23240 * assign.cs, literal.cs, constant.cs: Update to new calling
23243 * codegen.cs: EmitContext now contains a flag indicating whether
23244 code is being generated in a static method or not.
23246 * cs-parser.jay: DecomposeQI, new function that replaces the old
23247 QualifiedIdentifier. Now we always decompose the assembled
23248 strings from qualified_identifier productions into a group of
23251 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23253 * rootcontext.cs: Deal with field-less struct types correctly now
23254 by passing the size option to Define Type.
23256 * class.cs: Removed hack that created one static field.
23258 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23260 * statement.cs: Moved most of the code generation here.
23262 2001-10-09 Ravi Pratap <ravi@ximian.com>
23264 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23267 (ElementAccess): Remove useless bits for now - keep checks as the spec
23270 2001-10-08 Ravi Pratap <ravi@ximian.com>
23272 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23273 and start performing checks according to the spec.
23275 2001-10-07 Ravi Pratap <ravi@ximian.com>
23277 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23278 rank_specifiers instead.
23280 (rank_specifiers): Change the order in which the rank specifiers are stored
23282 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23284 * expression.cs (ElementAccess): Implement the LValue interface too.
23286 2001-10-06 Ravi Pratap <ravi@ximian.com>
23288 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23289 except that user defined conversions are not included.
23291 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23292 perform the conversion of the return type, if necessary.
23294 (New::DoResolve): Check whether we are creating an array or an object
23295 and accordingly do the needful.
23297 (New::Emit): Same here.
23299 (New::DoResolve): Implement guts of array creation.
23301 (New::FormLookupType): Helper function.
23303 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23305 * codegen.cs: Removed most of the code generation here, and move the
23306 corresponding code generation bits to the statement classes.
23308 Added support for try/catch/finalize and throw.
23310 * cs-parser.jay: Added support for try/catch/finalize.
23312 * class.cs: Catch static methods having the flags override,
23313 virtual or abstract.
23315 * expression.cs (UserCast): This user cast was not really doing
23316 what it was supposed to do. Which is to be born in fully resolved
23317 state. Parts of the resolution were being performed at Emit time!
23321 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23323 * expression.cs: Implicity convert the result from UserCast.
23325 2001-10-05 Ravi Pratap <ravi@ximian.com>
23327 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23328 prevented it from working correctly.
23330 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23331 merely ConvertImplicit.
23333 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23335 * typemanager.cs: Make the LookupTypeContainer function static,
23336 and not per-instance.
23338 * class.cs: Make static FindMembers (the one that takes a Type
23341 * codegen.cs: Add EmitForeach here.
23343 * cs-parser.jay: Make foreach a toplevel object instead of the
23344 inline expansion, as we need to perform semantic analysis on it.
23346 2001-10-05 Ravi Pratap <ravi@ximian.com>
23348 * expression.cs (Expression::ImplicitUserConversion): Rename to
23349 UserDefinedConversion.
23351 (Expression::UserDefinedConversion): Take an extra argument specifying
23352 whether we look for explicit user conversions too.
23354 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23356 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23358 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23359 with the appropriate arguments.
23361 * cs-parser.jay (cast_expression): Record location too.
23363 * expression.cs (Cast): Record location info.
23365 (Expression::ConvertExplicit): Take location argument.
23367 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23368 to determine if we are doing explicit conversions.
23370 (UserCast::Emit): Update accordingly.
23372 (Expression::ConvertExplicit): Report an error if everything fails.
23374 * ../errors/cs0030.cs : Add.
23376 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23378 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23379 virtual and newslot bits.
23381 * class.cs (TypeContainer::RegisterRequiredImplementations):
23382 Record methods we need.
23384 (TypeContainer::MakeKey): Helper function to make keys for
23385 MethodBases, since the Methodbase key is useless.
23387 (TypeContainer::Populate): Call RegisterRequiredImplementations
23388 before defining the methods.
23390 Create a mapping for method_builders_to_methods ahead of time
23391 instead of inside a tight loop.
23393 (::RequireMethods): Accept an object as the data to set into the
23394 hashtable so we can report interface vs abstract method mismatch.
23396 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23398 * report.cs: Make all of it static.
23400 * rootcontext.cs: Drop object_type and value_type computations, as
23401 we have those in the TypeManager anyways.
23403 Drop report instance variable too, now it is a global.
23405 * driver.cs: Use try/catch on command line handling.
23407 Add --probe option to debug the error reporting system with a test
23410 * report.cs: Add support for exiting program when a probe
23411 condition is reached.
23413 2001-10-03 Ravi Pratap <ravi@ximian.com>
23415 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23416 we do a forcible conversion regardless of type, to check if
23417 ForceConversion returns a null.
23419 (Binary::error19): Use location to report error.
23421 (Unary::error23): Use location here too.
23423 * ../errors/cs0019.cs : Check in.
23425 * ../errors/cs0023.cs : Check in.
23427 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23428 case of a non-null MethodInfo object with a length of 0 !
23430 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23431 an applicable member - according to the spec :-)
23432 Also fix logic to find members in base types.
23434 (Unary::ResolveOperator): Same here.
23436 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23437 as I was getting thoroughly confused between this and error19 :-)
23439 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23440 (::FindMostEncompassedType): Implement.
23441 (::FindMostEncompassingType): Implement.
23442 (::StandardConversionExists): Implement.
23444 (UserImplicitCast): Re-vamp. We now need info about most specific
23445 source and target types so that we can do the necessary conversions.
23447 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23448 mathematical union with no duplicates.
23450 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23452 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23453 in order from base classes to child classes, so that we can in
23454 child classes look up in our parent for method names and
23455 attributes (required for handling abstract, virtual, new, override
23456 constructs: we need to instrospect our base class, and if we dont
23457 populate the classes in order, the introspection might be
23458 incorrect. For example, a method could query its parent before
23459 the parent has any methods and would determine that the parent has
23460 no abstract methods (while it could have had them)).
23462 (RootContext::CreateType): Record the order in which we define the
23465 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23467 * class.cs (TypeContainer::Populate): Also method definitions can
23468 fail now, keep track of this.
23470 (TypeContainer::FindMembers): Implement support for
23471 DeclaredOnly/noDeclaredOnly flag.
23473 (Constructor::Emit) Return the ConstructorBuilder.
23475 (Method::Emit) Return the MethodBuilder.
23476 Check for abstract or virtual methods to be public.
23478 * rootcontext.cs (RootContext::CreateType): Register all the
23479 abstract methods required for the class to be complete and the
23480 interface methods that must be implemented.
23482 * cs-parser.jay: Report error 501 (method requires body if it is
23483 not marked abstract or extern).
23485 * expression.cs (TypeOf::Emit): Implement.
23487 * typemanager.cs: runtime_handle_type, new global type.
23489 * class.cs (Property::Emit): Generate code for properties.
23491 2001-10-02 Ravi Pratap <ravi@ximian.com>
23493 * expression.cs (Unary::ResolveOperator): Find operators on base type
23494 too - we now conform exactly to the spec.
23496 (Binary::ResolveOperator): Same here.
23498 * class.cs (Operator::Define): Fix minor quirk in the tests.
23500 * ../errors/cs0215.cs : Added.
23502 * ../errors/cs0556.cs : Added.
23504 * ../errors/cs0555.cs : Added.
23506 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23508 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23509 single integer which is really efficient
23511 2001-10-01 Ravi Pratap <ravi@ximian.com>
23513 * expression.cs (Expression::ImplicitUserConversion): Use location
23514 even in the case when we are examining True operators.
23516 * class.cs (Operator::Define): Perform extensive checks to conform
23517 with the rules for operator overloading in the spec.
23519 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23520 some of the other conversions mentioned in the spec.
23522 * typemanager.cs (array_type): New static member for the System.Array built-in
23525 (cloneable_interface): For System.ICloneable interface.
23527 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23528 we start resolving the tree and populating types.
23530 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23532 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23534 * expression.cs (Expression::ExprClassFromMemberInfo,
23535 Expression::Literalize): Create literal expressions from
23536 FieldInfos which are literals.
23538 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23539 type casts, because they were wrong. The test suite in tests
23542 (ImplicitNumericConversion): ushort to ulong requires a widening
23545 Int32 constant to long requires widening cast as well.
23547 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23548 for integers because the type on the stack is not i4.
23550 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23552 * expression.cs (report118): require location argument.
23554 * parameter.cs: Do not dereference potential null value.
23556 * class.cs: Catch methods that lack the `new' keyword when
23557 overriding a name. Report warnings when `new' is used without
23558 anything being there to override.
23560 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23562 * class.cs: Only add constructor to hashtable if it is non-null
23563 (as now constructors can fail on define).
23565 (TypeManager, Class, Struct): Take location arguments.
23567 Catch field instance initialization in structs as errors.
23569 accepting_filter: a new filter for FindMembers that is static so
23570 that we dont create an instance per invocation.
23572 (Constructor::Define): Catch errors where a struct constructor is
23575 * cs-parser.jay: Pass location information for various new
23578 * delegate.cs (Delegate): take a location argument.
23580 * driver.cs: Do not call EmitCode if there were problesm in the
23581 Definition of the types, as many Builders wont be there.
23583 * decl.cs (Decl::Decl): Require a location argument.
23585 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23586 into integers, and find the most appropiate integer for it.
23588 * literal.cs: Implement ULongLiteral.
23590 * rootcontext.cs: Provide better information about the location of
23591 failure when CreateType fails.
23593 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23595 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23598 * expression.cs (Binary::CheckShiftArguments): Add missing type
23600 (Binary::ResolveOperator): Add type to the logical and and logical
23601 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23604 (Binary::DoNumericPromotions): In the case where either argument
23605 is ulong (and most signed types combined with ulong cause an
23606 error) perform implicit integer constant conversions as well.
23608 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23610 * expression.cs (UserImplicitCast): Method should always be
23612 (Invocation::BetterConversion): Simplified test for IntLiteral.
23614 (Expression::ImplicitNumericConversion): Split this routine out.
23615 Put the code that performs implicit constant integer conversions
23618 (Expression::Resolve): Become a wrapper around DoResolve so we can
23619 check eclass and type being set after resolve.
23621 (Invocation::Badness): Remove this dead function
23623 (Binary::ResolveOperator): Do not compute the expensive argumnets
23624 unless we have a union for it.
23626 (Probe::Emit): Is needs to do an isinst and then
23627 compare against null.
23629 (::CanConvert): Added Location argument. If the Location argument
23630 is null (Location.Null), then we do not report errors. This is
23631 used by the `probe' mechanism of the Explicit conversion. We do
23632 not want to generate an error for something that the user
23633 explicitly requested to be casted. But the pipeline for an
23634 explicit cast first tests for potential implicit casts.
23636 So for now, if the Location is null, it means `Probe only' to
23637 avoid adding another argument. Might have to revise this
23640 (ClassCast): New class used to type cast objects into arbitrary
23641 classes (used in Explicit Reference Conversions).
23643 Implement `as' as well.
23645 Reverted all the patches from Ravi below: they were broken:
23647 * The use of `level' as a mechanism to stop recursive
23648 invocations is wrong. That was there just to catch the
23649 bug with a strack trace but not as a way of addressing
23652 To fix the problem we have to *understand* what is going
23653 on and the interactions and come up with a plan, not
23654 just get things going.
23656 * The use of the type conversion cache that I proposed
23657 last night had an open topic: How does this work across
23658 protection domains. A user defined conversion might not
23659 be public in the location where we are applying the
23660 conversion, a different conversion might be selected
23661 (ie, private A->B (better) but public B->A (worse),
23662 inside A, A->B applies, but outside it, B->A will
23665 * On top of that (ie, even if the above is solved),
23666 conversions in a cache need to be abstract. Ie, `To
23667 convert from an Int to a Short use an OpcodeCast', not
23668 `To convert from an Int to a Short use the OpcodeCast on
23669 the variable 5' (which is what this patch was doing).
23671 2001-09-28 Ravi Pratap <ravi@ximian.com>
23673 * expression.cs (Invocation::ConversionExists): Re-write to use
23674 the conversion cache
23676 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23677 cache all conversions done, not just user-defined ones.
23679 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23680 to determine if a conversion exists instead of acutually trying to
23681 perform the conversion. It's faster too.
23683 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23684 and only then attempt the implicit conversion.
23686 2001-09-28 Ravi Pratap <ravi@ximian.com>
23688 * expression.cs (ConvertImplicit): Use a cache for conversions
23689 already found. Check level of recursion and bail out if necessary.
23691 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23693 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23694 Export standard methods that we expect for string operations.
23696 * statement.cs (Block::UsageWarning): Track usage of variables and
23697 report the errors for not used variables.
23699 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23702 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23704 * codegen.cs: remove unnneded code
23706 * expression.cs: Removed BuiltinTypeAccess class
23708 Fix the order in which implicit conversions are
23711 The previous fixed dropped support for boxed conversions (adding a
23712 test to the test suite now)
23714 (UserImplicitCast::CanConvert): Remove test for source being null,
23715 that code is broken. We should not feed a null to begin with, if
23716 we do, then we should track the bug where the problem originates
23717 and not try to cover it up here.
23719 Return a resolved expression of type UserImplicitCast on success
23720 rather than true/false. Ravi: this is what I was talking about,
23721 the pattern is to use a static method as a "constructor" for
23724 Also, do not create arguments until the very last minute,
23725 otherwise we always create the arguments even for lookups that
23726 will never be performed.
23728 (UserImplicitCast::Resolve): Eliminate, objects of type
23729 UserImplicitCast are born in a fully resolved state.
23731 * typemanager.cs (InitCoreTypes): Init also value_type
23732 (System.ValueType).
23734 * expression.cs (Cast::Resolve): First resolve the child expression.
23736 (LValue): Add new method AddressOf to be used by
23739 Change the argument of Store to take an EmitContext instead of an
23740 ILGenerator, because things like FieldExpr need to be able to call
23741 their children expression to generate the instance code.
23743 (Expression::Error, Expression::Warning): Sugar functions for
23746 (Expression::MemberLookup): Accept a TypeContainer instead of a
23747 Report as the first argument.
23749 (Expression::ResolvePrimary): Killed. I still want to improve
23750 this as currently the code is just not right.
23752 (Expression::ResolveMemberAccess): Simplify, but it is still
23755 (Unary::Resolve): Catch errors in AddressOf operators.
23757 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23758 index to a byte for the short-version, or the compiler will choose
23759 the wrong Emit call, which generates the wrong data.
23761 (ParameterReference::Emit, ::Store): same.
23763 (FieldExpr::AddressOf): Implement.
23765 * typemanager.cs: TypeManager: made public variable instead of
23768 * driver.cs: document --fatal.
23770 * report.cs (ErrorMessage, WarningMessage): new names for the old
23771 Error and Warning classes.
23773 * cs-parser.jay (member_access): Turn built-in access to types
23774 into a normal simplename
23776 2001-09-27 Ravi Pratap <ravi@ximian.com>
23778 * expression.cs (Invocation::BetterConversion): Fix to cope
23779 with q being null, since this was introducing a bug.
23781 * expression.cs (ConvertImplicit): Do built-in conversions first.
23783 2001-09-27 Ravi Pratap <ravi@ximian.com>
23785 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23787 2001-09-27 Ravi Pratap <ravi@ximian.com>
23789 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23790 I had introduced long ago (what's new ?).
23792 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23793 the work of all the checking.
23794 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23795 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23797 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23798 that is the right way.
23800 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23801 overloading resolution. Use everywhere instead of cutting and pasting code.
23803 (Binary::ResolveOperator): Use MakeUnionSet.
23805 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23806 we have to convert to bool types. Not complete yet.
23808 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23810 * typemanager.cs (TypeManager::CSharpName): support ushort.
23812 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23813 to provide an expression that performsn an implicit constant int
23814 conversion (section 6.1.6).
23815 (Expression::ConvertImplicitRequired): Reworked to include
23816 implicit constant expression conversions.
23818 (Expression::ConvertNumericExplicit): Finished.
23820 (Invocation::Emit): If InstanceExpression is null, then it means
23821 that we perform a call on this.
23823 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23825 * expression.cs (Unary::Emit): Remove some dead code.
23826 (Probe): Implement Resolve and Emit for `is'.
23827 (Expression::ConvertImplicitRequired): Attempt to do constant
23828 expression conversions here. Maybe should be moved to
23829 ConvertImplicit, but I am not sure.
23830 (Expression::ImplicitLongConstantConversionPossible,
23831 Expression::ImplicitIntConstantConversionPossible): New functions
23832 that tell whether is it possible to apply an implicit constant
23833 expression conversion.
23835 (ConvertNumericExplicit): Started work on explicit numeric
23838 * cs-parser.jay: Update operator constants.
23840 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23841 (Parameters::GetSignature): Hook up VerifyArgs here.
23842 (Parameters::VerifyArgs): Verifies that no two arguments have the
23845 * class.cs (Operator): Update the operator names to reflect the
23846 ones that the spec expects (as we are just stringizing the
23849 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23850 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23851 previous usage did only work for our methods.
23852 (Expression::ConvertImplicit): Handle decimal implicit numeric
23853 conversions as well.
23854 (Expression::InternalTypeConstructor): Used to invoke constructors
23855 on internal types for default promotions.
23857 (Unary::Emit): Implement special handling for the pre/post
23858 increment/decrement for overloaded operators, as they need to have
23859 the same semantics as the other operators.
23861 (Binary::ResolveOperator): ditto.
23862 (Invocation::ConversionExists): ditto.
23863 (UserImplicitCast::Resolve): ditto.
23865 2001-09-26 Ravi Pratap <ravi@ximian.com>
23867 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23868 operator, return after emitting body. Regression tests pass again !
23870 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23871 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23872 (Invocation::OverloadResolve): Ditto.
23873 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23875 * everywhere : update calls to the above methods accordingly.
23877 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23879 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23881 * expression.cs (ExpressionStatement): New base class used for
23882 expressions that can appear in statements, so that we can provide
23883 an alternate path to generate expression that do not leave a value
23886 (Expression::Emit, and all the derivatives): We no longer return
23887 whether a value is left on the stack or not. Every expression
23888 after being emitted leaves a single value on the stack.
23890 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23891 facilties of ExpressionStatement if possible.
23893 * cs-parser.jay: Update statement_expression.
23895 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23897 * driver.cs: Change the wording of message
23899 2001-09-25 Ravi Pratap <ravi@ximian.com>
23901 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23902 the type of the expression to the return type of the method if
23903 we have an overloaded operator match ! The regression tests pass again !
23904 (Unary::ResolveOperator): Ditto.
23906 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23907 to find "op_Implicit", not "implicit" ;-)
23908 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23909 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23911 * everywhere : Correct calls to the above accordingly.
23913 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23914 (ConvertImplicit): Do user-defined conversion if it exists.
23916 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23918 * assign.cs: track location.
23919 (Resolve): Use implicit conversions on assignment.
23921 * literal.cs: Oops. Not good, Emit of short access values should
23922 pass (Bytes) or the wrong argument will be selected.
23924 * expression.cs (Unary::Emit): Emit code for -expr.
23926 (Unary::ResolveOperator): Handle `Substract' for non-constants
23927 (substract from zero from the non-constants).
23928 Deal with Doubles as well.
23930 (Expression::ConvertImplicitRequired): New routine that reports an
23931 error if no implicit conversion exists.
23933 (Invocation::OverloadResolve): Store the converted implicit
23934 expressions if we make them
23936 2001-09-24 Ravi Pratap <ravi@ximian.com>
23938 * class.cs (ConstructorInitializer): Take a Location argument.
23939 (ConstructorBaseInitializer): Same here.
23940 (ConstructorThisInitializer): Same here.
23942 * cs-parser.jay : Update all calls accordingly.
23944 * expression.cs (Unary, Binary, New): Take location argument.
23945 Update accordingly everywhere.
23947 * cs-parser.jay : Update all calls to the above to take a location
23950 * class.cs : Ditto.
23952 2001-09-24 Ravi Pratap <ravi@ximian.com>
23954 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23955 (Invocation::BetterConversion): Same here
23956 (Invocation::ConversionExists): Ditto.
23958 (Invocation::ConversionExists): Implement.
23960 2001-09-22 Ravi Pratap <ravi@ximian.com>
23962 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23963 Also take an additional TypeContainer argument.
23965 * All over : Pass in TypeContainer as argument to OverloadResolve.
23967 * typemanager.cs (CSharpName): Update to check for the string type and return
23970 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23973 2001-09-21 Ravi Pratap <ravi@ximian.com>
23975 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23976 (Invocation::BetterFunction): Implement.
23977 (Invocation::BetterConversion): Implement.
23978 (Invocation::ConversionExists): Skeleton, no implementation yet.
23980 Okay, things work fine !
23982 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23984 * typemanager.cs: declare and load enum_type, delegate_type and
23987 * expression.cs (Expression::Emit): Now emit returns a value that
23988 tells whether a value is left on the stack or not. This strategy
23989 might be reveted tomorrow with a mechanism that would address
23990 multiple assignments.
23991 (Expression::report118): Utility routine to report mismatches on
23994 (Unary::Report23): Report impossible type/operator combination
23997 (Unary::IsIncrementableNumber): Whether the type can be
23998 incremented or decremented with add.
23999 (Unary::ResolveOperator): Also allow enumerations to be bitwise
24001 (Unary::ResolveOperator): Implement ++, !, ~,
24003 (Invocation::Emit): Deal with new Emit convetion.
24005 * All Expression derivatives: Updated their Emit method to return
24006 whether they leave values on the stack or not.
24008 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24009 stack for expressions that are statements.
24011 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24013 * expression.cs (LValue): New interface. Must be implemented by
24015 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24018 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24019 interface for generating code, simplifies the code.
24021 2001-09-20 Ravi Pratap <ravi@ximian.com>
24023 * expression.cs (everywhere): Comment out return statements in ::Resolve
24024 methods to avoid the warnings.
24026 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24028 * driver.cs (parse): Report error 2001 if we can not open the
24031 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24034 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24037 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24038 otherwise nested blocks end up with the same index.
24040 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24042 * expression.cs: Instead of having FIXMEs in the Resolve
24043 functions, throw exceptions so it is obvious that we are facing a
24046 * cs-parser.jay (invocation_expression): Pass Location information.
24048 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24049 Use a basename for those routines because .NET does not like paths
24052 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24055 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24057 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24058 are loading the correct data types (throws an exception if not).
24059 (TypeManager::InitCoreTypes): Use CoreLookupType
24061 * expression.cs (Unary::ResolveOperator): return the child
24062 expression for expressions which are just +expr.
24063 (Unary::ResolveOperator): Return negative literals for -LITERAL
24064 expressions (otherwise they are Unary {Literal}).
24065 (Invocation::Badness): Take into account `Implicit constant
24066 expression conversions'.
24068 * literal.cs (LongLiteral): Implement long literal class.
24069 (IntLiteral): export the `Value' of the intliteral.
24071 2001-09-19 Ravi Pratap <ravi@ximian.com>
24073 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24075 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24076 instead of 'Operator'
24078 * expression.cs (Binary::ResolveOperator): Update accordingly.
24079 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24082 * cs-parser.jay (unary_expression): Update to use the new names.
24084 * gen-treedump.cs (GetUnary): Same here.
24086 * expression.cs (Unary::Resolve): Implement.
24087 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24088 operators are found instead of making noise ;-)
24089 (Unary::ResolveOperator): New method to do precisely the same thing which
24090 Binary::ResolveOperator does for Binary expressions.
24091 (Unary.method, .Arguments): Add.
24092 (Unary::OperName): Implement.
24093 (Unary::ForceConversion): Copy and Paste !
24095 * class.cs (Operator::Define): Fix a small bug for the case when we have
24098 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24099 for the inbuilt operators. Only overloading works for now ;-)
24101 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24103 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24104 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24106 * expression.cs (This::Emit): Implement.
24107 (This::Resolve): Implement.
24108 (TypeOf:Resolve): Implement.
24109 (Expression::ResolveSimpleName): Add an implicit this to instance
24111 (MemberAccess::Resolve): Deal with Parameters and Fields.
24112 Bind instance variable to Field expressions.
24113 (FieldExpr::Instance): New field used to track the expression that
24114 represents the object instance.
24115 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24117 (FieldExpr::Emit): Implement.
24119 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24120 the last instruction contains a return opcode to avoid generating
24121 the last `ret' instruction (this generates correct code, and it is
24122 nice to pass the peverify output).
24124 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24125 initializer for static and instance variables.
24126 (Constructor::Emit): Allow initializer to be null in the case of
24127 static constructors. Only emit initializer for instance
24130 (TypeContainer::FindMembers): Return a null array if there are no
24133 Also fix the code for the MemberTypes.Method branch, as it was not
24134 scanning that for operators (or tried to access null variables before).
24136 * assign.cs (Assign::Emit): Handle instance and static fields.
24140 * driver.cs: Stop compilation if there are parse errors.
24142 * cs-parser.jay (constructor_declaration): Provide default base
24143 initializer for non-static constructors.
24144 (constructor_declarator): Do not provide a default base
24145 initializers if none was specified.
24146 Catch the fact that constructors should not have parameters.
24148 * class.cs: Do not emit parent class initializers for static
24149 constructors, that should be flagged as an error.
24151 2001-09-18 Ravi Pratap <ravi@ximian.com>
24153 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24154 Move back code into TypeContainer::Populate.
24156 2001-09-18 Ravi Pratap <ravi@ximian.com>
24158 * class.cs (TypeContainer::AddConstructor): Fix the check to
24159 compare against Name, not Basename.
24160 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24162 * cs-parser.jay : Update accordingly.
24164 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24165 for methods, don't forget to look into the operators too.
24166 (RegisterMethodBuilder): Helper method to take care of this for
24167 methods, constructors and operators.
24168 (Operator::Define): Completely revamp.
24169 (Operator.OperatorMethod, MethodName): New fields.
24170 (TypeContainer::Populate): Move the registering of builders into
24171 RegisterMethodBuilder.
24172 (Operator::Emit): Re-write.
24174 * expression.cs (Binary::Emit): Comment out code path to emit method
24175 invocation stuff for the case when we have a user defined operator. I am
24176 just not able to get it right !
24178 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24180 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24183 (Expression::MemberLookup): Provide a version that allows to
24184 specify the MemberTypes and BindingFlags.
24186 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24187 so it was not fetching variable information from outer blocks.
24189 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24190 Beforefieldinit as it was buggy.
24192 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24193 that Ravi put here.
24195 * class.cs (Constructor::Emit): Only emit if block is not null.
24196 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24197 deal with this by semantically definining it as if the user had
24200 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24201 constructors as we now "emit" them at a higher level.
24203 (TypeContainer::DefineDefaultConstructor): Used to define the
24204 default constructors if none was provided.
24206 (ConstructorInitializer): Add methods Resolve and Emit.
24208 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24210 2001-09-17 Ravi Pratap <ravi@ximian.com>
24212 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24213 the default constructor builder with our hashtable for methodbuilders
24216 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24217 and argument_count is 0 in which case we have a match.
24218 (Binary::ResolveOperator): More null checking and miscellaneous coding
24221 2001-09-17 Ravi Pratap <ravi@ximian.com>
24223 * rootcontext.cs (IsNameSpace): Compare against null.
24225 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24227 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24228 and Unary::Operator.
24230 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24233 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24234 we have overloaded operators.
24235 (Binary::ResolveOperator): Implement the part which does the operator overload
24238 * class.cs (Operator::Emit): Implement.
24239 (TypeContainer::Emit): Emit the operators we have too.
24241 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24242 the case when we have a user-defined operator.
24244 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24246 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24248 2001-09-16 Ravi Pratap <ravi@ximian.com>
24250 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24251 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24252 (Constructor::Emit): Implement.
24253 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24254 if we have no work to do.
24255 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24258 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24259 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24261 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24264 2001-09-15 Ravi Pratap <ravi@ximian.com>
24266 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24268 (Tree::RecordNamespace): Method to do what the name says ;-)
24269 (Tree::Namespaces): Property to get at the namespaces hashtable.
24271 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24274 * rootcontext.cs (IsNamespace): Fixed it :-)
24276 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24278 * class.cs (TypeContainer::FindMembers): Add support for
24280 (MethodCore): New class that encapsulates both the shared aspects
24281 of a Constructor and a Method.
24282 (Method, Constructor): Factored pieces into MethodCore.
24284 * driver.cs: Added --fatal which makes errors throw exceptions.
24285 Load System assembly as well as part of the standard library.
24287 * report.cs: Allow throwing exceptions on errors for debugging.
24289 * modifiers.cs: Do not use `parent', instead use the real type
24290 container to evaluate permission settings.
24292 * class.cs: Put Ravi's patch back in. He is right, and we will
24293 have to cope with the
24295 2001-09-14 Ravi Pratap <ravi@ximian.com>
24297 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24298 FamORAssem, not FamANDAssem.
24300 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24302 * driver.cs: Added --parse option that only parses its input files
24305 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24306 incorrect. IsTopLevel is not used to tell whether an object is
24307 root_types or not (that can be achieved by testing this ==
24308 root_types). But to see if this is a top-level *class* (not
24309 necessarly our "toplevel" container).
24311 2001-09-14 Ravi Pratap <ravi@ximian.com>
24313 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24314 parent instead of a direct call to GetType.
24316 2001-09-14 Ravi Pratap <ravi@ximian.com>
24318 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24319 Modifiers.TypeAttr. This should just be a call to that method.
24321 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24322 object so that we can determine if we are top-level or not.
24324 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24327 * enum.cs (Enum::Define): Ditto.
24329 * modifiers.cs (FieldAttr): Re-write.
24331 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24332 (TypeContainer::HaveStaticConstructor): New property to provide access
24333 to precisely that info.
24335 * modifiers.cs (MethodAttr): Re-write.
24336 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24338 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24339 of top-level types as claimed.
24341 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24343 * expression.cs (MemberLookup): Fruitless attempt to lookup
24344 constructors. Maybe I need to emit default constructors? That
24345 might be it (currently .NET emits this for me automatically).
24346 (Invocation::OverloadResolve): Cope with Arguments == null.
24347 (Invocation::EmitArguments): new function, shared by the new
24348 constructor and us.
24349 (Invocation::Emit): Handle static and instance methods. Emit
24350 proper call instruction for virtual or non-virtual invocations.
24351 (New::Emit): Implement.
24352 (New::Resolve): Implement.
24353 (MemberAccess:Resolve): Implement.
24354 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24355 to track instances.
24356 (FieldExpr::Resolve): Set type.
24358 * support.cs: Handle empty arguments.
24360 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24361 SimpleLookup): Auxiliary routines to help parse a qualifier
24364 Update qualifier_identifier rule.
24366 * codegen.cs: Removed debugging messages.
24368 * class.cs: Make this a global thing, this acts just as a "key" to
24369 objects that we might have around.
24371 (Populate): Only initialize method_builders_to_methods once.
24373 * expression.cs (PropertyExpr): Initialize type from the
24376 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24377 Resolve pattern. Attempt to implicitly convert value to boolean.
24380 * expression.cs: Set the type for the int32/int32 argument case.
24381 (Binary::ResolveOperator): Set the return type to boolean for
24382 comparission operators
24384 * typemanager.cs: Remove debugging print code.
24386 (Invocation::Resolve): resolve type.
24388 * class.cs: Allocate a MemberInfo of the correct size, as the code
24389 elsewhere depends on the test to reflect the correct contents.
24391 (Method::) Keep track of parameters, due to System.Reflection holes
24393 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24396 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24397 of the exact size and return that.
24399 (Class::LookupMethodByBuilder): New function that maps
24400 MethodBuilders to its methods. Required to locate the information
24401 on methods because System.Reflection bit us again.
24403 * support.cs: New file, contains an interface ParameterData and
24404 two implementations: ReflectionParameters and InternalParameters
24405 used to access Parameter information. We will need to grow this
24408 * expression.cs (Invocation::GetParameterData): implement a cache
24409 and a wrapper around the ParameterData creation for methods.
24410 (Invocation::OverloadResolve): Use new code.
24412 2001-09-13 Ravi Pratap <ravi@ximian.com>
24414 * class.cs (TypeContainer::EmitField): Remove and move into
24415 (Field::Define): here and modify accordingly.
24416 (Field.FieldBuilder): New member.
24417 (TypeContainer::Populate): Update accordingly.
24418 (TypeContainer::FindMembers): Implement.
24420 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24422 * statement.cs: (VariableInfo::VariableType): New field to be
24423 initialized with the full type once it is resolved.
24425 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24427 * parameter.cs (GetParameterInfo): Use a type cache to compute
24428 things only once, and to reuse this information
24430 * expression.cs (LocalVariableReference::Emit): Implement.
24431 (OpcodeCast::Emit): fix.
24433 (ParameterReference::Resolve): Implement.
24434 (ParameterReference::Emit): Implement.
24436 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24437 that are expressions need to stay as Expressions.
24439 * typemanager.cs (CSharpName): Returns the C# name of a type if
24442 * expression.cs (Expression::ConvertImplicit): New function that
24443 implements implicit type conversions.
24445 (Expression::ImplicitReferenceConversion): Implements implicit
24446 reference conversions.
24448 (EmptyCast): New type for transparent casts.
24450 (OpcodeCast): New type for casts of types that are performed with
24451 a sequence of bytecodes.
24453 (BoxedCast): New type used for casting value types into reference
24454 types. Emits a box opcode.
24456 (Binary::DoNumericPromotions): Implements numeric promotions of
24457 and computation of the Binary::Type.
24459 (Binary::EmitBranchable): Optimization.
24461 (Binary::Emit): Implement code emission for expressions.
24463 * typemanager.cs (TypeManager): Added two new core types: sbyte
24466 2001-09-12 Ravi Pratap <ravi@ximian.com>
24468 * class.cs (TypeContainer::FindMembers): Method which does exactly
24469 what Type.FindMembers does, only we don't have to use reflection. No
24470 implementation yet.
24472 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24473 typecontainer objects as we need to get at them.
24474 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24476 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24477 typecontainer object.
24479 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24480 of just a Report object.
24482 2001-09-11 Ravi Pratap <ravi@ximian.com>
24484 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24486 (TypeContainer::Populate): Now define the delegates of the type too.
24487 (TypeContainer.Delegates): Property to access the list of delegates defined
24490 * delegates.cs (Delegate::Define): Implement partially.
24492 * modifiers.cs (TypeAttr): Handle more flags.
24494 2001-09-11 Ravi Pratap <ravi@ximian.com>
24496 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24498 (Operator::Define): Re-write logic to get types by using the LookupType method
24499 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24500 (Indexer::Define): Ditto.
24501 (Event::Define): Ditto.
24502 (Property::Define): Ditto.
24504 2001-09-10 Ravi Pratap <ravi@ximian.com>
24506 * class.cs (TypeContainer::Populate): Now define operators too.
24507 (TypeContainer.Operators): New property to access the list of operators
24509 (Operator.OperatorMethodBuilder): New member to hold the method builder
24510 for the operator we are defining.
24511 (Operator::Define): Implement.
24513 2001-09-10 Ravi Pratap <ravi@ximian.com>
24515 * class.cs (Event::Define): Make the prefixes of the accessor methods
24516 addOn_ and removeOn_
24518 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24519 of the location being passed in too. Ideally, this should go later since all
24520 error reporting should be done through the Report object.
24522 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24523 (Populate): Iterate thru the indexers we have and define them too.
24524 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24525 for the get and set accessors.
24526 (Indexer::Define): Implement.
24528 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24530 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24531 my previous implementation, did not work.
24533 * typemanager.cs: Add a couple of missing types (the longs).
24535 * literal.cs: Use TypeManager.bool_type instead of getting it.
24537 * expression.cs (EventExpr): New kind of expressions.
24538 (Expressio::ExprClassFromMemberInfo): finish
24540 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24542 * assign.cs: Emit stores to static fields differently.
24544 2001-09-08 Ravi Pratap <ravi@ximian.com>
24546 * Merge in changes and adjust code to tackle conflicts. Backed out my
24547 code in Assign::Resolve ;-)
24549 2001-09-08 Ravi Pratap <ravi@ximian.com>
24551 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24552 instead Report.Error and also pass in the location.
24553 (CSharpParser::Lexer): New readonly property to return the reference
24554 to the Tokenizer object.
24555 (declare_local_variables): Use Report.Error with location instead of plain
24559 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24560 (Operator.CheckBinaryOperator): Ditto.
24562 * cs-parser.jay (operator_declarator): Update accordingly.
24564 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24565 (CheckBinaryOperator): Same here.
24567 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24568 on the name without any prefixes of namespace names etc. This is because we
24569 already might have something already fully qualified like
24570 'System.Console.WriteLine'
24572 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24574 2001-09-07 Ravi Pratap <ravi@ximian.com>
24576 * cs-tokenizer.cs (location): Return a string which also contains
24579 * expression.cs (ElementAccess): New class for expressions of the
24580 type 'element access.'
24581 (BaseAccess): New class for expressions of the type 'base access.'
24582 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24585 * cs-parser.jay (element_access): Implement action.
24586 (base_access): Implement actions.
24587 (checked_expression, unchecked_expression): Implement.
24589 * cs-parser.jay (local_variable_type): Correct and implement.
24590 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24592 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24594 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24595 name and the specifiers.
24597 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24599 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24600 making them all public ;-)
24602 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24605 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24607 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24609 (FieldExpr, PropertyExprs): New resolved expressions.
24610 (SimpleName::MemberStaticCheck): Perform static checks for access
24611 to non-static fields on static methods. Maybe this should be
24612 generalized for MemberAccesses.
24613 (SimpleName::ResolveSimpleName): More work on simple name
24616 * cs-parser.jay (primary_expression/qualified_identifier): track
24617 the parameter index.
24619 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24620 (EmitContext::EmitBoolExpression): Chain to expression generation
24621 instead of temporary hack.
24622 (::EmitStatementExpression): Put generic expression code generation.
24624 * assign.cs (Assign::Emit): Implement variable assignments to
24625 local variables, parameters and fields.
24627 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24629 * statement.cs (Block::GetVariableInfo): New method, returns the
24630 VariableInfo for a variable name in a block.
24631 (Block::GetVariableType): Implement in terms of GetVariableInfo
24633 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24634 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24636 2001-09-06 Ravi Pratap <ravi@ximian.com>
24638 * cs-parser.jay (operator_declaration): Continue on my quest : update
24639 to take attributes argument.
24640 (event_declaration): Ditto.
24641 (enum_declaration): Ditto.
24642 (indexer_declaration): Ditto.
24644 * class.cs (Operator::Operator): Update constructor accordingly.
24645 (Event::Event): Ditto.
24647 * delegate.cs (Delegate::Delegate): Same here.
24649 * enum.cs (Enum::Enum): Same here.
24651 2001-09-05 Ravi Pratap <ravi@ximian.com>
24653 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24655 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24657 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24658 being passed around as an arraylist.
24659 (Attributes::AddAttribute): Method to add attribute sections.
24661 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24662 (struct_declaration): Update accordingly.
24663 (constant_declaration): Update.
24664 (field_declaration): Update.
24665 (method_header): Update.
24666 (fixed_parameter): Update.
24667 (parameter_array): Ditto.
24668 (property_declaration): Ditto.
24669 (destructor_declaration): Ditto.
24671 * class.cs (Struct::Struct): Update constructors accordingly.
24672 (Class::Class): Ditto.
24673 (Field::Field): Ditto.
24674 (Method::Method): Ditto.
24675 (Property::Property): Ditto.
24676 (TypeContainer::OptAttribute): update property's return type.
24678 * interface.cs (Interface.opt_attributes): New member.
24679 (Interface::Interface): Update to take the extra Attributes argument.
24681 * parameter.cs (Parameter::Parameter): Ditto.
24683 * constant.cs (Constant::Constant): Ditto.
24685 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24686 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24687 the attributes as a parameter.
24688 (InterfaceProperty): Update constructor call.
24689 (InterfaceEvent): Ditto.
24690 (InterfaceMethod): Ditto.
24691 (InterfaceIndexer): Ditto.
24693 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24694 pass the attributes too.
24695 (interface_event_declaration): Ditto.
24696 (interface_property_declaration): Ditto.
24697 (interface_method_declaration): Ditto.
24698 (interface_declaration): Ditto.
24700 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24702 * class.cs (Method::Define): Track the "static Main" definition to
24703 create an entry point.
24705 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24706 EntryPoint if we find it.
24708 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24709 (EmitContext::ig): Make this variable public.
24711 * driver.cs: Make the default output file be the first file name
24712 with the .exe extension.
24714 Detect empty compilations
24716 Handle various kinds of output targets. Handle --target and
24717 rename -t to --dumper.
24719 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24720 methods inherited from Expression return now an Expression. This
24721 will is used during the tree rewriting as we resolve them during
24724 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24725 the spec. Missing entirely is the information about
24726 accessability of elements of it.
24728 (Expression::ExprClassFromMemberInfo): New constructor for
24729 Expressions that creates a fully initialized Expression based on
24730 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24733 (Invocation::Resolve): Begin implementing resolution of invocations.
24735 * literal.cs (StringLiteral): Implement Emit.
24737 2001-09-05 Ravi Pratap <ravi@ximian.com>
24739 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24742 2001-09-04 Ravi Pratap <ravi@ximian.com>
24744 * cs-parser.jay (attribute_arguments): Implement actions.
24745 (attribute): Fix bug in production. Implement action.
24746 (attribute_list): Implement.
24747 (attribute_target): Implement.
24748 (attribute_target_specifier, opt_target_specifier): Implement
24749 (CheckAttributeTarget): New method to check if the attribute target
24751 (attribute_section): Implement.
24752 (opt_attributes): Implement.
24754 * attribute.cs : New file to handle attributes.
24755 (Attribute): Class to hold attribute info.
24757 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24758 (attribute_section): Modify production to use 2 different rules to
24759 achieve the same thing. 1 s/r conflict down !
24760 Clean out commented, useless, non-reducing dimension_separator rules.
24762 * class.cs (TypeContainer.attributes): New member to hold list
24763 of attributes for a type.
24764 (Struct::Struct): Modify to take one more argument, the attribute list.
24765 (Class::Class): Ditto.
24766 (Field::Field): Ditto.
24767 (Method::Method): Ditto.
24768 (Property::Property): Ditto.
24770 * cs-parser.jay (struct_declaration): Update constructor call to
24771 pass in the attributes too.
24772 (class_declaration): Ditto.
24773 (constant_declaration): Ditto.
24774 (field_declaration): Ditto.
24775 (method_header): Ditto.
24776 (fixed_parameter): Ditto.
24777 (parameter_array): Ditto.
24778 (property_declaration): Ditto.
24780 * constant.cs (Constant::Constant): Update constructor similarly.
24781 Use System.Collections.
24783 * parameter.cs (Parameter::Parameter): Update as above.
24785 2001-09-02 Ravi Pratap <ravi@ximian.com>
24787 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24788 (TypeContainer.delegates): New member to hold list of delegates.
24790 * cs-parser.jay (delegate_declaration): Implement the action correctly
24791 this time as I seem to be on crack ;-)
24793 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24795 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24796 tell whether an identifier represents a namespace.
24798 * expression.cs (NamespaceExpr): A namespace expression, used only
24799 temporarly during expression resolution.
24800 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24801 utility functions to resolve names on expressions.
24803 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24805 * codegen.cs: Add hook for StatementExpressions.
24807 * class.cs: Fix inverted test for static flag in methods.
24809 2001-09-02 Ravi Pratap <ravi@ximian.com>
24811 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24812 to make it coincide with MS' number.
24813 (Operator::CheckBinaryOperator): Ditto.
24815 * ../errors/errors.txt : Remove error numbers added earlier.
24817 * ../errors/cs1019.cs : Test case for error # 1019
24819 * ../errros/cs1020.cs : Test case for error # 1020
24821 * cs-parser.jay : Clean out commented cruft.
24822 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24823 used anywhere - non-reducing rule.
24824 (namespace_declarations): Non-reducing rule - comment out.
24826 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24827 with TypeContainer::AddEnum.
24829 * delegate.cs : New file for delegate handling classes.
24830 (Delegate): Class for declaring delegates.
24832 * makefile : Update.
24834 * cs-parser.jay (delegate_declaration): Implement.
24836 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24838 * class.cs (Event::Define): Implement.
24839 (Event.EventBuilder): New member.
24841 * class.cs (TypeContainer::Populate): Update to define all enums and events
24843 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24844 readonly fields for all these cases ?
24846 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24848 * class.cs (Property): Revamp to use the convention of making fields readonly.
24849 Accordingly modify code elsewhere.
24851 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24852 the Define method of the Property class.
24854 * class.cs : Clean up applied patch and update references to variables etc. Fix
24856 (TypeContainer::Populate): Update to define all the properties we have. Also
24857 define all enumerations.
24859 * enum.cs (Define): Implement.
24861 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24863 * cs-parser.jay (overloadable_operator): The semantic value is an
24864 enum of the Operator class.
24865 (operator_declarator): Implement actions.
24866 (operator_declaration): Implement.
24868 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24869 validity of definitions.
24870 (Operator::CheckBinaryOperator): Static method to check for binary operators
24871 (TypeContainer::AddOperator): New method to add an operator to a type.
24873 * cs-parser.jay (indexer_declaration): Added line to actually call the
24874 AddIndexer method so it gets added ;-)
24876 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24877 already taken care of by the MS compiler ?
24879 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24881 * class.cs (Operator): New class for operator declarations.
24882 (Operator::OpType): Enum for the various operators.
24884 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24886 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24887 ostensibly handle this in semantic analysis.
24889 * cs-parser.jay (general_catch_clause): Comment out
24890 (specific_catch_clauses, specific_catch_clause): Ditto.
24891 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24892 (catch_args, opt_catch_args): New productions.
24893 (catch_clause): Rewrite to use the new productions above
24894 (catch_clauses): Modify accordingly.
24895 (opt_catch_clauses): New production to use in try_statement
24896 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24897 and re-write the code in the actions to extract the specific and
24898 general catch clauses by being a little smart ;-)
24900 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24901 Hooray, try and catch statements parse fine !
24903 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24905 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24906 string from the hashtable of variables.
24908 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24909 I end up making that mistake ;-)
24910 (catch_clauses): Fixed gross error which made Key and Value of the
24911 DictionaryEntry the same : $1 !!
24913 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24915 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24917 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24918 when the add and remove accessors are specified.
24920 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24922 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24923 information about indexer_declarator.
24924 (indexer_declarator): Implement actions.
24925 (parsing_indexer): New local boolean used to keep track of whether
24926 we are parsing indexers or properties. This is necessary because
24927 implicit_parameters come into picture even for the get accessor in the
24928 case of an indexer.
24929 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24931 * class.cs (Indexer): New class for indexer declarations.
24932 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24933 (TypeContainer::indexers): New member to hold list of indexers for the
24936 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24938 * cs-parser.jay (add_accessor_declaration): Implement action.
24939 (remove_accessor_declaration): Implement action.
24940 (event_accessors_declaration): Implement
24941 (variable_declarators): swap statements for first rule - trivial.
24943 * class.cs (Event): New class to hold information about event
24945 (TypeContainer::AddEvent): New method to add an event to a type
24946 (TypeContainer::events): New member to hold list of events.
24948 * cs-parser.jay (event_declaration): Implement actions.
24950 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24952 * cs-parser.jay (dim_separators): Implement. Make it a string
24953 concatenating all the commas together, just as they appear.
24954 (opt_dim_separators): Modify accordingly
24955 (rank_specifiers): Update accordingly. Basically do the same
24956 thing - instead, collect the brackets here.
24957 (opt_rank_sepcifiers): Modify accordingly.
24958 (array_type): Modify to actually return the complete type string
24959 instead of ignoring the rank_specifiers.
24960 (expression_list): Implement to collect the expressions
24961 (variable_initializer): Implement. We make it a list of expressions
24962 essentially so that we can handle the array_initializer case neatly too.
24963 (variable_initializer_list): Implement.
24964 (array_initializer): Make it a list of variable_initializers
24965 (opt_array_initializer): Modify accordingly.
24967 * expression.cs (New::NType): Add enumeration to help us
24968 keep track of whether we have an object/delegate creation
24969 or an array creation.
24970 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24971 members to hold data about array creation.
24972 (New:New): Modify to update NewType
24973 (New:New): New Overloaded contructor for the array creation
24976 * cs-parser.jay (array_creation_expression): Implement to call
24977 the overloaded New constructor.
24979 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24981 * class.cs (TypeContainer::Constructors): Return member
24982 constructors instead of returning null.
24984 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24986 * typemanager.cs (InitCoreTypes): Initialize the various core
24987 types after we have populated the type manager with the user
24988 defined types (this distinction will be important later while
24989 compiling corlib.dll)
24991 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24992 on Expression Classification. Now all expressions have a method
24993 `Resolve' and a method `Emit'.
24995 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24996 generation from working. Also add some temporary debugging
24999 2001-08-24 Miguel de Icaza <miguel@ximian.com>
25001 * codegen.cs: Lots of code generation pieces. This is only the
25002 beginning, will continue tomorrow with more touches of polish. We
25003 handle the fundamentals of if, while, do, for, return. Others are
25004 trickier and I need to start working on invocations soon.
25006 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25009 * codegen.cs (EmitContext): New struct, used during code
25010 emission to keep a context. Most of the code generation will be
25013 * cs-parser.jay: Add embedded blocks to the list of statements of
25014 this block. So code generation proceeds in a top down fashion.
25016 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25018 * statement.cs: Add support for multiple child blocks.
25020 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25022 * codegen.cs (EmitCode): New function, will emit the code for a
25023 Block of code given a TypeContainer and its ILGenerator.
25025 * statement.cs (Block): Standard public readonly optimization.
25026 (Block::Block constructors): Link children.
25027 (Block::Child): Child Linker.
25028 (Block::EmitVariables): Emits IL variable declarations.
25030 * class.cs: Drop support for MethodGroups here, delay until
25032 (Method::): Applied the same simplification that I did before, and
25033 move from Properties to public readonly fields.
25034 (Method::ParameterTypes): Returns the parameter types for the
25035 function, and implements a cache that will be useful later when I
25036 do error checking and the semantic analysis on the methods is
25038 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25039 and made a method, optional argument tells whether this is a class
25040 or a structure to apply the `has-this' bit.
25041 (Method::GetCallingConvention): Implement, returns the calling
25043 (Method::Define): Defines the type, a second pass is performed
25044 later to populate the methods.
25046 (Constructor::ParameterTypes): implement a cache similar to the
25047 one on Method::ParameterTypes, useful later when we do semantic
25050 (TypeContainer::EmitMethod): New method. Emits methods.
25052 * expression.cs: Removed MethodGroup class from here.
25054 * parameter.cs (Parameters::GetCallingConvention): new method.
25056 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25058 * class.cs (TypeContainer::Populate): Drop RootContext from the
25061 (Constructor::CallingConvention): Returns the calling convention.
25062 (Constructor::ParameterTypes): Returns the constructor parameter
25065 (TypeContainer::AddConstructor): Keep track of default constructor
25066 and the default static constructor.
25068 (Constructor::) Another class that starts using `public readonly'
25069 instead of properties.
25071 (Constructor::IsDefault): Whether this is a default constructor.
25073 (Field::) use readonly public fields instead of properties also.
25075 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25076 track of static constructors; If none is used, turn on
25077 BeforeFieldInit in the TypeAttributes.
25079 * cs-parser.jay (opt_argument_list): now the return can be null
25080 for the cases where there are no arguments.
25082 (constructor_declarator): If there is no implicit `base' or
25083 `this', then invoke the default parent constructor.
25085 * modifiers.cs (MethodAttr): New static function maps a set of
25086 modifiers flags into a MethodAttributes enum
25087 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25088 MethodAttr, TypeAttr to represent the various mappings where the
25089 modifiers are used.
25090 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25092 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25094 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25097 * interface.cs (PopulateIndexer): Implemented the code generator
25098 for interface indexers.
25100 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25102 * interface.cs (InterfaceMemberBase): Now we track the new status
25105 (PopulateProperty): Implement property population. Woohoo! Got
25106 Methods and Properties going today.
25108 Removed all the properties for interfaces, and replaced them with
25109 `public readonly' fields.
25111 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25113 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25114 initialize their hashtables/arraylists only when they are needed
25115 instead of doing this always.
25117 * parameter.cs: Handle refs and out parameters.
25119 * cs-parser.jay: Use an ArrayList to construct the arguments
25120 instead of the ParameterCollection, and then cast that to a
25123 * parameter.cs: Drop the use of ParameterCollection and use
25124 instead arrays of Parameters.
25126 (GetParameterInfo): Use the Type, not the Name when resolving
25129 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25131 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25132 and instead use public readonly fields.
25134 * class.cs: Put back walking code for type containers.
25136 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25138 * class.cs (MakeConstant): Code to define constants.
25140 * rootcontext.cs (LookupType): New function. Used to locate types
25143 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25145 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25146 this System.Reflection code is. Kudos to Microsoft
25148 * typemanager.cs: Implement a type cache and avoid loading all
25149 types at boot time. Wrap in LookupType the internals. This made
25150 the compiler so much faster. Wow. I rule!
25152 * driver.cs: Make sure we always load mscorlib first (for
25153 debugging purposes, nothing really important).
25155 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25156 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25158 * rootcontext.cs: Lookup types on their namespace; Lookup types
25159 on namespaces that have been imported using the `using' keyword.
25161 * class.cs (TypeContainer::TypeAttr): Virtualize.
25162 (Class::TypeAttr): Return attributes suitable for this bad boy.
25163 (Struct::TypeAttr): ditto.
25164 Handle nested classes.
25165 (TypeContainer::) Remove all the type visiting code, it is now
25166 replaced with the rootcontext.cs code
25168 * rootcontext.cs (GetClassBases): Added support for structs.
25170 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25172 * interface.cs, statement.cs, class.cs, parameter.cs,
25173 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25174 Drop use of TypeRefs, and use strings instead.
25176 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25180 * class.cs (Struct::Struct): set the SEALED flags after
25181 checking the modifiers.
25182 (TypeContainer::TypeAttr): new property, returns the
25183 TypeAttributes for a class.
25185 * cs-parser.jay (type_list): Oops, list production was creating a
25186 new list of base types.
25188 * rootcontext.cs (StdLib): New property.
25189 (GetInterfaceTypeByName): returns an interface by type name, and
25190 encapsulates error handling here.
25191 (GetInterfaces): simplified.
25192 (ResolveTree): Encapsulated all the tree resolution here.
25193 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25196 * driver.cs: Add support for --nostdlib, to avoid loading the
25197 default assemblies.
25198 (Main): Do not put tree resolution here.
25200 * rootcontext.cs: Beginning of the class resolution.
25202 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25204 * rootcontext.cs: Provide better error reporting.
25206 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25208 * rootcontext.cs (CreateInterface): Handle the case where there
25209 are no parent interfaces.
25211 (CloseTypes): Routine to flush types at the end.
25212 (CreateInterface): Track types.
25213 (GetInterfaces): Returns an array of Types from the list of
25214 defined interfaces.
25216 * typemanager.c (AddUserType): Mechanism to track user types (puts
25217 the type on the global type hash, and allows us to close it at the
25220 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25222 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25223 RecordInterface instead.
25225 * cs-parser.jay: Updated to reflect changes above.
25227 * decl.cs (Definition): Keep track of the TypeBuilder type that
25228 represents this type here. Not sure we will use it in the long
25229 run, but wont hurt for now.
25231 * driver.cs: Smaller changes to accomodate the new code.
25233 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25236 * rootcontext.cs (CreateInterface): New method, used to create
25237 the System.TypeBuilder type for interfaces.
25238 (ResolveInterfaces): new entry point to resolve the interface
25240 (CodeGen): Property, used to keep track of the code generator.
25242 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25244 * cs-parser.jay: Add a second production for delegate_declaration
25247 (enum_body): Put an opt_comma here instead of putting it on
25248 enum_body or enum_member_declarations so we can handle trailing
25249 commas on enumeration members. Gets rid of a shift/reduce.
25251 (type_list): Need a COMMA in the middle.
25253 (indexer_declaration): Tell tokenizer to recognize get/set
25255 * Remove old targets.
25257 * Re-add the parser target.
25259 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25261 * cs-parser.jay: Add precendence rules for a number of operators
25262 ot reduce the number of shift/reduce conflicts in the grammar.
25264 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25266 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25269 Get rid of old crufty code.
25271 * rootcontext.cs: Use this to keep track of the parsed
25272 representation and the defined types available to the program.
25274 * gen-treedump.cs: adjust for new convention.
25276 * type.cs: Split out the type manager, and the assembly builder
25279 * typemanager.cs: the type manager will live here now.
25281 * cil-codegen.cs: And the code generator here.
25283 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25285 * makefile: Fixed up for easy making.
25287 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25289 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25292 (unary_expression): Expand pre_increment_expression and
25293 post_decrement_expression to reduce a shift/reduce.
25295 2001-07-11 Simon Cozens
25297 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25299 Improve allow_keyword_as_indent name.
25301 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25303 * Adjustments for Beta2.
25305 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25307 * decl.cs: Added `Define' abstract method.
25308 (InTransit): new property, used to catch recursive definitions.
25310 * interface.cs: Implement `Define'.
25312 * modifiers.cs: Map Modifiers.constants to
25313 System.Reflection.TypeAttribute flags.
25315 * class.cs: Keep track of types and user-defined types.
25316 (BuilderInit): New method for creating an assembly
25317 (ResolveType): New function to launch the resolution process, only
25318 used by interfaces for now.
25320 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25321 that are inserted into the name space.
25323 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25325 * ARGH. I have screwed up my tree so many times due to the use of
25326 rsync rather than using CVS. Going to fix this at once.
25328 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25331 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25333 * Experiment successful: Use System.Type rather that our own
25336 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25338 * cs-parser.jay: Removed nsAliases from here.
25340 Use new namespaces, handle `using XXX;'
25342 * namespace.cs: Reimplemented namespace handling, use a recursive
25343 definition of the class. Now we can keep track of using clauses
25344 and catch invalid using clauses.
25346 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25348 * gen-treedump.cs: Adapted for all the renaming.
25350 * expression.cs (Expression): this class now has a Type property
25351 which returns an expression Type.
25353 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25354 `Type', as this has a different meaning now in the base
25356 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25358 * interface.cs, class.cs: Removed from all the sources the
25359 references to signature computation, as we can not do method
25360 signature computation during the parsing time, as we are not
25361 trying to solve at that point distinguishing:
25365 void a (NS.Blah x) {}
25368 Which depending on the context might be valid or not, as we do not
25369 know if Blah is the same thing as NS.Blah at that point.
25371 * Redid everything so the code uses TypeRefs now instead of
25372 Types. TypeRefs are just temporary type placeholders, that need
25373 to be resolved. They initially have a pointer to a string and the
25374 current scope in which they are used. This is used later by the
25375 compiler to resolve the reference to an actual Type.
25377 * DeclSpace is no longer a CIR.Type, and neither are
25378 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25379 are all DeclSpaces, but no Types.
25381 * type.cs (TypeRefManager): This implements the TypeRef manager,
25382 which keeps track of all the types that need to be resolved after
25383 the parsing has finished.
25385 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25387 * ARGH. We are going to have to store `foreach' as a class rather
25388 than resolving it, as we need to verify error 1579 after name
25389 resolution. *OR* we could keep a flag that says `This request to
25390 IEnumerator comes from a foreach statement' which we can then use
25391 to generate the error.
25393 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25395 * class.cs (TypeContainer.AddMethod): we now add methods to the
25396 MethodGroup instead of the method hashtable.
25398 * expression.cs: Add MethodGroup abstraction, which gets us one
25399 step closer to the specification in the way we handle method
25402 * cs-parser.jay (primary_expression): qualified_identifier now
25403 tried to match up an identifier to a local variable reference or
25404 to a parameter reference.
25406 current_local_parameters is now a parser global variable that
25407 points to the current parameters for the block, used during name
25410 (property_declaration): Now creates an implicit `value' argument to
25413 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25415 * parameter.cs: Do not use `param' arguments as part of the
25416 signature, per the spec.
25418 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25420 * decl.cs: Base class for classes, structs and interfaces. This
25421 is the "Declaration Space"
25423 * cs-parser.jay: Use CheckDef for checking declaration errors
25424 instead of having one on each function.
25426 * class.cs: Factor out some code for handling error handling in
25427 accordance to the "Declarations" section in the "Basic Concepts"
25428 chapter in the ECMA C# spec.
25430 * interface.cs: Make all interface member classes derive from
25431 InterfaceMemberBase.
25433 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25435 * Many things: all interfaces are parsed and generated in
25436 gen-treedump. Support for member variables, constructors,
25437 destructors, properties, constants is there.
25439 Beginning of the IL backend, but very little done, just there for
25442 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25444 * cs-parser.jay: Fix labeled statement.
25446 * cs-tokenizer.cs (escape): Escape " and ' always.
25447 ref_line, ref_name: keep track of the line/filename as instructed
25448 by #line by the compiler.
25451 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25453 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25454 to match the values in System.CodeDOM.
25456 Divid renamed to Divide.
25458 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25460 (Statements.set): remove.
25462 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25465 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25466 falseStatements always have valid values.
25468 * cs-parser.jay: Use System.CodeDOM now.