1 2006-04-01 Raja R Harinath <rharinath@novell.com>
4 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
8 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
11 * report.cs (SymbolRelatedToPreviousError): Drop generic type
12 arguments before checking whether a type is reflected or not.
15 * expression.cs (Invocation.IsApplicable): Ensure a generic method
16 definition doesn't take part in overload resolution.
17 (Invocation.IsParamsMethodApplicable): Likewise.
18 (Invocation.OverloadResolve): When replacing a reflected override
19 method with its base definition, ensure that type arguments are
22 2006-04-01 Marek Safar <marek.safar@seznam.cz>
26 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
29 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
31 2006-03-31 Marek Safar <marek.safar@seznam.cz>
33 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
36 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
37 LocalTemporary change.
39 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
41 (ClassOrStruct.DefineFieldInitializers): Implemented static field
42 initializers optimization.
43 (ClassOrStruct.TypeAttr): Moved from modifiers.
44 (Constructor.CheckBase): Don't crash when static ctor has parameters.
45 (FieldBase.ResolveInitializer): Resolves initializer.
46 (FieldBase.HasDefaultInitializer): New property.
48 * cs-parser.jay: Removed message.
50 * expression.cs (CompilerGeneratedThis): New specialization.
52 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
54 2006-03-28 Marek Safar <marek.safar@seznam.cz>
56 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
58 2006-03-27 Marek Safar <marek.safar@seznam.cz>
60 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
61 be now EnumConstants only.
63 2006-03-27 Marek Safar <marek.safar@seznam.cz>
65 * attribute.cs, driver.cs: Reset more caches.
67 2006-03-26 Marek Safar <marek.safar@seznam.cz>
69 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
71 2006-03-26 Marek Safar <marek.safar@seznam.cz>
73 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
74 for easier reuse. Updated all overrides.
75 (IntegralConstant): New base class for all integral constants.
76 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
77 of the constant range, report custom error.
78 (UIntConstant.Reduce): Fixed uint conversion.
80 * ecore.cs, literal.cs: Reduce updates.
82 2006-03-26 Marek Safar <marek.safar@seznam.cz>
86 * class.cs (Constructor.Define): Removed extra if for default ctors.
87 A patch from Atsushi Enomoto.
89 2006-03-26 Marek Safar <marek.safar@seznam.cz>
91 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
94 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
97 * convert.cs (ImplicitConversionRequired): Error message moved to
100 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
101 automatic implicit conversion of an output value.
102 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
104 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
106 (TypeOf.GetAttributableValue): Add extra handling for object type.
108 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
109 special error message.
111 2006-03-25 Marek Safar <marek.safar@seznam.cz>
113 * class.cs (Constructor.Emit): Don't crash when struct ctor is
115 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
116 compatible with MS runtime.
118 2006-03-23 Marek Safar <marek.safar@seznam.cz>
120 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
121 attribute arguments here.
123 * class.cs (Indexer.Define): The check was moved to attribute class.
125 2006-03-21 Marek Safar <marek.safar@seznam.cz>
127 * expression.cs (StringConcat.Append): Reverted back to no warning state.
129 2006-03-21 Marek Safar <marek.safar@seznam.cz>
131 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
133 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
136 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
138 * doc-bootstrap.cs : fix build.
140 2006-03-20 Marek Safar <marek.safar@seznam.cz>
142 * expression.cs (StringConcat.Append): Issue a warning when empty string
145 2006-03-20 Marek Safar <marek.safar@seznam.cz>
147 * assign.cs (CompoundAssign.ResolveSource): Removed.
149 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
152 * class.cs (TypeContainer.FindMethods): Removed.
153 (TypeContainer.CheckMemberUsage): Made static.
155 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
157 * constant.cs (CheckRange): Removed unused type argument.
158 (CheckUnsigned): Removed unused type argument.
160 * cs-parser.jay: Updated after MemberAccess clean up.
161 Uses Length for empty string test.
163 * cs-tokenizer.cs: Uses Length for empty string test.
164 (IsCastToken): Made static.
165 (is_hex): Made static.
166 (real_type_suffix): Made static.
168 * decl.cs (SetupCache): Made static.
169 (OnGenerateDocComment): Removed unused ds argument.
171 * delegate.cs (VerifyDelegate): Removed unused argument.
173 * doc.cs: Uses Length for empty string test.
175 * driver.cs: Uses Length for empty string test.
177 * enum.cs (IsValidEnumType): Made static
179 * expression.cs (EnumLiftUp): Removed unused argument.
180 (ResolveMethodGroup): Ditto.
181 (BetterConversion): Ditto.
182 (GetVarargsTypes): Ditto.
183 (UpdateIndices): Ditto.
184 (ValidateInitializers): Ditto.
185 (MemberAccess.ctor): Ditto.
186 (GetIndexersForType): Ditto.
188 * flowanalysis.cs: (MergeFinally): Removed unused argument.
190 * iterators.cs: Updated after MemberAccess clean up.
192 * location.cs: Uses Length for empty string test.
194 * namespace.cs: Uses Length for empty string test.
196 * report.cs (CheckWarningCode): Made static.
198 * statement.cs (LabeledStatement): Removed unused argument.
200 * typemanager.cs (FilterNone): Removed.
202 2006-03-18 Marek Safar <marek.safar@seznam.cz>
204 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
209 2006-03-18 Marek Safar <marek.safar@seznam.cz>
211 * cs-parser.jay.cs: __arglist is not allowed for delegates.
213 2006-03-18 Marek Safar <marek.safar@seznam.cz>
217 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
219 (AnonymousMethod.ImplicitStandardConversionExists): New method.
220 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
221 Add more error reporting; Fixed issue with params.
223 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
225 * cs-parser.jay: AnonymousMethod requires host container.
227 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
229 2006-03-18 Raja R Harinath <harinath@gmail.com>
231 * class.cs: Change 'TypeContainer ds' constructor argument to
232 'DeclSpace parent'. Some classes were missed below due to
233 different naming convention.
235 * class.cs (MemberCore.Parent): Delete. This makes the
236 ParentContainer changes below enforceable by the compiler.
238 Treat pointers to enclosing declaration space as 'DeclSpace', not
240 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
241 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
243 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
245 (Block.AddThisVariable): Likewise.
246 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
247 (AbstractPropertyEventMethod.Emit): Likewise.
248 (AbstractPropertyEventMethod.EmitMethod): Likewise.
249 (GetMethod.Define, SetMethod.Define): Likewise.
250 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
251 (DelegateMethod.EmitMethod): Likewise.
253 Fix regression test-partial-13.cs.
254 Rationalize use of PartialContainer. Ensure that the partial
255 class semantics can be tied to type-correctness, i.e., any
256 violation will cause a compile error.
257 * class.cs, const.cs: Access all fields that belong to class
258 TypeContainer via ParentContainer. Arguments of EmitContexts and
259 Resolve()-like functions still use 'Parent'.
261 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
262 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
263 (PropertyMethod.CheckModifiers): Remove unused argument.
264 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
267 2006-03-28 Raja R Harinath <rharinath@novell.com>
269 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
271 2006-03-17 Raja R Harinath <harinath@gmail.com>
273 Make semantics of PartialContainer simpler.
274 * decl.cs (DeclSpace.IsPartial): Remove.
275 * class.cs (TypeContainer.IsPartial): Likewise.
276 (TypeContainer..ctor): Set PartialContainer to point to self.
277 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
278 (TypeContainer.FindNestedType): Likewise.
279 (MemberCore.ParentContainer): Simplify. Remove deprecation.
281 2006-03-17 Marek Safar <marek.safar@seznam.cz>
283 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
285 2006-03-15 Marek Safar <marek.safar@seznam.cz>
287 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
290 2006-03-15 Marek Safar <marek.safar@seznam.cz>
292 * class.cs (Operator.Define): An error for base conversion was not
295 2006-03-13 Marek Safar <marek.safar@seznam.cz>
297 A fix for #77593, #77574.
299 * class.cs (MethodCore.CheckBase): Another if for operator.
301 2006-03-18 Marek Safar <marek.safar@seznam.cz>
305 * expression.cs (VerifyArgumentsCompat): Reverted to double error
306 reporting, it's more tricky than I thought.
308 2006-03-09 Marek Safar <marek.safar@seznam.cz>
310 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
313 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
314 (DelegateCreation.ImplicitStandardConversionExists): New method for just
317 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
320 2006-03-04 Marek Safar <marek.safar@seznam.cz>
324 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
325 (Event.Define): ditto
326 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
328 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
329 Removed redundant code and set NewSlot for Invoke method too.
331 * parameter.cs (Parameters.ctor): Add custom, type ctor.
332 (Parameters.MergeGenerated): New method. Use this method when you merge
333 compiler generated argument with user arguments.
335 2006-03-03 Marek Safar <marek.safar@seznam.cz>
337 * attribute.cs (ResolveAsTypeTerminal): Removed.
339 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
340 specialization for predefined types; 30% speed up.
341 Finally placed obsolete check to right place.
342 (Expression.ResolveType): Removed.
344 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
345 Updated after ResolveType was removed.
347 * expression.cs (Cast.ctor): Check void cast.
348 (Binary.ResolveAsTypeTerminal): Is never type.
349 (Conditional.ResolveAsTypeTerminal): Is never type.
351 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
353 2006-03-26 Marek Safar <marek.safar@seznam.cz>
355 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
357 2006-03-23 Martin Baulig <martin@ximian.com>
359 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
360 type check if either of the types is an open generic type.
362 2006-03-23 Martin Baulig <martin@ximian.com>
365 (Convert.ExplicitTypeParameterConversion): New method; implement
366 explicit type parameter conversions.
368 2006-03-23 Martin Baulig <martin@ximian.com>
370 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
371 blindly allow all conversions if we do not have any constraints.
373 2006-02-27 Marek Safar <marek.safar@seznam.cz>
375 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
376 these two separated members to simplify the code.
377 (Attribute.Resolve): Refactored to use new fields and methods.
378 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
379 implemented obsolete attribute checking.
380 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
381 implemented obsolete checking again. It look line never ending quest ;-)
382 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
384 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
386 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
388 *class.cs (Property.Define): Add RegisterProperty call.
390 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
391 argument groups (only 2).
393 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
394 encoding expression to arguments.
395 (Expression.ExprClassToResolveFlags): Just turned to property.
397 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
398 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
399 optimized as well as implemented support for zero-length attributes.
401 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
402 Add caching of PropertyInfo's.
404 2006-02-25 Marek Safar <marek.safar@seznam.cz>
406 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
407 error multiple times.
409 2006-02-25 Marek Safar <marek.safar@seznam.cz>
411 New partial class implementation.
412 A fix for #77027, #77029, #77403
414 * attribute.cs (Attributable): Made attributes protected.
416 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
417 the replacements of ClassPart and PartialContainer.
418 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
419 (TypeContainer.AddInterface): Ditto.
420 (TypeContainer.AddPartial): The main method for partial classes. It checks
421 for errors and merges ModFlags and attributes. At the end class is added to
423 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
425 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
426 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
427 from the rest of partial classes.
428 (TypeContainer.GetClassBases): Simplified.
429 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
431 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
432 (TypeContainer.HasExplicitLayout): Uses Flags now.
433 (PartialContainer): Removed.
434 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
435 (StaticClass): Was merged with Class.
436 (Class.GetClassBases): class and static class bases are verified here.
437 (Class.TypeAttr): Added static attributes when class is static.
438 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
439 (MemberBase): In some cases we need to call parent container for partial
440 class. It should be eliminated but it's not easy now.
442 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
444 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
445 partial classed to accumulate class comments.
446 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
448 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
450 * driver.cs (MainDriver): Tree.GetDecl was removed.
452 * modifiers.cs (Modifiers): Add partial modifier.
454 * tree.cs (Tree.decl): Removed.
455 (RootTypes): Started to use this class more often for root types
458 2006-03-23 Raja R Harinath <rharinath@novell.com>
460 * generic.cs (TypeParameter.UpdateConstraints): Update
461 'constraints' if null.
463 2006-02-22 Marek Safar <marek.safar@seznam.cz>
467 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
468 external interface does not have an attribute.
470 2006-02-22 Marek Safar <marek.safar@seznam.cz>
472 Another prerequisites for new partial classs implementation.
474 * attribute.cs (Attribute.Equal): Implemented.
475 (Attribute.Emit): Changed as attributes can be applied more than twice.
476 (Attributes.Emit): Check for duplicate attributes here.
478 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
479 as a parameter, clean-up.
481 2006-02-11 Marek Safar <marek.safar@seznam.cz>
485 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
486 contains obsolete attribute check which can in some cases look for base
487 type of current class which is not initialized yet.
488 (TypeContainer.BaseType): Replacement of ptype.
490 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
492 2006-02-11 Marek Safar <marek.safar@seznam.cz>
494 First of prerequisites for new partial classs implemention.
496 * attribute.cs (Attributable): Extended by ResolveContext;
497 Attributes finally have correct context for resolving in all cases.
498 (AttachTo): Attribute owner is assigned here.
500 * codegen.cs (IResolveContext): Introduce new interface to hold
501 all information needed in resolving phase.
502 (EmitContext): Implements IResolveContext; more clean-up needed here.
504 * decl.cs (MemberCore): Implemented IResolveContext.
506 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
507 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
508 parameter.cs, statement.cs, tree.cs, typemanager.cs:
509 Refactored to use new IResolveContext instead of EmitContext; cleanup
511 2006-03-22 Raja R Harinath <rharinath@novell.com>
513 Support ParameterDefaultValueAttribute in gmcs. Also applied to
514 mcs to keep code differences small.
515 * attribute.cs (Attribute.GetParameterDefaultValue): New.
516 * typemanager.cs (parameter_default_value_attribute_type): New.
517 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
520 2006-03-22 Martin Baulig <martin@ximian.com>
523 (Nullable.NullableLiteral): Derive from `NullLiteral'.
526 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
527 instead of the normal `NullLiteral'.
529 2006-03-21 Martin Baulig <martin@ximian.com>
532 * generic.cs (TypeManager.InferType): If `pt' is a generic
533 parameter, don't check whether `pt == at'.
535 2006-03-20 Raja R Harinath <rharinath@novell.com>
538 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
539 (TypeParameter.Resolve): Update to change.
540 (ConstraintChecker.CheckConstraints): Resolve type-argument
541 constraints before use.
543 2006-03-16 Martin Baulig <martin@ximian.com>
546 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
547 and don't have any instance constructors, also lookup in the base class.
548 (TypeManager.IsNullableValueType): New public method.
550 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
551 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
552 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
554 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
555 instead of just TypeManager.IsNullableType() to determine whether
556 a lifted operator exists.
557 (UnaryMutator.DoResolve): Likewise.
558 (Conditional.DoResolve): Likewise.
559 (Binary.DoResolve): A lifted operator only exists if both operands
560 are valuetypes and at least one of them is a nullable type.
562 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
564 * iterator.cs : yield break is allowed in try statement which has
565 catch clauses. Fixed bug #77767.
567 2006-03-12 Martin Baulig <martin@ximian.com>
569 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
570 private IsSignatureEqual() to compare types; see the comment in
571 that method; fixes #77674.
573 2006-03-10 Raja R Harinath <rharinath@novell.com>
575 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
576 (Expression.ResolveAsTypeTerminal): Likewise.
577 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
578 * expression.cs, generic.cs, iterators.cs: Likewise.
579 * parameter.cs, statement.cs, typemanager.cs: Likewise.
581 2006-03-09 Martin Baulig <martin@ximian.com>
583 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
584 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
586 2006-03-09 Martin Baulig <martin@ximian.com>
588 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
589 `prepared' flag is set.
591 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
592 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
593 issues; see gtest-254.cs.
595 2006-03-07 Martin Baulig <martin@ximian.com>
597 * generic.cs (TypeManager.InferType): Allow infering
598 `IEnumerable<T>' with an array of T; see gtest-251.cs.
600 2006-03-06 Martin Baulig <martin@ximian.com>
603 (TypeManager.InferType): Fix gtest-250.cs.
606 (TypeManager.IsSubclassOf): Also check the base class.
609 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
612 2006-03-01 Raja R Harinath <rharinath@novell.com>
615 * expression.cs (ParameterReference.DoResolveBase): Change return
617 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
621 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
624 * typemanager.cs (GetFullNameSignature): Don't nullref on
627 2006-02-16 Martin Baulig <martin@ximian.com>
630 (TypeManager.GetGenericFieldDefinition): New public method; use it
631 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
633 2006-02-14 Martin Baulig <martin@ximian.com>
635 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
637 2006-02-14 Martin Baulig <martin@ximian.com>
640 (TypeManager.DropGenericMethodArguments): New public method; don't
641 use GetGenericMethodDefinition() on something which is not a
644 2006-02-14 Martin Baulig <martin@ximian.com>
647 (ConstraintChecker.CheckConstraints): If a type parameter has the
648 `struct' constraint, the type must be a non-nullable valuetype.
650 2006-02-10 Martin Baulig <martin@ximian.com>
653 (TypeManager.IsOverride): Make this work for instantiated methods
654 in a generic class; fixes #77509.
655 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
656 rather than calling it directly; fixes #77488.
658 2006-02-08 Martin Baulig <martin@ximian.com>
660 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
661 reporting into CheckConstraint() so we can use the correctly
664 2006-02-08 Martin Baulig <martin@ximian.com>
666 * expression.cs (BaseAccess): Add support for generic methods.
668 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
669 the new MethodGroupExpr.
671 2006-02-07 Martin Baulig <martin@ximian.com>
673 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
674 also reference types; fixes #77483.
676 2006-02-07 Martin Baulig <martin@ximian.com>
679 (TypeManager.IsGenericMethod): We now return whether something is
680 an instantiated generic method (and not a generic method def).
681 (TypeManager.IsGenericMethodDefinition): New public method.
684 (TypeManager.CSharpSignature): Only include type arguments for
685 "real" generic methods, not for any instantiated method.
686 (TypeManager.GetMethodName): Likewise, but also allow generic
687 method definitions here.
689 2006-02-06 Miguel de Icaza <miguel@novell.com>
691 * codegen.cs (EmitScopeInitFromBlock): check here the
692 capture_context, there is no need to make two calls to the
695 * anonymous.cs: Add some debugging messages that might help me
696 track other instances of this problem in the future (the
697 regression of test 467).
699 * cs-parser.jay: track the variable block, as we need to initalize
700 any captured variables declared in this block for the "catch"
701 portion of the "Try" statement.
703 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
704 scope initialization for captured variables.
706 Also, move the emit for the variables after the block location has
709 2006-02-06 Marek Safar <marek.safar@seznam.cz>
711 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
713 2006-02-06 Martin Baulig <martin@ximian.com>
715 * class.cs (TypeContainer.DefineType): If we're a struct, pass
716 `TypeManager.value_type' as parent type to
717 ModuleBuilder.DefineType(). Fixes #77358.
719 2006-02-02 Miguel de Icaza <miguel@novell.com>
721 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
722 commit yesterday, the initialization for the roots is necessary.
723 What is not necessary is the scope activation.
725 2006-02-02 Raja R Harinath <rharinath@novell.com>
727 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
728 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
730 (Argument.Resolve): Remove CS0206 checks.
732 2006-02-01 Miguel de Icaza <miguel@novell.com>
734 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
735 scopes for all the roots, the scopes will now be emitted when the
736 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
738 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
739 code. This reduces a lot of existing cruft.
741 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
742 that the ScopeInfo is generated as we enter the scope, not at the
743 time of use, which is what we used to do before.
745 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
746 every time a Block is about to be emitted if we have a
749 2006-02-01 Raja R Harinath <rharinath@novell.com>
751 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
752 attribute for mscorlib too.
754 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
756 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
758 * typemanager.cs (cons_param_array_attribute): Make private.
759 (Reset): Set it to null.
760 (InitCoreHelpers): Don't initialize it.
761 (ConsParamArrayAttribute): New. Initialize it as needed.
762 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
764 2006-01-31 Miguel de Icaza <miguel@novell.com>
766 * expression.cs: There might be errors reported during the
767 selection of applicable methods. If there are errors, do not
768 continue execution as it will lead the compiler to crash.
770 2006-01-30 Miguel de Icaza <miguel@novell.com>
772 * expression.cs: Member access is not allowed on anonymous
773 methods. Fixes #77402.
775 2006-01-30 Raja R Harinath <rharinath@novell.com>
778 * cs-parser.jay (VariableDeclaration): Don't set
779 current_array_type to null.
780 (field_declaration, event_declaration, declaration_statement):
783 2006-01-29 Raja R Harinath <harinath@gmail.com>
786 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
788 2006-01-28 Raja R Harinath <harinath@gmail.com>
790 * typemanager.cs (GenericParameterPosition): New.
793 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
795 * doc.cs : To process "include" elements, first we should create
796 another list than XmlNodeList, because it could result in node
797 removal, which could result in that the XmlNodeList gives up
800 2006-01-25 Miguel de Icaza <miguel@novell.com>
802 * expression.cs: Introduce an error report that we were not
803 catching before. Gonzalo ran into it.
805 2006-01-23 Miguel de Icaza <miguel@novell.com>
807 A fix for bug: #76957
809 * iterators.cs (MoveNextMethod.CreateMethodHost): call
810 ComputeMethodHost before creating the method, this is a new
813 * anonymous.cs (AnonymousContainer): Now we track all the scopes
814 that this method references (RegisterScope). The actual scope
815 where the method is hosted is computed with the ComputeMethodHost
816 before we create the method.
818 Moved the Deepest routine here.
820 (AnonymousContainer.ComputeMethodHost): New routine used to
821 compute the proper ScopeInfo that will host the anonymous method.
823 (ScopeInfo): Deal with multiple roots. The problem was that we
824 did not have a unique root where all ScopeInfos could be hanged
825 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
828 Remove AdjustMethodScope which is now computed at the end. Remove
829 LinkScope which did a partial link, instead link all ScopeInfos
830 before code generation from the new "LinkScopes" routine.
832 Simplify all the Add* routines as they no longer need to maintain
833 the tree, they just need to record that they are using variables
836 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
837 routines to produce the forest of ScopeInfo trees.
839 * class.cs (TypeContainer.AppendMethod): This is just like
840 AddMethod, but ensures that an interface implementation method
841 (IEnumerable.XXX) is not inserted at the beginning of the queue of
842 methods, but at the end.
844 We use this functionality to ensure that the generated MoveNext
845 method in the iterator class is resolved/emitted before the
846 enumerator methods created.
848 This is required because the MoveNext method computes the right
849 ScopeInfo for the method. And the other methods will eventually
850 need to resolve and fetch information computed from the anonymous
854 2006-01-23 Raja R Harinath <rharinath@novell.com>
856 Improve implementation of section 14.4.2.2 (Better function member).
857 * expression.cs (Invocation.MoreSpecific): Compare all type
858 arguments before deciding if one type is more specific than
859 another. Handle array types too. Return the more specific type.
860 (Invocation.BetterFunction): Add more tie-breaking rules from
861 section 14.4.2.2. Perform "more specific" check after
862 other tie-breaking rules. Compare all parameter types before
863 choosing the "more specific" method.
865 2006-01-21 Raja R Harinath <harinath@gmail.com>
866 Carlos Alberto Cortez <calberto.cortez@gmail.com>
869 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
871 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
872 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
874 2006-01-18 Martin Baulig <martin@ximian.com>
876 * class.cs (TypeContainer.AddToMemberContainer): Use
877 `symbol.MemberName.MethodName' instead of just `symbol.Name';
880 2006-01-18 Martin Baulig <martin@ximian.com>
882 Fix #76417: a generic class may now have methods which may unify
883 for some type parameter substitutions.
885 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
886 for methods which may unify anymore.
888 * expression.cs (Invocation.MoreSpecific): New private static
889 method; checks whether one method is more specific than another
890 according to 14.4.2.2 of the spec.
891 (Invocation.BetterFunction): Implement the tie-breaking rules from
892 14.4.2.2 of the spec: if two methods unify for some type parameter
893 substitution, we need to pick the more specific one.
895 2006-01-18 Raja R Harinath <rharinath@novell.com>
897 Fix #76656, cs0231-2.cs.
898 * cs-parser.jay (formal_parameter_list): Make error case catch
900 (parenthesized_expression_0): Add CS1026 check.
901 (invocation_expression): Remove unused { $$ = lexer.Location }.
903 2006-01-17 Raja R Harinath <rharinath@novell.com>
906 * cs-parser.jay (statement_expression): Don't list out the
907 individual statement-expressions. Convert syntax error into
910 2006-01-16 Raja R Harinath <rharinath@novell.com>
913 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
914 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
915 CheckIntermediateModification.
916 (FieldExpr.DoResolve): Add new two-argument version that
917 allows us to resolve the InstanceExpression as an lvalue.
918 The one-argument variant is now just a wrapper.
919 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
920 Resolve the lhs as an lvalue if the it has a value type.
921 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
922 from Assign.DoResolve.
923 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
924 resolved as an lvalue.
925 (PropertyExpr.DoResolve): Update.
926 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
927 has a value type. Move CS1612 check here from
928 CheckIntermediateModification.
929 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
930 * expression.cs (EmptyExpression.OutAccess): New. Used as the
931 'right_side' of a ResolveLValue on an 'out' argument.
932 (EmptyExpression.LValueMemberAccess): New. Used as the
933 'right_side' of a propagated ResolveLValue on a value type.
934 (LocalVariableReference.DoResolveBase): Recognize
935 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
937 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
938 EmptyExpression.Null.
940 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
942 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
943 Type.IsGenericParameter(). Fixed bug #77183.
944 * doc.cs : it is now identical to doc.cs in mcs.
946 2006-01-16 Martin Baulig <martin@ximian.com>
948 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
950 2006-01-16 Martin Baulig <martin@ximian.com>
952 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
955 2006-01-12 Miguel de Icaza <miguel@novell.com>
957 This fixes the problem where we used ldfld instead of ldflda to
958 load the "THIS" pointer on captured parameters, when THIS is a
959 value type. See bug #77205.
961 * iterators.cs (CapturedThisReference.Emit): Pass false to
962 EmitThis (we do not need the address).
964 * codegen.cs (EmitThis): it needs to know whether we need the
965 address of `this' or not. This is used by value types.
967 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
968 every other call passes false.
970 2006-01-12 Raja R Harinath <rharinath@novell.com>
973 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
975 * expression.cs (Invocation.OverloadResolve): Update.
976 (Invocation.DoResolve): Avoid double resolution of invocation.
978 2006-01-11 Raja R Harinath <rharinath@novell.com>
981 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
982 unary negation of floating point types as 0-expr; negation cannot
983 overflow in floating point types.
986 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
987 on operands of 'void' type.
990 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
991 and ExclusiveOr for boolean constants too.
993 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
995 * expression.cs: Fix Console.WriteLine ((this = x).foo);
997 2006-01-12 Miguel de Icaza <miguel@novell.com>
999 * cs-tokenizer.cs (Position): New class used to save and restore
1000 the position state in the tokenizer. Before this patch the save
1001 and restore was not complete enough so the line and columns would
1002 start to drift and the debugger and stack traces will get the
1005 2006-01-10 Martin Baulig <martin@ximian.com>
1008 (TypeParameter.InflateConstraints): New public method.
1010 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1011 constraints; fixes #77042.
1013 2006-01-10 Martin Baulig <martin@ximian.com>
1015 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1016 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1019 2006-01-09 Raja R Harinath <rharinath@novell.com>
1022 * expression.cs (Invocation.OverloadResolve): Replace reflected
1023 override methods with their base virtual methods, rather than
1025 * typemanager.cs (TypeManager.GetOverride): New.
1027 2005-12-21 Miguel de Icaza <miguel@novell.com>
1029 * driver.cs: Report the case of no source files and no -out:
1032 2005-12-20 Raja R Harinath <rharinath@novell.com>
1035 * expression.cs (ComposedCast.GetSignatureForError): Define.
1037 2006-01-05 Jb Evain <jbevain@gmail.com>
1039 * class.cs (Property.Define, Indexer.Define): do not tag the
1040 properties as SpecialName | RTSpecialName.
1042 2006-01-04 Miguel de Icaza <miguel@novell.com>
1044 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1045 doing a low-level comparission of parameter types. It was lacking
1046 a check for __argslist.
1048 2005-12-30 Miguel de Icaza <miguel@novell.com>
1050 * expression.cs (ParameterReference.DoResolveBase): Allow
1051 reference parameters if they are local to this block.
1053 This allows the ref and out parameters of a delegate to be used in
1054 an anonymous method, for example:
1056 delegate void set (out int x);
1058 set s = delegate (out int x){
1062 This is used by functionality introduced late in the C# language.
1064 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1065 method that take ref and out parameters.
1067 Fixes #77119 which was a late change in the spec.
1069 2005-12-23 Miguel de Icaza <miguel@novell.com>
1071 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1072 parent if its the same scope. Fixes #77060.
1074 2005-12-22 Marek Safar <marek.safar@seznam.cz>
1076 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1078 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1080 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1081 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
1082 that doesn't contain the full public key. This is a update of the
1083 friend assemblies in .Net 2.0 release.
1085 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1089 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1090 ListDictionary, to contain the ExternAliasEntry entries (in
1091 addition to the NamespaceEntry.aliases hashtable). This field is
1092 shared between the original entry and its doppelganger (bodyless
1094 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1095 extern_aliases field.
1096 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1097 lookup in extern_aliases.
1099 2005-12-16 Raja R Harinath <rharinath@novell.com>
1102 * class.cs (TypeContainer.Mark_HasEquals): New.
1103 (TypeContainer.Mark_HasGetHashCode): New.
1104 (ClassPart): Override them.
1105 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1107 * generic.cs (GenericMethod.DefineMembers): Update to changes.
1108 (TypeParameter.TypeParameter): Change type of 'parent' argument to
1112 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1113 'parent' argument to the base constructor.
1115 Remove all mention of TypeContainer from decl.cs.
1116 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1117 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1118 (DeclSpace.DeclSpace): Likewise.
1119 (DeclSpace.DefineMembers): Remove unused argument.
1120 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1121 debugging check -- we don't care if the debug code throws an
1122 InvalidCastException instead of an InternalErrorException.
1123 * class.cs (TypeContainer.DefineMembers): Update to changes.
1124 (TypeContainer.DoDefineMembers): Likewise.
1125 (TypeContainer.GetMethods): Likewise.
1126 (PropertyMember.Define): Likewise.
1127 (MemberBase.Parent): New property that forwards to
1128 MemberCore.Parent, but ensures that we get a TypeContainer.
1129 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1130 (RootContext.PopulateTypes): Likewise. Remove special case code
1131 for !RootContext.StdLib: DefineMembers is idempotent.
1133 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1135 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1137 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1139 * doc.cs : The search for referenced namespace was insufficient to
1140 get global one as it used to do. Fixed bug #76965.
1142 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1144 * doc.cs : check name in cref in the last phase that whether it is
1147 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1149 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1152 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1154 * doc.cs : so it turned out that we cannot skip override check for
1155 interface members. Fixed bug #76954.
1157 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1159 * cs-tokenizer.cs : fixed bug #75984:
1160 - #warning and #error should not be handled when the source line
1162 - #line is not checked strictly when the source line is disabled.
1163 - #define and #undef is on the other hand checked strictly at any
1166 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1168 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1171 2005-12-15 Raja R Harinath <rharinath@novell.com>
1173 * generic.cs (TypeManager.IsGeneric): Remove unused method.
1175 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1178 2005-12-14 Martin Baulig <martin@ximian.com>
1180 * typemanager.cs (TypeManager.GetFullName): Make this public;
1181 `Type.Fullname' now never returns null.
1183 * class.cs (Method.Define): Use TypeManager.GetFullName() for
1184 explicit interface implementations; we're now using the same
1185 naming convention than csc does.
1187 2005-12-14 Miguel de Icaza <miguel@novell.com>
1189 * convert.cs (ExplicitConversionCore): Check the return value from
1190 ExplicitConversionCore which can return null on failure. Fixes #76914
1192 2005-12-09 Raja R Harinath <rharinath@novell.com>
1194 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1195 instead of IsGenericInstance.
1196 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
1197 code that's now covered by the more general test.
1198 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1200 * generic.cs (DropGenericTypeArguments): New. Captures the common
1201 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1202 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1203 * generic.cs, report.cs, typemanager.cs: Likewise.
1205 2005-12-08 Martin Baulig <martin@ximian.com>
1207 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1209 * typemanager.cs (TypeManager.CSharpSignature): Include type
1210 arguments in the signature of a generic method.
1212 2005-12-07 Martin Baulig <martin@ximian.com>
1214 Add support for custom attributes on type parameters.
1216 * cs-parser.jay (type_arguments): Added `opt_attributes'.
1218 * generic.cs (TypeParameterName): New public class; we use this
1219 instead of a `string' to store the name of a type parameter, so we
1220 can also have `Attributes'.
1221 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1222 array instead of a `string[]' array.
1223 (TypeParameter.ctor): We now also take an `Attributes' argument.
1224 (TypeParameter.EmitAttributes): New public method; emit our
1225 `OptAttributes' here.
1226 (GenericMethod.EmitAttributes): New public method; emit the custom
1227 attributes on all our type parameters.
1229 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1230 our type parameters.
1231 (MethodData.Define): If we're a generic method, call
1232 EmitAttributes() on it.
1234 2005-12-07 Martin Baulig <martin@ximian.com>
1237 (ConstraintChecker): New public abstract class; move the
1238 constraint checking here from `ConstructedType' and also do
1239 constraint checking for generic methods here.
1241 * expression.cs (Invocation.OverloadResolve): Use
1242 ConstraintChecker.CheckConstraints() if we resolved to a generic
1245 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1247 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1249 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1251 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1252 (FieldBase.Initializer): Initializer is now optional.
1253 (EventField.Define): Only event field can have initializer.
1255 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1257 * const.cs (Const): Reuse initializer.
1259 * cs-parser.jay: Updated after FieldBase changes.
1260 Added current_array_type to simplify array initializers.
1262 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1264 * expression.cs, iterators.cs: Updated.
1266 * namespace.cs (NamespaceEntry): Made UsingFound private.
1268 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1270 * parameterCollection.cs: Obsolete, removed.
1271 * parser.cs: Obsolete, removed.
1273 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1276 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1278 * enum.cs (Enum.Define): Set obsolete context here.
1280 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1283 - FindDocumentedMember() now expects 1) paramList as null
1284 when "we don't have to check the number of parameters" and
1285 2) Type.EmptyTypes when "there is no arguments".
1286 - Introduced FoundMember struct to hold the exact type which was
1287 used to find the documented member (the above change broke
1288 test-xml-044; it might be better just to use DeclaringType than
1289 what MS does, like this change does, but it depends on usage.)
1291 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1293 * doc.cs : documented member might be from DeclaringType for nested
1294 types. Fixed bug #76782.
1296 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1298 * anonymous.cs: Have the param code handle leaving copies on the
1299 stack etc. Allows anonymous params to take part in the assignment
1300 code (++, +=, etc). Fixes bug #76550
1302 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1303 it down to the anon code.
1305 * iterators.cs: Use dummy var here
1307 * codegen.cs: Handle new vars
1309 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1312 * class.cs (MethodData.Define): Set proper Obsolete context.
1314 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1316 (FieldExpr.DoResolve): Ditto.
1318 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1321 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1322 parent is not obsolete.
1324 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1326 * doc.cs : (FindDocumentedMember) find parameterless members first
1327 and get CS0419 in the early stage. Fixed first case of bug #76727.
1329 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1332 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1333 no error was reported.
1335 *expression.cs (Binary.DoResolve): left can be null.
1337 2005-12-06 Raja R Harinath <rharinath@novell.com>
1339 * class.cs (MethodCore.CheckGenericOverride): Delete unused
1340 abstract method and all overrides.
1341 * support.cs (ParameterData.GenericConstraints): Delete.
1342 (ReflectionParameters.type_params): Delete.
1343 (ReflectionParameters.ReflectionParameters): Make private.
1344 (ReflectionParameters.GetConstaints): New factory method.
1345 * generic.cs (TypeParameterDefineType): Use it.
1346 (TypeManager.GetTypeParameterConstraints): Likewise.
1348 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1351 * class.cs (MethodData.Emit): Parameters should be labeled first.
1353 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1356 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1358 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1360 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1362 * class.cs (MethodCore): Parameter clean up.
1363 (IMethodData): Added ParameterInfo.
1364 (MethodData): Parameter clean up.
1365 (Indexer.Define): Parameter clean up.
1377 * typemanager.cs: Parameter clean up.
1379 * delegate.cs (Define): Get rid of duplicated code.
1381 * expression.cs (ParameterReference): Removed useless parameters
1383 (Invocation): Ditto.
1385 * parameter.cs (ParamsParameter): New class, params specialization.
1386 (ArglistParameter): Attemp to separate arglist.
1387 (Parameter): Refactored to be reusable and faster.
1388 (Parameter.Modifier): Made understandable.
1389 (Parameters): Changed to be used as a class for `this' assembly
1390 parameters. Refactored to use new specialized classes.
1392 * support.cs (ParameterData): Added Types property.
1393 (InternalParameters): Deleted.
1395 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1397 * doc.cs : the previous patch does not actually fix the bug.
1398 PropertyInfo override check is now implemented and really fixed it.
1399 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1401 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1403 * doc.cs : apply "override filter" also to properties.
1406 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1408 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1409 no need to check overrides. For classes, omit those results from
1410 interfaces since they must exist in the class. Fixed bug #76726.
1412 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1414 * typemanager.cs : (GetFullNameSignature) differentiate indexers
1415 with different parameters. Fixed the second problem in #76685.
1417 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1419 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1420 get expected 'protected' access in CheckValidFamilyAccess()).
1423 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1425 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1426 Fixed bug #76705. CS1569 was incorrectly commented out.
1428 2005-11-23 Martin Baulig <martin@ximian.com>
1430 * generic.cs (Constraints.Define): Removed.
1431 (TypeParameter.DefineConstraints): Removed.
1432 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1433 on the GenericTypeParameterBuilder here.
1435 2005-11-23 Martin Baulig <martin@ximian.com>
1437 * typemanager.cs (TypeManager.GetProperty): Make this public.
1439 * generic.cs (Nullable.NullableInfo.ctor): Use
1440 TypeManager.GetProperty() rather than using reflection directly.
1442 2005-11-17 Martin Baulig <martin@ximian.com>
1444 * expression.cs (Indexers.GetIndexersForType): Added support for
1445 generic parameters; fixes #76587.
1447 2005-11-17 Martin Baulig <martin@ximian.com>
1450 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1451 inherit the scope from our parent. Fixes #76653.
1453 2005-11-15 Martin Baulig <martin@ximian.com>
1455 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1456 instead of `ScopeTypeBuilder' to refer to the "current" type.
1457 (AnonymousMethod.CreateScopeType): Correctly create the helper
1458 class if we're inside a generic type definition.
1460 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1462 * doc.cs : use Invocation.IsOverride() to do real override check.
1463 * expression.cs : made Invocation.IsOverride() internal.
1465 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1467 * doc.cs : use TypeManager.FindMembers() instead of (possible)
1468 TypeBuilder.FindMembers() and filter overriden base members out.
1471 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1473 * doc.cs : ref/out parameters are represented as '@' (instead of
1474 '&' in type FullName). Fixed bug #76630 (additionally crefs).
1476 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1478 * doc.cs : when there was no '.' in cref to methods in doc comment,
1479 then parameters were missing in the output. Fixed bug #76691.
1481 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1483 * driver.cs : don't output docs when there is an error.
1486 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1489 Now it should detect indexers. Fixed primary concern in bug #76685.
1490 Fixed CS0419 message to not show the identical member signature in
1493 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1495 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1496 instead of Type.FindMembers() since it does not handle events.
1499 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
1501 * codegen.cs: Fixed typo (speficied -> specified).
1503 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1506 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1508 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1510 * attribute.cs: Changed error message.
1512 * cs-tokenizer.cs: One more check.
1514 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1516 * statement.cs (Block.Resolve): Ignore empty statement.
1518 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1520 * report.cs: Made error/warning methods more strict to avoid
1523 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1524 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1525 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1526 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1528 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1530 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
1531 Use the more explicit AssemblyName.FullName instead of
1532 AssemblyName.Name to report errors.
1534 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1536 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1539 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1549 * report.cs: Fixed error reporting and typos.
1551 * generic.cs (TypeParameter.GetSignatureForError): New method.
1552 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1554 * typemanager.cs (GetFullName): Refactored.
1556 2005-11-08 Marek Safar <marek.safar@seznam.cz>
1558 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1559 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1561 * class.cs (TypeContainer.IsComImport): New property.
1562 (Constructor.Define): Create proper ctor for ComImport types.
1564 * expression.cs (New.CheckComImport): Fixed.
1566 2005-11-07 Miguel de Icaza <miguel@novell.com>
1568 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1569 that a parameter has been captured does not mean that we do not
1570 have to do the rest of the processing. This fixes the second part
1571 of #76592. If there was another anonymous method capturing
1572 values in the past, the Scope would never be set for the second
1573 method that captured the same parameter.
1575 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1576 properly manipulate the stack. Second part of fix for #76592.
1578 * expression.cs (New): Add support for invoking "new" on
1579 interfaces that have been flagged with the ComImport attribute and
1580 the CoClass. Fixes #76637
1582 * statement.cs (Try.DoEmit): When a variable is captured, do not
1583 try to emit the vi.LocalBuilder variable as it has been captured.
1584 Create a temporary variable and store the results on the
1585 FieldBuilder. Fixes #76642
1587 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1589 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1591 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1593 * expression.cs (Binary.DoResolve): Added && optimalization.
1595 * typemanager.cs (AddUserType): Removed useless argument.
1597 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1599 * statement.cs (Block.variables): Uses ListDictionary.
1601 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1604 * class.cs (PartialContainer.EmitType): Customized to emit
1605 security attributes.
1606 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1607 for partial classes.
1609 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1612 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1613 access has to be fixed.
1615 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1617 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1620 * ecore.cs (NullCast.Reduce): Implemented.
1622 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1625 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1627 (Foreach.Resolve): Catch null properly.
1629 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1631 * cs-tokenizer.cs: Warning text fix.
1633 * driver.cs: AllWarningNumbers exposed on public interface.
1635 * report.cs (): Reviewed warning numbers.
1636 (IsValidWarning): Use binary search.
1638 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1640 * driver.cs: Implemeted resource visibility.
1641 (Resources): New class for code sharing between /res: and
1644 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1646 decl.cs (CurrentTypeParameters): Fixed to be public.
1648 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1650 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1652 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1654 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1656 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
1658 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1660 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1662 Add friend assembly access support.
1663 * typemanager.cs: assembly_internals_vis_attrs
1664 cache for friend assembly access.
1665 (TypeManager.IsFriendAssembly): New method for
1666 checking friend assembly access.
1667 (TypeManager.Error_FriendAccessNameNotMatching): New
1669 (TypeManager.CompareKeyTokens): Likewise.
1670 (TypeManager.Filter): Handle friend accessible
1673 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1674 friend accessible types.
1676 * ecore.cs (Expression.IsAccessorAccessible): Handle
1677 friend accessible properties.
1679 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1682 2005-10-28 Marek Safar <marek.safar@seznam.cz>
1685 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1688 * convert (Convert.ImplicitReferenceConversion): NullCast holds
1691 * ecore.cs (NullCast): Child is contant only.
1693 * literal.cs (NullLiteral.Reduce): null can be converted to any
1696 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
1698 * driver.cs: Use Encoding.Default as default code page instead
1701 2005-10-27 Raja R Harinath <rharinath@novell.com>
1704 * expression.cs (Invocation.Error_InvalidArguments): Handle
1705 __arglist parameters.
1706 (Invocation.VerifyArgumentsCompat): Likewise.
1707 * support.cs (ReflectionParameters.GetSignatureForError): Print
1708 __arglist parameters.
1709 (InternalParamters.GetSignatureForError): Likewise.
1710 * parameter.cs (Parameters.GetSignatureForError): Likewise.
1712 2005-10-26 Marek Safar <marek.safar@seznam.cz>
1714 * attribute.cs (GetPropertyValue): Made public.
1716 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1718 Add new property WrapNonExceptionThrows to handle 2.0 assembly
1720 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1723 * driver.cs: Reflect method name change.
1725 * statement.cs (Try.Resolve): Warn when try has both general
1728 * typemanager.cs: runtime_compatibility_attr_type new predefined
1731 2005-10-26 Raja R Harinath <harinath@gmail.com>
1734 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1735 treat it as an empty parameter list.
1737 2005-10-26 Raja R Harinath <rharinath@novell.com>
1740 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
1741 ResolveAsTypeStep silent.
1742 * statement.cs (Block.AddConstant): Mark block as used.
1743 (Block.ResolveMeta): Avoid piling on error messages
1744 if a constant initializer resolution fails.
1746 2005-10-25 Raja R Harinath <rharinath@novell.com>
1748 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1750 (NamespaceEntry.VerifyAllUsing): New.
1751 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
1752 behaviour. Delegates actual resolution of alias to ...
1753 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
1754 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1756 * driver.cs (Driver.MainDriver): Update.
1758 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1759 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1761 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1763 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1764 RootNamespace.DefineNamespacesForAll.
1766 2005-10-24 Raja R Harinath <harinath@gmail.com>
1768 * typemanager.cs (assemblies, external_aliases, modules)
1769 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1770 (ComputeNamespaces, GetRootNamespace): Remove extra staging
1771 overhead. Move resposibility ...
1772 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
1773 * driver.cs, attribute.cs, codegen.cs: Update to changes.
1775 2005-10-23 Raja R Harinath <harinath@gmail.com>
1777 * namespace.cs (RootNamespace.all_namespaces): Renamed from
1778 cached_namespaces. Improve usage.
1779 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1780 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1781 Move from GlobalRootNamespace and simplify.
1782 (RootNamespace.Global): Make instance variable.
1783 (RootNamespace.RootNamespace): Add "alias name" parameter.
1784 (GlobalRootNamespace): Simplify drastically.
1785 (Namespace.Lookup): Don't use GetNamespace.
1786 * typemanager.cs (GetRootNamespace): Rename from
1787 ComputeNamespaceForAlias.
1788 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1790 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1792 * anonymous.cs (AnonymousContainer): Don't crash when container
1795 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1797 * expression.cs (Binary.DoResolve): Warn when comparing same
1800 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1803 * expression.cs (Binary.DoResolve): It looks like there are no
1804 convetsion rules in enum context.
1806 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1808 Add support for extern alias qualifiers.
1809 * typemanager.cs: Move some LookupTypeReflection code
1810 to namespace.cs, to have cleaner code. Added some methods
1811 to help us keep track of the extern aliased references.
1812 * driver.cs: Add suport for extern alias assemblies on command
1813 line and check for their warnings/errors. Also keep track of the
1814 extern aliased assemblies.
1815 * namespace.cs: Move the global functionality of Namespace
1816 to GlobalRootNamespace/RootNamespace. Now the global namespace
1817 is GlobalRootNamespace.Globa. Also the code moved from
1818 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
1819 Finally added LocalAliasEntry (AliasEntry before) and
1820 ExternAliasEntry, to handle alias statements.
1821 * cs-parser.jay: Add support in the grammar for extern alias
1823 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
1824 Update callings to Namespace (now in GlobalRootNamespace).
1826 2005-10-25 Martin Baulig <martin@ximian.com>
1828 * convert.cs (ImplicitTypeParameterConversion): Make base
1829 interfaces actually work; fixes #76557.
1831 2005-10-25 Martin Baulig <martin@ximian.com>
1834 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1835 all the type parameters; fixes #76551.
1837 2005-10-25 Martin Baulig <martin@ximian.com>
1842 (GenericMethod.ctor): Added `Expression return_type' and
1843 `Parameters parameters' arguments.
1844 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1845 parameter and return types to check their constraints if they're
1848 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1851 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1852 constraints of a generic type if `ec.ResolvingGenericMethod'.
1854 * class.cs (MethodCore.DoDefineParameters): Set
1855 `ec.ResolvingGenericMethod' if we're a generic method.
1856 (MemberBase.MemberType): Likewise.
1858 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1860 * typemanager.cs (TypeManager): Added
1861 TypeManager.internals_visible_attr_type to cache
1862 S.R.CompilerServices.InternalsVisibleToAttribute.
1864 * codegen.cs (AssemblyClass): Added checks for
1865 InternalsVisibleToAttribute in new method
1866 CheckInternalsVisibleAttribute () and also cache the
1867 AssemblyName in AssemblyClass.Name.
1869 2005-10-24 Martin Baulig <martin@ximian.com>
1872 (TypeManager.ExpandInterfaces): Added overloaded version which
1873 just takes a `Type[]' array.
1876 (Constraints.Resolve): Don't expand the interfaces here; ie. we
1877 just use the interfaces which were explicitly specified and not
1878 the interfaces they inherit. Fixes #76482.
1879 (TypeParameter.FindMembers): Expand the interfaces here.
1881 2005-10-21 Martin Baulig <martin@ximian.com>
1884 (Constraints.Resolve): Also resolve the actual types here.
1885 (Constraints.ResolveTypes): Just check the constraints here.
1886 Fixes #76363; see gtest-218.cs.
1888 2005-10-21 Martin Baulig <martin@ximian.com>
1891 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1892 instead of a `BoxedCast'; fixes gtest-217.cs.
1894 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
1896 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1897 1) "new()" is specified as generic parameter constraint and 2) the
1898 type is TypeBuilder and 3) the type is abstract even if it has a
1899 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1901 2005-10-20 Martin Baulig <martin@ximian.com>
1904 (GenericConstraints.TypeParameter): New public property.
1905 (TypeParameter.ctor): Also take a `DeclSpace' argument.
1906 (TypeParameter.DeclSpace): New public property.
1907 (TypeParameter.DefineType): Inflate the constraints if our
1908 `DeclSpace' is an `Iterator'.
1910 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
1912 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
1913 GenericMethod argument to compare methods' generic type arguments.
1916 2005-10-19 Martin Baulig <martin@ximian.com>
1918 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1919 not ResolveType() when resolving the base type, so we're not
1920 checking the constraints here.
1921 (TypeContainer.ResolveType): Call ResolveType() on our base_type
1924 2005-10-19 Martin Baulig <martin@ximian.com>
1926 * generic.cs (ConstructedType.CheckConstraints): Committing
1927 untested fix for #76441.
1929 2005-10-18 Raja R Harinath <rharinath@novell.com>
1932 * class.cs (TypeContainer.DefineType): Move updating of
1933 topological sort earlier in the code.
1934 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1936 2005-10-18 Marek Safar <marek.safar@seznam.cz>
1939 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1941 * constant.cs (Constant.TryReduce): Moved from Cast class.
1942 (Reduce): Made little bit more OO and fixed missing conversions.
1944 * ecore.cs (Reduce): Implemented.
1945 (Binary.EnumLiftUp): New method to upgrade values to enum values.
1947 * literal.cs (Reduce): Implemented.
1949 * class.cs: Reverted Miguel's wrong commit.
1951 2005-10-14 Miguel de Icaza <miguel@novell.com>
1953 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1955 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
1957 * cs-parser.jay, expression.cs : CS0214 was missing error location
1958 for constants. Fixed bug #76404.
1960 2005-10-10 Raja R Harinath <rharinath@novell.com>
1962 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1964 (PropertyExpr.EmitCall): Likewise.
1965 * expression.cs (Invocation.EmitArguments): Handle case where
1967 (Invocation.EmitCall): Avoid allocating temporary variable if
1968 there are no arguments.
1970 2005-10-11 Marek Safar <marek.safar@seznam.cz>
1973 * convert.cs (ExplicitConversionCore): Fixed object->enum
1976 2005-10-07 Raja R Harinath <rharinath@novell.com>
1979 * convert.cs (ImplicitConversionStandard): Move conversion of
1980 void* to arbitrary pointer types ...
1981 (ExplicitConversionStandard): .. here.
1982 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1983 error to always print typenames.
1985 2005-10-07 Raja R Harinath <rharinath@novell.com>
1987 * convert.cs (GetConversionOperator): Rename from
1988 GetConversionOperators. Move operator selection code from ...
1989 (UserDefinedConversion): ... here.
1991 2005-10-06 Marek Safar <marek.safar@seznam.cz>
1993 * convert.cs (ExplicitConversionCore): Removed duplicate enum
1996 2005-10-05 Marek Safar <marek.safar@seznam.cz>
1998 * assign.cs (Assign.DoResolve): Error method changed.
2000 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2002 * const.cs (ResolveValue): Reset in_transit immediately.
2004 * constant.cs: Error method changed.
2006 * convert.cs: Removed useless location parameter.
2007 (ExplicitNumericConversion): Don't do double enum check.
2008 (ExplicitConversionCore): Renamed from ExplicitConversion.
2009 (ExplicitUnsafe): Extracted from ExplicitConversion.
2010 (ExplicitConversion): Uses for error reporting.
2012 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2014 (ResolveBoolean): Uses common error method.
2015 (CastToDecimal): Get rid of ec.
2016 (CastFromDecimal): Optimized.
2017 (ConvCast): Get rid of ec.
2019 * enum.cs (ResolveValue): Reset in_transit immediately.
2020 (Emit): Return after first error.
2022 * expression.cs: Convert changes.
2024 * literal.cs: Error method changed.
2026 * statement.cs: Error method changed.
2028 2005-10-06 Raja R Harinath <rharinath@novell.com>
2030 Fix gtest-131.cs and gtest-211.cs.
2031 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2032 Only emit code for a label if it is used. Unreachable code can
2033 violate ECMA evaluation stack invariants.
2035 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2037 * anonymous.cs: Implemented ExprClassName.
2039 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2042 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2045 * class.cs (StaticClass.DefineContainerMembers): Report protected
2048 * codegen.cs: if(ed) PRODUCTION.
2050 * convert.cs (Error_CannotImplicitConversion): Better error
2053 * cs-parser.jay: More error checks.
2055 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2057 * driver.cs (CSCParseOption): Enabled wrong option check.
2059 * ecore.cs (Expression.ExprClassName): Turned to property.
2060 (MemberExpr.CheckIntermediateModification): For checking boxed
2061 value types modification.
2063 * statement.cs (Fixed.Resolve): Expression type must be
2064 convertible to fixed type.
2065 (CollectionForeach.GetEnumeratorFilter,TryType):
2066 Small refactoring for easier error checking.
2068 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2070 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2073 * class.cs (GeneratedBaseInitializer): New class for customization
2074 compiler generated initializers.
2075 (MemberBase.DoDefine): Check Obsolete attribute here.
2076 (FieldMember.DoDefine): Ditto.
2078 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2081 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2082 (MemberCore.GetObsoleteAttribute): Removed argument.
2083 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2084 (MemberCore.CheckObsoleteType): New helper.
2088 * statement.cs: Updates after MemberCore changes.
2090 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2091 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2093 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2094 obsolete attribute for compiler construct.
2095 (As.DoResolve): Cache result.
2097 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2099 2005-10-01 Miguel de Icaza <miguel@novell.com>
2101 * expression.cs (Probe): instead of having a "Type probe_type"
2102 keep the extra information as a TypeExpr probe_type_expr since the
2103 "As" operator needs to perform some type checks.
2105 * (As.DoResolve): If the type is a type parameter, ensure that it
2106 is constrained by a class.
2108 2005-09-22 Miguel de Icaza <miguel@novell.com>
2110 * statement.cs (Lock): Use the TemporaryVariable class instead of
2111 manually using local variables as those do not work when variables
2114 * ecore.cs: Moved the TemporaryVariable class from being a nested
2115 class inside Foreach to be a public class that can be employed in
2118 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2120 * cs-parser.jay: interface_accessors replaced by
2121 accessor_declarations.
2123 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2126 * statement.cs (GotoCase.Resolve): Convert null constant to
2128 (SwitchLabel.ResolveAndReduce): Ditto.
2129 (SwitchLabel.NullStringCase): Custom null stamp.
2130 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2132 typemanager.cs (CSharpSignature): Don't skip first argument
2135 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2137 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2138 expression.cs, iterators.cs, literal.cs: Store constants and
2141 * class.cs (MemberBase.ShortName): Pass location.
2143 * cs-parser.jay: Some location fixes.
2145 * ecore.cs (Expression.Location): Made virtual.
2147 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2150 * const.cs (Const.ResolveValue): Check for assigning non-null
2151 value to reference type.
2153 2005-09-26 Raja R Harinath <rharinath@novell.com>
2156 * expression.cs (This.VerifyFixed): In a value type T, the type of
2157 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2158 value type R, 'this' is treated as a value parameter.
2160 2005-09-05 Miguel de Icaza <miguel@novell.com>
2162 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2163 if the underlying types are the same, otherwise we need to produce
2164 code that will do the proper cast.
2166 This was exposed by Marek's constant rewrite which produced
2167 invalid code for the call site:
2170 void Method (X v) {}
2174 This fixes test-49.cs
2176 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2178 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2179 Type/Object should be allowed as well. Fixed bug #75968.
2181 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2183 * expression.cs : (Binary.DoResolve): when one is enum constant and
2184 another is constant 0, then return enum one *as enum type*.
2187 2005-10-04 Martin Baulig <martin@ximian.com>
2189 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2190 `SetMemberIsUsed()' work for generics, too.
2192 2005-10-04 Martin Baulig <martin@ximian.com>
2194 * expression.cs (DelegateInvocation.EmitStatement): Make this work
2195 for corlib. Fixes #75691.
2197 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2200 * driver.cs: Fix compilation files with full root path.
2202 2005-09-25 Miguel de Icaza <miguel@novell.com>
2204 * report.cs (SymbolRelatedToPreviousError): Format the output so
2205 it does not use an open parenthesis that is never closed.
2207 * driver.cs: Follow coding guidelines
2209 2005-09-18 Miguel de Icaza <miguel@novell.com>
2211 * driver.cs: Set InEmacs based on the environment variable EMACS.
2213 * location.cs (InEmacs): in this mode, do not report column
2214 location as it confuses Emacs.
2216 2005-10-03 Raja R Harinath <rharinath@novell.com>
2218 * support.cs (SeekableStreamReader.Position): Don't error out when
2219 the requested position is just beyond the end of the current
2222 2005-09-28 Raja R Harinath <rharinath@novell.com>
2224 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2225 try to keep in sync with the byte count of the underlying Stream.
2226 However, this limits us to a window size of 2048 characters: i.e.,
2227 the maximum lookahead of our lexer/parser can be 2048 characters.
2229 2005-09-22 Martin Baulig <martin@ximian.com>
2231 * driver.cs: Removed a debugging FIXME.
2233 2005-09-21 Raja R Harinath <rharinath@novell.com>
2235 * cs-parser.jay (type_arguments): Add CS1644 check.
2236 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2238 2005-09-15 Raja R Harinath <rharinath@novell.com>
2240 * Makefile (PROGRAM): Make profile specific.
2241 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2242 the current directory.
2245 * expression.cs (Invocation.EmitCall): Remove optimization on
2246 this_call since it doesn't handle 'this' being a value type.
2248 2005-09-05 Geoff Norton <gnorton@customerdna.com>
2250 * driver.cs: Ensure file handles are closed after parsing
2252 2005-09-05 Miguel de Icaza <miguel@novell.com>
2254 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2255 if the underlying types are the same, otherwise we need to produce
2256 code that will do the proper cast.
2258 This was exposed by Marek's constant rewrite which produced
2259 invalid code for the call site:
2262 void Method (X v) {}
2266 This fixes test-49.cs
2268 2005-09-05 Martin Baulig <martin@ximian.com>
2270 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2271 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2273 * cs-parser.jay (delegate_declaration): Small fix for #75852.
2275 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2277 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2278 to be a pointer type due to the spec 25.2, so check if declaring
2279 type is generic type definition. Fixed bug #75772.
2281 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2284 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2285 both types are not defined by methods.
2286 * expression.cs : (Invocation.IsApplicable): it should work when
2287 the argument type is equal to the parameter type, not only when
2288 ImplicitConversionExists() returns true.
2290 2005-09-02 Raja R Harinath <rharinath@novell.com>
2292 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2296 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2297 flow-branching for LocalVariableReferences in case we were invoked
2298 from a MemberAccess.
2299 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2301 (LocalVariableReference.DoResolveBase): ... this.
2302 (MemberAccess.Resolve): Do the check that was disabled during
2305 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2308 (PartialContainer.Create): check abstract/sealed/static strictly
2309 but abstract/sealed can exist only at one side. Fixed bug #75883.
2311 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2314 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2315 specified, don't default to UnmanagedType.I4.
2317 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2319 * expression.cs : conditional operator should check possibly
2320 incorrect assign expression. Fixed bug #75946.
2322 2005-08-30 Raja R Harinath <rharinath@novell.com>
2325 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2326 (ScopeInfo.EmitScopeType): Use it to construct field names from
2327 names of captured locals.
2330 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2331 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2332 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2333 (ExplicitConversion): Remove enum cases already handled by
2334 implicit conversion. Move implicit conversion check to the beginning.
2335 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2336 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2337 Don't treat System.Enum as a struct.
2339 2005-08-30 Jb Evain <jbevain@gmail.com>
2341 * attribute.cs: handles as expression in parameters.
2343 2005-08-30 Raja R Harinath <rharinath@novell.com>
2346 * class.cs (TypeContainer.VerifyClsName): Don't use a
2347 PartialContainer when verifying CLS compliance.
2348 (AbstractPropertyEventMethod): Set Parent here, ...
2349 (PropertyMethod): ... not here.
2351 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2353 * attribute.cs : escaped attribute name should not be allowed to be
2354 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2356 2005-08-29 Raja R Harinath <rharinath@novell.com>
2359 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2360 when converting a long constant to unsigned long.
2361 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2362 detect where IsApplicable and VerifyArgumentsCompat disagree.
2364 2005-08-29 Raja R Harinath <rharinath@novell.com>
2365 and Carlos Alberto Cortez <carlos@unixmexico.org>
2368 * class.cs (TypeContainer.CanElideInitializer): New helper.
2369 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2370 can safely emitting the initializer of a field.
2372 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2374 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2375 allowed inside a switch (without loop). Fixed bug #75433.
2377 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2379 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2380 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2382 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2384 * driver.cs : kinda reverting the default encoding changes (not exact
2385 revert since I noticed that "codepage:reset" might not work fine).
2387 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2389 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2390 Location. Now getter and setter store location correctly.
2391 (errors/cs0111-12.cs now reports the expected location.)
2393 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2395 * driver.cs : Use default encoding on the environment.
2396 Removed (now that) extra parameter for SeekableStreamReader.
2397 * support.cs : (SeekableStreamReader) third .ctor() argument for
2398 StreamReader is not required (always true). preamble size could
2399 be acquired in simpler and safe way.
2401 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2403 * cs-parser.jay: report CS0642 at warning level 3
2404 and report CS0642 for an if else statement also
2405 fixes bug #74745. Patch by John Luke (and a bit
2407 Removed extra CS0642 warning check for "while",
2409 * statement.cs: In Block.Resolve(), CS0642 check
2410 is reimplemented to check a sequence of an empty
2411 statement and a block.
2413 Both fix bug #66777.
2415 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2417 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2418 detection until I fix it.
2420 * cs-tokenizer.cs: Changed error message.
2422 * cs-parser.jay: Fixed 2 error locations.
2424 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2425 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2428 * enum.cs (GetSignatureForError): Fixed.
2430 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2434 * typemanager.cs (RegisterProperty): Removed.
2436 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2438 2005-08-24 Raja R Harinath <rharinath@novell.com>
2441 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2442 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2444 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2446 * expression.cs : tiny fix is required for not warning positive ulong.
2449 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2451 * expression.cs : add CS0652 check for constant and integral
2452 expression. Fixed bug #53974.
2454 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2456 * expression.cs : in DoNumericPromotions(), check if there is implicit
2457 conversion overload for string (to check CS0034). Fixed bug #52492.
2459 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2461 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2463 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2465 * ecore.cs : report location when it is *not* Null.
2467 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2473 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2474 correctly. Fixed bug #75721.
2476 2005-08-23 Raja R Harinath <rharinath@novell.com>
2478 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2479 loop that performs 'min (pos, char_count)'.
2482 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2483 converted value in Operator.OnesComplement.
2485 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2487 * anonymous.cs: If the anon method is pulled into a helper class,
2488 it needs to be `internal' not `private'. Fixes runtime behavior on
2491 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2494 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2497 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2499 The big constants rewrite
2500 Fix #75746, #75685 and more
2501 As a side effect saved 1MB for MWF ;-)
2503 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2504 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2505 enum based for corlib compilation.
2507 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2510 * class.cs (FixedField.Define): Use ResolveAsConstant.
2512 * const.cs (IConstant): Interface constants and enums.
2513 (Const.ResolveValue): New method for constant resolvning.
2514 (ExternalConstant): Constants from imported assemblies.
2516 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2517 conversion; like enums.
2518 (Constant.ToType): Converts this constant to different type.
2519 (Constant.Increment): Adds 1.
2521 * convert.cs (ImplicitConversionRequired): Simplified.
2523 * cs-parser.jay: Create EnumMember directly.
2525 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2527 * doc.cs (GenerateEnumDocComment): Removed.
2529 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2530 (ConvertIntLiteral): Removed.
2531 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2533 * enum.cs (EnumMember): Implement IConstant.
2534 (Enum.IsValidEnumConstant): Removed.
2535 (Enum.GetNextDefaultValue): Removed.
2536 (Enum.FindMembers): Updated.
2537 (Enum.GenerateDocComment): Iterate enum members.
2539 * expression.cs (Cast.TryReduce): Handle enums correctly.
2540 (New.Constantify): Made public.
2541 (MemberAccess.DoResolve): Removed contant specific if(s).
2543 * literal.cs (NullLiteral): Implement new abstract methods.
2545 * statement.cs (GotoCase.Resolve): Use new constant methods.
2546 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2548 * typemanager.cs (LookupEnum): Removed.
2549 (IsEnumType): Fixed to work with corlib.
2550 (RegisterConstant): Removed.
2551 (LookupConstant): Removed.
2552 (GetConstant): Changed to work with IConstant.
2554 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2556 * location.cs : Fixed overflown (>255) column number.
2558 2005-08-03 Raja R Harinath <rharinath@novell.com>
2560 First cut of the qualified-alias-member feature.
2561 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2563 * cs-parser.jay (DOUBLE_COLON): New token.
2564 (namespace_or_type_name): Add rule for recognizing
2565 qualified-alias-members.
2566 (primary_expression): Likewise.
2567 (element_access): Allow QualifiedAliasMember as a possible
2568 type-bearing expression.
2569 (local_variable_type, local_variable_pointer_type): Likewise.
2570 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2571 aliases in the current and enclosing namespace declarations.
2572 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2573 * decl.cs (MemberName.is_double_colon): New.
2574 (MemberName.MemberName): Add new constructor for alias-member.
2575 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2576 * expression.cs (QualifiedAliasMember): New expression type.
2578 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2580 * location.cs : it borked when no argument was specified.
2582 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2584 * location.cs : tiny ToString() format fix.
2586 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2588 * statement.cs : oops, it was missing.
2590 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2592 A set of fixes for precise line/column location.
2595 "token" field now holds a file/line "delta", a line number offset
2596 from the segment, and a column number. See also:
2597 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2598 December/009508.html
2599 Removed static IsNull. Use instance IsNull property instead.
2601 For some tokens it stores Location. For Identifier it stores
2602 LocatedToken which is a pair of string name and location.
2603 Column numbers are adjusted only at getChar().
2605 Use Location.ToString() for reporting (it now contains column).
2607 Largely modified to use LocatedToken instead of
2608 string (IDENTIFIER), and to acquire Location from some tokens.
2609 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2610 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2612 Now MemberName holds Location. DeclSpace.ctor() receives Location
2613 as a parameter. Removed extra parameters to all derived classes.
2614 Replaced Location.IsNull() with instance property.
2615 * assign.cs, expression.cs :
2616 Added .ctor() overload that omits Location.
2618 Added "nameEscaped" flag that indicates the identifier was escaped
2619 in the source file. This fixes bug #57047.
2621 2005-09-02 Martin Baulig <martin@ximian.com>
2623 * class.cs: Make CS3005 a warning, not an error.
2625 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2627 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2628 New method, looking for lo-case imported cls type.
2630 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2633 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2635 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2637 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2639 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2641 Optimized to save 3.5 MB for SWF compilation.
2643 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2645 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2646 (PartialContainer.Create): Moved logic AddToContainer.
2647 (PartialContainer.MarkForDuplicationCheck): Shares name.
2649 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2652 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2654 (Namespace.GetSignatureForError): New method.
2656 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2657 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2659 2005-08-01 Raja R Harinath <rharinath@novell.com>
2662 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2663 member lookup rather than qualifier_type, since qualifier_type can
2666 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2668 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2671 2005-07-31 Miguel de Icaza <miguel@novell.com>
2673 * statement.cs: Copy the local exception into the exception
2674 captured local. Fixes 75674
2676 2005-07-31 Raja R Harinath <harinath@gmail.com>
2679 * expression.cs (Invocation.OverloadResolve): Don't report error
2680 CS1501 if error CS1502 has been reported.
2681 (New.DoResolve): Delegate CS1501 reporting to
2682 Invocation.OverloadResolve.
2685 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2686 invariant-meaning-in-block property in an enclosing block if
2689 2005-07-29 Marek Safar <marek.safar@seznam.cz>
2691 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2692 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2693 (Switch.CheckSwitch): Just save 50kb for SWF.
2695 2005-07-27 Martin Baulig <martin@ximian.com>
2697 * anonymous.cs (CaptureContext.AddField): Added
2698 `AnonymousContainer am' argument; compute its toplevel scope if
2699 it's not already computed. Fixes #75649.
2701 2005-07-26 Raja R Harinath <rharinath@novell.com>
2704 * class.cs (Constructor.Emit): Reset block to null if the block
2707 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2709 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2711 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2713 * class.cs (MethodData.Define): Check whether accessor implementing
2714 interface is public.
2716 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2718 2005-07-22 Marek Safar <marek.safar@seznam.cz>
2721 * namespace.cs (LookupType): Moved same type check to...
2723 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2726 2005-07-21 Raja R Harinath <rharinath@novell.com>
2728 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2729 already found a typebuilder.
2730 * class.cs (MethodCore.IsDuplicateImplementation): Compare
2731 MemberNames, not strings.
2733 * const.cs (Error_ExpressionMustBeConst):
2734 Rename from Error_EpressionMustBeConst.
2735 * const.cs, class.cs, statement.cd: Update.
2737 2005-07-21 Marek Safar <marek.safar@seznam.cz>
2741 * const.cs (Const.LookupConstantValue): Report missing contant expression
2743 (Error_EpressionMustBeConstant): Only one error method.
2745 * class.cs, statement.c: Updated.
2747 2005-07-20 Raja R Harinath <rharinath@novell.com>
2749 * statement.cs (Block.Flags): Add back HasVarargs.
2750 (Block.flags): Make protected.
2751 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2753 * typemanager.cs (types, typecontainers, user_types): Remove.
2754 (UserTypes, TypeContainers): Likewise.
2755 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2756 (CleanUp, Reset): Update.
2757 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
2758 (GetNestedType): Use Type.GetNestedType.
2759 (CoreLookupType): Take two arguments, the namespace and the
2760 basename of the type. Update to use the Namespace.Lookup
2762 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2763 (RealMemberLookup): Use IsNestedChildOf instead of playing with
2764 string concatenation and substring matches.
2765 * class.cs, enum.cs, delegate.cs: Update to changes.
2767 2005-07-20 Marek Safar <marek.safar@seznam.cz>
2769 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2770 Expression and made virtual.
2772 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2773 (ImplicitStandardConversionExists): Fixed `byte' typo ?
2775 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2777 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2780 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2783 2005-07-18 Marek Safar <marek.safar@seznam.cz>
2786 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2787 AssemblyCultureAttribute is not used on executable.
2790 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2792 2005-07-16 Raja R Harinath <rharinath@novell.com>
2795 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2796 New. Reports CS0252/CS0253.
2797 Mostly taken from preliminary patch by Duncak Mak.
2798 (Binary.DoResolveOperator): Store results of operator lookup.
2799 Use them to detect if we need to warn about unintended reference
2802 2005-07-15 Raja R Harinath <rharinath@novell.com>
2805 * namespace.cs (Namespace.Lookup): Add back location parameter.
2806 (Namespace.LookupType): Add CS0436 report. Add location parameter.
2807 * delegate.cs, ecore.cs, expression.cs: Update to changes.
2809 * codegen.cs (EmitContext.DeclSpace): Make readonly.
2810 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2811 (Namespace.LookupType): ... this.
2812 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2814 * typemanager.cs (LookupTypeReflection): Remove buggy code that
2815 purported to handle pointers.
2816 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2819 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2821 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2824 2005-07-15 Raja R Harinath <rharinath@novell.com>
2826 * namespace.cs (Namespace.Lookup): Drop location parameter.
2827 (NamespaceEntry.LookupAlias): Remove. Merge into ...
2828 (NamespaceEntry.Lookup): ... this.
2829 (NamespaceEntry.Error_AmbiguousTypeReference):
2830 Move here from DeclSpace.
2831 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2833 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2834 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2835 Move to NamespaceEntry.
2836 * delegate.cs, expression.cs: Update to changes.
2838 2005-08-31 Martin Baulig <martin@ximian.com>
2840 Committing a patch from Atsushi Enomoto for #75850.
2842 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2843 Prefer a generic enumerator over a non-generic one.
2845 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2847 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2848 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2850 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2852 * driver.cs : reverting default encoding change as well as mcs.
2854 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2856 * driver.cs, support.cs : merged r48826.
2858 > could you integrate your mcs changes to gmcs otherwise
2859 > gmcs cannot compile some files.
2861 2005-08-20 Martin Baulig <martin@ximian.com>
2863 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2864 scope if we don't already have it.
2866 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2867 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2870 2005-07-31 Miguel de Icaza <miguel@novell.com>
2872 * statement.cs: Copy the local exception into the exception
2873 captured local. Fixes 75674
2875 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2877 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2880 2005-08-12 Martin Baulig <martin@ximian.com>
2882 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2883 for nested types here to avoid hitting the cache too early.
2885 2005-08-09 Miguel de Icaza <miguel@novell.com>
2887 * enum.cs: On the new compiler CLS error 3005 is now a warning not
2890 2005-08-03 Martin Baulig <martin@ximian.com>
2892 Make iterators in generic methods work; see gtest-191.cs.
2895 (Constraints.Resolve): Protect against being called twice.
2898 (TypeContainer.GetClassBases): Make this `protected virtual'.
2900 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2901 (Iterator.GetClassBases): Override this and compute the base
2903 (Iterator.DefineNestedTypes): If we're a generic method, all our
2904 method type parameters become class type parameters on the proxy
2908 (ToplevelBlock.Parameters): Make this a property, not a field.
2909 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2911 2005-08-03 Martin Baulig <martin@ximian.com>
2913 * typemanager.cs (TypeManager.IsSubclassOf): Use
2914 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2915 (TypeManager.GetFullName_recursed): Improved.
2917 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2920 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2921 Private accessor case, using TypeManager.IsPrivateAccessible instead of
2922 invocation_type == mi.DeclaringType, since the first one also checks
2923 other condition used by generic instances.
2925 2005-07-27 Martin Baulig <martin@ximian.com>
2927 * anonymous.cs (CaptureContext.AddField): Added
2928 `AnonymousContainer am' argument; compute its toplevel scope if
2929 it's not already computed. Fixes #75649.
2931 2005-07-14 Marek Safar <marek.safar@seznam.cz>
2933 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2934 CheckAttributeType and refactored.
2935 (Attribute.ResolvePossibleAttributeType): Changed to reuse
2936 ResolveAsTypeTerminal error handling.
2937 (ResolveAsTypeTerminal): Introduced because of global attributes extra
2939 (GetSignatureForError): Print errors in same way.
2942 * codegen.cs: Reflect attribute GetSignatureForError change.
2945 * expression.cs: Add silent parameter to ResolveAsTypeStep.
2947 * namespace.cs (UsingEntry): Refactored to make fields private.
2950 statement.cs: Error_UnexpectedKind has extra parameter.
2952 2005-07-14 Raja R Harinath <rharinath@novell.com>
2954 * ecore.cs (IAlias): Remove.
2955 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
2956 that implement the interface.
2957 * namespace.cs (Namespace): Likewise.
2958 (Namespace.declspaces): Renamed from 'defined_names'.
2959 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
2960 DeclSpace instead of an IAlias.
2961 * tree.cs (Tree.AddDecl): Update.
2963 2005-07-12 Raja R Harinath <rharinath@novell.com>
2965 * statement.cs (Block.Flags); Remove HasVarargs.
2966 (Block.HasVarargs): Move to ToplevelBlock.
2967 (Block.ThisVariable, Block.AddThisVariable): Likewise.
2968 (Block.Variables): Make protected. Initialize variable hashtable
2970 (Block.AddVariable): Update.
2971 (Block.Resolve): Update to changes.
2972 (ToplevelBlock.HasVarargs): New boolean.
2973 (ToplevelBlock.ThisVariable): Move here from Block.
2974 (ToplevelBlock.AddThisVariable): Likewise.
2975 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
2976 * expression.cs (This.ResolveBase): Update to changes.
2977 (ArglistAccess.DoResolve): Likewise.
2979 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2982 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2984 * class.cs (TypeContainer.VerifyMembers): Distinguish between
2985 not used and not used & assigned.
2986 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2988 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2991 * expression.cs (Is.DoResolve): null is never provided type.
2993 2005-07-08 Marek Safar <marek.safar@seznam.cz>
2996 * cs-parser.jay: Less strict event error rule to catch more errors.
2998 2005-07-11 Martin Baulig <martin@ximian.com>
3000 * generic.cs (ConstructedType.CheckConstraints): Improve the check
3001 for the constructor constraint: we do not only have to check
3002 whether the class has a public constructor, but also ensure that
3003 it's parameterless. Fixes #75492.
3005 2005-07-11 Martin Baulig <martin@ximian.com>
3007 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3008 between type parameters if they either have the reference type
3009 constraint or the class constraint.
3011 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
3013 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3015 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3018 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3019 (ExtractSecurityPermissionSet): Cope with self referencing security
3020 attributes properly.
3022 * driver.cs (SetOutputFile): Made public property OutputFile.
3024 2005-07-07 Raja R Harinath <rharinath@novell.com>
3027 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3028 has_nonstatic_fields. Make into a FieldBase pointer.
3029 (TypeContainer.AddField): Add CS0282 check.
3030 (TypeContainer.EmitType): Update.
3032 2005-07-06 Miguel de Icaza <miguel@novell.com>
3034 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3035 compare if they start with __.
3037 2005-07-06 Raja R Harinath <rharinath@novell.com>
3039 * statement.cs (Switch.SwitchGoverningType): Only look at
3040 UserCasts that don't need implicit standard conversions to one of
3041 the allowed switch types (Fixes test-322.cs).
3042 (LocalInfo.Resolve): Re-enable sanity-test.
3044 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3046 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3048 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3050 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3052 2005-07-06 Raja R Harinath <rharinath@novell.com>
3055 * ecore.cs (SimpleName.GetSignatureForError): Add.
3056 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3057 (MemberAccess.GetSignatureForError): Add.
3059 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3061 The big error and warning messages review.
3091 * typemanager.cs: Updated.
3093 * class.cs: (MethodCore.SetYields): Moved here to share.
3094 (PropertyMethod.Define): Moved iterator setup here.
3096 * iterators.cs: Add orig_method to have full access to parent
3099 2005-07-05 Raja R Harinath <rharinath@novell.com>
3101 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3102 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3103 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3104 variable of struct type.
3105 * expression.cs (Unary.ResolveOperator): Update to change.
3106 (Indirection.VerifyFixed): Likewise.
3107 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3108 (ParameterReference.VerifyFixed): Value parameters are fixed.
3109 (This.VerifyFixed): Treat 'this' as a value parameter.
3110 * statement.cs (LocalInfo.IsFixed): Remove.
3112 2005-07-01 Martin Baulig <martin@ximian.com>
3114 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3115 `ec.EmitThis ()' to get the correct scope.
3117 2005-07-01 Martin Baulig <martin@ximian.com>
3119 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3120 instance is a ParameterReference; fixes #75299.
3122 2005-06-30 Raja R Harinath <rharinath@novell.com>
3125 * expression.cs (Indexers.map): Remove.
3126 (Indexers.Append): Filter out inaccessible setters and getters.
3127 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3130 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3132 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3133 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3134 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3135 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3137 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3140 * class.cs (FieldBase.GetInitializerExpression): One more field
3143 2005-06-28 Miguel de Icaza <miguel@novell.com>
3145 * pending.cs: Do not define a proxy if the base method is virtual,
3146 it will be picked up by the runtime (bug 75270).
3148 2005-07-08 Martin Baulig <martin@ximian.com>
3150 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3151 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3153 2005-07-07 Martin Baulig <martin@ximian.com>
3155 * generic.cs (ConstructedType.CheckConstraint): Use
3156 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3157 called recursively; fixes #75329.
3159 2005-07-06 Martin Baulig <martin@ximian.com>
3161 * generic.cs (TypeManager.InferTypeArguments): Added support for
3162 anonymous methods; fixes #75461.
3164 2005-07-01 Martin Baulig <martin@ximian.com>
3166 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3167 `ec.EmitThis ()' to get the correct scope.
3169 2005-07-01 Martin Baulig <martin@ximian.com>
3171 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3172 instance is `This'; fixes #75299.
3174 2005-06-30 Martin Baulig <martin@ximian.com>
3176 * class.cs (Indexer): Implement IIteratorContainer; added support
3177 for iterators in indexers.
3180 (EmitContext.CurrentIterator): Make this a property, not a field.
3182 * anonymous.cs (AnonymousContainer.Iterator): New public property.
3184 2005-06-28 Miguel de Icaza <miguel@novell.com>
3186 * pending.cs: Do not define a proxy if the base method is virtual,
3187 it will be picked up by the runtime (bug 75270).
3189 2005-06-28 Martin Baulig <martin@ximian.com>
3191 * cs-parser.jay (interface_method_declaration): Avoid a
3192 reduce/reduce conflict by moving some of the code into a separate
3193 `interface_method_declaration_body' rule; fixes #75368.
3195 2005-06-28 Martin Baulig <martin@ximian.com>
3197 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3198 array check after the check for TypeBuilder's.
3200 2005-06-21 Raja R Harinath <rharinath@novell.com>
3202 * convert.cs (FindMostEncompassedType): Add two trivial special
3203 cases (number_of_types == 0 || number_of_types == 1).
3204 (FindMostEncompasingType): Likewise.
3206 2005-06-17 Raja R Harinath <rharinath@novell.com>
3208 Some cleanups preparing for the fix of #75283.
3209 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3211 (EventExpr.InstanceResolve): Likewise.
3212 (EventExpr.DoResolve): Remove redundant checks.
3214 2005-06-08 Miguel de Icaza <miguel@novell.com>
3216 * class.cs: Small fix.
3218 2005-06-08 Raja R Harinath <rharinath@novell.com>
3221 * class.cs (GetPartialBases): Fix return value check of
3224 2005-06-07 Raja R Harinath <rharinath@novell.com>
3226 Ensure that partial classes are registered in their enclosing
3227 namespace. Initial part of fix of #75160.
3228 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3229 Register declspace with namespace here, not in
3230 DeclSpace.RecordDecl.
3231 * cs-parser.jay: Pass namespace to RecordDecl.
3232 * class.cs (PartialContainer.Create): Likewise.
3233 (ClassPart.DefineType): New sanity-check. Throws an exception if
3235 * decl.cs (Declspace.RecordDecl): Remove.
3236 * namespace.cs (NamespaceEntry.DefineName): Remove.
3238 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3240 * rootcontext.cs: Reset TargetExt as well.
3242 2005-06-03 Raja R Harinath <rharinath@novell.com>
3244 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3247 2005-06-02 Raja R Harinath <rharinath@novell.com>
3249 Fix #75080, cs0119.cs.
3250 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3252 (Expression.Resolve): ... this. Use it. Remove bogus code
3253 allowing ExprClass.Type and ExprClass.Namespace for
3254 ResolveFlags.VariableOrValue.
3255 (Expression.Resolve) [1-argument variant]: Change default resolve
3256 flags based on language version.
3257 (Expression.Error_UnexpectedKind): Use a simple string array
3258 rather than an ArrayList.
3259 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3261 (TypeOfVoid.DoResolve): Likewise.
3262 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3263 flags argument -- it always has the same value.
3265 2005-05-31 Raja R Harinath <rharinath@novell.com>
3268 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3269 Use it in the error message.
3270 * assign.cs, expression.cs, statement.cs: Update.
3272 2005-05-30 Raja R Harinath <rharinath@novell.com>
3275 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3276 the "almostMatchedMember" case too.
3277 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3278 that failed the accessibility checks to 'almost_match'.
3280 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3282 * attribute.cs: Use internal MethodBuilder methods to set
3283 ExactSpelling and SetLastError on PInvoke methods, instead
3284 of passing them via charset. Fixes #75060.
3286 2005-05-27 Raja R Harinath <rharinath@novell.com>
3288 * parameter.cs (Parameter): Remove TODO comment.
3289 (Parameter.DefineParameter): Remove Location parameter.
3290 (Parameters.LabelParameters): Likewise.
3291 * class.cs (Constructor.Emit): Update to change.
3292 (MethodData.Emit): Likewise.
3293 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3294 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3296 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3299 Removed Parameters.Location and added Parameter.Location instead.
3300 Removed Location parameter from Emit() and GetSignature().
3307 Modified all related calls.
3309 2005-06-21 Martin Baulig <martin@ximian.com>
3311 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3312 left-hand side is not a nullable type; fixes #75328.
3314 2005-06-21 Martin Baulig <martin@ximian.com>
3317 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3318 (TypeManager.GetFullNameSignature): Likewise.
3320 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3321 `source.FullName' and `target.FullName' to check whether there are
3322 two conflicting definitions.
3324 2005-06-21 Martin Baulig <martin@ximian.com>
3326 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3327 a BoxedCast - also for reference types - to be compatible with csc.
3329 2005-06-21 Martin Baulig <martin@ximian.com>
3331 * expression.cs (MemberAccess.DoResolve): Add support for nested
3332 types in a generic instance; fixes #75320.
3334 2005-06-20 Martin Baulig <martin@ximian.com>
3336 * generic.cs (TypeManager.InferType): Also walk the class
3337 hierarchy for generic instances; fixes #75261.
3339 2005-06-17 Martin Baulig <martin@ximian.com>
3341 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3342 to make things work for corlib.
3344 2005-06-15 Martin Baulig <martin@ximian.com>
3346 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3347 obsolete `SecurityAction' values.
3349 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3351 * rootcontext.cs: Reset TargetExt as well.
3353 2005-06-09 Martin Baulig <martin@ximian.com>
3355 * delegate.cs (Delegate.VerifyMethod): Added
3356 `MethodGroupExpr old_mg' argument; inherit its
3357 `HasTypeParameters'; fix #75085.
3359 2005-06-09 Martin Baulig <martin@ximian.com>
3361 * expression.cs (Invocation.OverloadResolve): Correctly handle
3362 generic methods for the SetMemberIsUsed(); fix #75064.
3364 2005-06-09 Martin Baulig <martin@ximian.com>
3366 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3369 2005-06-08 Martin Baulig <martin@ximian.com>
3371 * cs-parser.jay (nullable_type_or_conditional): If we put the
3372 nullable back and our `type' is a `ComposedCast', remove the
3373 nullable from it. Fixes #75156.
3375 * expression.cs (ComposedCast.RemoveNullable): New public method.
3377 2005-06-08 Martin Baulig <martin@ximian.com>
3379 The big Iterators rewrite :-)
3381 * iterators.cs: Rewrite this to use the anonymous methods framework.
3383 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3384 before the TypeContainers; see 2test-21.cs.
3387 (TypeContainer.DefineType): Don't create a new EmitContext if we
3388 already have one (this only happens if we're an Iterator).
3389 (TypeContainer.Define): Also call Define() on all our iterators.
3390 (Method.CreateEmitContext): Added support for iterators.
3393 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3394 (AnonymousContainer.CreateMethodHost): Moved here from
3395 AnonymousMethod and made abstract.
3396 (AnonymousContainer.CreateScopeType): New abstract method.
3397 (AnonymousContainer.IsIterator): New public property.
3398 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3399 get the ScopeTypeBuilder rather than manually defining it here.
3400 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3403 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3404 before RootContext.DefineTypes().
3406 * codegen.cs (EmitContext.RemapToProxy): Removed.
3407 (EmitContext.CurrentAnonymousMethod): Changed type from
3408 AnonymousMethod -> AnonymousContainer.
3409 (EmitContext.ResolveTopBlock): Protect from being called twice.
3410 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3411 (EmitContext.EmitThis): Removed the iterators hacks; use the
3412 anonymous methods framework for that.
3415 (ToplevelBlock.Container): Make this a property, not a field.
3416 (ToplevelBlock.ReParent): New public method; move the
3417 ToplevelBlock into a new container.
3418 (Foreach.TemporaryVariable): Simplify.
3420 2005-06-05 Martin Baulig <martin@ximian.com>
3422 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3423 (Block.AddTemporaryVariable): New public method; creates a new
3424 `LocalInfo' for a temporary variable.
3425 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3427 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3428 non-iterator variables.
3430 2005-06-05 Martin Baulig <martin@ximian.com>
3432 * statement.cs (Foreach.TemporaryVariable): Create the
3433 LocalBuilder in the Emit phase and not in Resolve since in some
3434 situations, we don't have an ILGenerator during Resolve; see
3435 2test-19.cs for an example.
3437 2005-06-04 Martin Baulig <martin@ximian.com>
3439 The big Foreach rewrite - Part II.
3441 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3442 with `PropertyInfo ienumerator_getcurrent'.
3444 * codegen.cs (VariableStorage): Removed.
3447 (Foreach): Derive from Statement, not ExceptionStatement.
3448 (Foreach.CollectionForeach): New nested class. Moved all the code
3449 dealing with collection foreach here.
3450 (Foreach.ForeachHelperMethods): Removed.
3451 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3453 2005-05-23 Martin Baulig <martin@ximian.com>
3455 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3456 don't need to. Fix #75014.
3458 2005-05-26 Raja R Harinath <rharinath@novell.com>
3460 Improve user-defined conversion handling.
3461 * convert.cs (GetConversionOperators): Rewrite. Return only the
3462 applicable operators.
3463 (AddConversionOperators): New. Helper for GetConversionOperators.
3464 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3465 there is only one most encompassed/encompassing type.
3466 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3467 "applicable operator" handling.
3468 (UserConversion): Move cache here from GetConversionOperators.
3469 Directly cache the chosen operator, rather than the whole
3471 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3472 case. Allow conversion of decimal to sbyte and byte too.
3473 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3474 New static methods. Used to avoid allocating EmptyExpressions in
3477 2005-05-24 Duncan Mak <duncan@novell.com>
3479 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3480 another class, used in Convert.ExplicitNumericConversion.
3481 (CastToDecimal): New class, similar to above, but casts to
3482 System.Decimal, used in Convert.ImplicitNumericConversion and also
3483 in explicit convesion from double/float to decimal.
3485 * convert.cs (ImplicitNumericConversion): Handle implicit
3486 conversions to System.Decimal.
3487 (ExplicitNumericConversion): handle explicit conversions to
3492 2005-05-20 Miguel de Icaza <miguel@novell.com>
3494 * typemanager.cs: Do not throw an exception in the TypeBuilder
3495 case, we take care of it on the TypeCode.
3497 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3499 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3502 * cs-parser.jay: Catch more lexical errors.
3504 * report.cs: Add one more Error method.
3507 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3509 2005-05-20 Martin Baulig <martin@ximian.com>
3511 * class.cs (TypeContainer.CircularDepException): Removed.
3512 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3513 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3514 (CS0146) and interface (CS0529) dependencies here.
3516 2005-05-20 Martin Baulig <martin@ximian.com>
3518 * expression.cs (New.DoResolve): Move the CS0712 check above the
3519 CS0144 check; otherwise it can never be reached.
3521 2005-05-20 Martin Baulig <martin@ximian.com>
3523 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3525 2005-05-20 Martin Baulig <martin@ximian.com>
3527 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3529 * typemanager.cs (TypeManager.IsAttributeType): New public method.
3531 2005-05-19 Martin Baulig <martin@ximian.com>
3534 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3535 to disable error reporting.
3537 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3538 here since we don't want to report an error; see the new test-336.cs.
3540 2005-05-19 Raja R Harinath <rharinath@novell.com>
3542 * statement.cs (ToplevelBlock.GetParameterReference)
3543 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3544 Move here from class Block.
3545 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3546 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3548 2005-05-18 Martin Baulig <martin@ximian.com>
3553 (FlowBranching.Reachability): Add non-static public And() and Or()
3555 (FlowBranchingSwitch): New class; do the `break_origins' thing
3556 like in FlowBranchingLoop.
3557 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3558 reachability, not just locals and parameters.
3559 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3560 switch; MergeBreakOrigins() now takes care of that.
3562 2005-05-18 Martin Baulig <martin@ximian.com>
3564 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3565 a loop and may leave it, reset the barrier; fixes #74974.
3567 2005-05-16 Raja R Harinath <rharinath@novell.com>
3569 Fix test-382.cs. Emit values of decimal constants.
3570 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3572 (TypeContainer.AddField): ... this.
3573 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3574 with initializers to include 'Const's.
3575 (ClassPart.RegisterFieldForInitialization): Forward to
3577 * const.cs (Const.Const): Pass initializer to base class.
3578 (Const.Define): In case of decimal constants, register them for
3579 initialization in a static constructor.
3581 2005-05-14 Martin Baulig <martin@ximian.com>
3583 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3584 do not call ResolveUnreachable() on unreachable statements in
3585 here, see the comment in the source code.
3587 2005-05-13 Raja R Harinath <rharinath@novell.com>
3590 * expression.cs (BinaryResolveOperator): If one of the operands of
3591 an equality comparison is 'null' and the other is a pointer type,
3592 convert the null to a NullPointer.
3593 * convert.cs (ImplicitReferenceConversion): If the expression is a
3594 NullLiteral and the target type is a pointer type, return a
3595 NullPointer instead.
3596 (ImplicitConversionStandard): Likewise.
3598 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3600 * cs-parser.jay: Set readonly context based on special constructs.
3602 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3603 readonly variable error handling.
3605 * rootcontext.cs (EmitCode): Don't verify members when error
3608 * statement.cs (LocalInfo): Add reaodnly context information.
3609 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3611 2005-05-17 Martin Baulig <martin@ximian.com>
3613 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3616 2005-05-13 Martin Baulig <martin@ximian.com>
3618 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3619 handle unreachable blocks.
3621 2005-05-13 Martin Baulig <martin@ximian.com>
3624 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3625 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3628 2005-05-13 Martin Baulig <martin@ximian.com>
3630 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3631 instance variable, not a local. Fix #74873.
3632 (Block.ResolveUnreachable): Set it to true here.
3634 2005-05-12 Martin Baulig <martin@ximian.com>
3636 * cs-parser.jay (property_declaration): Pass the `current_class',
3637 not the `current_container' to Property's .ctor. Fixes #74912.
3639 2005-05-11 Martin Baulig <martin@ximian.com>
3641 * typemanager.cs (Closure): Copy this from MCS and merge all the
3642 GMCS-specific changes into it.
3644 2005-05-12 Raja R Harinath <harinath@gmail.com>
3647 * typemanager.cs (unmanaged_enclosing_types): New.
3648 (IsUnmanagedType): Avoid infloops by using
3649 'unmanaged_enclosing_types' to talk with recursive invocations.
3651 2005-05-11 Duncan Mak <duncan@novell.com>
3653 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3654 continuing to process for 'arg'.
3655 (handle_preprocessing_directive): Check the argument of the #endif
3656 directive and report error CS1025 if there are any trailing
3659 According to the C# spec, having even whitespace after the #endif
3660 directive is illegal; however, because we call arg.TrimEnd ()
3661 beforehand, we have the same behavior as csc, allowing whitespace
3662 after the directive.
3666 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3670 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3671 (Constructor.GetObsoleteAttribute): Implemented correctly.
3673 2005-05-10 Martin Baulig <martin@ximian.com>
3675 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3676 resolve the type; fixes #74864.
3677 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3678 in DoResolve(); fixes #74862.
3680 2005-05-10 Martin Baulig <martin@ximian.com>
3682 * support.cs (ReflectionParameters.ParameterModifier): Use
3683 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3684 and `ParameterAttributes.In'. Fixes #74884.
3686 2005-05-10 Martin Baulig <martin@ximian.com>
3688 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3689 the cache if we're just looking for `MemberTypes.NestedType' in a
3692 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3693 constraints if we're still resolving the type tree.
3694 (Expression.MemberLookup): If we're resolving the type tree, only
3695 look for `MemberTypes.NestedType' since we're only interested in
3698 * class.cs (TypeContainer.DefineType): Don't resolve the type
3699 parameters here; do this later in ResolveType() after the type
3700 tree has been resolved.
3701 (TypeContainer.ResolveType): New public method; this is called
3702 after the type tree is resolved and before the types are being
3703 populated. We resolve the generic constraints here.
3704 (TypeContainer.DoDefineMember): Check the constraints on our base
3705 class and interfaces.
3707 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3708 set the `ResolvingTypeTree' flag on the EmitContext.
3710 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3712 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3714 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3716 * expression.cs (Argument.GetParameterModifier): Turned to property.
3717 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3719 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3722 2005-05-09 Raja R Harinath <rharinath@novell.com>
3725 * decl.cs (MemberCache.AddMethods): Register override methods,
3726 rather than non-override methods.
3727 * typemanager.cs (RegisterOverride): New.
3728 (IsOverride): Update.
3730 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3732 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3734 2005-05-06 Martin Baulig <martin@ximian.com>
3737 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3738 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3740 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3744 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3745 recursive declaration.
3747 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3749 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3751 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3753 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3755 2005-05-05 Raja R Harinath <rharinath@novell.com>
3758 * decl.cs (DeclSpace.FamilyAccessible):
3759 Use TypeManager.IsNestedFamilyAccessible.
3761 Fix reopened #64812.
3762 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3765 2005-05-04 Raja R Harinath <rharinath@novell.com>
3766 Abin Thomas <projectmonokochi@rediffmail.com>
3767 Anoob V E <projectmonokochi@rediffmail.com>
3768 Harilal P R <projectmonokochi@rediffmail.com>
3771 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3772 allow access to all static members.
3774 2005-05-04 Martin Baulig <martin@ximian.com>
3776 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3778 2005-05-04 Martin Baulig <martin@ximian.com>
3782 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3783 section at the end; make things work if `default' is not the last
3786 2005-05-04 Martin Baulig <martin@ximian.com>
3790 * statement.cs (Switch): Replaced the `got_default' field with a
3791 `default_section' one.
3792 (Switch.CheckSwitch): Set `default_section' here.
3793 (Switch.Resolve): If we're a constant switch and the constant is
3794 not found, use the default section.
3796 2005-05-03 Martin Baulig <martin@ximian.com>
3798 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3800 * statement.cs (Foreach.ArrayForeach): New nested class.
3801 (Foreach.TemporaryVariable): New nested class.
3802 (Foreach.EmitArrayForeach): Removed; this is now in the new
3805 2005-05-03 Raja R Harinath <rharinath@novell.com>
3807 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3809 (VerifyPendingMethods): Revert change below.
3811 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3812 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3813 that used to trigger warning -28. Remove warning -28.
3814 * expression.cs (Invocation.OverloadResolve): Use
3815 TypeManager.IsOverride to distinguish override methods.
3818 * pending.cs (VerifyPendingMethods): If a base type implements the
3819 requested interface, don't bother checking individual methods of
3820 the base type. As a side-effect, this prevents the creation of
3821 unnecessary proxies.
3823 2005-05-02 Martin Baulig <martin@ximian.com>
3827 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3828 Also `And' the locals if the old vector is null.
3829 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3830 null; in this case we basically reset all the variables.
3832 2005-05-02 Martin Baulig <martin@ximian.com>
3836 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3837 Added `FlowBranching branching' argument; always `and' the
3838 variables instead of `or'ing them unless we're an infinite loop.
3840 * statement.cs (While.Resolve): Create a new sibling unless we're
3843 2005-05-02 Martin Baulig <martin@ximian.com>
3847 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3848 arguments; use it instead of creating a new TopLevelBlock.
3849 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3850 our ConstructorInitializer.
3853 (TopLevelBlock.TopLevelBranching): New public property.
3854 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3855 and create our `TopLevelBranching'.
3857 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3858 anonymous method host, use `block.TopLevelBranching' rather than
3859 creating a new branching.
3861 2005-04-20 Miguel de Icaza <miguel@novell.com>
3863 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3864 a ScopeInfo, if any of the current children is a child of the new
3865 entry, move those children there.
3867 2005-04-30 Martin Baulig <martin@ximian.com>
3869 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3870 at the beginning of a SwitchSection. Fix #73335.
3872 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3875 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3877 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3878 (FieldExpr.DoResolve): Obsolete members are ignored for field
3881 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3883 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3884 of arrays detection.
3886 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3888 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3890 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3893 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3895 * cs-parser.jay: Use the prefered version of -unsafe in error
3898 2005-04-22 Marek Safar <marek.safar@seznam.cz>
3900 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3903 2005-04-20 John Luke <john.luke@gmail.com>
3905 * driver.cs: fix typo in error message, --outout to --output
3907 2005-04-30 Martin Baulig <martin@ximian.com>
3909 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3910 handle the .NET 2.x security attributes.
3912 2005-04-30 Martin Baulig <martin@ximian.com>
3915 (TypeManager.ExpandInterfaces): Don't add things twice.
3918 (TypeContainer.VerifyClsCompliance): Allow generic instances.
3920 2005-04-29 Martin Baulig <martin@ximian.com>
3922 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3924 * anonymous.cs: Added support for anonymous generic methods.
3926 2005-04-29 Martin Baulig <martin@ximian.com>
3928 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3931 2005-04-29 Martin Baulig <martin@ximian.com>
3933 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3935 * expression.cs (New.DoResolve): Fix the CS0304 check.
3937 2005-04-29 Martin Baulig <martin@ximian.com>
3939 * typemanager.cs (TypeManager.GetFullName): Updated to the new
3942 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3943 explicit interface implementation, compare the interface types.
3944 (MethodData.Define): Use the new naming scheme from the latest
3946 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3948 * decl.cs (MemberName.GetMemberName): Removed.
3949 (MemberName.MethodName, FullName): New properties.
3951 2005-04-25 Raja R Harinath <rharinath@novell.com>
3953 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3955 2005-04-22 Martin Baulig <martin@ximian.com>
3957 * generic.cs (GenericMethod): Create the EmitContext in the
3958 `Define()'; in `Define(MethodBuilder)', create the type parameters
3959 before calling `Define()'. Fixes #73933.
3961 2005-04-22 Martin Baulig <martin@ximian.com>
3964 (Constraints.Resolve): Make things work wrt. the new type lookup system.
3965 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3967 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3968 ConstructedType, check its constraints.
3970 2005-04-20 Marek Safar <marek.safar@seznam.cz>
3972 * codegen.cs (InRefOutArgumentResolving): New field.
3974 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3975 fields outside contructor.
3977 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3979 2005-04-19 Miguel de Icaza <miguel@novell.com>
3981 * anonymous.cs (CaptureContext.EmitParameterInstance): The
3982 parameter code was not completed ever, so it was not as up-to-date
3983 as local variables. Must finish it.
3985 The bug fix was to compare the Toplevel of the block, not the
3986 current block. Thanks for Ben for pointing this out.
3988 2005-04-19 Raja R Harinath <rharinath@novell.com>
3990 * decl.cs (AddMethods): Use the declaring type of the problem
3991 method to determine if we want to squash a warning.
3993 2005-04-19 Marek Safar <marek.safar@seznam.cz>
3995 * attribute.cs: Removed debug output.
3997 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3999 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4002 2005-04-18 Raja R Harinath <rharinath@novell.com>
4005 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4006 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4007 all null comparisons against reference types.
4009 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4012 * class.cs (TypeContainer.CircularDepException) New nested
4014 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4015 (TypeContainer.DefineType): Removed error, reset InTransit before
4017 (Class.DefineType): Throw exception when is in Transit.
4018 Catch exception and report error.
4019 (Struct.DefineType): Throw exception when is in Transit.
4020 Catch exception and report error.
4021 (Interface.DefineType): Throw exception when is in Transit.
4022 Catch exception and report error.
4024 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4025 handle nested exception handlers.
4027 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4030 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4031 InFinally and InCatch storage.
4033 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4034 (Catch.Resolve): Set and Restore ec.InCatch.
4035 (Try.Resolve): Set and Restore ec.InFinally.
4036 (Try.HasCatch): True when try has catch.
4038 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4040 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4041 for the same event member, so exclude such cases from warning 419.
4044 2005-04-16 Miguel de Icaza <miguel@novell.com>
4046 * expression.cs (Binary.ResolveOperator): Apply patch from John
4047 Luke to fix bug 59864: operators &, | and ^ on enumerations
4048 require that the same enum type on both sides.
4050 * driver.cs: Add warnings to old flag usage, this is to assist
4051 people who produce Makefiles and hope that the Makefiles will be
4054 * class.cs (TypeContainer.EmitType): Moved the definition of the
4055 special $PRIVATE$ field from the resolve phase to the Emit phase.
4056 During resolve we do not know if we are a struct with
4057 HasExplicitLayout, we know this only after the attributes for the
4060 Set the FieldOffset to zero on the dummy field that we create for
4061 the class. Fixes 74590.
4063 2005-04-16 Raja R Harinath <rharinath@novell.com>
4066 * ecore.cs (PropertyExpr.resolved): New.
4067 (DoResolve): Use it to handle a case of double resolution here.
4068 Handle a case of identical-name-and-type-name.
4069 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4070 resolution by storing the results of expression resolution back
4071 into the "probes" array.
4073 2005-04-15 Raja R Harinath <rharinath@novell.com>
4075 Fix cs0208-7.cs and cs0208-8.cs.
4076 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4077 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4078 error reporting to point out the reason a struct is not unmanaged.
4080 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4082 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4083 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4085 2005-04-13 Raja R Harinath <rharinath@novell.com>
4088 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4089 IdenticalNameAndTypeName here.
4090 (EventExpr.InstanceResolve): Likewise.
4092 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4094 C# 2.0 DefaultCharSetAttribute implementation
4096 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4097 which allows us to set GlobalNamespace for every resolve.
4098 (Attribute.ResolveArguments): Cut from Resolve.
4099 (Attribute.GetCharSetValue): Returns CharSet named argument.
4100 (Attribute.DefinePInvokeMethod): Gets default charset from
4102 (GlobalAttribute.ResolveAsTypeStep): Override.
4103 (GlobalAttribute.ResolveArguments): Override.
4105 * class.cs (TypeAttr): Is protected.
4107 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4108 (ModuleClass.DefaultCharSetType): New memeber.
4109 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4111 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4112 charset from module.
4114 * delegate.cs (TypeAttr): Override.
4115 (Delegate.DefineType): Use this TypeAttr.
4117 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4118 at very early stage (before types are defined) to resolve model
4119 module attributes. It will probably not work with corlib but it
4122 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4123 charset from module.
4125 * typemanager.cs (default_charset_type): New type.
4127 2005-04-13 Raja R Harinath <rharinath@novell.com>
4129 * decl.cs (MemberCache.AddMethods): Don't warn if
4130 System.Object.Finalize has buggy MethodAttributes.
4132 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4135 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4137 * doc.cs : detect ambiguous reference to overloaded members.
4138 Fixed bug #71603. MS 1.1 csc does not detect it.
4140 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4142 * doc.cs : delegates must not be referenced with parameters.
4145 2005-04-12 Miguel de Icaza <miguel@novell.com>
4147 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4149 2005-04-10 Miguel de Icaza <miguel@novell.com>
4151 * driver.cs (MainDriver): Stop processing if the CLS stage found
4154 (CompilerCallableEntryPoint.InvokeCompiler): Always
4155 reset after execution; Take a TextWriter argument for the
4158 * report.cs: Use the error stream instead of hardcoding stderr.
4160 2005-04-09 Miguel de Icaza <miguel@novell.com>
4162 * class.cs: Reduce code paths to test, too small of an
4163 optimization to make it worth the extra testing. Always perform
4166 2005-04-08 Raja R Harinath <rharinath@novell.com>
4169 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4170 operators that had errors reported on them.
4172 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4174 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4176 (Attribute.Resolve): Add named argument type checking.
4178 * class.cs (FixedField.Define): Use IsPrimitiveType
4180 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4182 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4183 unsafe parameter types.
4185 * statement.cs (Using.ResolveExpression): Add better error description.
4187 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4189 2005-04-08 Raja R Harinath <rharinath@novell.com>
4192 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4193 AttributeUsageAttribute in the emitcontext of the attribute class,
4194 not in the emitcontext of the attributable entity it was attached to.
4195 * cs-parser.jay: Use 'current_class', not 'current_container',
4196 when creating a GlobalAttribute.
4198 2005-04-08 Alp Toker <alp@atoker.com>
4200 * pending.cs: The fix to #58413 failed to compile methods implementing
4201 interfaces with/without params modifiers and vice versa, even though
4202 params modifiers aren't part of the signature. Make the modifier check
4203 less strict as in csc.
4205 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4206 Anoob V E <projectmonokochi@rediffmail.com>
4207 Harilal P R <projectmonokochi@rediffmail.com>
4210 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4211 modifiers of pending methods.
4212 (PendingImplementation.PendingImplementation): Initialize it.
4213 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4214 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4215 with ParameterData. Add check for modifiers.
4216 * class.cs (MethodData.Define): Update to changes.
4218 2005-04-07 Raja R Harinath <rharinath@novell.com>
4220 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4222 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4224 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4227 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4230 * typemanager.cs: Registered RequiredAttributeAttribute.
4232 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4234 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4235 Warning CS0169 is back at level 3.
4236 (IMethodData.SetMemberIsUsed): New method.
4238 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4239 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4241 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4243 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4245 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4248 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4251 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4252 to avoid the problems with nested types.
4254 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4255 Anoob V.E <projectmonokochi@rediffmail.com>
4256 Harilal P.R <projectmonokochi@rediffmail.com>
4257 Raja R Harinath <rharinath@novell.com>
4260 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4262 * typemanager (GetConstructor): Make public.
4264 2005-04-05 John Luke <john.luke@gmail.com>
4265 Raja R Harinath <rharinath@novell.com>
4268 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4269 struct too. Return false quicker in a few cases.
4270 (VerifyUnManaged): Use it.
4272 2005-04-05 Raja R Harinath <rharinath@novell.com>
4275 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4276 not 'unreachable_seen'.
4278 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4280 * attribute.cs (Attribute.GetValue): Removed unused.
4282 * codegen.cs (CodeGen.TrimExt): Removed unused.
4284 * cs-parser.jay (output): Removed unused.
4286 * cs-tokenizer.cs (hex_digits): Removed unused.
4288 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4290 * expression.cs (Indirection.LoadExprValue): Removed unused.
4291 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4293 * iterators.cs (Iterator.param_types): Removed unused.
4295 * statement.cs (Goto.block): Removed unused.
4296 (ToplevelBlock.did): Removed unused.
4297 (Switch.ResolveConstantSwitch): Removed unused.
4299 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4301 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4304 2005-04-19 Martin Baulig <martin@ximian.com>
4306 Merged r42462 from MCS and made it work for GMCS.
4308 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4310 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4312 2005-04-01 Raja R Harinath <rharinath@novell.com>
4314 Fix #74232 and cs0208-3.cs.
4315 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4316 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4317 unmanaged type. Don't use FieldBuilders when 't' is a
4318 TypeBuilder. Use ModFlags and MemberType fields.
4319 * class.cs (MemberBase.member_type): Rename from MemberType.
4320 (MemberBase.MemberType): New property. Determines member_type on
4322 (MemberBase.DoDefine): Don't initialize MemberType here.
4323 (FieldMember.Define): Likewise.
4325 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4328 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4329 Attributes are emitted there.
4331 2005-04-01 Raja R Harinath <rharinath@novell.com>
4333 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4334 keyword in 'partial enum' too.
4335 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4337 Report from Kamil Skalski <nazgul@omega.pl>.
4340 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4341 have partial containers too.
4343 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4344 in block' checks to Block.CheckInvariantMeaningInBlock.
4345 * statement.cs (Block.GetKnownVariableInfo): Make private.
4346 (Block.IsVariableUsedInChildBlock): Remove.
4347 (Block.IsVariableUsedInBlock): Likewise.
4348 (Block.CheckInvariantMeaningInBlock): New. Show location of
4349 conflicting declaration.
4350 (Block.AddVariable): Make error messages less long-winded and more
4351 specific. Show location of conflicting declaration.
4352 * parameter.cs (Parameters.Location): New readonly property.
4354 2005-03-31 Raja R Harinath <rharinath@novell.com>
4356 Clean up semantics of invoking ResolveMemberAccess.
4357 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4358 can have an instance, ensure that we pass in a non-TypeExpression
4359 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4360 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4361 argument. Update to changes and simplify.
4362 (FieldExpr.Emitinstance): Remove CS0120 check.
4363 (PropertyExpr.EmitInstance): Likewise.
4364 * expression.cs (Argument.Resolve): Likewise.
4365 (Invocation.DoResolve): Update to changes in semantics of
4368 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4371 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4374 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4376 2005-03-31 Raja R Harinath <rharinath@novell.com>
4378 Fix difference in behaviour with commandline invocation.
4379 * driver.cs (Driver.Reset): New.
4380 (CompilerCallableEntryPoint): Call it.
4382 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4383 variable" warnings if the boolean expression failed to resolve.
4385 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4387 * attribute.cs: Fix the union of several permissions when some of them
4388 are unrestricted (so the result isn't an unrestricted permission set).
4391 2005-03-30 Raja R Harinath <rharinath@novell.com>
4393 * ecore.cs (MemberExpr): New class. Convert from interface
4395 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4396 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4398 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4399 (MethodGroupExpr.IsExplicitImpl): Remove.
4400 (Expression.GetFieldFromEvent): Remove.
4401 (SimpleName.MemberStaticCheck): Remove.
4402 (SimpleName.DoSimpleNameResolve): Update to changes.
4403 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4404 (MemberAccess.IdenticalNameAndTypeName): Remove.
4405 (MemberAccess.error176): Move to MemberExpr.
4406 (MemberAccess.DoResolve): Update to changes.
4407 (BaseAccess.DoResolve): Likewise.
4409 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4411 C# 2.0 Conditional attribute class implementation
4413 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4414 Analyzes class whether it has attribute which has ConditionalAttribute
4415 and its condition is not defined.
4417 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4418 (Class.IsExcluded): New method. Search for at least one defined
4419 condition in ConditionalAttribute of attribute class.
4421 2005-03-30 Raja R Harinath <rharinath@novell.com>
4423 * ecore.cs (PropertyExpr): Derive from Expression, not
4424 ExpressionStatement.
4425 (PropertyExpr.EmitStatement): Remove.
4427 2005-03-29 Raja R Harinath <rharinath@novell.com>
4430 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4431 internal field "value__" of an enum be private. The examples for
4432 "value__" that I found on MSDN all used FieldAttributes.Private.
4434 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4435 Don't mention IL method attribute names.
4437 Fix #47991. Remove a TODO.
4438 * statement.cs (Block.Toplevel): Make into a field.
4439 (Block.Parameters): Move into ToplevelBlock.
4440 (Block.known_variables): Rename from child_variable_names.
4441 (Block.Block): Remove variants that take Parameters. Initialize
4442 'Toplevel' with the immediately surrounding toplevel block.
4443 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4444 LocalInfo parameter.
4445 (Block.GetKnownVariableInfo): New.
4446 (Block.IsVariableNameUsedInChildBlock): Update.
4447 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4448 the block, even though it may not be in scope.
4449 (Block.AddVariable): Remove Parameters parameter. Use
4450 Toplevel.Parameters instead.
4451 (Block.AddConstant): Remove Parameters parameter.
4452 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4453 (Block.IsParamaterReference): Likewise.
4454 (Block.IsLocalParameter): Likewise. Simplify a lot.
4455 (ToplevelBlock.Parameters): New. Moved from Block.
4456 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4457 initialize Parameters to a non-null value.
4458 * cs-parser.jay: Update to changes.
4459 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4460 simple names that mean different things in the same block. Use
4461 Block.IsVariableNameUsedInBlock.
4463 2005-03-28 Raja R Harinath <rharinath@novell.com>
4465 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4467 2005-03-26 Raja R Harinath <harinath@acm.org>
4470 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4471 fails to resolve, ensure that the LHS is still resolved as an
4474 2005-03-25 Raja R Harinath <harinath@acm.org>
4476 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4478 (Enum.current_ec): Remove.
4479 (Enum.LookupEnumValue): Remove EmitContext argument.
4480 Just uses the one created during DefineType.
4481 (Enum.FindMembers): Update.
4482 * expression.cs (MemberAccess.DoResolve): Update.
4484 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4486 * assign.cs (Assign.DoResolve): Check for CS1717 when
4487 source and target are same (uses Equals).
4489 * expression.cs (LocalVariableReference, ParameterReference,
4490 This): Implemented Equals, GetHashCode.
4492 * statement.cs (Block.GetParameterReference): Removed useless
4495 2005-03-22 Raja R Harinath <rharinath@novell.com>
4498 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4499 blocks before deciding whether the error is cs0136 or cs0128.
4501 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4502 (using_alias_directive, using_namespace_directive): Pass
4503 MemberName, not an expression to Namespace.UsingAlias and
4505 (MakeName): Use the MemberName of the namespace.
4506 * namespace.cs (Namespace.MemberName): New.
4507 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4508 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4510 * decl.cs (MemberName.Name): Make readonly.
4511 (MemberName.FromDotted): New "constructor".
4512 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4513 (MemberCore.Name): Compute from MemberName on demand.
4514 (MemberCore.SetMemberName): Provide a way to change the
4516 (MemberCore.AddToContainer): Don't take a fullname parameter.
4517 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4518 fully qualified name of the container to the member name.
4519 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4520 only if the type is a member of the root container.
4521 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4522 MemberName.Left rather than searching for an embedded ".".
4523 (PartialContainer.CreatePart): Update to changes in RootContext.
4524 (MemberBase.ShortName): Turn into a property. Use
4525 MemberCore.SetMemberName.
4526 (MemberBase.ExplicitInterfaceName): Remove.
4527 (MemberBase.UpdateMemberName): Remove.
4528 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4529 (PropertyBase.SetMemberName): New override.
4530 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4531 (Tree.GetDecl): New.
4532 (Tree.AllDecls): Rename from Decls.
4533 * attribute.cs, enum.cs, report.cs: Update to changes.
4534 * driver.cs (MainDriver): Use MemberName.FromDotted on
4535 RootContext.MainClass.
4537 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4539 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4542 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4544 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4546 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4547 property accessor modifiers.
4549 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4550 fixed buffer attribute (CS1716).
4551 (PropertyMethod.HasCustomAccessModifier): When property accessor
4552 has custom modifier.
4554 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4556 (PropertyExpr.DoResolveLValue): Add CS0272.
4558 2005-03-17 Miguel de Icaza <miguel@novell.com>
4560 * convert.cs: When converting to a pointer, use the proper Conv.U
4561 or Conv.I depending on the source data type.
4563 * cs-tokenizer.cs: Make the size for large decimal constants,
4566 2005-03-17 Martin Baulig <martin@ximian.com>
4568 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4569 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4571 2005-03-17 Martin Baulig <martin@ximian.com>
4573 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4574 to bool so we can return an error condition.
4575 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4578 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4580 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4583 2005-03-16 Raja R Harinath <rharinath@novell.com>
4585 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4586 Refactor to avoid traversing the list of assemblies, and to avoid
4587 string concatenation.
4588 * typemanager.cs (guid_attr_type): Remove.
4589 (negative_hits, pointers, references): Remove hashes.
4591 (GetConstructedType): New. Uses type_hash to handle constructed
4592 types (arrays, references, pointers).
4593 (GetReferenceType, GetPointerType): Use it.
4594 (GetNestedType): New. Uses type_hash to handle nested types of
4596 (LookupType, LookupTypeDirect): Remove.
4597 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4598 'types' hash and LookupTypeReflection directly.
4599 (params_string, params_object): Use GetConstructedType.
4600 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4602 (Namespace.Lookup): Use cached_types.
4603 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4604 provided by old TypeManager.LookupType.
4605 * rootcontext.cs (MakeFQN): Remove.
4606 * decl.cs (DeclSpace.MakeFQN): Likewise.
4607 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4608 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4609 TypeManager.GetConstructedType.
4610 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4612 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
4614 * cs-parser.jay: Fix build.
4616 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4618 * class.cs (TypeContainer.CircularDepException) New nested
4619 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4621 * cs-parser.jay: Reports CS1527 for any namespace element.
4623 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4626 * expression.cs (ParameterReference.IsAssigned): Changed error to
4628 (Error_WrongNumArguments): Moved CS0245 detection here.
4630 * statement.cs (Return.Resolve): Add CS1622 report.
4632 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4634 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4636 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4638 * attribute.cs expression.cs: Get rid of some allocations.
4640 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4642 * doc.cs : just eliminate the latest change.
4644 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4646 * doc.cs : commented out the latest change. It breaks xml-030.cs
4648 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4650 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4651 fail. So invoke CreateType() in FindDocumentedType().
4653 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4655 * cs-tokenizer.cs : added IsKeyword().
4656 * doc.cs : Detect keyword incorrectly used as identifier.
4657 Allow identifiers prefixed by @.
4659 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4661 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4662 It caused exception in namespace resolving (again!).
4664 * class.cs (Class.ctor): Removed exit.
4665 (PropertyMethod.ctor): ditto.
4667 * codegen.cs (Codegen.Reset): Reset static data.
4668 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4670 * cs-tokenizer.cs (Cleanup): Removed.
4672 * driver.cs (GetSystemDir): Rewrote to one line command.
4673 It caused problem with unloaded dynamic modules.
4674 (UnixParseOption): Removed Exit.
4675 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4676 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4677 Now can be mcs used as library.
4679 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4682 * location.cs (Reset): Reset static data.
4684 * namespace.cs (Reset): Reset static data.
4686 * report.cs (Report.Reset): Reset static data.
4688 * rootcontext.cs (RootContext.Reset): Reset static data.
4690 * tree.cs (RootTypes.ctor): Use Location.Null
4692 * typemanager.cs (TypeManager.Reset): Reset static data.
4693 (CoreLookupType): Removed Exit.
4694 (TypeHandle.Reset): Reset static data.
4696 2005-03-10 Raja R Harinath <rharinath@novell.com>
4699 * typemanager.cs (ComputeNamespaces): Import namespaces from
4700 referenced modules too.
4702 2005-03-09 Raja R Harinath <rharinath@novell.com>
4704 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4707 2005-03-09 Raja R Harinath <rharinath@novell.com>
4709 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4710 enclosing DeclSpace. This ensures that a name-lookup populates
4711 more caches and there are fewer 'TypeExpression's. Carve out
4712 nested type lookup into ...
4713 (LookupNestedTypeInHierarchy): ... this.
4715 2005-04-15 Martin Baulig <martin@ximian.com>
4717 Merged r41590 from MCS and make it work in the generics land.
4719 * generic.cs (TypeParameter.UpdateConstraints): Removed the
4722 * class.cs (PartialContainer.UpdateConstraints): Removed.
4723 (PartialContainer.CheckConstraints): Removed.
4724 (PartialContainer.SetParameterInfo): Store the constraints here.
4725 (PartialContainer.DefineTypeParameters): New public method;
4726 resolve the type parameter's constraints here. Note that the
4727 PartialContainer doesn't have an EmitContext anymore, so we must
4728 do this in the ClassPart.
4730 2005-03-09 Raja R Harinath <rharinath@novell.com>
4732 Clean up a few partial-class semantics.
4733 Fixes test-357.cs and cs1618-2.cs.
4734 * cs-parser.jay (struct_declaration): Use 'current_class' as
4735 parent of newly-created struct. Remove call to Register ().
4736 Use 'pop_current_class' to complete handing the current struct.
4737 (interface_declaration): Likewise.
4738 (class_declaration): Likewise.
4739 (enum_declaration): Use 'current_class' as parent of newly created
4741 (delegate_declaration): Likewise.
4742 (pop_current_class): New function. This is used to handle closing
4743 up the 'current_class' and 'current_container', and pointing them
4744 to the enclosing class/container.
4745 (CSharpParser): Initialize 'current_class' too.
4746 * decl.cs (MemberCore): Add check for invariant: a partial
4747 container is not a parsed entity, and thus does not enclose any
4749 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4750 (DeclSpace.BaseTypeExpr): Use it.
4751 (DeclSpace.LookupType): Add check for invariant.
4752 * class.cs (TypeContainer): Add check for invariant: a nested
4753 class should have the same NamespaceEntry as its enclosing class.
4754 (TypeContainer.EmitFieldInitializers): Make virtual.
4755 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4757 (TypeContainer.Register): Remove.
4758 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4759 null. Use TypeResolveEmitContext for resolving base types and
4760 interfaces. Move initialization of Parts.TypeBuilder here from
4762 (TypeContainer.DefineNestedTypes): ... here.
4763 (PartialContainer): Take a Namespace not a NamespaceEntry.
4764 (PartialContainer.Create): Don't use Register. Call the
4765 appropriate Add... function directly.
4766 (ClassPart): Take both the PartialContainer and the enclosing
4767 class as constructor arguments.
4768 (ClassPart.EmitFieldInitializers): Override.
4769 (ClassPart.PartFindNestedTypes): Remove.
4770 (FieldBase.GetInitializerExpression): Resolve the initializer
4771 expression in the emit context of the enclosing class.
4772 * tree.cs (RootTypes): Remove Register ().
4774 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4776 * cs-parser.jay: Removed CS0134.
4778 * driver.cs: Removed CS1901.
4780 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4781 for predefined types.
4783 2005-03-07 Duncan Mak <duncan@novell.com>
4785 * codegen.cs (Save): Catch UnauthorizedAccessException as
4786 well. Fixes bug #73454.
4788 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4790 * cs-tokenizer.cs (xtoken): Add CS1035.
4792 * class.cs (MethodData.Define): Add CS0683.
4793 (FieldMember.ctor): Add CS0681.
4795 2005-03-07 Raja R Harinath <rharinath@novell.com>
4797 * ecore.cs (SimpleName.DoResolve): Rename from
4798 SimpleName.DoResolveAllowStatic.
4799 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4800 Pass 'intermediate' flag to MemberStaticCheck.
4801 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4802 of "intermediate" lookups via MemberAccess.
4803 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4804 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4806 2005-03-07 Raja R Harinath <rharinath@novell.com>
4809 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4810 slipped in because of variable names that are identical to a
4811 builtin type's BCL equivalent ('string String;', 'int Int32;').
4812 (PropertyExpr.EmitInstance): Likewise.
4814 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4816 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4818 * report.cs (warning_ignore_table): Made public.
4820 2005-03-04 Raja R Harinath <rharinath@novell.com>
4823 * class.cs (MethodData.Emit): Pass 'container' to
4824 container.GetObsoleteAttribute instead of 'container.Parent'.
4826 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4828 * cs-parser.jay: Add 1534 error test.
4830 * iterators.cs (Yield.CheckContext): Add error 1629.
4831 (Iterator.ctor): Save unsafe modifier.
4832 (MoveNextMethod.DoEmit): Restore unsafe context.
4834 * namespace.cs (UsingAlias): Better error message.
4836 2005-03-03 Dan Winship <danw@novell.com>
4838 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4839 the warning message [#73219]
4841 2005-03-03 Raja R Harinath <rharinath@novell.com>
4843 Fix compile with MCS 1.0.0.0.
4844 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4845 w_restore to not depend on string constant folding.
4847 2005-03-03 Raja R Harinath <rharinath@novell.com>
4849 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4850 CS0246 check to users who passed 'silent = false'.
4851 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4853 (SimpleName.SimpleNameResolve): Update.
4854 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4855 (MemberAccess.IdenticalNameAndTypeName): Update.
4856 * doc.cs (FindDocumentedTypeNonArray): Update.
4858 2005-03-03 Raja R Harinath <rharinath@novell.com>
4860 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4861 * parameters.cs (ComputeAndDefineParameters): Remove.
4862 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4863 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4864 Use GetParameterInfo.
4866 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4868 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4870 2005-03-02 Raja R Harinath <rharinath@novell.com>
4872 Unify DeclSpace.LookupType and DeclSpace.FindType.
4873 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4874 is in charge of defining nested types on demand.
4875 (DeclSpace.LookupType): Use it when the current_type is a
4876 TypeBuilder. Use LookupTypeDirect for reflected types.
4877 (DeclSpace.FindType): Remove.
4878 (DeclSpace.LookupInterfaceOrClass): Likewise.
4879 (DeclSpace.DefineTypeAndParents): Likewise.
4880 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4881 DeclSpace.LookupType.
4882 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4883 * typemanager.cs (LookupType): Simplify.
4884 (AddUserType): Remove type from negative_hits.
4885 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4886 * class.cs (TypeContainer.FindMembers): Move handling of nested
4888 (TypeContainer.FindMembers_NestedTypes): ... here.
4889 (TypeContainer.FindNestedType): Implement override.
4890 (ClassPart.FindNestedType): Delegate to PartialContainer.
4891 (ClassPart.PartFindNestedType): Looks up the nested types of the
4894 2005-04-14 Martin Baulig <martin@ximian.com>
4896 * generic.cs (ConstructedType): Moved all the type lookup and
4897 nested class logic into SimpleName.
4898 (ConstructedType.ResolveConstructedType): Our underlying type is
4899 already fully resolved; all the type lookup stuff is in
4902 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4903 constructed types here instead of in ConstructedType.
4905 * decl.cs (MemberName.GetTypeExpression): Always create a
4906 SimpleName, not a ConstructedType.
4907 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4909 2005-03-02 Martin Baulig <martin@ximian.com>
4911 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4912 static constructor in static classes.
4914 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4916 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4917 sizeParamIndex is not specified.
4919 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4922 * report.cs (WarningMessage.IsEnabled): Missing null check.
4924 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4926 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4927 in the fields and not in the properties.
4929 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4931 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4934 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4936 * attribute.cs: Small refactoring (improved robustness).
4937 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4938 (ValidateGuid): Removed.
4939 (Resolve): Removed referenced to above mentioned.
4940 (GetAttributeUsage): Made private and changed to work without
4942 (GetIndexerAttributeValue): Don't crash.
4943 (GetConditionalAttributeValue): Ditto.
4944 (GetClsCompliantAttributeValue): Ditto.
4945 (ExtractSecurityPermissionSet): All attributes exceptions are
4947 (GetPropertyValue): New helper.
4948 (GetMethodImplOptions): New method.
4949 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4950 some missing properties.
4952 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4953 (Method.ApplyAttributeBuilder): Updated.
4955 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4958 2005-02-28 Raja R Harinath <rharinath@novell.com>
4961 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4962 non-simple types (array, pointer, reference).
4964 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4966 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4968 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4970 (Method.CheckBase): Catch wrong destructor here.
4971 (MethodData.Define): Add errors 550, 668.
4973 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4975 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4977 * pending.cs (VerifyPendingMethods): Add error 551.
4979 * typemanager.cs (CSharpName): Next error report helper.
4981 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4983 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4984 attributes. Removed useless attribute double check.
4985 It saves almost 2MBs for corlib.
4987 2005-02-25 Raja R Harinath <rharinath@novell.com>
4990 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4991 called twice in case of error.
4993 2005-02-23 Chris Toshok <toshok@ximian.com>
4995 Fix compiler portions of #72827.
4996 * statement.cs (Block.Emit): call Begin/EndScope on the
4997 EmitContext instead of the ILGenerator.
4999 * codegen.cs (EmitContext.BeginScope): new method, call
5000 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5002 (EmitContext.BeginScope): same, but EndScope and CloseScope
5004 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5005 offset and call the superclass's OpenScope(int) with it.
5006 (SymbolWriter.CloseScope): get the current il
5007 offset and call superclass's CloseScope(int) with it.
5009 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5011 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5012 CS1677 for out and ref as well.
5014 * class.cs (Method.Define): Add error CS1599 detection.
5016 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5018 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5020 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5022 * support.cs.cs (ModifierDesc): New helper method.
5024 2005-02-23 Raja R Harinath <rharinath@novell.com>
5025 Abin Thomas <projectmonokochi@rediffmail.com>
5026 Anoob V E <projectmonokochi@rediffmail.com>
5027 Harilal P R <projectmonokochi@rediffmail.com>
5030 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5031 MemberLookup (used for error reporting) actually returns a result.
5032 Fix error report number (122, not 112).
5034 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5035 Anoob V E <projectmonokochi@rediffmail.com>
5036 Harilal P R <projectmonokochi@rediffmail.com>
5039 * pending.cs (PendingImplementation.GetAbstractMethods):
5040 Find NonPublic members too.
5042 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5044 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5047 * class.cs (MethodCore.CheckMethodAgainstBase):
5048 Add error 239 report.
5050 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5052 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5054 * class.cs (Operator.Define): Add error 217 report.
5056 2005-02-21 Raja R Harinath <rharinath@novell.com>
5059 * expression.cs (Invocation.IsApplicable): Make public.
5060 (Invocation.IsParamsMethodApplicable): Likewise.
5061 * delegate.cs (Delegate.VerifyApplicability): Don't use
5062 Invocation.VerifyArgumentCompat for parameter applicability
5063 testing. Use Invocation.IsApplicable and
5064 Invocation.IsParamsMethodApplicable.
5066 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5068 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5070 * class.cs (Operator.Define): Add error 217 report.
5072 2005-02-21 Raja R Harinath <rharinath@novell.com>
5074 * namespace.cs (UsingEntry.Resolve): Undo change below.
5076 2005-02-21 Raja R Harinath <rharinath@novell.com>
5079 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5080 disable the error message when the extended MemberLookup also
5082 (Expression.MemberLookupFinal): Update.
5083 (SimpleName.DoSimpleNameResolve): Update.
5084 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5085 Don't use MemberLookupFinal.
5086 (New.DoResolve): Update.
5087 (BaseAccess.CommonResolve): Update.
5089 2005-02-21 Raja R Harinath <rharinath@novell.com>
5092 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5093 occured previously, don't resolve again.
5095 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5098 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5099 argument. Call ResolveAttributeUsage for unresolved.
5100 when types doesn't match ctor arguments.
5102 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5103 for nested attribute classes.
5104 (Class.attribute_usage): Removed.
5105 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5106 for attribute class.
5108 * ecore.cs (IsAttribute): Removed.
5110 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5112 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5114 (attribute_types): Removed.
5115 (EmitCode): Global attributes are emited as the latest.
5117 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5119 * class.cs (EmitFieldInitializers): Don't emit field initializer
5120 for default values when optimilization is on.
5122 * constant.cs (Constant.IsDefaultValue): New property.
5124 * driver.cs: Add /optimize handling.
5128 * literal.cs: Implement new IsDefaultValue property.
5130 * rootcontext.cs (Optimize): New field, holds /optimize option.
5132 2005-02-18 Raja R Harinath <rharinath@novell.com>
5134 Fix crasher in re-opened #72347.
5135 * namespace.cs (Namespace.Lookup): Return null if
5136 DeclSpace.DefineType returns null.
5139 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5141 2005-02-18 Raja R Harinath <rharinath@novell.com>
5143 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5144 now returns null if it cannot resolve to an lvalue.
5145 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5146 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5147 returned null. Remove check for SimpleName.
5148 (EventExpr.DoResolveLValue): New.
5149 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5150 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5152 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5154 (Unary.ResolveOperator): Move CS0211 check ...
5155 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5157 (Unary.DoResolveLValue): Simplify.
5158 (AddressOf.DoResolveLValue): New.
5159 (ArrayAccess.DoResolveLValue): New.
5161 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5163 * attribute.cs (Attribute.Resolve): Add arguments casting for
5164 when types doesn't match ctor arguments.
5166 2005-02-16 Raja R Harinath <rharinath@novell.com>
5168 Fix parts of #63202.
5169 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5170 lookup of operator in base type. Ensure that all checks happen
5171 when the operator resolves to an "op_..." method.
5173 2005-02-15 Raja R Harinath <rharinath@novell.com>
5176 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5177 'ignore_cs0104' parameter. Pass it to ...
5178 (NamespaceEntry.Lookup): ... this.
5179 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5180 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5181 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5182 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5183 Update. Request that cs0104 errors be ignored.
5184 (ComposedCast.ResolveAsTypeStep): Update.
5186 2005-02-14 Raja R Harinath <rharinath@novell.com>
5189 * expression.cs (Invocation.BetterFunction): Remove support for
5190 comparing virtual functions and their overrides.
5191 (Invocation.IsOverride): New.
5192 (Invocation.OverloadResolve): Don't consider 'override' functions
5193 during candidate selection. Store them in a lookaside list.
5194 If the selected method is a 'virtual' function, use the list to
5195 find any overrides that are closer to the LHS type.
5197 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5199 * expression.cs (New.DoResolve): Add complex core type reduction.
5200 (New.Constantify): Converts complex core type syntax like 'new int ()'
5203 2005-02-14 Raja R Harinath <rharinath@novell.com>
5205 * decl.cs (EntryType.EntryType): New constructor to create an
5206 updated copy of a cache entry.
5207 (MemberCache.AddMethods): Use it.
5208 (MemberCache.ClearDeclaredOnly): Remove.
5209 (MemberCache.MemberCache): Update.
5211 2005-02-11 Miguel de Icaza <miguel@novell.com>
5213 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5214 variable. This one is represents the actual low-level declaration
5215 of the method, as opposed to the semantic level `IsStatic'.
5217 An anonymous method which is hosted into a static method might be
5218 actually an instance method. IsStatic would reflect the
5219 container, while MethodIsStatic represents the actual code
5222 * expression.cs (ParameterReference): Use the new MethodIsStatic
5223 instead of IsStatic.
5225 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5226 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5227 set on the current EmitContext.
5229 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5230 resolve our casted expression as an LValue. This triggers the
5231 proper LValue processing that is later required by Assign.
5235 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5237 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5239 C# 2.0 Fixed buffer implementation
5241 * anonymous.cs: Update after RegisterHelperClass renaming.
5243 * attribute.cs (AttributeTester.fixed_buffer_cache):
5244 Cache of external fixed buffers.
5245 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5246 implementation if field is fixed buffer else null.
5249 (TypeContainer.AddField): Accept FieldMember instead of Field.
5250 (FieldBase.IsFieldClsCompliant): Extracted code from
5251 VerifyClsCompliance descendant customization.
5252 (FixedField): New class handles fixed buffer fields.
5253 (FixedFieldExternal): Keeps information about imported fixed
5255 (IFixedField): Make access to internal or external fixed buffer
5258 * cs-parser.jay: Add fixed buffer parsing.
5260 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5263 * expression.cs (Indirection): Extended implementation to accept
5265 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5266 (ElementAccess.MakePointerAccess): Get type as parameter.
5267 (DoResolve): Add fixed buffer field expression conversion.
5268 (DoResolveLValue): Ditto.
5269 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5270 (ArrayPtr): Derives from FixedBufferPtr.
5271 (ArrayPtr.Emit): Add extra emit for array elements.
5273 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5275 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5276 for compiler generated types.
5277 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5279 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5280 and consume less memory.
5281 (Fixed.Resolve): Add fixed buffer case.
5283 * typemanager.cs (compiler_generated_attr_ctor,
5284 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5285 (HasElementType): Add our own implementation to work on every
5288 2005-02-11 Miguel de Icaza <miguel@novell.com>
5290 * anonymous.cs (CaptureContext): Track whether `this' has been
5293 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5294 only captured `this' if it was implicitly done (instance
5295 methods/variables were used).
5297 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5298 `this' must be captured.
5300 2005-01-30 Miguel de Icaza <miguel@novell.com>
5302 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5303 is null it means that there has been no need to capture anything,
5304 so we just create a sibling.
5306 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5308 Just a partial fix. The other half is fairly elusive.
5310 2005-02-10 Raja R Harinath <rharinath@novell.com>
5312 Fix #52586, cs0121-4.cs.
5313 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5314 and return a hashtable.
5315 (MemberCache.ClearDeclaredOnly): New.
5316 (MemberCache.MemberCache): Update to change. Make a deep copy of
5317 the method_hash of a base type too.
5318 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5319 type methods. Overwrite entries with the same MethodHandle so
5320 that the ReflectedType is correct. The process leaves in base
5321 virtual functions and their overrides as distinct entries.
5322 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5323 matters since it was boxed in a ArrayList before.
5324 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5326 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5327 case of a virtual function and its override (choose the overload
5329 (Invocation.OverloadResolve): Avoid 'override' members during
5330 'applicable_type' calculation.
5332 2005-03-28 Raja R Harinath <rharinath@novell.com>
5334 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5335 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5336 GetTypeHandle. It is possible for a reflected type to derive from
5337 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5338 System.Array during mscorlib compilation).
5339 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5340 contain a method_hash, don't create one either. Don't create a
5341 deep copy of the base cache's method_hash.
5342 (MemberCache.SetupCache): Rename back from DeepCopy.
5343 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5344 already initialized. If we see an override function, add its
5345 underlying base virtual function to the member_hash too.
5347 2005-02-09 Raja R Harinath <rharinath@novell.com>
5349 Combine two near-redundant caches.
5350 * typemanager.cs (method_params): Rename from method_internal_params.
5351 (TypeManager.GetParameterData): New. Replace
5352 Invocation.GetParameterData.
5353 (TypeManager.LookupParametersByBuilder): Remove.
5354 * expression.cs (Invocation.method_parameter_cache): Remove.
5355 (Invocation.GetParameterData): Remove.
5357 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5360 2005-02-08 Raja R Harinath <rharinath@novell.com>
5363 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5364 TypeManager.multicast_delegate_type is null, resolve it by looking
5365 up "System.MulticastDelegate".
5366 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5368 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5369 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5370 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5373 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5374 (LabeledStatement.AddReference): New. Set 'referenced'.
5375 (Goto.Resolve): Use it.
5377 2005-02-05 John Luke <john.luke@gmail.com>
5379 * driver.cs: remove duplicate -doc line in Usage ()
5381 2005-02-04 Raja R Harinath <rharinath@novell.com>
5383 * location.cs (Location.AddFile): Fix CS2002 error report.
5385 2005-02-02 Martin Baulig <martin@ximian.com>
5387 * delegate.cs (Delegate.DefineType): Report an internal error if
5388 TypeManager.multicast_delegate_type is null. See bug #72015 for
5391 2005-02-02 Raja R Harinath <rharinath@novell.com>
5393 Fix a crasher in a variant of #31984.
5394 * const.cs (Constant.CheckBase): New override that defers the
5395 new-or-override check in case the base type hasn't been populated
5397 (Constant.Define): Ensure the new-or-override check is performed.
5399 2005-02-01 Duncan Mak <duncan@ximian.com>
5401 * const.cs (LookupConstantValue): Check that `ce' is not null
5402 before calling GetValue ().
5404 2005-02-01 Raja R Harinath <rharinath@novell.com>
5406 Fix test-334.cs (#69519).
5407 * cs-parser.jay (using_alias_directive): Pass in an expression to
5408 NamespaceEntry.UsingAlias.
5409 (using_namespace_directive): Pass in an expression to
5410 NamespaceEntry.Using.
5411 (namespace_name): Don't flatten to a string.
5412 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5413 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5415 (NamespaceEntry.UsingEntry): Likewise.
5416 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5418 (NamespaceEntry.LookupForUsing): Remove.
5419 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5421 (NamespaceEntry.Lookup): Remove support for dotted names.
5423 2005-02-01 Raja R Harinath <rharinath@novell.com>
5425 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5427 (NamespaceEntry.ImplicitParent): Compute on demand.
5428 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5429 parallels the current.
5430 (NamespaceEntry.LookupForUsing): Use it.
5431 (NamespaceEntry.Lookup): If the current namespace-entry is
5432 implicit, don't search aliases and using tables.
5434 2005-02-01 Raja R Harinath <rharinath@novell.com>
5437 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5439 (TypeContainer.BaseCache): Compute on demand.
5440 (TypeContainer.FindMembers): Define constants and types if they're
5441 not already created.
5442 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5444 * const.cs (Constant.Define): Make idempotent.
5446 2005-01-29 Miguel de Icaza <miguel@novell.com>
5448 * pending.cs: Produce better code (no nops produced by using Ldarg
5451 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5452 i - 1' it should be arg + 1.
5456 2005-01-28 Raja R Harinath <rharinath@novell.com>
5458 * attribute.cs (Attribute.CheckAttributeType): Make private
5460 (Attribute.ResolveType): Make virtual.
5461 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5462 handling of RootContext.Tree.Types.
5464 2005-01-27 Raja R Harinath <rharinath@novell.com>
5466 Update attribute-handling to use the SimpleName/MemberAccess
5468 * cs-parser.jay (attribute): Pass in an expression to the
5469 constructors of Attribute and GlobalAttribute.
5470 * attribute.cs (Attribute): Take an expression for the name.
5471 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5472 passed in attribute name expression.
5473 (Attribute.CheckAttributeType): Use it.
5474 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5475 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5476 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5477 argument to prevent error messages if the lookup fails.
5479 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5481 * expression.cs (Indirection): Implemented IVariable interface
5482 to support indirection in AddressOf operator.
5483 (PointerArithmetic.Emit): Add optimalization for case where
5484 result can be precomputed.
5486 2005-01-26 Martin Baulig <martin@ximian.com>
5488 * class.cs (TypeContainer.AttributeTargets): Return the correct
5489 AttributeTargets depending on our `Kind' instead of throwing an
5490 exception; fixes #71632.
5492 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5495 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5498 2005-03-17 Martin Baulig <martin@ximian.com>
5500 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5501 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5503 2005-03-17 Martin Baulig <martin@ximian.com>
5505 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5506 to bool so we can return an error condition.
5507 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5510 2005-03-17 Martin Baulig <martin@ximian.com>
5512 * generic.cs (TypeMananager.IsIEnumerable): New public method.
5514 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5515 converting from an array-type of T to `IEnumerable<T>'.
5517 2005-03-16 Martin Baulig <martin@ximian.com>
5519 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5520 (Nullable.LiftedUnaryMutator): New public class.
5522 * expression.cs (UnaryMutator.DoResolve): Added support for
5525 2005-03-14 Martin Baulig <martin@ximian.com>
5527 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5529 2005-03-14 Martin Baulig <martin@ximian.com>
5531 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5532 the comparision operators `<', `>', `<=' and `>='.
5534 2005-03-13 Martin Baulig <martin@ximian.com>
5537 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5538 avoid confusion with the `NullLiteral'.
5539 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5541 2005-03-13 Martin Baulig <martin@ximian.com>
5543 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5544 comparing arbitrary types with the null literal.
5546 2005-03-13 Martin Baulig <martin@ximian.com>
5548 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5549 boolean operators '&&', '||', '&' and '|'.
5550 (Nullable.OperatorTrueOrFalse): New public class.
5552 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5553 instead of a `StaticCallExpr'; added support for nullables.
5555 2005-03-10 Martin Baulig <martin@ximian.com>
5558 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5559 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
5561 2005-03-07 Martin Baulig <martin@ximian.com>
5563 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5564 it work if `expr' is not an IMemoryLocation.
5565 (Nullable.Lifted): Implement IMemoryLocation.
5566 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5569 2005-03-05 Martin Baulig <martin@ximian.com>
5571 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5572 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5573 (Nullable): Added support for lifted unary and binary operators.
5575 * expression.cs (Unary.DoResolve): Added support for nullable types.
5576 (Binary.DoResolve): Likewise.
5577 (Conditional.DoResolve): Likewise.
5579 2005-03-02 Martin Baulig <martin@ximian.com>
5581 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5583 * class.cs (ClassPart.SetParameterInfo): Override this.
5584 (PartialContainer.SetParameterInfo): Override this.
5585 (TypeContainer.CheckConstraints): New protected method.
5586 (PartialContainer.CheckConstraints): Override this and check
5587 whether the same contraints were specified in all parts of a
5588 partial generic type definition.
5589 (PartialContainer.UpdateConstraints): New public method.
5591 * generic.cs (TypeParameter.UpdateConstraints): New public method.
5593 2005-03-02 Martin Baulig <martin@ximian.com>
5595 Committing a patch from Carlos Alberto Cortez to fix #72887.
5597 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5598 casts from `T []' to `int []'.
5600 2005-03-02 Martin Baulig <martin@ximian.com>
5602 * generic.cs (TypeManager.IsEqual): Make this symmetric.
5604 * expression.cs (Binary.ResolveOperator): When resolving a
5605 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5606 `=='. Fixes #71866. See gen-127.cs.
5608 2005-03-02 Martin Baulig <martin@ximian.com>
5610 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5611 static constructor in static classes.
5613 2005-03-02 Martin Baulig <martin@ximian.com>
5616 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5617 (Nullable.LiftedConversion): Added support for user-defined
5620 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5622 * cs-parser.jay: Use ComposedCast everywhere instead of
5623 NullableType, so we don't need to check for NullableType
5625 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5626 case where we'll be resolved into a `parenthesized_expression_0'
5630 (Convert.UserDefinedConversion): Added nullable conversions.
5632 2005-02-28 Martin Baulig <martin@ximian.com>
5634 * generic.cs (TypeManager.IsNullableType): New static method.
5635 (Nullable): New abstract class.
5636 (Nullable.NullLiteral): New public class.
5637 (Nullable.LiftedConversion): New public class.
5639 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5640 `builtin_types opt_nullable'.
5643 (Convert.ImplicitConversionStandard): Added nullable conversions.
5644 (Convert.ExplicitConversionStandard): Likewise.
5645 (Convert.ExplicitConversion): Likewise.
5647 2005-02-26 Martin Baulig <martin@ximian.com>
5649 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5650 begin with a "?", for instance "?[]". Don't do a type lookup if
5653 2005-02-25 Martin Baulig <martin@ximian.com>
5655 The first part of Nullable Types :-)
5657 * generic.cs (NullableType): New public class.
5658 (NullCoalescingOperator): New public class.
5659 (TypeArguments.Resolve): Add a CS0306 check.
5661 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5662 (opt_nullable): New rule.
5663 (type): Added `opt_nullable' to `namespace_or_type_name',
5664 `builtin_types' and `pointer_type'.
5665 (array_type): Added `opt_nullable'.
5666 (opt_rank_specifier_or_nullable): New rule; this is the
5667 combination of `opt_rank_specifier' and `opt_nullable'.
5668 (opt_error): New rule; catch errors here.
5669 (nullable_type_or_conditional): New rule; we use this to check for
5670 nullable and still detect the conditional operator.
5671 (local_variable_type): Use `opt_rank_specifier_or_nullable'
5672 instead `opt_rank_specifier'.
5674 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5677 2005-02-24 Martin Baulig <martin@ximian.com>
5679 * README, README.Changes: Removed; they're old and obsolete.
5681 2005-02-22 Martin Baulig <martin@ximian.com>
5683 * generic.cs (TypeParameter.Resolve): If resolving the constraints
5684 returned an error, set `constraints' to null to avoid a crash
5686 (TypeParameter.ResolveType): Likewise.
5688 2005-02-22 Martin Baulig <martin@ximian.com>
5691 (Constraints.ResolveTypes): Protect against being called twice.
5692 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5693 (TypeParameter.ResolveType): New public method; calls
5694 constraints.ResolveTypes().
5695 (TypeParameter.DefineType): Moved constraints.ResolveType() out
5696 into the new ResolveType().
5697 (GenericMethod.Define): Call ResolveType() on all our
5700 2005-02-21 Martin Baulig <martin@ximian.com>
5703 (TypeManager.generic_nullable_type): New static public field.
5704 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5707 (RootContext.ResolveCore): Resolve "System.Nullable`1".
5709 2005-02-15 Martin Baulig <martin@ximian.com>
5711 * generic.cs (ConstructedType.Constraints): Correctly check
5712 constraints if the argument type is a type parameter; fixes
5715 2005-02-02 Martin Baulig <martin@ximian.com>
5717 * delegate.cs (Delegate.DefineType): Report an internal error if
5718 TypeManager.multicast_delegate_type is null. See bug #72015 for
5721 2005-01-29 Miguel de Icaza <miguel@novell.com>
5723 * pending.cs: Produce better code (no nops produced by using Ldarg
5726 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5727 i - 1' it should be arg + 1.
5731 2005-01-26 Martin Baulig <martin@ximian.com>
5733 * cs-parser.jay (indexer_declarator): Don't report an error if we
5734 have type parameters since we can be an explicit interface
5735 implementation; fixes #71449.
5737 2005-01-26 Martin Baulig <martin@ximian.com>
5739 * class.cs (TypeContainer.AttributeTargets): Return the correct
5740 AttributeTargets depending on our `Kind' instead of throwing an
5741 exception; fixes #71632.
5743 2005-01-26 Martin Baulig <martin@ximian.com>
5745 * delegate.cs (Delegate.DefineType): Correctly define our type
5746 parameters. Fixes #71483.
5748 2005-01-25 Raja R Harinath <rharinath@novell.com>
5751 * expression.cs (MemberAccess.DoResolve): Don't complain with
5752 cs0572 when the LHS of a member access has identical name and type
5755 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5758 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5760 Create custom PermissionSet only for PermissionSetAttribute.
5762 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5765 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5766 delegates in static class.
5768 2005-01-24 Martin Baulig <martin@ximian.com>
5770 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5771 merging an implicit block, just use its reachability.
5773 * statement.cs (Block.Resolve): Make the unreachable code check
5774 work wrt. implicit blocks; see test-337 from #63842.
5776 2005-01-21 Alp Toker <alp@atoker.com>
5778 * cs-parser.jay: destructor_declaration's container is PartialContainer
5779 not Class when partial types are used, so use Kind prop instead of
5782 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5784 * cs-parser.jay: Improve error reporting when an interface
5787 2005-01-20 Dick Porter <dick@ximian.com>
5789 * support.cs: SeekableStreamReader fix from Sandor Dobos
5790 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5791 chars are read. Fixes bug 70369.
5793 2005-01-20 Raja R Harinath <rharinath@novell.com>
5795 * cs-parser.jay (catch_clause): Simplify current_block handling
5798 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5800 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5801 code with ImplicitStandardConversion to handle the implicit
5802 conversion of method groups into valid delegate invocations.
5804 The problem is that in parameter handling we were using this code
5805 path. Fixes bug #64698
5807 2005-01-19 Raja R Harinath <rharinath@novell.com>
5809 * cs-parser.jay: Fix several infelicities.
5810 - Avoid assigning to the parser value stack. Code like
5811 '$3 = null' is unclean. Synthesize a value for the code block
5813 - Avoid using oob_stack for storing location information. Use ...
5814 (_mark_): ... this. New (empty) rule. Saves the current location
5816 (foreach_statement): Avoid using oob_stack for current_block
5817 handling. Use technique used in for_statement and
5818 using_statement. Synthesize a value for the code block to store
5819 additional intermediate information.
5821 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5823 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5824 of a different type is only allowed to private fields of a
5825 containing type, not on fields of a base class.
5827 See test-174.cs and error cs0122-9.cs
5829 2005-01-13 Raja R Harinath <rharinath@novell.com>
5831 Fix test-335.cs (bug #58126).
5832 * cs-parser.jay (argument): Split out non-expression parts of the
5833 rule into 'non_simple_argument'.
5834 (invocation_expression): Support parenthesized invocations with
5835 multiple arguments, and with single non-simple arguments.
5837 2005-01-13 Raja R Harinath <rharinath@novell.com>
5839 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5842 2005-01-12 Raja R Harinath <rharinath@novell.com>
5844 Fix cs0038-1.cs, cs1640-6.cs.
5845 * ecore.cs (Expression.Resolve): Remove special-case for
5846 SimpleName in error-handling.
5847 (Expression.almostMatchedMembers): Relax access permission to
5849 (Expression.MemberLookupFailed): Handle duplicates in
5850 almostMatchedMembers list.
5851 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5852 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5853 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5854 overload if the passed in MemberInfo is a MethodBase.
5856 2005-01-25 Martin Baulig <martin@ximian.com>
5859 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5861 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5864 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5865 for non-CAS & merge permission sets properly.
5867 2005-01-11 Raja R Harinath <rharinath@novell.com>
5869 Improve standard-compliance of simple name and member access
5870 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5871 * ecore.cs (FullNamedExpression): New abstract base class
5872 for Namespaces and TypeExpressions.
5873 (ResolveFlags.SimpleName): Remove.
5874 (SimpleName): Remove support for dotted names.
5875 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5876 DeclSpace.FindType and DeclSpace.LookupType.
5877 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5878 (Expression.ExprClassName): Make member function.
5879 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5880 a namespace. Remove creation of dotted "SimpleName"s.
5881 (MemberAccess.DoResolve): Likewise.
5882 * decl.cs (DeclSpace.Cache): Make private.
5883 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5884 (DeclSpace.FindType): Update.
5885 (DeclSpace.LookupType): Move here from RootContext. Return a
5886 FullNamedExpression.
5887 * namespace.cs (Namespace): Derive from FullNamedExpression
5888 so that it can be part of expression resolution.
5889 (Namespace.Lookup): Return an FullNamedExpression.
5890 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5892 * rootcontext.cs (NamespaceLookup): Remove.
5893 (LookupType): Move to DeclSpace.
5894 * attribute.cs (CheckAttributeType): Update.
5895 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5896 (FindDocumentedTypeNonArray): Likewise.
5898 2005-01-11 Raja R Harinath <rharinath@novell.com>
5900 Fix cs0509.cs, cs1632.cs.
5901 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5902 is the same as IsInterface.
5903 (TypeContainer.GetClassBases): Likewise.
5904 * statement.cs (LabeledStatement.ig): New field.
5905 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5907 (LabeledStatement.DoEmit): Check that the label was created with
5908 the same ILGenerator.
5910 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5913 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5914 accessors to its properties.
5916 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5917 from accessors to property.
5919 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5922 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5925 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5927 * attribute.cs: Check for null and empty strings.
5929 I have lost another battle to Paolo.
5931 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5934 * class.cs (PropertyMethod): Set Parent field in ctors.
5935 (SetMethod.InternalParameters): Add unsafe switch hack.
5936 Override MarkForDuplicationCheck where it is appropriate.
5938 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5939 It says whether container allows members with the same name.
5941 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5942 Removed is_method parameter.
5944 2005-01-06 Duncan Mak <duncan@ximian.com>
5946 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5947 because the previous change led to incorrect reporting of CS1032
5948 ("Cannot define/undefine preprocessor symbols after first token in
5949 file"). Instead of using `tokens_seen' as the only flag that
5950 triggers CS1040, introduce `comments_seen'. This new flag is used
5951 to signify having seen comments on the current line, so it is
5952 unset after a newline.
5954 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5956 * doc.cs : When searching for a type, find nested type too.
5957 This fixes bug #71040.
5959 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5962 - Warn missing member comment on those classes which also does not
5963 have doc comments. Fixed bug #71041.
5964 - Don't warn missing doc comment on default constructor.
5967 2005-01-06 Duncan Mak <duncan@ximian.com>
5969 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5970 comments, set `tokens_seen' to true. This allows us to detect
5971 misplaced preprocessor directives (i.e. not at the beginning of
5972 the a line, nor after whitespaces). In that case, report error
5973 CS1040. This fixes bug #56460.
5975 * cs-parser.jay (interface_member_declaration): Add checks for
5976 IsExplicitImpl, and report CS0541 error if an interface member is
5977 defined as an explicit interface declaration.
5979 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5982 * class.cs (PropertyMethod): Set Parent field in ctors.
5983 (SetMethod.InternalParameters): Add unsafe switch hack.
5985 * decl.cs (MemberCore.Parent): Cannot be readonly.
5987 2005-01-06 Raja R Harinath <rharinath@novell.com>
5989 * decl.cs (DeclSpace.ResolveType): Remove.
5990 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5991 Merge in code from ...
5992 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5993 * class.cs, enum.cs: Update to changes.
5995 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5997 * anonymous.cs: Ensure that we init the scope of our parent if it
5998 has not been initialized yet.
6000 2004-12-30 Duncan Mak <duncan@ximian.com>
6002 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6003 if field.FieldBuilder is null. Fixes #70758.
6005 * convert.cs: Fixed some typos and updated some of the comments.
6006 (ImplicitStandardConversionExists):
6007 (TryImplicitIntConversion): If `target_type' is an interface and
6008 the type of `ic' implements this interface, return true or a new
6009 BoxedCast instead of null. This fixes #70468.
6011 2004-12-29 Duncan Mak <duncan@ximian.com>
6013 * expression.cs (Argument.Emit): Check that Expr is
6014 IMemoryLocation before casting to it, and report CS1510 otherwise.
6018 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6020 * statement.cs (Block.ThisVariable): remove the recursion here, to
6021 make the --profile more sane.
6023 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6025 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6026 assembly, by JB Evain.
6028 2004-12-17 Raja R Harinath <rharinath@novell.com>
6030 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6031 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6032 "parent" refers to enclosing type/class. "base" refers to superclass.
6034 2004-12-17 Raja R Harinath <rharinath@novell.com>
6036 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6037 Ensure that we only have GlobalAttributes.
6038 * attribute.cs (Attribute.Emit): Make non-virtual.
6039 (GlobalAttribute.Emit): Remove.
6040 (Attribute.Resolve): Make virtual.
6041 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6042 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6043 the argument. Don't create one.
6044 (Attribute.GetObsoleteAttribute): Likewise.
6045 (Attribute.GetClsCompliantAttributeValue): Likewise.
6046 * class.cs, decl.cs: Update to changes.
6048 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6050 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6052 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6054 * statement.cs (Foreach.Resolve): Add error 186 report.
6056 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6058 * expression.cs (Conditional.DoResolve): Add warning 429.
6060 * statement.cs (If.Resolve): Add warning 665.
6062 2004-12-16 Raja R Harinath <rharinath@novell.com>
6064 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6065 except when in the parser, and in GlobalAttribute.
6066 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6067 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6068 RootContext.Tree.Types.NamespaceEntry once work is done.
6069 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6070 and resets RootContext.Tree.Types.NamespaceEntry.
6072 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6074 * cs-parser.jay: Don't create a block for every variable.
6076 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6078 * location.cs: Provide extra information.
6080 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6081 variables from the captured environment, it is the ldarg_0.
6083 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6085 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6088 * class.cs: Changed warning level for 169 to avoid developer
6089 displeasure from warning flooding. It will be changed back when they
6090 fix most of current BCL warnings.
6092 * RootContext.cs: Pushed default WarningLevel to 3.
6094 * statement.cs: Removed unused variable.
6096 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6098 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6099 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6100 Add error 502 report.
6101 (StaticClass.DefineType): Add error 441 report.
6102 (Class.AllowedModifiersProp): New virtual property as temporary
6103 extension to AllowedModifiers.
6104 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6105 to share implementation with StaticClass and don't call virtual
6108 * driver.cs (MainDriver): Add error 1558 test.
6110 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6111 report. Moved error 36 test here.
6113 * statement.cs (Throw.Resolve): Add error 724 report.
6115 * typemanager.cs: Add out_attribute_type core type.
6117 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6119 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6121 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6123 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6126 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6128 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6129 Add error 3023 report.
6130 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6132 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6135 2004-12-12 John Luke <john.luke@gmail.com>
6137 * driver.cs (AddArgs): take -- into account when
6138 adding arguments, fixes bug 65710
6140 2004-12-12 Martin Baulig <martin@ximian.com>
6142 * expression.cs (Unary.TryReduceNegative): Added support for
6143 SByteConstant and ByteConstant.
6144 (Unary.Reduce): Check error values from TryReduceNegative().
6146 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6148 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6149 and report exception as error 182.
6151 2004-12-10 Raja R Harinath <rharinath@novell.com>
6153 * driver.cs (Main): Fix message when there are warnings.
6155 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6157 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6159 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6161 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6162 Reduced number of warnings.
6164 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6166 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6168 * driver.cs: Removed message.
6170 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6172 2004-12-08 <vargaz@freemail.hu>
6174 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6176 2004-12-08 Martin Baulig <martin@ximian.com>
6178 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6179 instead of a CS3002 for properties and indexer.
6181 2004-12-08 Martin Baulig <martin@ximian.com>
6183 * decl.cs (MemberName.ToString): Make this work again.
6185 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6187 * attribute.cs (Resolve): Add error 591 detection.
6189 * class.cs (FieldMember.Define): Add error 1547 detection.
6190 (Indexer.Define): Add error 620 detection.
6191 (Operator.Define): Add error 590 detection.
6193 * ecore.cs: Missing argument for error 79.
6195 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6198 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6201 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6204 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6206 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6207 Some operator comments were suppressed.
6208 * doc.cs : Implicit/explicit operator name in doc comments are like
6209 "op_Explicit(type)~returnType", so added suffix handling.
6211 2005-01-21 Alp Toker <alp@atoker.com>
6213 * cs-parser.jay: destructor_declaration's container is PartialContainer
6214 not Class when partial types are used, so use Kind prop instead of 'is'.
6216 2004-12-12 Martin Baulig <martin@ximian.com>
6218 * expression.cs (Unary.TryReduceNegative): Added support for
6219 SByteConstant and ByteConstant.
6220 (Unary.Reduce): Check error values from TryReduceNegative().
6222 2004-12-11 Martin Baulig <martin@ximian.com>
6224 * support.cs (ReflectionParameters.ParameterName): If we have a
6225 `gpd', call `ParameterName' on it.
6227 * parameter.cs (Parameter.GetParameterAttributes): New static method.
6229 * pending.cs (PendingImplementation.DefineProxy): Call
6230 DefineParameter() for all of the MethodBuilder's arguments.
6232 2004-12-09 Martin Baulig <martin@ximian.com>
6234 * doc.cs (DocUtil): Make this a static class.
6236 2004-12-09 Martin Baulig <martin@ximian.com>
6238 * expression.cs (Invocation.InferType): Moved the type inference
6239 implementation into TypeManager.
6241 * generics.cs (TypeManager): Moved the type inference
6242 implementation here.
6244 2004-12-09 Martin Baulig <martin@ximian.com>
6246 * typemanager.cs (TypeManager): Make this a partial class.
6249 (TypeManager): Move the generics part of `TypeManager' here.
6251 2004-12-08 Martin Baulig <martin@ximian.com>
6253 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6254 instead of a CS3002 for properties and indexer. Added CS3024
6255 check for generic interfaces.
6257 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6258 instances are not CLS-compliant.
6260 2004-12-08 Martin Baulig <martin@ximian.com>
6263 (void_pointer_expression): New rule for `void*', `void**' etc.
6264 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
6266 2004-12-08 Martin Baulig <martin@ximian.com>
6268 * expression.cs (Invocation.InferType): Removed the hack for
6269 MethodCore.MayUnify().
6271 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6274 * class.cs (MethodCore.MayUnify): Use
6275 TypeManager.MayBecomeEqualGenericTypes().
6277 2004-12-08 Martin Baulig <martin@ximian.com>
6279 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6280 parameter, box it. Fixes #69233.
6282 2004-12-08 Martin Baulig <martin@ximian.com>
6284 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6285 have the ctor constraint. Fixes #68326.
6287 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6289 * cs-parser.jay : interface comment was not consumed because of
6290 extra opt_semicolon before doc handling.
6292 2004-12-03 Raja R Harinath <rharinath@novell.com>
6294 Fix test-327.cs, test-328.cs, and put in early infrastructure
6295 for eventually fixing #52697.
6296 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6297 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6299 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6300 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6301 (VerifyUsing, error246): Update.
6302 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6303 'NamespaceEntry.LookupNamespaceOrType'.
6305 2004-12-07 Martin Baulig <martin@ximian.com>
6307 * driver.cs: Call it "BETA SOFTWARE" :-)
6309 2004-12-06 Raja R Harinath <rharinath@novell.com>
6311 Fix crash on cs0657-17.cs.
6312 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6313 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6314 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6315 the case where the NamespaceEntry gets overwritten.
6317 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6319 Fixed #69195, #56821
6320 * ecore.cs (ResolveBoolean): Tiny refactoring.
6322 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6323 of right expression resolving when left is false constant and
6324 operator is LogicalAnd OR true constant and operator is LogicalOr.
6326 * statement.cs (ResolveUnreachable): Always reports warning.
6328 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6330 * class.cs: Distinguish between 1721 and 1722 (just a little help
6331 for the programmer).
6333 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6335 * delegate.cs: Only allow this on new versions of the language.
6337 2004-12-02 Duncan Mak <duncan@ximian.com>
6339 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6341 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6342 here as a static method. Take an additional bool out parameter
6343 `must_do_cs1540_check' for signaling to InstanceResolve.
6344 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6345 member field from PropertyExpr class and made it an argument of
6347 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6348 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6349 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6350 and `remove_accessor' as well as InstanceResolve: report CS0122
6355 2004-12-07 Martin Baulig <martin@ximian.com>
6357 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6358 and CS0692 where appropriate.
6360 2004-12-06 Martin Baulig <martin@ximian.com>
6362 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6363 IsDuplicateImplementation() and improved it.
6365 * expression.cs (Invocation.InferTypeArguments): Added
6366 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6367 and removed the "ref" modifier from `infered_types'.
6369 * decl.cs (MemberName.ToString): Removed the exception.
6371 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6373 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6374 comments are allowed.
6376 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6378 * delegate.cs: Add checks for subtypes in paramaters and return values
6379 in VerifyMethod () to add support for Covariance/Contravariance
6382 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6384 * report.cs: Remove extra closing parenthesis.
6386 * convert.cs (Error_CannotImplicitConversion): If the name of the
6387 types are the same, provide some extra information.
6389 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6392 * attribute.cs (Resolve): Improved implementation of params
6393 attribute arguments.
6395 * support.cs (ParameterData): Add HasParams to be faster.
6397 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6399 all things are for /doc support:
6401 * doc.cs: new file that supports XML documentation generation.
6402 * mcs.exe.sources: added doc.cs.
6404 Handle /doc command line option.
6405 Report error 2006 instead of 5 for missing file name for /doc.
6406 Generate XML documentation when required, after type resolution.
6408 Added support for picking up documentation (/// and /** ... */),
6409 including a new XmlCommentState enumeration.
6411 Added lines to fill Documentation element for field, constant,
6412 property, indexer, method, constructor, destructor, operator, event
6413 and class, struct, interface, delegate, enum.
6414 Added lines to warn incorrect comment.
6416 Added Documentation field (passed only when /doc was specified).
6418 Added DocComment, DocCommentHeader, GenerateDocComment() and
6419 OnGenerateDocComment() and some supporting private members for
6420 /doc feature to MemberCore.
6422 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6424 Added overriden DocCommentHeader.
6426 Added overriden DocCommentHeader and GenerateDocComment().
6428 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6430 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6431 unwrapping the enumeration values, chain to
6432 DoConstantNumericPromotions again, so we can promote things to the
6433 fundamental types (takes care of enums that are bytes, sbytes).
6437 2004-12-01 Raja R Harinath <rharinath@novell.com>
6439 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6440 Fix long-standing bug in type-lookup. Use FindType instead of
6441 LookupType when ec.ResolvingTypeTree.
6442 (Attribute.ResolveType, Attribute.Resolve)
6443 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6445 (Attributes.Search): Remove internal version. Update.
6446 (Attributes.SearchMulti): Update.
6447 (Attributes.GetClsCompliantAttribute): Remove.
6448 (Attributes.GetIndexerNameAttribute): Remove.
6449 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6450 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6451 * class.cs (Indexer.Define): Likewise.
6453 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6456 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6457 MarshallByReference members access.
6459 * expression.cs: Use CheckMarshallByRefAccess;
6460 Better error CS0197 message.
6462 * report.cs: Print whole related error message.
6464 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6466 * class (GetClassBases): Better error 60 report.
6467 (EventProperty): Disabled warning 67 detection.
6469 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6472 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6474 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6477 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6480 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6482 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6484 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6486 * attribute.cs (Attribute.Resolve): Refine error reporting and
6487 report a cs0117 if the identifier does not exist, to distinguish
6488 from 0617 which is a miss-use of the actual identifier.
6490 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6491 between cs0070 and cs0079.
6493 * class.cs (MemberBase.DoDefine): When reporting a wrong
6494 accessibility level, we use MethodCore to compare instead of
6495 Method (this was a regression in some refactoring effort).
6497 So now we correctly report cs0056 again.
6499 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6500 testing the target_type (which was known to be object_type) and
6501 not the source type (which is anonymous_method).
6503 Fixed reporting of error cs1660.
6505 * expression.cs (UserCast.Source): Expose the underlying cast.
6507 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6508 allowed types to find a match to int32 first (most common).
6510 In addition, it ignores any ImplicitUserConversions that did an
6511 internal implicit conversion (as the switch statement allows only
6512 one integral conversion to exist).
6514 * class.cs (PartialContainer.Create): rename `name' to
6515 `member_name' for clarity. Then replace the string calls with a
6516 call to MemberName.GetPartialName, as now using
6517 MemberName.ToString is an error (this is due to the side effects
6518 it had, that were fixed in the past).
6520 This will restore the error reporting on a number of partial class
6521 errors that were missusing this (and getting an exception as a
6522 results, which is now just a plain textual warning, because
6523 yyparse debug output would crash otherwise).
6525 2004-11-26 Raja R Harinath <rharinath@novell.com>
6527 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6529 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6531 * rootcontext.cs (LookupType): Make sure to cache lookups that
6532 don't give us a negative result. This saves about 5% of corlib
6535 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6537 * report.cs (AbstractMessage.Print): messages are sent to stderr
6539 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6540 non-interface in the list of interfaces (at this point, either
6541 parent was properly set, or a base class is being listed in the
6542 interfaces section).
6544 This flags error 1722, and resolves the crash from bug 69259.
6546 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6548 * statement.cs (Using.EmitExpressionFinally): make this work right
6549 for valuetypes. Fixes 69926.
6551 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6553 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6554 converted to an enum" here, before we try to change the underlying
6555 type. This code exists, but it is a different code path than the
6556 one used while encoding constants.
6558 (ImplicitReferenceConversionExists): In addition, resynchronized
6559 the code here, so it matches the same code in
6560 ImplicitReferenceConversionExists for the `from any class-type S
6561 to any interface-type T'.
6563 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6565 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6567 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6569 * cs-parser.jay: Use verbosity accordingly.
6571 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6573 * expression.cs (Unary.ResolveOperator): Do not report warning;
6574 AddressOf reads from variable.
6576 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6578 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6582 * attribute.cs (Attributable): Removed CheckTargets.
6583 (Attributes.Emit): Explicit attribute targets are tested here.
6585 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6586 not enabled for interfaces.
6588 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6589 (GetAssemblyName): Ouch next bug there.
6591 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6593 * expression.cs: Error 275 added.
6595 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6597 Fix bug #69177 (Implemented decimal constant support)
6599 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6600 (BinaryFold): Add DecimalConstant.
6602 * const.cs (Define): Decimal constant
6604 (ChangeType): Add decimal type handling.
6605 (LookupConstantValue): Don't set value for decimal type but
6606 emit DecimalConstantAttribute. Needed for constant optimization.
6608 * constant.cs (ToDecimal): New method.
6609 (ConvertToDecimal): New method.
6610 (IntConstant): Implemented ConvertToDecimal.
6611 (DecimalConstant.Emit): Emit optimized version for decimals in
6614 * expression.cs (ResolveOperator): Changed order of constant
6615 reduction to work correctly with native types which have
6616 overloaded operators.
6617 (ResolveMemberAccess): Extract constant value from attribute
6620 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6622 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6623 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6624 (ChangeType): Decimal is special.
6625 (TypeToCoreType): Add decimal type.
6627 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6629 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6632 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6634 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6637 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6639 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6641 * pending.cs (PendingImplementation): Grab only interfaces.
6643 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6645 * statement.cs (ForeachHelperMethods): Add location member and
6646 error 202 detection.
6648 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6650 * expression.cs (DoResolveBase): Fixed wrong warning for out
6653 2004-12-04 Martin Baulig <martin@ximian.com>
6655 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6656 to check whether the conversion is ok.
6658 * typemanager.cs (TypeManager.GetTypeArguments): Just return
6659 `Type.EmptyTypes' if we're not a generic TypeContainer.
6661 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6663 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6664 old bug: when converting from the null literal to a pointer,
6665 return an EmptyCast, not the NullLiteral.
6667 This fixes #69921, the recent null_type changes probably made this
6670 2004-12-03 Martin Baulig <martin@ximian.com>
6672 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6673 method as our child, call AnonymousMethod.Compatible() on it.
6675 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6677 * class.cs (FieldBase): Use an unused bit field from the field to
6678 encode the `has_offset' property from the FieldMember. This saves
6679 a couple of Ks on bootstrap compilation.
6681 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6682 method as our child, return the AnonymousMethod resolved
6685 * expression.cs (New.DoResolve): Allow return values from
6686 NewDelegate to also include AnonymousMethods.
6690 2004-11-29 Raja R Harinath <rharinath@novell.com>
6692 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6694 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6695 System.Runtime.InteropServices._Exception, since it's a base
6696 interface of the core type System.Exception in the net_2_0 profile.
6698 2004-11-27 Martin Baulig <martin@ximian.com>
6700 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6702 2004-11-26 Raja R Harinath <rharinath@novell.com>
6704 * Makefile: Convert to use executable.make.
6705 * gmcs.exe.sources: New.
6707 2004-11-25 Martin Baulig <martin@ximian.com>
6709 * expression.cs (Invocation.InferType): Added support for byref types.
6711 2004-11-25 Martin Baulig <martin@ximian.com>
6713 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6714 in TypeManager.TypeToCoreType().
6716 2004-11-25 Martin Baulig <martin@ximian.com>
6718 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6719 "Dispose" method from the `current_type'.
6720 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6721 DoDefineMembers() instead of using the MethodBuilder; this is
6722 required for generic iterators.
6724 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6726 2004-11-24 Martin Baulig <martin@ximian.com>
6728 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6730 2004-11-20 Martin Baulig <martin@ximian.com>
6732 * expression.cs (Invocation.InferType): Correctly infer generic
6733 instances; see gen-103.cs.
6734 (Invocation.InferTypeArguments): If a generic method doesn't have
6735 any unbound type parameters, we don't need to infer anything.
6737 2004-11-19 Raja R Harinath <rharinath@novell.com>
6739 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6741 2004-11-17 Raja R Harinath <rharinath@novell.com>
6743 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6744 (TypeHandle.GetMemberCache): New.
6745 (TypeHandle.TypeHandle): Update.
6746 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6747 (TypeManager.LookupParentInterfacesCache):
6748 Rename from LookupInterfaceCache. Optimize slightly.
6749 (TypeManager.MemberLookup_FindMembers): Update.
6750 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6752 (AddCacheContents): Rename from AddHashtable.
6753 * class.cs (TypeContainer.parent_container): Remove.
6754 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6755 (TypeContainer.DoDefineMembers): Don't initialize it.
6756 Update to name changes.
6758 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6760 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6761 that factors the code to check access modifiers on override.
6763 (PropertyBase): Use the code here.
6765 Patch from Lluis S'anchez, fixes bug #69361.
6767 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6769 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6770 routine that is used to report the use of a captured variable
6771 whose address has been taken.
6773 There are two checks: one when variables are being captured and
6774 the other check is when the address of a variable is taken.
6776 (because an anonymous methods might be resolved before *or* after
6777 the address has been taken) and
6779 * expression.cs (Conditional.DoResolve): Remove the special
6780 casing that Martin added to trueExpr and falseExpr being both
6781 NullLiteral. We get the right behavior now just by introducing
6782 the null_type into the compiler.
6784 * convert.cs (ExplicitConversion): Change the code to use
6785 null_type instead of testing `expr is NullLiteral'.
6786 (ImplicitConversionStandard): use null_type too.
6787 (ImplicitReferenceConversionExists): use null_type too.
6788 (ImplicitReferenceConversion): use null_type too.
6790 * literal.cs: The type of `NullLiteral' is now null_type instead
6792 (Resolve): Set the type here.
6794 * typemanager.cs: Introduce null_type.
6796 2004-11-18 Martin Baulig <martin@ximian.com>
6799 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6801 2004-11-18 Martin Baulig <martin@ximian.com>
6803 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6805 2004-11-18 Martin Baulig <martin@ximian.com>
6807 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6808 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
6809 call ResolveConstructedType() on it to resolve it without checking
6811 (Constraints.ResolveTypes): Check them here.
6812 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6813 but don't check constraints.
6814 (ConstructedType.ResolveAsTypeTerminal): Override this and also
6815 check constraints here.
6816 (ConstructedType.ResolveConstructedType): New public method. This
6817 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6818 resolve ourselves without checking constraints.
6820 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6822 2004-11-18 Martin Baulig <martin@ximian.com>
6825 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6827 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6829 2004-11-18 Martin Baulig <martin@ximian.com>
6831 * ecore.cs (TypeExpr.ResolveType): Removed.
6832 (Expression.ResolveAsTypeTerminal): We always return a fully
6833 resolved `TypeExpr', so we can just access its `Type'.
6835 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6837 2004-11-17 Martin Baulig <martin@ximian.com>
6839 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6840 sure we don't return any unresolved TypeExpr's.
6841 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6843 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6845 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6846 unresolved `ConstructedType's.
6848 2004-11-17 Martin Baulig <martin@ximian.com>
6850 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6852 2004-11-17 Martin Baulig <martin@ximian.com>
6855 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6857 * decl.cs (DeclSpace.ResolveType): Removed.
6858 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6860 2004-11-17 Martin Baulig <martin@ximian.com>
6862 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6863 direction, like FindMembers() does. Fixes #69546, testcase is in
6866 2004-11-16 Martin Baulig <martin@ximian.com>
6868 This is based on a patch from Marek Safar, see bug #69082.
6869 Fixes bugs #63705 and #67130.
6871 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6872 method; create a MemberCache for an interface type and cache the
6875 * decl.cs (IMemberContainer.ParentContainer): Removed.
6876 (IMemberContainer.ParentCache): New property.
6877 (MemberCache.SetupCacheForInterface): Removed.
6878 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6879 to create a cache for an interface's "parent".
6881 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6884 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6886 * statement.cs: Avoid adding bools to a hashtable.
6888 2004-11-15 Martin Baulig <martin@ximian.com>
6890 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6892 2004-11-11 Martin Baulig <martin@ximian.com>
6894 * typemanager.cs (TypeManager.GetMethodName): New method.
6896 * class.cs (MethodData.Define): Include the generic arity in the
6897 name of an explicit interface; also add it to the method name.
6899 * pending.cs (PendingImplementation.InterfaceMethod): The method
6900 name now includes the generic arity.
6902 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6904 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6905 calling an unsafe method from a safe location.
6907 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6910 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6912 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6914 * namespace.cs (VerifyUsing): use GetPartialName instead of
6917 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6919 * statement.cs (Return.Resolve): Fix regression in typo: if
6920 `in_exc', we have to request a NeedReturnLabel, this was a typo
6921 introduced in the anonymous method check-in. Fixes #69131.
6923 * Indexers were using the ShortName when defining themselves,
6924 causing a regression in the compiler bootstrap when applying the
6925 patch from 2004-11-02 (first part), now they use their full name
6926 and the bug is gone.
6928 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6930 * driver.cs: Strip the path from the names of embedded resources. Fixes
6933 2004-11-04 Raja R Harinath <rharinath@novell.com>
6935 Fix error message regression: cs0104-2.cs.
6936 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6937 (AliasEntry.Resolve): Update.
6938 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6940 (RootContext.LookupType): Update.
6942 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6944 * cs-parser.jay: Add support for handling accessor modifiers
6945 * class: Add support port accessor modifiers and error checking,
6946 define PropertyMethod.Define as virtual (not abstract anymore)
6947 * ecore.cs: Add checking for proeprties access with access modifiers
6948 * iterators.cs: Modify Accessor constructor call based in the modified
6950 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6952 * expression.cs (StringConcat): Handle being called twice,
6953 as when we have a concat in a field init with more than two
6956 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6958 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6959 special case explicit implementations, we should always produce
6960 the .property or .event declaration.
6962 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6963 since it will not return correct data if people use this
6964 unresolved in the presence of using statements (see test-313).
6966 * class.cs (MethodData.Define): If we are an explicit interface
6967 implementation, set the method name to the full name of the
6968 interface plus the name of the method.
6970 Notice that using the method.MethodName.GetFullName() does not
6971 work, as it will only contain the name as declared on the source
6972 file (it can be a shorthand in the presence of using statements)
6973 and not the fully qualifed type name, for example:
6977 class D : ICloneable {
6978 object ICloneable.Clone () {
6982 Would produce a method called `ICloneable.Clone' instead of
6983 `System.ICloneable.Clone'.
6985 * namespace.cs (Alias.Resolve): Use GetPartialName.
6987 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6989 * cs-parser.jay: Add error 1055 report.
6991 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6993 * assign.cs (Assign.DoResolve): Only do the transform of
6994 assignment into a New if the types are compatible, if not, fall
6995 through and let the implicit code deal with the errors and with
6996 the necessary conversions.
6998 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7000 * cs-parser.jay: Add error 1031 report.
7002 * cs-tokenizer.cs: Add location for error 1038.
7004 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7006 * cs-parser.jay: Add error 1016 report.
7008 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7010 * cs-parser.jay: Add errors 1575,1611 report.
7012 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7014 * cs-parser.jay: Add error 1001 report.
7016 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7019 * attribute.cs (GetMarshal): Add method argument for
7020 caller identification.
7022 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7023 agument for GetMarshal and RuntimeMissingSupport.
7025 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7027 * attribute.cs (ExtractSecurityPermissionSet): Removed
7028 TypeManager.code_access_permission_type.
7030 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7032 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7034 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7035 for obsolete use of a variable here. Fixes regression on errors
7036 cs0619-25 and cs0619-26.
7038 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7040 Fix #62358, implemented security attribute encoding.
7042 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7043 Tests permitted SecurityAction for assembly or other types.
7044 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7045 data from SecurityPermissionAttribute to PermisionSet class.
7047 * class.cs (ApplyAttributeBuilder): Added special handling
7048 for System.Security.Permissions.SecurityAttribute based types.
7050 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7051 special handling for System.Security.Permissions.SecurityAttribute
7054 * enum.cs (ApplyAttributeBuilder): Added special handling
7055 for System.Security.Permissions.SecurityAttribute based types.
7057 * parameter.cs (ApplyAttributeBuilder): Added special handling
7058 for System.Security.Permissions.SecurityAttribute based types.
7060 * rootcontext.cs: Next 2 core types.
7062 * typemanager.cs (TypeManager.security_permission_attr_type):
7063 Built in type for the SecurityPermission Attribute.
7064 (code_access_permission_type): Build in type.
7066 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7068 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7069 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7070 all of this information into
7071 EmitContext.EmitCapturedVariableInstance.
7073 * codegen.cs (EmitCapturedVariableInstance): move here the
7074 funcionality of emitting an ldarg.0 in the presence of a
7075 remapping. This centralizes the instance emit code.
7077 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7078 then emit a load of this: it means that we have reached the
7079 topmost ScopeInfo: the one that contains the pointer to the
7080 instance of the class hosting the anonymous method.
7082 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7083 captures to the topmost CaptureContext.
7085 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7087 * expression.cs (LocalVariableReference): Move the knowledge about
7088 the iterators into codegen's EmitCapturedVariableInstance.
7090 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7092 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7093 all code paths return a value from an anonymous method (it is the
7094 same as the 161 error, but for anonymous methods).
7096 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7098 The introduction of anonymous methods in the compiler changed
7099 various ways of doing things in the compiler. The most
7100 significant one is the hard split between the resolution phase
7101 and the emission phases of the compiler.
7103 For instance, routines that referenced local variables no
7104 longer can safely create temporary variables during the
7105 resolution phase: they must do so from the emission phase,
7106 since the variable might have been "captured", hence access to
7107 it can not be done with the local-variable operations from the runtime.
7111 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7112 is a toplevel block.
7114 (ToplevelBlock): A new kind of Block, these are the blocks that
7115 are created by the parser for all toplevel method bodies. These
7116 include methods, accessors and anonymous methods.
7118 These contain some extra information not found in regular blocks:
7119 A pointer to an optional CaptureContext (for tracking captured
7120 local variables and parameters). A pointer to the parent
7123 (Return.Resolve): Catch missmatches when returning a value from an
7124 anonymous method (error 1662).
7125 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7128 (Break.Resolve): ditto.
7130 (SwitchLabel): instead of defining the labels during the
7131 resolution phase, we now turned the public ILLabel and ILLabelCode
7132 labels into methods called GetILLabelCode() and GetILLabel() that
7133 only define the label during the Emit phase.
7135 (GotoCase): Track the SwitchLabel instead of the computed label
7136 (its contained therein). Emit the code by using
7137 SwitchLabel.GetILLabelCode ().
7139 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7140 whether the Local has been captured or not.
7142 (LocalInfo.IsCaptured): New property, used to tell whether the
7143 local has been captured.
7145 * anonymous.cs: Vastly updated to contain the anonymous method
7148 The main classes here are: CaptureContext which tracks any
7149 captured information for a toplevel block and ScopeInfo used to
7150 track the activation frames for various local variables.
7152 Each toplevel block has an optional capture context associated
7153 with it. When a method contains an anonymous method both the
7154 toplevel method and the anonymous method will create a capture
7155 context. When variables or parameters are captured, they are
7156 recorded on the CaptureContext that owns them, for example:
7160 MyDelegate d = delegate {
7165 Here `a' will be recorded as captured on the toplevel
7166 CapturedContext, the inner captured context will not have anything
7167 (it will only have data if local variables or parameters from it
7168 are captured in a nested anonymous method.
7170 The ScopeInfo is used to track the activation frames for local
7171 variables, for example:
7173 for (int i = 0; i < 10; i++)
7174 for (int j = 0; j < 10; j++){
7175 MyDelegate d = delegate {
7180 At runtime this captures a single captured variable `i', but it
7181 captures 10 different versions of the variable `j'. The variable
7182 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7183 recorded on a child.
7185 The toplevel ScopeInfo will also track information like the `this'
7186 pointer if instance variables were referenced (this is necessary
7187 as the anonymous method lives inside a nested class in the host
7188 type of the method).
7190 (AnonymousMethod): Expanded to track the Toplevel, implement
7191 `AnonymousMethod.Compatible' to tell whether an anonymous method
7192 can be converted to a target delegate type.
7194 The routine now also produces the anonymous method content
7196 (AnonymousDelegate): A helper class that derives from
7197 DelegateCreation, this is used to generate the code necessary to
7198 produce the delegate for the anonymous method that was created.
7200 * assign.cs: API adjustments for new changes in
7201 Convert.ImplicitStandardConversionExists.
7203 * class.cs: Adjustments to cope with the fact that now toplevel
7204 blocks are of type `ToplevelBlock'.
7206 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7207 insteda of standard blocks.
7209 Flag errors if params arguments are passed to anonymous methods.
7211 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7212 `CurrentAnonymousMethod' which points to the current Anonymous
7213 Method. The variable points to the AnonymousMethod class that
7214 holds the code being compiled. It is set in the new EmitContext
7215 created for the anonymous method.
7217 (EmitContext.Phase): Introduce a variable and an enumeration to
7218 assist in enforcing some rules about when and where we are allowed
7219 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7220 only one that enfonces this right now).
7222 (EmitContext.HaveCaptureInfo): new helper method that returns
7223 whether we have a CapturedContext initialized.
7225 (EmitContext.CaptureVariable): New method used to register that a
7226 LocalInfo must be flagged for capturing.
7228 (EmitContext.CapturedParameter): New method used to register that a
7229 parameters must be flagged for capturing.
7231 (EmitContext.CapturedField): New method used to register that a
7232 field must be flagged for capturing.
7234 (EmitContext.HaveCapturedVariables,
7235 EmitContext.HaveCapturedFields): Return whether there are captured
7236 variables or fields.
7238 (EmitContext.EmitMethodHostInstance): This is used to emit the
7239 instance for the anonymous method. The instance might be null
7240 (static methods), this (for anonymous methods that capture nothing
7241 and happen to live side-by-side with the current method body) or a
7242 more complicated expression if the method has a CaptureContext.
7244 (EmitContext.EmitTopBlock): Routine that drives the emission of
7245 code: it will first resolve the top block, then emit any metadata
7246 and then emit the code. The split is done so that we can extract
7247 any anonymous methods and flag any captured variables/parameters.
7249 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7250 during this phase, the ILGenerator should not be used as labels
7251 and local variables declared here might not be accessible to any
7252 code that is part of an anonymous method.
7254 Exceptions to this include the temporary variables that are
7255 created by some statements internally for holding temporary
7258 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7261 (EmitContext.TemporaryReturn): This method is typically called
7262 from the Emit phase, and its the only place where we allow the
7263 ReturnLabel to be defined other than the EmitMeta. The reason is
7264 that otherwise we would have to duplicate a lot of logic in the
7265 Resolve phases of various methods that today is on the Emit
7268 (EmitContext.NeedReturnLabel): This no longer creates the label,
7269 as the ILGenerator is not valid during the resolve phase.
7271 (EmitContext.EmitThis): Extended the knowledge in this class to
7272 work in anonymous methods in addition to iterators.
7274 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7275 code is necessary on the stack to access the instance to a local
7276 variable (the variable will be accessed as a field).
7278 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7279 EmitContext.EmitAddressOfParameter): Routines to support
7280 parameters (not completed at this point).
7282 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7283 will also remove the parameters.
7285 * convert.cs (Convert): Define a `ConstantEC' which points to a
7286 null. This is just to prefity some code that uses
7287 ImplicitStandardConversion code and do not have an EmitContext
7290 The idea is to flag explicitly that at that point in time, it is
7291 known that the conversion will not trigger the delegate checking
7292 code in implicit conversions (which requires a valid
7295 Everywhere: pass new EmitContext parameter since
7296 ImplicitStandardConversionExists now requires it to check for
7297 anonymous method conversions.
7299 (Convert.ImplicitStandardConversionExists): If the type of an
7300 expression is the anonymous_method_type, and the type is a
7301 delegate, we invoke the AnonymousMethod.Compatible method to check
7302 whether an implicit conversion is possible.
7304 (Convert.ImplicitConversionStandard): Only do implicit method
7305 group conversions if the language level is not ISO_1.
7307 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7308 MethodInfo for the Invoke method. used by Delegate and
7311 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7312 method conversions if the target type is a delegate.
7314 Removed extra debugging nops.
7316 (LocalVariableReference): Turn the `local_info' into a public
7319 Add `prepared' field, the same hack used for FieldExprs to cope
7320 with composed assignments, as Local variables do not necessarily
7321 operate purely on the stack as they used to: they can be captured
7324 Add `temp' for a temporary result, like fields.
7326 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7328 It now copes with Local variables that are captured and emits the
7329 proper instance variable to load it from a field in the captured
7332 (ParameterReference.DoResolveBase): During the resolve phase,
7333 capture parameters if we are in an anonymous method.
7335 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7336 anonymous method, use the EmitContext helper routines to emit the
7337 parameter reference.
7339 * iterators.cs: Set RemapToProxy to true/false during the
7342 * parameters.cs (GetParameterByName): New helper method.
7344 * typemanager.cs (anonymous_method_type) a new type that
7345 represents an anonyous method. This is always an internal type,
7346 used as a fencepost to test against the anonymous-methodness of an
7349 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7351 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7353 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7355 2004-11-10 Martin Baulig <martin@ximian.com>
7357 * expression.cs (Invocation.BetterFunction): If two methods have
7358 equal parameter types, but only one of them is generic, the
7359 non-generic one wins.
7360 (New.DoResolve): Don't set `is_struct' to false if we're a generic
7361 instance; just use `Type.IsValueType' to determine whether
7362 something is a struct or not.
7363 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7364 so we can be called multiple times.
7366 2004-11-10 Martin Baulig <martin@ximian.com>
7368 * generic.cs (TypeParameter.DefineConstraints): New public method.
7369 (TypeParameter.CheckAccessLevel): Override this and return true.
7370 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7371 override ResolveType() anymore.
7372 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7374 2004-11-10 Martin Baulig <martin@ximian.com>
7376 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7377 call DeclSpace.ResolveNestedType() on it.
7379 2004-11-10 Martin Baulig <martin@ximian.com>
7381 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7382 non-null, call ParameterModifier() on it.
7384 2004-11-10 Martin Baulig <martin@ximian.com>
7387 (Iterators): Added `current_type' and `this_type' fields.
7388 (Iterators.DefineIterator): Create a new EmitContext and store it
7389 in `ec'; compute `this_type'.
7391 2004-11-10 Martin Baulig <martin@ximian.com>
7394 (TypeManager.IsPrivateAccessible): New public method.
7395 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7397 2004-11-10 Martin Baulig <martin@ximian.com>
7399 * class.cs (TypeContainer.DefineType): Call
7400 TypeBuilder.DefineGenericParameters() before resolving the type
7402 (MethodData.parent_method): New protected field.
7403 (MethodData..ctor): Added `MethodInfo parent_method' argument.
7404 (MethodData.Define): Compute `parent_method'.
7407 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7408 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7409 (DeclSpace.ec): New protected field; store the EmitContext here.
7410 (DeclSpace.EmitContext): New public property.
7411 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7412 (DeclSpace.ResolveNestedType): New public method.
7413 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7414 (DeclSpace.NestedAccessible): Added `Type tb' argument.
7415 (DeclSpace.FamilyAccessible): Likewise.
7416 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7417 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7420 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7423 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7424 (Enum.Emit): Don't create a new EmitContext.
7426 2004-10-18 Martin Baulig <martin@ximian.com>
7428 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7429 `Type' directly, but call ResolveType() on it.
7430 (Catch.Resolve): Likewise.
7431 (Foreach.Resolve): Likewise.
7433 2004-10-18 Martin Baulig <martin@ximian.com>
7435 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7436 `Type' directly, but call ResolveType() on it.
7437 (Probe.DoResolve): Likewise.
7438 (ArrayCreation.LookupType): Likewise.
7439 (TypeOf.DoResolve): Likewise.
7440 (SizeOf.DoResolve): Likewise.
7442 2004-10-18 Raja R Harinath <rharinath@novell.com>
7444 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7447 2004-10-17 John Luke <john.luke@gmail.com>
7449 * class.cs (Operator.GetSignatureForError): use CSharpName
7451 * parameter.cs (Parameter.GetSignatureForError): Returns
7452 correct name even if was not defined.
7454 2004-10-13 Raja R Harinath <rharinath@novell.com>
7457 * class.cs (TypeContainer.EmitContext): New property.
7458 (DefineNestedTypes): Create an emitcontext for each part.
7459 (MethodCore.DoDefineParameters): Use container's emitcontext.
7460 Pass type array to InternalParameters.
7461 (MemberBase.DoDefine): Use container's emitcontext.
7462 (FieldMember.Define): Likewise.
7463 (Event.Define): Likewise.
7464 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7465 Pass type array to InternalParameters.
7466 (SetIndexerMethod.GetParameterInfo): Likewise.
7467 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7468 * delegate.cs (Define): Pass emitcontext to
7469 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7470 array to InternalParameters.
7471 * expression.cs (ParameterReference.DoResolveBase): Pass
7472 emitcontext to GetParameterInfo.
7473 (ComposedCast.DoResolveAsTypeStep): Remove check on
7474 ec.ResolvingTypeTree.
7475 * parameter.cs (Parameter.Resolve): Change argument to
7476 EmitContext. Use ResolveAsTypeTerminal.
7477 (Parameter.GetSignature): Change argument to EmitContext.
7478 (Parameters.ComputeSignature): Likewise.
7479 (Parameters.ComputeParameterTypes): Likewise.
7480 (Parameters.GetParameterInfo): Likewise.
7481 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7482 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7483 * support.cs (InternalParameters..ctor): Remove variant that takes
7485 * typemanager.cs (system_intptr_expr): New.
7486 (InitExpressionTypes): Initialize it.
7488 2004-10-12 Chris Toshok <toshok@ximian.com>
7490 * cs-parser.jay: fix location for try_statement and catch_clause.
7492 2004-10-18 Martin Baulig <martin@ximian.com>
7494 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7495 `Type' directly, but call ResolveType() on it.
7496 (MemberBase.DoDefine): Likewise.
7498 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7499 `Type' directly, but call ResolveType() on it.
7500 (ComposedCast.DoResolveAsTypeStep): Likewise.
7502 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7503 `Type' directly, but call ResolveType() on it.
7505 2004-10-17 John Luke <john.luke@gmail.com>
7507 * class.cs (Operator.GetSignatureForError): use CSharpName
7509 * parameter.cs (Parameter.GetSignatureForError): Returns
7510 correct name even if was not defined.
7512 2004-10-13 Raja R Harinath <rharinath@novell.com>
7515 * class.cs (TypeContainer.EmitContext): New property.
7516 (DefineNestedTypes): Create an emitcontext for each part.
7517 (MethodCore.DoDefineParameters): Use container's emitcontext.
7518 Pass type array to InternalParameters.
7519 (MemberBase.DoDefine): Use container's emitcontext.
7520 (FieldMember.Define): Likewise.
7521 (Event.Define): Likewise.
7522 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7523 Pass type array to InternalParameters.
7524 (SetIndexerMethod.GetParameterInfo): Likewise.
7525 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7526 * delegate.cs (Define): Pass emitcontext to
7527 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7528 array to InternalParameters.
7529 * expression.cs (ParameterReference.DoResolveBase): Pass
7530 emitcontext to GetParameterInfo.
7531 (ComposedCast.DoResolveAsTypeStep): Remove check on
7532 ec.ResolvingTypeTree.
7533 * parameter.cs (Parameter.Resolve): Change argument to
7534 EmitContext. Use ResolveAsTypeTerminal.
7535 (Parameter.GetSignature): Change argument to EmitContext.
7536 (Parameters.ComputeSignature): Likewise.
7537 (Parameters.ComputeParameterTypes): Likewise.
7538 (Parameters.GetParameterInfo): Likewise.
7539 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7540 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7541 * support.cs (InternalParameters..ctor): Remove variant that takes
7543 * typemanager.cs (system_intptr_expr): New.
7544 (InitExpressionTypes): Initialize it.
7546 2004-10-12 Chris Toshok <toshok@ximian.com>
7548 * cs-parser.jay: fix location for try_statement and catch_clause.
7550 2004-10-07 Raja R Harinath <rharinath@novell.com>
7552 More DeclSpace.ResolveType avoidance.
7553 * decl.cs (MemberCore.InUnsafe): New property.
7554 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7555 with newly created EmitContext.
7556 (FieldMember.Define): Likewise.
7557 * delegate.cs (Delegate.Define): Likewise.
7558 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7559 only if normal name-lookup fails.
7560 (TypeExpr.DoResolve): Enable error-checking.
7561 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7562 (SizeOf.DoResolve): Likewise.
7563 (ComposedCast.DoResolveAsTypeStep): Likewise.
7564 (StackAlloc.DoResolve): Likewise.
7565 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7566 (Block.Unsafe): New property.
7567 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7568 (Unsafe): Set 'unsafe' flag of contained block.
7569 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7570 (Fixed.Resolve): Likewise.
7571 (Catch.Resolve): Likewise.
7572 (Using.ResolveLocalVariableDecls): Likewise.
7573 (Foreach.Resolve): Likewise.
7575 2004-10-05 John Luke <john.luke@gmail.com>
7577 * cs-parser.jay: add location to error CS0175
7579 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7581 * ecore.cs (Expression.Constantity): Add support for turning null
7584 * const.cs (Const.Define): Allow constants to be reference types
7585 as long as the value is Null.
7587 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7589 * namespace.cs (NamespaceEntry.Using): No matter which warning
7590 level is set, check if this namespace name has already been added.
7592 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7594 * expression.cs: reftype [!=]= null should always use br[true,false].
7597 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7600 * attribute.cs: Enum conversion moved to
7601 GetAttributeArgumentExpression to be applied to the all
7604 2004-10-01 Raja R Harinath <rharinath@novell.com>
7606 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7607 * class.c (TypeContainer.DefineType): Flag error if
7608 base types aren't accessible due to access permissions.
7609 * decl.cs (DeclSpace.ResolveType): Move logic to
7610 Expression.ResolveAsTypeTerminal.
7611 (DeclSpace.ResolveTypeExpr): Thin layer over
7612 Expression.ResolveAsTypeTerminal.
7613 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7614 Refactor code into NestedAccess. Use it.
7615 (DeclSpace.NestedAccess): New.
7616 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7617 argument to silence errors. Check access permissions.
7618 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7619 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7620 (Cast.DoResolve): Likewise.
7621 (New.DoResolve): Likewise.
7622 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7623 (TypeOf.DoResolve): Likewise.
7625 * expression.cs (Invocation.BetterConversion): Return the Type of
7626 the better conversion. Implement section 14.4.2.3 more faithfully.
7627 (Invocation.BetterFunction): Make boolean. Make correspondence to
7628 section 14.4.2.2 explicit.
7629 (Invocation.OverloadResolve): Update.
7630 (Invocation): Remove is_base field.
7631 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7632 (Invocation.Emit): Likewise.
7634 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7636 * cs-parser.jay: Reverted 642 warning fix.
7638 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7641 * decl.cs (FindMemberWithSameName): Indexer can have more than
7644 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7646 * expression.cs (LocalVariableReference.DoResolveLValue):
7647 Do not report warning 219 for out values.
7648 (EmptyExpression.Null): New member to avoid extra allocations.
7650 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7652 * cs-parser.jay: Fix wrong warning 642 report.
7654 * cs-tokenizer.cs (CheckNextToken): New helper;
7655 Inspect next character if is same as expected.
7657 2004-09-23 Martin Baulig <martin@ximian.com>
7659 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7660 (Convert.ImplicitReferenceConversionExists): Likewise.
7662 2004-11-09 Raja R Harinath <rharinath@novell.com>
7664 * Makefile (DISTFILES): Comment out a few missing files.
7666 2004-10-29 Raja R Harinath <rharinath@novell.com>
7668 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7669 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
7670 (gmcs.exe): Invoke bootstrap-libs.
7671 (clean-local): Clean the net_2_0_bootstrap profile too.
7672 (PROGRAM_INSTALL_DIR): New.
7673 (install-local): Use it.
7675 2004-10-13 Martin Baulig <martin@ximian.com>
7677 * generic.cs (TypeManager.InflatedConstraints): New nested class.
7678 (TypeParameter.DefineType): If we're a method type parameter and
7679 that method is overriding something, "inflate" its constraints.
7681 2004-10-12 Martin Baulig <martin@ximian.com>
7683 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7684 and have type arguments, create and resolve a ConstructedType.
7686 2004-10-12 Martin Baulig <martin@ximian.com>
7688 * decl.cs (MemberCache.FindMemberToOverride): Use
7689 TypeManager.IsEqual() to compare the parameters and Type.Equals()
7690 to compare the invocationType.
7692 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7693 When comparing two type parameters, only do the signature-only
7694 comparision for method type parameters.
7696 2004-10-11 Martin Baulig <martin@ximian.com>
7698 * report.cs: Don't make --fatal abort on warnings, we have
7699 -warnaserror for that.
7701 2004-10-11 Martin Baulig <martin@ximian.com>
7704 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7705 (TypeManager.IsEqual): Call ourself recursively instead of using
7708 2004-10-11 Martin Baulig <martin@ximian.com>
7710 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7711 on our own type parameters, not on the ones we inherit from a containing
7714 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7717 * generic.cs (TypeParameter.Define): We may only be called once.
7719 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7720 instead of TypeManager.IsEqual().
7722 2004-09-28 Martin Baulig <martin@ximian.com>
7725 (GenericConstraints.EffectiveBaseClass): New public property.
7726 (TypeParameter.GenericConstraints): New public property.
7727 (ConstructedType.CheckConstraints): Improved.
7729 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7730 (Convert.TypeParameterConversion): New private method; use this in
7731 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7732 for all conversions related to type parameters.
7734 2004-09-24 Martin Baulig <martin@ximian.com>
7736 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7737 type parameter conversions for type parameters which are known to
7740 2004-09-24 Martin Baulig <martin@ximian.com>
7742 * generic.cs (GenericConstraints): Added `IsReferenceType' and
7743 `IsValueType' properties.
7745 * support.cs (ReflectionConstraints): Use
7746 Type.GetGenericParameterConstraints() instead of the old hack.
7748 2004-09-24 Martin Baulig <martin@ximian.com>
7750 * generic.cs (GenericConstraints): Moved here and made it an
7753 * support.cs (GenericConstraints): Moved to generic.cs.
7755 2004-09-24 Martin Baulig <martin@ximian.com>
7758 (ReflectionConstraints): Un-nested this class and made it public.
7761 (TypeManager.GetTypeParameterConstraints): New public method.
7762 (TypeManager.HasConstructorConstraint): Use the attributes.
7764 2004-09-24 Martin Baulig <martin@ximian.com>
7766 * support.cs (GenericConstraints): Replaced `HasConstructor',
7767 `IsReferenceType' and `IsValueType' with `Attributes'.
7768 (ReflectionParameters.ReflectionConstraints): Removed the Create()
7769 method and made the .ctor public.
7771 * generic.cs (Constraints.Attributes): New public property.
7772 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7773 `IsReferenceType' -> `HasReferenceTypeConstraint' and
7774 `IsValueType' -> `HasValueTypeConstraint'.
7776 2004-09-23 Martin Baulig <martin@ximian.com>
7778 * generic.cs (Constraints): Reflect latest runtime changes.
7780 2004-09-23 Martin Baulig <martin@ximian.com>
7782 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7783 (Convert.ImplicitReferenceConversionExists): Likewise.
7785 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7787 * class.cs (Operator.Define): Add error 448 and 559 report.
7789 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7791 * class.cs (MemberBase.IsTypePermitted): New protected
7792 method for checking error CS0610.
7794 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7796 * class.cs (TypeContainer.HasExplicitLayout): New property
7797 Returns whether container has StructLayout attribute set Explicit.
7798 (FieldMember): New abstract class for consts and fields.
7799 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7800 (Field): Reuse FieldMember.
7802 * const.cs (Const): Reuse FieldMember.
7804 * rootcontext.cs: EmitConstants call moved to class.
7806 2004-09-22 Martin Baulig <martin@ximian.com>
7808 Marek and me just fixed one of our oldest bugs: #28562 :-)
7810 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7812 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7813 we're an EnumConstant, just return that.
7814 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7815 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7816 to get the value which'll actually be written into the attribute.
7817 However, we have to use GetValue() to access the attribute's value
7820 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7822 * constant.cs (Constant.IsNegative): New abstract property
7825 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7826 (StackAlloc.DoResolve): Reused IsNegative.
7828 2004-09-22 Martin Baulig <martin@ximian.com>
7830 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7831 public method; like LookupTypeContainer, but also works for
7834 * report.cs (Report.SymbolRelatedToPreviousError): Use
7835 TypeManager.LookupGenericTypeContainer().
7837 2004-09-22 Martin Baulig <martin@ximian.com>
7839 Thanks to Peter Sestoft for this bug report.
7841 * expression.cs (Conditional): If both the `trueExpr' and the
7842 `falseExpr' is a NullLiteral, return a NullLiteral.
7844 2004-09-22 Martin Baulig <martin@ximian.com>
7846 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7847 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7848 for the "get_Current" call.
7850 2004-09-21 Martin Baulig <martin@ximian.com>
7852 * convert.cs (Convert.ImplicitReferenceConversion): When
7853 converting to an interface type, first check whether we're
7854 converting from a reference type.
7856 2004-09-14 Martin Baulig <martin@ximian.com>
7858 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7860 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7863 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7864 called and is obsolete then this member suppress message
7865 when call is inside next [Obsolete] method or type.
7867 * expression.cs: Use TestObsoleteMethodUsage member.
7869 2004-09-14 Martin Baulig <martin@ximian.com>
7871 * genericparser.cs: Removed.
7873 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7875 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7877 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7879 * attribute.cs (Attribute.Resolve): Add error 653 report.
7881 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7883 (Method.ApplyAttributeBuilder): Add error 685 report.
7884 (Operator.Define): Add error 564 report.
7886 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7888 * expression.cs (Invocation.DoResolve): Add error
7891 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7894 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7896 * class.cs (ConstructorInitializer.Resolve):
7897 Wrong error number (515->516).
7899 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7901 * class.cs (Indexer.Define): Add error 631 report.
7903 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7905 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7907 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7909 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7911 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7913 * cs-parser.jay: Added error CS0241 report.
7915 2004-09-10 Raja R Harinath <rharinath@novell.com>
7917 * cs-parser.jay (fixed_statement): Introduce a scope for the
7918 declaration in the 'fixed' statement.
7920 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7922 * cs-parser.jay: Added CS0230 error report.
7924 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7926 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7928 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7930 * expression.cs (Argument.Resolve): Added error CS0192 and
7933 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7935 C# 2.0 #pragma warning feature
7937 * cs-tokenizer.cs (PreProcessPragma): New method;
7938 Handles #pragma directive.
7940 * report.cs (WarningRegions): New class; Support
7941 class for #pragma warning directive. It tests whether
7942 warning is enabled for a given line.
7944 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7946 * const.cs: Add more descriptive error report, tahnks to
7949 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7951 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7953 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7955 * expression.cs: Apply patch from Ben: Remove dead code from
7956 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7957 as that code just threw an exception anwyays.
7959 * const.cs: Remove the call to the turnintoconstant, for details
7962 * literal.cs: The type of the null-literal is the null type; So
7963 we use a placeholder type (literal.cs:System.Null, defined here)
7966 * expression.cs (Conditional.DoResolve): Remove some old code that
7967 is no longer needed, conversions have been fixed.
7969 (ArrayCreationExpression.DoResolve): Return false if we fail to
7970 resolve the inner expression.
7972 2004-09-07 Raja R Harinath <rharinath@novell.com>
7975 * cs-parser.jay (delegate_declaration): Record a delegate
7976 declaration as a type declaration.
7977 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7979 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7981 * parameter.cs: Do not crash if the type can not be resolved.
7983 * expression.cs: Report errors with unsafe pointers, fixes #64896
7985 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7987 * expression.cs: Pointer arith always needs to do a conv.i
7988 if the operand is a long. fix 65320
7990 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7992 Fixed cs0619-37.cs, cs0619-38.cs
7994 * enum.cs (GetObsoleteAttribute): Removed.
7996 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7997 on Enum member is double staged. The first is tested member
8000 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8002 Fixed #56986, #63631, #65231
8004 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8005 adds member to name container.
8006 (TypeContainer.AddToTypeContainer): New method, adds type to
8008 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8009 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8010 AddOperator): Simplified by reusing AddToMemberContainer.
8011 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8013 (Method.CheckForDuplications): Fixed implementation to test all
8015 (MemberBase): Detection whether member is explicit interface
8016 implementation is now in constructor.
8017 (MemberBase.UpdateMemberName): Handles IndexerName.
8018 (Accessor): Changed to keep also location information.
8019 (AbstractPropertyEventMethod): Is derived from MemberCore.
8020 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8021 will be emited or not.
8022 (PropertyBase.AreAccessorsDuplicateImplementation):
8023 Tests whether accessors are not in collision with some method.
8024 (Operator): Is derived from MethodCore to simplify common
8027 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8029 (DeclSpace.AddToContainer): Adds the member to defined_names
8030 table. It tests for duplications and enclosing name conflicts.
8032 * enum.cs (EnumMember): Clean up to reuse the base structures
8034 2004-09-03 Martin Baulig <martin@ximian.com>
8036 Merged latest changes into gmcs. Please keep this comment in
8037 here, it makes it easier for me to see what changed in MCS since
8038 the last time I merged.
8040 2004-09-03 Martin Baulig <martin@ximian.com>
8042 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8043 into TypeContainer, to make partial classes work again.
8045 2004-09-03 Martin Baulig <martin@ximian.com>
8047 * rootcontext.cs (RootContext.V2): Removed.
8049 2004-03-23 Martin Baulig <martin@ximian.com>
8051 * expression.cs (Invocation.OverloadResolve): Added `bool
8052 may_fail' argument and use it instead of the Location.IsNull() hack.
8054 2004-09-09 Martin Baulig <martin@ximian.com>
8056 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8058 2004-09-09 Martin Baulig <martin@ximian.com>
8060 * generic.cs (TypeParameter.DefineType): Added support for
8061 explicit interface methods.
8063 2004-09-09 Martin Baulig <martin@ximian.com>
8065 * README.Changes: New document. Started to list important changes
8066 between MCS and GMCS here.
8068 2004-09-08 Martin Baulig <martin@ximian.com>
8071 (TypeContainer.CheckRecursiveDefinition): New protected method.
8072 (TypeContainer.DefineType): Move the CS0146 check into
8073 CheckRecursiveDefinition().
8075 2004-09-06 Martin Baulig <martin@ximian.com>
8077 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8078 types for the constructor constraint.
8080 2004-09-03 Martin Baulig <martin@ximian.com>
8082 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8083 into TypeContainer, to make partial classes work again.
8085 2004-09-03 Martin Baulig <martin@ximian.com>
8087 * rootcontext.cs (RootContext.V2): Removed.
8089 2004-03-23 Martin Baulig <martin@ximian.com>
8091 * expression.cs (Invocation.OverloadResolve): Added `bool
8092 may_fail' argument and use it instead of the Location.IsNull() hack.
8094 2004-09-03 Martin Baulig <martin@ximian.com>
8096 Merged latest changes into gmcs. Please keep this comment in
8097 here, it makes it easier for me to see what changed in MCS since
8098 the last time I merged.
8100 2004-09-03 Raja R Harinath <rharinath@novell.com>
8103 * expression.cs (BetterConversion): Don't allow either conversion
8104 to be null. Remove redundant implicit conversion test when 'q ==
8105 null' -- when this function is invoked, we already know that the
8106 implicit conversion exists.
8107 (BetterFunction): Assume that 'best' is non-null. Remove
8108 redundant reimplementation of IsApplicable when 'best' is null.
8109 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8110 number of arguments.
8111 (IsAncestralType): Extract from OverloadResolve.
8112 (OverloadResolve): Make robust to the MethodGroupExpr being
8113 unsorted. Implement all the logic of Section 14.5.5.1, and
8114 support overloading of methods from multiple applicable types.
8115 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8117 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8118 (RealError, Warning): Append type of report to related symbol.
8120 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8122 * enum.cs: Fixed CLS-Compliance checks for enum members.
8123 Error tests cs3008-8.cs, cs3014-8.cs
8125 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8127 Fixed bug #62342, #63102
8128 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8129 like ImplementMethod.
8131 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8133 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8136 2004-09-02 Martin Baulig <martin@ximian.com>
8138 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8139 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8142 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8144 C# 2.0 Static classes implemented
8146 * class.cs (TypeContainer): instance_constructors,
8147 initialized_fields, initialized_static_fields,
8148 default_constructor, base_inteface_types are protected to be
8149 accessible from StaticClass.
8150 (TypeContainer.DefineDefaultConstructor): New virtual method
8151 for custom default constructor generating
8152 (StaticClass): New class to handle "Static classes" feature.
8154 * cs-parser.jay: Handle static keyword on class like instance
8157 * driver.cs: Added "/langversion" command line switch with two
8158 options (iso-1, default).
8160 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8162 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8164 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8166 * delegate.cs: Style.
8168 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8170 * delegate.cs: Add seperate instance expr field for miguel.
8172 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8174 * PointerArithmetic (Resolve): make sure we are not doing
8175 pointer arith on void*. Also, make sure we are resolved
8176 by not setting eclass until resolve.
8178 All callers: Make sure that PointerArithmetic gets resolved.
8180 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8182 * ArrayCreation (LookupType): If the type does not resolve
8183 to an array, give an error.
8185 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8187 * statement.cs (Try.Resolve): Fixed bug #64222
8189 2004-08-27 Martin Baulig <martin@ximian.com>
8192 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8195 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8197 * ecore.cs (Constantify): Get underlying type via
8198 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8199 Windows in special cases.
8201 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8203 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8204 for obtaining also private methods.
8205 (GetRemoveMethod): Used GetRemoveMethod (true)
8206 for obtaining also private methods.
8208 2004-09-02 Martin Baulig <martin@ximian.com>
8210 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8211 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8214 2004-08-27 Martin Baulig <martin@ximian.com>
8217 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8220 2004-08-25 Martin Baulig <martin@ximian.com>
8222 * support.cs (ReflectionParameters..ctor): If this is a generic
8223 method, retrieve and store its type parameters.
8224 (InternalParameters..ctor): Added `TypeParameter[]' argument.
8225 (ReflectionParameters.GenericConstraints): The argument specifies
8226 the type parameter, not the method parameter.
8227 (InternalParameters.GenericConstraints): Likewise.
8229 * generic.cs (TypeParameter.DefineType): Correctly handle
8230 constraints wrt. generic methods in interfaces and their
8233 2004-08-24 Martin Baulig <martin@ximian.com>
8235 * generic.cs (TypeParameter.IsSubclassOf): New public method.
8236 (Constraints.IsSubclassOf): New internal method.
8238 * typemanager.cs (TypeManager.FindMembers): Added special support
8239 for GenericTypeParameterBuilder's.
8240 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8243 2004-08-24 Martin Baulig <martin@ximian.com>
8246 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8247 this for accessibility checks.
8248 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8249 IsNestedFamilyAccessible.
8250 (TypeManager.IsSubclassOf): New method, do what the name actually
8253 2004-08-24 Martin Baulig <martin@ximian.com>
8255 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8256 as a SimpleName, include the generic arity.
8258 2004-08-24 Martin Baulig <martin@ximian.com>
8260 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8261 MethodAttributes.HideBySig for operators.
8263 2004-08-23 Martin Baulig <martin@ximian.com>
8265 Back to the old error reporting system :-)
8267 * report.cs (Message): Removed.
8268 (Report.MessageData, ErrorData, WarningData): Removed.
8269 (Report.Error, Warning): Back to the old system.
8271 2004-08-23 Martin Baulig <martin@ximian.com>
8273 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8275 * class.cs (TypeContainer.ParentContainer): New public virtual
8276 method; replaces the explicit interface implementation.
8277 (ClassPart.ParentContainer): Override.
8279 2004-08-23 Martin Baulig <martin@ximian.com>
8281 * statement.cs (Switch): Added support for constant switches; see
8282 #59428 or test-285.cs.
8284 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8287 * statement.cs (GetEnumeratorFilter): Removed useless
8288 logic because C# specs is strict. GetEnumerator must be
8291 2004-08-22 Martin Baulig <martin@ximian.com>
8293 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8294 a switch and may break, reset the barrier. Fixes #59867.
8296 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8298 CLS-Compliance speed up (~5% for corlib)
8300 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8301 New method. Tests container for CLS-Compliant names
8303 * class.cs (TypeContainer.VerifyClsName): New method.
8304 Checks whether container name is CLS Compliant.
8305 (Constructor): Implements IMethodData.
8307 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8308 low-case table for CLS Compliance test.
8309 (MemberCache.VerifyClsParameterConflict): New method.
8310 Checks method parameters for CS3006 error.
8312 * enum.cs (EnumMember): Is derived from MemberCore.
8313 (Enum.VerifyClsName): Optimized for better performance.
8315 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8317 * report.cs: Renamed Error_T to Error and changed all
8320 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8322 * class.cs (TypeContainer.IndexerArrayList): New inner class
8323 container for indexers.
8324 (TypeContainer.DefaultIndexerName): New constant for default
8325 indexer name. Replaced all "Item" with this constant.
8326 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8328 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8329 DefaultMemberAttribute constructor.
8331 2004-08-05 Martin Baulig <martin@ximian.com>
8333 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8336 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8338 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8339 multi platforms problem.
8341 * compiler.csproj: Included shared files.
8343 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8345 Fix bug 60333, 55971 in the more general way
8346 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8347 Added arg_type argument for constant conversion.
8348 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8350 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8353 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8354 OperatorArrayList, MethodCoreArrayList for typecontainer
8355 containers. Changed class member types to these new types.
8356 (MethodArrayList.DefineMembers): Added test for CS0659.
8358 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8360 * cfold.cs: Synchronize the folding with the code in expression.cs
8361 Binary.DoNumericPromotions for uint operands.
8363 * attribute.cs: Revert patch from Raja, it introduced a regression
8364 while building Blam-1.2.1 (hard to isolate a test case).
8366 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8370 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8372 (MethodCore.parent_method): New member. The method we're overriding
8373 if this is an override method.
8374 (MethodCore.CheckBase): Moved from Method class and made common.
8375 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8377 (MethodCore.CheckForDuplications): New abstract method. For custom
8378 member duplication search in a container
8379 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8380 method and its return type.
8381 (Event.conflict_symbol): New member. Symbol with same name in the
8385 (MemberCache.FindMemberWithSameName): New method. The method
8386 is looking for conflict with inherited symbols.
8388 2004-08-04 Martin Baulig <martin@ximian.com>
8390 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8392 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8394 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8396 * report.cs (Message): New enum for better error, warning reference in
8398 (MessageData): New inner abstract class. It generally handles printing of
8399 error and warning messages.
8400 Removed unused Error, Warning, Message methods.
8402 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8404 Fix for cs0592-8.cs test
8406 (Attributable.ValidAttributeTargets): Made public.
8407 (Attribute.ExplicitTarget): New member for explicit target value.
8408 (Attribute.CheckTargets): Now we translate explicit attribute
8409 target to Target here.
8411 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8413 * ecore.cs (MethodGroupExpr): new IsBase property.
8415 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8417 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8418 rather than an instance expr.
8420 (DelegateCreation.Emit): Use the method group rather than
8421 the instance expression. Also, if you have base.Foo as the
8422 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8424 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8426 (NewDelegate.DoResolve): Only check for the existance of Invoke
8427 if the method is going to be needed. Use MethodGroupExpr.
8429 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8431 * expression.cs: For pointer arith., make sure to use
8432 the size of the type, not the size of the pointer to
8435 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8438 * class.cs (Class): Added error CS0502 test.
8440 2004-08-03 John Luke <jluke@cfl.rr.com>
8441 Raja R Harinath <rharinath@novell.com>
8444 * attribute.cs (Attribute.complained_before): New flag.
8445 (Attribute.ResolveType, Attribute.Resolve),
8446 (Attribute.DefinePInvokeMethod): Set it.
8447 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8449 2004-08-03 Martin Baulig <martin@ximian.com>
8451 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8452 use a user-defined operator; we still need to do numeric
8453 promotions in case one argument is a builtin type and the other
8454 one has an implicit conversion to that type. Fixes #62322.
8456 2004-08-18 Martin Baulig <martin@ximian.com>
8458 * class.cs (Method.Define): Use the correct method name when
8459 creating the MethodBuilder for a generic method.
8461 2004-08-17 Martin Baulig <martin@ximian.com>
8463 * generic.cs (Constraints): Support type parameter constraints.
8465 2004-08-16 Martin Baulig <martin@ximian.com>
8467 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8468 (Token.GENERIC_DIMENSION): New token; this is returned if we
8469 encounter an unbound generic type in a typeof() expression.
8471 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8472 this token is only generated while parsing a typeof() expression.
8473 (typeof_expression): Removed the old unbound_type hack.
8475 * generic.cs (TypeArguments.IsUnbound): New public property.
8477 * decl.cs (MemberName): Added support for unbound types.
8479 2004-08-14 Martin Baulig <martin@ximian.com>
8482 (TypeManager.IsEqualGenericInstance): New static method.
8483 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8484 just used to check accessibility, so follow the rules of 26.1.6.
8486 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8487 ConstructedType instead of a TypeExpression if we have type arguments.
8489 * cs-parser.jay (typeof_expression): Support unbound generic types.
8491 * ecore.cs (UnboundTypeExpression): New public class.
8493 2004-08-12 Martin Baulig <martin@ximian.com>
8495 * typemanager.cs (TypeManager.IsNestedChildOf): Use
8496 TypeManager.IsEqual() rather than `=='.
8498 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8499 generic instances as well.
8501 2004-08-12 Martin Baulig <martin@ximian.com>
8503 * expression.cs (Invocation.InferType): We can only infer method
8504 type parameters. Fixes #62647.
8506 2004-08-11 Martin Baulig <martin@ximian.com>
8508 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8509 before resolving the base classes.
8511 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8513 * Makefile: install .mdb file too.
8515 2004-08-05 Martin Baulig <martin@ximian.com>
8517 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8518 initializer, the current type is just the TypeBuilder, not the
8519 instantiated generic type.
8520 (FieldExpr.IsFieldInitializer): New public property.
8522 2004-08-04 Martin Baulig <martin@ximian.com>
8524 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8526 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8528 2004-08-03 Martin Baulig <martin@ximian.com>
8530 * class.cs (MethodData.Define): If we're an explicit
8531 implementation, remove the generic arity from the type name.
8533 2004-08-03 Martin Baulig <martin@ximian.com>
8535 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8536 use a user-defined operator; we still need to do numeric
8537 promotions in case one argument is a builtin type and the other
8538 one has an implicit conversion to that type. Fixes #62322.
8540 2004-08-02 Martin Baulig <martin@ximian.com>
8542 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8544 (TypeContainer.GetClassBases): Return the unexpanded list of
8545 interfaces; we expand them later.
8546 (TypeContainer.DefineType): After creating the TypeBuilder, call
8547 TypeManager.ExpandInterfaces() to get an expanded and resolved
8550 * ecore.cs (TypeExpr.GetInterfaces): Removed
8552 * generics.cs (Constraints.InterfaceConstraints): Remove.
8553 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8554 register the interface constraints.
8557 (TypeManager.AddUserType): Removed the `ifaces' argument.
8558 (TypeManager.AddTypeParameter): Likewise.
8559 (TypeManager.AddUserInterface): Removed, was unused.
8560 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8561 `TypeExpr[]' array for the interfaces.
8562 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8563 has been defined, returns a list of the resolved interfaces types.
8564 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8565 (TypeManager.GetExplicitInterfaces): Likewise.
8567 2004-08-02 Martin Baulig <martin@ximian.com>
8569 * expression.cs (Invocation.EmitCall): If we're invoking a method
8570 on a type parameter, use the new `Constrained' prefix opcode.
8572 2004-08-02 Martin Baulig <martin@ximian.com>
8574 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8575 (LocalInfo.IsThis): New public property.
8576 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8578 2004-08-01 Martin Baulig <martin@ximian.com>
8580 * class.cs (TypeContainer.GetClassBases): Don't set the default
8581 here since we may get called from GetPartialBases().
8582 (TypeContainer.DefineType): If GetClassBases() didn't return a
8583 parent, use the default one.
8585 2004-07-30 Martin Baulig <martin@ximian.com>
8587 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8589 * class.cs (SourceMethod): New public class, derive from the
8590 symbol writer's ISourceMethod.
8591 (Method): Use the new symbol writer API.
8593 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8594 as argument and use the new symbol writer.
8597 (SourceFile): Implement the symbol writer's ISourceFile.
8598 (Location.SymbolDocument): Removed.
8599 (Location.SourceFile): New public property.
8601 * symbolwriter.cs: Use the new symbol writer API.
8603 2004-07-30 Raja R Harinath <rharinath@novell.com>
8605 * Makefile (install-local): Remove. Functionality moved to
8608 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8610 * Makefile: Install mcs.exe.config file together with mcs.exe.
8611 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8612 correct runtime version.
8614 2004-07-25 Martin Baulig <martin@ximian.com>
8617 (TypeContainer.RegisterOrder): Removed, this was unused.
8618 (TypeContainer, interface_order): Removed.
8619 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8620 TypeContainer as argument since we can also be called with a
8621 `PartialContainer' for a partial class/struct/interface.
8622 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8623 of checking whether we're an `Interface' - we could be a
8625 (PartialContainer.Register): Override; call
8626 AddClass()/AddStruct()/AddInterface() on our parent.
8628 * cs-parser.jay (interface_member_declaration): Add things to the
8629 `current_container', not the `current_class'.
8631 * rootcontext.cs (RegisterOrder): The overloaded version which
8632 takes an `Interface' was unused, removed.
8634 * typemanager.cs (TypeManager.LookupInterface): Return a
8635 `TypeContainer', not an `Interface'.
8636 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8637 contain a `PartialContainer' for an interface, so check it's
8638 `Kind' to figure out what it is.
8640 2004-07-25 Martin Baulig <martin@ximian.com>
8642 * class.cs (Class.DefaultTypeAttributes): New public constant.
8643 (Struct.DefaultTypeAttributes): Likewise.
8644 (Interface.DefaultTypeAttributes): Likewise.
8645 (PartialContainer.TypeAttr): Override this and add the
8646 DefaultTypeAttributes.
8648 2004-07-25 Martin Baulig <martin@ximian.com>
8650 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8651 we can just use the `Parent' field instead.
8653 2004-07-25 Martin Baulig <martin@ximian.com>
8655 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8657 2004-07-25 Martin Baulig <martin@ximian.com>
8659 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8660 our parts before defining any methods.
8661 (TypeContainer.VerifyImplements): Make this virtual.
8662 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8663 on our PartialContainer.
8665 2004-07-25 Martin Baulig <martin@ximian.com>
8667 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8669 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8670 argument, we can just use the `Parent' field instead.
8673 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8674 (MemberBase.DoDefine): Likewise.
8676 2004-07-24 Martin Baulig <martin@ximian.com>
8678 * decl.cs (MemberCore.Parent): New public field.
8679 (DeclSpace.Parent): Moved to MemberCore.
8681 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8682 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8684 (FieldBase, Field, Operator): Likewise.
8685 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8686 (EventField, Event): Likewise.
8688 2004-07-23 Martin Baulig <martin@ximian.com>
8690 * class.cs (PartialContainer): New public class.
8691 (ClassPart): New public class.
8692 (TypeContainer): Added support for partial classes.
8693 (TypeContainer.GetClassBases): Splitted some of the functionality
8694 out into GetNormalBases() and GetPartialBases().
8696 * cs-tokenizer.cs (Token.PARTIAL): New token.
8697 (Tokenizer.consume_identifier): Added some hacks to recognize
8698 `partial', but only if it's immediately followed by `class',
8699 `struct' or `interface'.
8701 * cs-parser.jay: Added support for partial clases.
8703 2004-07-23 Martin Baulig <martin@ximian.com>
8705 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8706 a `DeclSpace' and also made it readonly.
8707 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8708 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8709 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8711 * cs-parser.jay: Pass the `current_class', not the
8712 `current_container' (at the moment, this is still the same thing)
8713 to a new Method, Property, Event, Indexer or Constructor.
8715 2004-07-23 Martin Baulig <martin@ximian.com>
8717 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8718 and removed the `current_interface' one.
8719 (struct_declaration, class_declaration, interface_declaration):
8720 Set `current_class' to the newly created class/struct/interface;
8721 set their `Bases' and call Register() before parsing their body.
8723 2004-07-23 Martin Baulig <martin@ximian.com>
8725 * class.cs (Kind): New public enum.
8726 (TypeContainer): Made this class abstract.
8727 (TypeContainer.Kind): New public readonly field.
8728 (TypeContainer.CheckDef): New public method; moved here from
8730 (TypeContainer.Register): New public abstract method.
8731 (TypeContainer.GetPendingImplementations): New public abstract
8733 (TypeContainer.GetClassBases): Removed the `is_class' and
8734 `is_iface' parameters.
8735 (TypeContainer.DefineNestedTypes): Formerly known as
8737 (ClassOrStruct): Made this class abstract.
8739 * tree.cs (RootTypes): New public type.
8741 2004-07-20 Martin Baulig <martin@ximian.com>
8743 * tree.cs (Tree.RecordNamespace): Removed.
8744 (Tree.Namespaces): Removed.
8746 * rootcontext.cs (RootContext.IsNamespace): Removed.
8748 * cs-parser.jay (namespace_declaration): Just create a new
8749 NamespaceEntry here.
8751 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
8753 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8754 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8755 entry to make sure it runs in the correct runtime version.
8757 2004-07-18 Martin Baulig <martin@ximian.com>
8759 * generic.cs (ConstructedType.CheckConstraints): Improved
8760 constraints checking.
8762 2004-07-18 Martin Baulig <martin@ximian.com>
8764 * expression.cs (Invocation.BetterMethod): Call
8765 TypeManager.TypeToCoreType() on all types and removed my previous
8766 hack; we're already doig the right thing here.
8768 2004-07-17 Martin Baulig <martin@ximian.com>
8770 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8772 2004-07-16 Martin Baulig <martin@ximian.com>
8774 * iterators.cs: Added generics support.
8776 2004-07-16 Martin Baulig <martin@ximian.com>
8778 * iterators.cs: Rewrote this. We're now using one single Proxy
8779 class for both the IEnumerable and the IEnumerator interface and
8780 `Iterator' derives from Class so we can use the high-level API.
8782 * class.cs (TypeContainer.AddIterator): New method.
8783 (TypeContainer.DoDefineType): New protected virtual method, which
8784 is called from DefineType().
8785 (TypeContainer.DoDefineMembers): Call DefineType() and
8786 DefineMembers() on all our iterators.
8787 (TypeContainer.Emit): Call Emit() on all our iterators.
8788 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8790 * codegen.cs (EmitContext.CurrentIterator): New public field.
8792 2004-07-15 Martin Baulig <martin@ximian.com>
8795 (TypeManager.not_supported_exception_type): New type.
8797 2004-07-14 Martin Baulig <martin@ximian.com>
8800 (TypeManager.generic_ienumerable_type): New type.
8801 (TypeManager.generic_ienumerator_type): New type.
8804 (RootContext.interfaces_first_stage): Added
8805 "System.Collections.Generic.IEnumerator`1" and
8806 "System.Collections.Generic.IEnumerable`1".
8808 2004-07-14 Martin Baulig <martin@ximian.com>
8810 * iterators.cs: Use real error numbers.
8812 2004-07-14 Martin Baulig <martin@ximian.com>
8814 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8815 requires this to be a System.Collection.IEnumerable and not a
8816 class implementing that interface.
8817 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8819 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8821 * class.cs: Fixed previous fix, it broke some error tests.
8823 2004-07-12 Martin Baulig <martin@ximian.com>
8825 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8828 2004-07-14 Martin Baulig <martin@ximian.com>
8830 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8831 an exclamation mark (!) for the generic arity to reflect the
8832 latest spec changes; ie. use "System.Collections.Generic.IList`1".
8834 2004-07-13 Martin Baulig <martin@ximian.com>
8836 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8837 specifiers being part of a type argument.
8839 2004-07-13 Martin Baulig <martin@ximian.com>
8841 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8842 name for generic types.
8844 2004-07-13 Martin Baulig <martin@ximian.com>
8846 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8849 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8851 * assign.cs (LocalTemporary): Add new argument: is_address,If
8852 `is_address' is true, then the value that we store is the address
8853 to the real value, and not the value itself.
8855 * ecore.cs (PropertyExpr): use the new local temporary
8856 stuff to allow us to handle X.Y += z (where X is a struct)
8858 2004-07-08 Martin Baulig <martin@ximian.com>
8860 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8861 not always return, just like we're doing in Using.Resolve().
8863 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8865 * cs-parser.jay (fixed_statement): flag this as Pinned.
8867 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8869 * typemanager.cs (TypeManager): Removed MakePinned method, this
8870 mechanism is replaced with the .NET 2.x compatible mechanism of
8871 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8873 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8874 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8875 `IsFixed' property which has a different meaning.
8877 2004-07-02 Raja R Harinath <rharinath@novell.com>
8879 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8880 visible from inside a nested class, not just the names of the
8881 immediately enclosing class.
8884 2004-06-24 Raja R Harinath <rharinath@novell.com>
8886 * expression.cs (BetterConversion): Remove buggy special-case
8887 handling of "implicit constant expression conversions". At this
8888 point, we already know that the conversion is possible -- we're
8889 only checking to see which is better.
8891 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8893 * cs-parser.jay: Added error CS0210 test.
8895 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8897 * cs-parser.jay: Added error CS0134 test.
8899 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8902 * cs-parser.jay: Added error CS0145 test.
8904 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8906 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8908 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8910 * expression.cs (StackAlloc.Resolve): The argument may not
8911 be a constant; deal with this case.
8913 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8915 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8916 GetIndexerAttributeValue.
8917 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8919 * class.cs (Indexer.Define): Added error tests for CS0415,
8922 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8924 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8927 2004-06-23 Martin Baulig <martin@ximian.com>
8929 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8930 neither return nor throw, reset the barrier as well. Fixes #60457.
8932 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8934 * class.cs : EventAttributes is now set to None by default.
8935 This fixes bug #60459.
8937 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8940 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8941 Don't throw exception but return null (it's sufficient now).
8943 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8945 * typemanager.cs (GetArgumentTypes): Faster implementation.
8947 2004-06-18 Martin Baulig <martin@ximian.com>
8949 * attribute.cs (Attribute.Resolve): Check whether we're an
8950 EmptyCast which a Constant child. Fixes #60333.
8952 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8954 * statement.cs (EmitCollectionForeach): Account for the fact that
8955 not all valuetypes are in areas which we can take the address of.
8956 For these variables, we store to a temporary variable. Also, make
8957 sure that we dont emit a `callvirt' on a valuetype method.
8959 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8961 * expression.cs (StackAlloc.DoReSolve): Added test for
8962 negative parameter (CS0247).
8964 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8967 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8969 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8972 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8975 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8977 Fix bug #58254 & cs1555.cs, cs1556.cs
8978 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8980 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8982 * cs-parser.jay: Added error CS1669 test for indexers.
8984 2004-06-18 Martin Baulig <martin@ximian.com>
8986 * generics.cs (GenericMethod.ctor): Don't take an Attributes
8987 argument. Fixes #60441.
8989 2004-06-16 Ben Maurer <bmaurer@ximian.com>
8990 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8991 The name needs to have the actual name of the method in order
8992 for other tests (such as the one in OverloadResolve for Invoke
8993 on a delegate) to work. As well, it does not really help
8994 error reporting because the method group had multiple methods.
8995 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8996 Make profiling work.
8998 2004-06-13 Martin Baulig <martin@ximian.com>
9000 * cs-parser.jay: Don't allow generic attributes.
9002 2004-06-13 Martin Baulig <martin@ximian.com>
9004 * class.cs (MemberBase.DoDefineBase): New protected method.
9005 (MemberBase.DoDefine): Compute the `flags' in the new
9006 DoDefineBase() which must be called first.
9007 (Method.Define): Call DoDefineBase() first so we have the flags
9008 when defining the generic method.
9010 * cs-parser.jay (interface_method_declaration): Support generic methods.
9012 2004-06-13 Martin Baulig <martin@ximian.com>
9014 * decl.cs (TypeName): Removed.
9015 (MemberName): Removed TypeName and MemberNow; now we just have
9018 * cs-parser.jay: Don't distinguish between type arguments and type
9019 parameters in the grammar and simplified the rules a bit. The
9020 reduce/reduce conflicts are now gone (except the one we inherited
9023 2004-06-11 Martin Baulig <martin@ximian.com>
9025 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9026 call this twice: for params and varargs methods.
9028 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9031 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9033 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9035 * attribute.cs (Attribute.GetValidTargets): Made public.
9038 (AbstractPropertyEventMethod): New class for better code sharing.
9039 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9041 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9043 2004-06-09 Martin Baulig <martin@ximian.com>
9045 * cs-parser.jay: Removed a reduce/reduce conflict.
9047 2004-06-03 Martin Baulig <martin@ximian.com>
9049 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9050 GetSimpleName() and return a SimpleName.
9052 * ecore.cs (SimpleName.Arguments): New public field.
9053 (SimpleName): Added overloaded ctor which takes an additional
9054 TypeArguments argument.
9055 (SimpleName.SimpleNameResolve): Added support for generic methods.
9056 (MethodGroupExpr.ResolveGeneric): New public method. The code was
9057 formerly in MemberAccess.DoResolve(), but we also need it in
9058 SimpleNameResolve().
9060 * expression.cs (MemberAccess.DoResolve): Use the new
9061 MethodGroupExpr.ResolveGeneric().
9063 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9065 * decl.cs: If possible, use lookuptypedirect here. We can only do
9066 this if there is no `.' after the namespace. Avoids using
9067 LookupType, which does lots of slow processing.
9068 (FindNestedType) New method, does what it says :-).
9069 * namespace.cs: use LookupTypeDirect.
9070 * rootcontext.cs: use membercache, if possible.
9071 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9073 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9076 According to the spec,
9078 In a member access of the form E.I, if E is a single identifier,
9079 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9080 field, property, localvariable, or parameter with the same type as
9081 the meaning of E as a type-name (§3.8), then both possible
9082 meanings of E are permitted.
9084 We did not check that E as a simple-name had the same type as E as
9087 This trivial check gives us 5-7% on bootstrap time.
9089 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9091 * expression.cs (Invocation.OverloadResolve): Avoid the
9092 use of hashtables and boxing here by allocating on demand.
9094 2004-05-30 Martin Baulig <martin@ximian.com>
9096 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9097 we're doing a silent lookup. Don't try to lookup nested types in
9098 TypeManager.object_type (thanks to Ben Maurer).
9100 2004-05-30 Martin Baulig <martin@ximian.com>
9102 Committing a patch from Ben Maurer.
9104 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9106 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9108 * convert.cs: add a trivial cache for overload operator resolution.
9110 2004-05-31 Marek Safar <marek.safar@seznam.cz>
9113 (AttributeTester.GetObsoleteAttribute): Returns instance of
9114 ObsoleteAttribute when type is obsolete.
9117 (TypeContainer.VerifyObsoleteAttribute): Override.
9118 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9119 (MethodCode.VerifyObsoleteAttribute): Override.
9120 (MemberBase.VerifyObsoleteAttribute): Override.
9123 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9124 and report proper error.
9127 (Delegate.VerifyObsoleteAttribute): Override.
9130 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9131 and report proper error.
9132 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9135 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9139 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9140 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9141 Added test for ObsoleteAttribute.
9144 (Catch): Derived from Statement.
9146 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9148 * decl.cs: If possible, use lookuptypedirect here. We can only do
9149 this if there is no `.' after the namespace. Avoids using
9150 LookupType, which does lots of slow processing.
9151 (FindNestedType) New method, does what it says :-).
9152 * namespace.cs: use LookupTypeDirect.
9153 * rootcontext.cs: use membercache, if possible.
9154 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9156 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9159 According to the spec,
9161 In a member access of the form E.I, if E is a single identifier,
9162 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9163 field, property, localvariable, or parameter with the same type as
9164 the meaning of E as a type-name (§3.8), then both possible
9165 meanings of E are permitted.
9167 We did not check that E as a simple-name had the same type as E as
9170 This trivial check gives us 5-7% on bootstrap time.
9172 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9174 Fixed bug #59071 & cs0160.cs
9175 * statement.cs (Try.Resolve): Check here whether order of catch
9176 clauses matches their dependencies.
9178 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9181 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9184 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9186 * expression.cs (Invocation.OverloadResolve): Avoid the
9187 use of hashtables and boxing here by allocating on demand.
9189 2004-05-30 Martin Baulig <martin@ximian.com>
9191 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9192 we're doing a silent lookup. Don't try to lookup nested types in
9193 TypeManager.object_type (thanks to Ben Maurer).
9195 2004-05-30 Martin Baulig <martin@ximian.com>
9197 Committing a patch from Ben Maurer.
9199 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9201 2004-05-29 Martin Baulig <martin@ximian.com>
9203 * class.cs (IMethodData.ShouldIgnore): New method.
9205 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9206 `Location' argument, we don't need it anywhere. Use
9207 `IMethodData.ShouldIgnore ()' instead of
9208 `MethodData.GetMethodFlags ()'.
9209 (TypeManager.AddMethod): Removed.
9210 (TypeManager.AddMethod2): Renamed to AddMethod.
9212 2004-05-29 Martin Baulig <martin@ximian.com>
9214 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9216 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9217 converting from a class type S to an interface type and we already
9218 have an object on the stack, don't box it again. Fixes #52578.
9220 2004-05-29 Martin Baulig <martin@ximian.com>
9222 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9223 Added support for `params' parameters. Fixes #59267.
9225 2004-05-29 Martin Baulig <martin@ximian.com>
9227 * literal.cs (NullPointer): Provide a private .ctor which sets
9228 `type' to TypeManager.object_type. Fixes #59048.
9230 2004-05-29 Martin Baulig <martin@ximian.com>
9232 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9233 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9235 * ecore.cs (EventExpr.instance_expr): Make the field private.
9237 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9239 Fixed bug #50080 & cs0214-2.cs
9240 * expression.cs (Cast.DoResolve): Check unsafe context here.
9242 * statement.cs (Resolve.DoResolve): Likewise.
9244 2004-05-26 Martin Baulig <martin@ximian.com>
9246 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9248 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9249 (RootContext.LookupType): Pass down the `silent' flag.
9251 2004-05-25 Martin Baulig <martin@ximian.com>
9254 (MethodGroupExpr.IdenticalTypeName): New public property.
9255 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9256 expression actually refers to a type.
9258 2004-05-25 Martin Baulig <martin@ximian.com>
9260 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9261 for #56176 and made it actually work.
9263 2004-05-25 Martin Baulig <martin@ximian.com>
9265 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9266 (FieldExpr, PropertyExpr): Override and implement
9267 CacheTemporaries. Fixes #52279.
9269 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9271 * location.cs: In the new compiler listing a file twice is a
9272 warning, not an error.
9274 2004-05-24 Martin Baulig <martin@ximian.com>
9276 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9277 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9279 2004-05-24 Martin Baulig <martin@ximian.com>
9281 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9282 walking the `using' list. Fixes #53921.
9284 2004-05-24 Martin Baulig <martin@ximian.com>
9286 * const.cs (Const.LookupConstantValue): Added support for
9287 EmptyCast's; fixes #55251.
9289 2004-05-24 Martin Baulig <martin@ximian.com>
9291 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9292 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9293 which does the CS0135 check. The reason is that we first need to
9294 check whether the variable actually exists.
9296 2004-05-24 Martin Baulig <martin@ximian.com>
9298 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9299 than RootContext.LookupType() to find the explicit interface
9302 2004-05-24 Raja R Harinath <rharinath@novell.com>
9304 * Makefile: Simplify. Use executable.make.
9305 * mcs.exe.sources: New file. List of sources of mcs.exe.
9307 2004-05-24 Anders Carlsson <andersca@gnome.org>
9311 Use the invariant culture when doing String.Compare for CLS case
9314 2004-05-23 Martin Baulig <martin@ximian.com>
9316 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9317 don't have any dots. Fixes #52622, added cs0246-8.cs.
9319 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9321 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9323 * class.cs (MemberBase.Define): Reuse MemberType member for
9324 resolved type. Other methods can use it too.
9326 2004-05-23 Martin Baulig <martin@ximian.com>
9328 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9329 the variable also exists in the current block (otherwise, we need
9330 to report a CS0103). Fixes #58670.
9332 2004-05-23 Martin Baulig <martin@ximian.com>
9334 * flowanalysis.cs (Reachability.Reachable): Compute this
9335 on-the-fly rather than storing it as a field.
9337 2004-05-23 Martin Baulig <martin@ximian.com>
9339 * flowanalysis.cs (Reachability.And): Manually compute the
9340 resulting `barrier' from the reachability.
9342 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9345 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9346 instance of ObsoleteAttribute when symbol is obsolete.
9349 (IMethodData): Extended interface for ObsoleteAttribute support.
9351 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9353 * attribute.cs: Fix bug #55970
9355 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9359 (GetObsoleteAttribute): New method. Creates the instance of
9361 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9362 ObsoleteAttribute when member is obsolete.
9363 (AttributeTester.Report_ObsoleteMessage): Common method for
9364 Obsolete error/warning reporting.
9367 (TypeContainer.base_classs_type): New member for storing parent type.
9370 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9371 for this MemberCore.
9373 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9375 * attribute.cs, const.cs: Fix bug #58590
9377 2004-05-21 Martin Baulig <martin@ximian.com>
9379 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9380 out parameters if the end of the method is unreachable. Fixes
9383 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9385 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9386 Hari was right, why extra method.
9388 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9390 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9392 2004-05-20 Martin Baulig <martin@ximian.com>
9394 * delegate.cs: Convert this file to Unix mode - like the original
9397 2004-05-20 Martin Baulig <martin@ximian.com>
9399 * attribute.cs: Convert this file to Unix mode - like the original
9402 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9404 Fix bug #58688 (MCS does not report error when the same attribute
9407 * attribute.cs (Attribute.Emit): Distinction between null and default.
9409 2004-05-19 Raja R Harinath <rharinath@novell.com>
9411 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9412 of a top-level attribute without an attribute target.
9413 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9415 (Attribute.Conditional_GetConditionName),
9416 (Attribute.Obsolete_GetObsoleteMessage): Update.
9417 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9418 part of ScanForIndexerName.
9419 (Attribute.CanIgnoreInvalidAttribute): New function.
9420 (Attribute.ScanForIndexerName): Move to ...
9421 (Attributes.ScanForIndexerName): ... here.
9422 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9423 (Attributes.Search): New internal variant that can choose not to
9424 complain if types aren't resolved. The original signature now
9426 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9427 complaints suppressed.
9428 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9429 only if it not useful.
9430 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9431 top-level for attributes that are shared between the assembly
9432 and a top-level class.
9433 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9434 * class.cs: Update to reflect changes.
9435 (DefineIndexers): Fuse loops.
9436 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9437 a couple more variants of attribute names.
9439 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9441 Fix bug #52585 (Implemented explicit attribute declaration)
9444 (Attributable.ValidAttributeTargets): New abstract method. It gets
9445 list of valid attribute targets for explicit target declaration.
9446 (Attribute.Target): It holds target itself.
9447 (AttributeSection): Removed.
9448 (Attribute.CheckTargets): New method. It checks whether attribute
9449 target is valid for the current element.
9452 (EventProperty): New class. For events that are declared like
9453 property (with add and remove accessors).
9454 (EventField): New class. For events that are declared like field.
9457 * cs-parser.jay: Implemented explicit attribute target declaration.
9459 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9460 Override ValidAttributeTargets.
9463 (ReturnParameter): Class for applying custom attributes on
9465 (ParameterAtribute): New class. Class for applying custom
9466 attributes on the parameter type.
9468 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9470 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9473 (Method): Allow UNSAFE here.
9475 * modifiers.cs: Support unsafe reporting.
9477 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9479 * decl.cs: Fix bug #58478.
9481 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9483 * statement.cs: When checking for unreachable code on an EmptyStatement,
9484 set the location. Fixes bug #58488.
9486 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9488 * driver.cs: Add -pkg handling.
9490 From Gonzalo: UseShelLExecute=false
9492 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9495 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9497 (Attribute.IsClsCompliaceRequired): Moved to base for better
9499 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9500 when attribute is AttributeUsageAttribute.
9501 (Attribute.GetValidTargets): Simplified.
9502 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9503 attribute for this type.
9504 (Attribute.ApplyAttributes): Method renamed to Emit and make
9506 (GlobalAttributeSection): New class for special handling of global
9507 attributes (assembly, module).
9508 (AttributeSection.Emit): New method.
9510 * class.cs: Implemented Attributable abstract methods.
9511 (MethodCore.LabelParameters): Moved to Parameter class.
9512 (Accessor): Is back simple class.
9513 (PropertyMethod): Implemented Attributable abstract class.
9514 (DelegateMethod): Implemented Attributable abstract class.
9515 (Event): New constructor for disctintion between normal Event
9516 and Event with accessors.
9518 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9520 * codegen.cs, const.cs, decl.cs, delegate.cs:
9521 (CommonAssemblyModulClass): Implemented Attributable abstract class
9524 * enum.cs: Implement IAttributeSupport interface.
9525 (EnumMember): New class for emum members. Implemented Attributable
9529 (ParameterBase): Is abstract.
9530 (ReturnParameter): New class for easier [return:] attribute handling.
9532 * typemanager.cs: Removed builder_to_attr.
9534 2004-05-11 Raja R Harinath <rharinath@novell.com>
9537 * attribute.cs (Attribute.GetPositionalValue): New function.
9538 * class.cs (TypeContainer.VerifyMembers): New function.
9539 (TypeContainer.Emit): Use it.
9540 (ClassOrStruct): New base class for Class and Struct.
9541 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9542 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9544 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9545 then each non-static field should have a FieldOffset attribute.
9546 Otherwise, none of the fields should have a FieldOffset attribute.
9547 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9548 and FieldOffset attributes.
9549 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9550 (TypeManager.field_offset_attribute_type): New core types.
9551 (TypeManager.InitCoreTypes): Initialize them.
9553 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9555 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9556 Return correct type.
9559 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9561 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9562 be implicitly converted to ulong.
9564 * expression.cs: The logic for allowing operator &, | and ^ worked
9565 was wrong, it worked before because we did not report an error in
9566 an else branch. Fixes 57895.
9568 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9569 allow volatile fields to be reference types.
9571 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9573 * driver.cs: Add support for /debug-
9575 2004-05-07 Raja R Harinath <rharinath@novell.com>
9577 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9578 Add a 'complain' parameter to silence errors.
9579 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9580 silently overlooked type-resolutions.
9581 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9583 (Attributes.Search): New function.
9584 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9585 (Attributes.GetAttributeFullName): Remove hack.
9586 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9587 Update to reflect changes.
9588 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9589 Use Attributes.Search instead of nested loops.
9591 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9594 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9595 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9596 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9598 * report.cs: (Report.Warning): Renamed to Warning_T because of
9599 parameter collision.
9601 2004-05-05 Raja R Harinath <rharinath@novell.com>
9603 * expression.cs (MemberAccess.ResolveMemberAccess):
9604 Exit with non-zero status after Report.Error.
9605 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9607 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9609 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9611 * support.cs: Don't hang when the file is empty.
9613 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9615 * support.cs: In SeekableStreamReader, compute the preamble size of the
9616 underlying stream. Position changes should take into account that initial
9619 2004-05-03 Todd Berman <tberman@sevenl.net>
9621 * driver.cs: remove unused GetSysVersion function.
9623 2004-05-03 Todd Berman <tberman@sevenl.net>
9625 * driver.cs: Remove the hack from saturday, as well as the hack
9626 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9627 link_paths to get that bit proper.
9629 2004-05-01 Todd Berman <tberman@sevenl.net>
9631 * driver.cs: Try a LoadFrom before a Load, this checks the current
9632 path. This is currently a bug in mono that is be fixed, however, this
9633 provides a workaround for now. This will be removed when the bug
9636 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9638 * CryptoConvert.cs: Updated to latest version. Fix issue with
9639 incomplete key pairs (#57941).
9641 2004-05-01 Todd Berman <tberman@sevenl.net>
9643 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9646 2004-04-30 Jackson Harper <jackson@ximian.com>
9648 * codegen.cs: Open keys readonly.
9650 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9652 * typemanager.cs: don't report cyclic struct layout when a struct
9653 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9654 which has 2 Pango.Rectangle fields.
9656 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9658 * expression.cs: Handle IntPtr comparisons with IL code
9659 rather than a method call.
9661 2004-04-29 Martin Baulig <martin@ximian.com>
9663 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9664 the list of PropertyInfo's in class hierarchy and find the
9665 accessor. Fixes #56013.
9667 2004-04-29 Martin Baulig <martin@ximian.com>
9669 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9671 2004-04-29 Martin Baulig <martin@ximian.com>
9673 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9675 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9677 2004-04-29 Martin Baulig <martin@ximian.com>
9679 * class.cs (ConstructorInitializer.Resolve): Check whether the
9680 parent .ctor is accessible. Fixes #52146.
9682 2004-04-29 Martin Baulig <martin@ximian.com>
9684 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9686 * statement.cs (Using.EmitLocalVariableDecls): Use
9687 TypeManager.idisposable_type, not typeof (IDisposable).
9688 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9690 2004-04-29 Martin Baulig <martin@ximian.com>
9692 * class.cs (Event.Define): Don't emit the field and don't set
9693 RTSpecialName and SpecialName for events on interfaces. Fixes
9696 2004-04-29 Raja R Harinath <rharinath@novell.com>
9698 Refactor Attribute.ApplyAttributes.
9699 * attribute.cs (Attributable): New base class for objects that can
9700 have Attributes applied on them.
9701 (Attribute): Make AttributeUsage fields public.
9702 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9703 (Attribute.IsInternalCall): New property.
9704 (Attribute.UsageAttr): Convert to a public read-only property.
9705 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9706 (Attribute.ResolveType, Attribute.Resolve)
9707 (Attribute.ScanForIndexerName): Update to reflect changes.
9708 (Attribute.CheckAttributeTarget): Re-format.
9709 (Attribute.ApplyAttributes): Refactor, to various
9710 Attributable.ApplyAttributeBuilder methods.
9711 * decl.cs (MemberCore): Make Attributable.
9712 * class.cs (Accessor): Make Attributable.
9713 (MethodData.ApplyAttributes): Use proper attribute types, not
9715 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9716 (TypeContainer.ApplyAttributeBuilder)
9717 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9718 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9719 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9720 (Operator.ApplyAttributeBuilder): New factored-out methods.
9721 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9722 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9723 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9724 * parameter.cs (ParameterBase): New Attributable base class
9725 that can also represent Return types.
9726 (Parameter): Update to the changes.
9728 2004-04-29 Jackson Harper <jackson@ximian.com>
9730 * driver.cs: Prefer the corlib system version when looking for
9731 assemblies in the GAC. This is still a hack, but its a better hack
9734 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9736 * decl.cs, enum.cs: Improved error 3005 reporting.
9738 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9739 (related_symbols): New private member for list of symbols
9740 related to reported error/warning.
9742 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9744 2004-04-29 Martin Baulig <martin@ximian.com>
9746 * ecore.cs (Expression.Constantify): If we're an enum and
9747 TypeManager.TypeToCoreType() doesn't give us another type, use
9748 t.UnderlyingSystemType. Fixes #56178.
9750 2004-04-29 Martin Baulig <martin@ximian.com>
9752 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9753 interfaces and for each interface, only add members directly
9754 declared in that interface. Fixes #53255.
9756 2004-04-28 Martin Baulig <martin@ximian.com>
9758 * expression.cs (ConditionalLogicalOperator): Use a temporary
9759 variable for `left' to avoid that we evaluate it more than once;
9762 2004-04-28 Martin Baulig <martin@ximian.com>
9764 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9767 2004-04-28 Martin Baulig <martin@ximian.com>
9769 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9772 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9773 whether the type is not void (CS1547).
9775 2004-04-28 Martin Baulig <martin@ximian.com>
9777 * expression.cs (Unary.DoResolveLValue): Override this and report
9778 CS0131 for anything but Operator.Indirection.
9780 2004-04-28 Martin Baulig <martin@ximian.com>
9782 Committing a patch from Ben Maurer; see bug #50820.
9784 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9787 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9790 2004-04-28 Martin Baulig <martin@ximian.com>
9792 Committing a patch from Ben Maurer; see bug #50820.
9794 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9797 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9800 2004-04-28 Martin Baulig <martin@ximian.com>
9802 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9803 (Block.AddLabel): Call DoLookupLabel() to only search in the
9806 2004-04-28 Martin Baulig <martin@ximian.com>
9808 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9809 comparing StringConstants and NullLiterals in Equality and Inequality.
9811 2004-04-28 Jackson Harper <jackson@ximian.com>
9813 * driver.cs: Attempt to load referenced assemblies from the
9814 GAC. This is the quick and dirty version of this method that
9815 doesnt take into account versions and just takes the first
9816 canidate found. Will be good enough for now as we will not have more
9817 then one version installed into the GAC until I update this method.
9819 2004-04-28 Martin Baulig <martin@ximian.com>
9821 * typemanager.cs (TypeManager.CheckStructCycles): New public
9822 static method to check for cycles in the struct layout.
9824 * rootcontext.cs (RootContext.PopulateTypes): Call
9825 TypeManager.CheckStructCycles() for each TypeContainer.
9826 [Note: We only need to visit each type once.]
9828 2004-04-28 Martin Baulig <martin@ximian.com>
9830 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9832 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9833 success and added `out object value'. Use a `bool resolved' field
9834 to check whether we've already been called rather than
9835 `ConstantValue != null' since this breaks for NullLiterals.
9837 2004-04-28 Raja R Harinath <rharinath@novell.com>
9839 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9840 setting of this flag, since the 'set' method may be non-public.
9842 2004-04-28 Raja R Harinath <rharinath@novell.com>
9844 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9845 check on current_vector.Block.
9847 2004-04-27 Martin Baulig <martin@ximian.com>
9849 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9850 a field initializer. Fixes #56459.
9852 2004-04-27 Martin Baulig <martin@ximian.com>
9854 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9855 we're not attempting to use an indexer. Fixes #52154.
9857 2004-04-27 Martin Baulig <martin@ximian.com>
9859 * statement.cs (Return): Don't create a return label if we don't
9860 need it; reverts my change from January 20th. Thanks to Ben
9863 2004-04-27 Martin Baulig <martin@ximian.com>
9865 According to the spec, `goto' can only leave a nested scope, but
9868 * statement.cs (Block.LookupLabel): Only lookup in the current
9869 block, don't recurse into parent or child blocks.
9870 (Block.AddLabel): Check in parent and child blocks, report
9871 CS0140/CS0158 if we find a duplicate.
9872 (Block): Removed this indexer for label lookups.
9873 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9874 this already does the error reporting for us.
9877 (FlowBranching.UsageVector.Block): New public variable; may be null.
9878 (FlowBranching.CreateSibling): Added `Block' argument.
9879 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9880 label for the target of a `goto' and check whether we're not
9881 leaving a `finally'.
9883 2004-04-27 Martin Baulig <martin@ximian.com>
9885 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9886 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9889 2004-04-27 Martin Baulig <martin@ximian.com>
9891 * statement.cs (Block.AddLabel): Also check for implicit blocks
9892 and added a CS0158 check.
9894 2004-04-27 Martin Baulig <martin@ximian.com>
9896 * flowanalysis.cs (FlowBranchingLoop): New class.
9897 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9898 UsageVector's instead of an ArrayList.
9899 (FlowBranching.Label): Likewise.
9900 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9901 (FlowBranching.AddBreakVector): New method.
9903 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9905 * attribute.cs: Small regression fix: only convert the type if we
9906 the type is different, fixes System.Drawing build.
9908 2004-04-27 Martin Baulig <martin@ximian.com>
9910 * attribute.cs (Attribute.Resolve): If we have a constant value
9911 for a named field or property, implicity convert it to the correct
9914 2004-04-27 Raja R Harinath <rharinath@novell.com>
9916 * statement.cs (Block.Block): Implicit blocks share
9917 'child_variable_names' fields with parent blocks.
9918 (Block.AddChildVariableNames): Remove.
9919 (Block.AddVariable): Mark variable as "used by a child block" in
9920 every surrounding block.
9921 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9922 been used in a child block, complain about violation of "Invariant
9923 meaning in blocks" rule.
9924 * cs-parser.jay (declare_local_variables): Don't use
9925 AddChildVariableNames.
9926 (foreach_statement): Don't create an implicit block: 'foreach'
9929 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9931 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9932 converting from 0L to ulong. Fixes 57522.
9934 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9936 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9937 derived class hides via 'new' keyword field from base class (test-242.cs).
9938 TODO: Handle this in the more general way.
9940 * class.cs (CheckBase): Ditto.
9942 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9944 * decl.cs (caching_flags): New member for storing cached values
9946 (MemberCore.Flags): New enum where bit flags for caching_flags
9948 (MemberCore.cls_compliance): Moved to caching_flags.
9949 (DeclSpace.Created): Moved to caching_flags.
9951 * class.cs: Use caching_flags instead of DeclSpace.Created
9953 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9955 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9956 if we are only a derived class, not a nested class.
9958 * typemanager.cs: Same as above, but do this at the MemberLookup
9959 level (used by field and methods, properties are handled in
9960 PropertyExpr). Allow for the qualified access if we are a nested
9963 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9965 * class.cs: Refactoring.
9966 (IMethodData): New inteface; Holds links to parent members
9967 to avoid member duplication (reduced memory allocation).
9968 (Method): Implemented IMethodData interface.
9969 (PropertyBase): New inner classes for get/set methods.
9970 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9971 (Event): New inner classes for add/remove methods.
9972 (Event.DelegateMethod): Implemented IMethodData interface.
9974 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9975 EmitContext (related to class.cs refactoring).
9977 2004-04-21 Raja R Harinath <rharinath@novell.com>
9979 * delegate.cs (Delegate.VerifyApplicability): If the number of
9980 arguments are the same as the number of parameters, first try to
9981 verify applicability ignoring any 'params' modifier on the last
9985 2004-04-08 Martin Baulig <martin@ximian.com>
9987 Merged latest changes into gmcs. Please keep this comment in
9988 here, it makes it easier for me to see what changed in MCS since
9989 the last time I merged.
9991 2004-04-16 Raja R Harinath <rharinath@novell.com>
9993 * class.cs (TypeContainer.AddIndexer): Use
9994 'ExplicitInterfaceName' to determine if interface name was
9995 explicitly specified. 'InterfaceType' is not initialized at this time.
9996 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9997 Indexers array is already in the required order. Initialize
9998 'IndexerName' only if there are normal indexers.
9999 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10000 (TypeContainer.Emit): Emit DefaultMember attribute only if
10001 IndexerName is initialized.
10004 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10006 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10009 2004-04-15 Raja R Harinath <rharinath@novell.com>
10011 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10015 * attribute.cs (Attribute.Resolve): Check for duplicate named
10019 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10021 * iterators.cs (MarkYield): track whether we are in an exception,
10022 and generate code accordingly. Use a temporary value to store the
10023 result for our state.
10025 I had ignored a bit the interaction of try/catch with iterators
10026 since their behavior was not entirely obvious, but now it is
10027 possible to verify that our behavior is the same as MS .NET 2.0
10031 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10033 * iterators.cs: Avoid creating temporaries if there is no work to
10036 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10037 Enumerations, use TypeManager.EnumToUnderlying and call
10040 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10043 (This.Emit): Use EmitContext.EmitThis to emit our
10046 (This.EmitAssign): Ditto.
10048 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10049 codepaths, we will move all the functionality into
10052 (FieldExpr.EmitAssign): Ditto.
10054 This fixes several hidden bugs that I uncovered while doing a code
10055 review of this today.
10057 * codegen.cs (EmitThis): reworked so the semantics are more clear
10058 and also support value types "this" instances.
10060 * iterators.cs: Changed so that for iterators in value types, we
10061 do not pass the value type as a parameter.
10063 Initialization of the enumerator helpers is now done in the caller
10064 instead of passing the parameters to the constructors and having
10065 the constructor set the fields.
10067 The fields have now `assembly' visibility instead of private.
10069 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10071 * expression.cs (Argument.Resolve): Check if fields passed as ref
10072 or out are contained in a MarshalByRefObject.
10074 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10075 another compiler type.
10077 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10079 * class.cs (Indexer.Define): use the new name checking method.
10080 Also, return false on an error.
10081 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10082 (is_identifier_[start/part]_character): make static.
10084 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10086 * expression.cs (Binary.ResolveOperator): Do no append strings
10087 twice: since we can be invoked more than once (array evaluation)
10088 on the same concatenation, take care of this here. Based on a fix
10089 from Ben (bug #56454)
10091 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10093 * codegen.cs: Fix another case where CS1548 must be reported (when
10094 delay-sign isn't specified and no private is available #56564). Fix
10095 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10096 error when MCS is used on the MS runtime and we need to delay-sign
10097 (which seems unsupported by AssemblyBuilder - see #56621).
10099 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10101 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10102 (TypeManager.ComputeNamespaces): Faster implementation for
10105 * compiler.csproj: Updated AssemblyName to mcs.
10107 2004-05-11 Jackson Harper <jackson@ximian.com>
10109 * Makefile: Preserve MONO_PATH
10111 2004-05-11 Jackson Harper <jackson@ximian.com>
10113 * Makefile: Use mono and mcs to build gmcs
10115 2004-05-03 Miguel de Icaza <miguel@ximian.com>
10117 * codegen.cs: Add patch from Robert Shade
10118 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10121 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
10123 * CryptoConvert.cs: Updated to latest version. Fix issue with
10124 incomplete key pairs (#57941).
10126 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10128 * codegen.cs: Fix another case where CS1548 must be reported (when
10129 delay-sign isn't specified and no private is available #56564). Fix
10130 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10131 error when MCS is used on the MS runtime and we need to delay-sign
10132 (which seems unsupported by AssemblyBuilder - see #56621).
10134 2004-04-29 Jackson Harper <jackson@ximian.com>
10136 * Makefile: Set MONO_PATH to use the bootstrap corlib
10137 * driver.cs: Check the GAC for referenced assemblies.
10139 2004-04-29 Martin Baulig <martin@ximian.com>
10141 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10143 2004-04-07 Martin Baulig <martin@ximian.com>
10145 * expression.cs (Binary.ResolveOperator): Added special case for
10146 Equality/Inequality between a type parameter and a null literal.
10148 2004-04-07 Martin Baulig <martin@ximian.com>
10150 * convert.cs: Check null literal -> type parameter conversions.
10152 2004-04-07 Martin Baulig <martin@ximian.com>
10154 * generic.cs (ConstructedType.CheckConstraints): Enforce the
10155 `class' and `struct' constraints.
10157 2004-04-07 Martin Baulig <martin@ximian.com>
10159 * generic.cs (SpecialConstraint): New public enum.
10160 (Constraints.Resolve): Added support for the `class' and `struct'
10163 * cs-parser.jay (type_parameter_constraint): Added support for the
10164 `class' and `struct' constraints.
10166 2004-04-07 Martin Baulig <martin@ximian.com>
10168 * support.cs (GenericConstraints): Replaced `Types' by
10169 `ClassConstraint' and `InterfaceConstraints'; added
10170 `HasClassConstraint'.
10172 2004-04-07 Martin Baulig <martin@ximian.com>
10175 (Constraints.InterfaceConstraints): New public property.
10176 (Constraints.Types): Make this property public
10177 (TypeParameter): Implement IMemberContainer.
10178 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10179 instead of a TypeBuilder/MethodBuilder; pass the interface
10180 constraints to TypeManager.AddTypeParameter().
10181 (TypeParameter.DefineType): Just take an EmitContext and no
10182 TypeBuilder/MethodBuilder. Use the new public API.
10184 * typemanager.cs (TypeManager.AddTypeParameter): Added
10185 `TypeExpr[]' argument; add the interfaces to the
10186 `builder_to_ifaces' hash.
10187 (TypeManager.LookupMemberContainer): For
10188 GenericTypeParameterBuilders, get the TypeParameter from the
10189 `builder_to_type_param'.
10190 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10191 the TypeParameter and call FindMembers on it.
10193 2004-04-07 Martin Baulig <martin@ximian.com>
10196 (MethodCore.GenericMethod): Moved this field here from Method.
10197 (MethodCore.IsDuplicateImplementation): Take the number of type
10198 parameters into account if we're a generic method.
10200 * expression.cs (Invocation.InferTypeArguments): Don't return true
10201 if `arguments' is null; we still need to check whether we actually
10202 don't need to infer anything in this case.
10203 (MemberAccess): Merged the functionality from GenericMemberAccess
10206 * generic.cs (GenericMemberAccess): Removed.
10208 2004-04-05 Martin Baulig <martin@ximian.com>
10210 * decl.cs (MemberCore): For generic classes, interfaces and
10211 structs, `Name' now includes the number of type parameters
10212 ("Stack!1.Node!1").
10213 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10214 encode the number of type arguments in the type name.
10216 * expression.cs (Expression.MemberLookup): Removed the
10217 `num_type_args' argument; we now encode the number of type
10218 arguments in the type name.
10220 * ecore.cs (SimpleName): Encode the number of type arguments in
10221 the type name itself.
10223 * generic.cs (ConstructedType): Likewise.
10225 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10226 `MemberName'; we now include the number of type parameters in the
10229 * typemanager.cs (TypeManager.CheckGeneric): Removed.
10230 (TypeManager.MemberLookup): Removed the
10231 `num_type_args' argument; we now encode the number of type
10232 arguments in the type name.
10234 2004-04-03 Martin Baulig <martin@ximian.com>
10236 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10237 (MemberCore.MemberName): Moved here from MemberBase.
10238 (DeclSpace.SetParameterInfo): Just take the constraints as an
10239 ArrayList; we already have the type parameters in our
10240 `MemberName'; also do the CS0080 reporting here.
10242 * cs-parser.jay (struct_declaration): Use `member_name' instead of
10243 `IDENTIFIER opt_type_parameter_list'; when constructing our
10244 `MemberName', it'll already include our type parameters.
10245 (class_declaration, interface_declaration): Likewise.
10246 (delegate_declaration): Likewise.
10247 (MakeName): Take a MemberName and return a MemberName.
10248 The following two changes are required to avoid shift/reduce conflicts:
10249 (member_name): Don't include a TypeName anymore; ie. this is now
10250 just 'IDENTIFIER opt_type_parameter_list'.
10251 (property_declaration, event_declaration): Use a
10252 `namespace_or_type_name' instead of a `member_name'.
10254 2004-04-03 Martin Baulig <martin@ximian.com>
10256 * decl.cs (MemberName): Renamed to `TypeName' and created a new
10257 `MemberName' class.
10258 (TypeName): Formerly known as MemberName.
10260 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10261 instead of a `MemberName'.
10263 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10264 (member_name): New rule; create a MemberName.
10266 2004-04-02 Martin Baulig <martin@ximian.com>
10268 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10269 (CS0305 and CS0308).
10271 2004-04-02 Martin Baulig <martin@ximian.com>
10273 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10274 support for nested types.
10276 2004-04-02 Martin Baulig <martin@ximian.com>
10278 * ecore.cs (IAlias): New public interface.
10279 (TypeExpr, TypeExpression): Implement IAlias.
10280 (TypeAliasExpression): New public class.
10282 * namespace.cs (Namespace): Implement IAlias.
10283 (Namespace.Lookup): Return an IAlias instead on an object.
10284 (Namespace.DefineName): Take an IAlias instead of an object.
10285 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10287 (NamespaceEntry.UsingAlias): Take a Membername instead of an
10289 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10291 (NamespaceEntry.Lookup): Likewise.
10293 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10296 * decl.cs (DeclSpace): Implement IAlias.
10297 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10299 * generic.cs (ConstructedType): Improved error checking.
10301 2004-04-02 Martin Baulig <martin@ximian.com>
10303 * convert.cs: Added type parameter conversions.
10306 (UnboxCast.Emit): Emit an `unbox.any' for type params.
10307 (ClassCast.Emit): If the source type is a type parameter, box it.
10308 If the target type is a type parameter, emit an `unbox.any'
10309 instead of a `classcast'.1
10311 2004-04-01 Martin Baulig <martin@ximian.com>
10313 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10315 2004-04-01 Martin Baulig <martin@ximian.com>
10317 * generic.cs (ConstructedType.CheckConstraints): Use
10318 Convert.ImplicitStandardConversionExists(); user-defined implicit
10319 conversions are not allowed according to the spec.
10321 2004-03-30 Martin Baulig <martin@ximian.com>
10323 * expression.cs (New): Added support for type parameters.
10326 (TypeManager.activator_type): New public static field.
10327 (TypeManager.activator_create_instance): Likewise.
10329 2004-03-30 Martin Baulig <martin@ximian.com>
10331 * typemanager.cs (TypeManager.HasConstructorConstraint): New
10334 2004-03-30 Martin Baulig <martin@ximian.com>
10336 * generic.cs (ConstructedType.CheckConstraints): Actually follow
10337 the spec here: the argument type must be convertible to the
10340 2004-03-30 Martin Baulig <martin@ximian.com>
10343 (TypeParameter.Define, TypeParameter.DefineMethod): Call
10344 TypeManager.AddTypeParameter().
10345 (ConstructedType.CheckConstraints): Re-enable this and actually
10346 check whether we have a constructor constraint.
10349 (TypeManager.builder_to_type_param): New static field.
10350 (TypeManager.AddTypeParameter): New static method.
10351 (TypeManager.LookupTypeParameter): New public method.
10353 2004-03-30 Martin Baulig <martin@ximian.com>
10355 * generic.cs (TypeParameter.DefineType): Return a boolean and use
10356 the new API to actually define the constructor constraint.
10359 (TypeManager.new_constraint_attr_type): New static field.
10360 (TypeManager.InitCoreTypes): Initialize it.
10362 2004-03-30 Martin Baulig <martin@ximian.com>
10364 * generic.cs (Constraints): Completed error checking, use correct
10367 2004-03-29 Martin Baulig <martin@ximian.com>
10369 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10371 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10372 public version which takes a `ParameterData pd' instead of an
10375 2004-03-29 Martin Baulig <martin@ximian.com>
10377 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10380 2004-03-29 Martin Baulig <martin@ximian.com>
10382 * expression.cs (Argument.ResolveMethodGroup): If we're a
10383 ConstructedType, call GetMemberAccess() on it.
10385 2004-03-29 Martin Baulig <martin@ximian.com>
10387 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10388 (MethodCore.CheckGenericOverride): When overriding a generic
10389 method, check whether the constraints match.
10391 * support.cs (GenericConstraints): New public interface.
10392 (ParameterData.GenericConstraints): New public method.
10394 * parameter.cs (Parameter.Resolve): Check whether we're a generic
10395 method parameter and compute our constraints if appropriate.
10396 (Parameter.GenericConstraints): New public property.
10398 * generic.cs (Constraints): Implement GenericConstraints.
10400 2004-03-29 Martin Baulig <martin@ximian.com>
10402 * decl.cs (MemberCache.FindMemberToOverride): Use
10403 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10405 2004-03-29 Martin Baulig <martin@ximian.com>
10407 * generic.cs (GenericMethod.Define): Resolve our type parameters.
10409 2004-03-29 Martin Baulig <martin@ximian.com>
10411 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10412 not allowed on non-generic declarations").
10414 2004-03-29 Martin Baulig <martin@ximian.com>
10416 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10417 public version of this method.
10419 * class.cs (MethodCore.IsDuplicateImplementation): Use
10420 Invocation.InferTypeArguments() to check this.
10422 2004-03-29 Martin Baulig <martin@ximian.com>
10424 * convert.cs: Use TypeManager.IsDelegateType() instead of
10425 comparing types correctly.
10427 2004-03-29 Martin Baulig <martin@ximian.com>
10429 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10430 types directly to make it work for generic instances.
10432 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10434 2004-03-29 Martin Baulig <martin@ximian.com>
10436 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10437 support for arrays.
10439 2004-03-24 Martin Baulig <martin@ximian.com>
10441 * decl.cs (DeclSpace.FindType): Also use
10442 TypeManager.CheckGeneric() for types from the using clauses.
10444 2004-03-23 Martin Baulig <martin@ximian.com>
10446 * expression.cs (Invocation.OverloadResolve): Added `bool
10447 may_fail' argument and use it instead of the Location.IsNull() hack.
10449 2004-03-23 Martin Baulig <martin@ximian.com>
10451 * expression.cs (Invocation.InferType): Use correct type inference
10454 2004-03-23 Martin Baulig <martin@ximian.com>
10456 * ecore.cs (MethodGroupExpr.Name): Use
10457 TypeManager.CSharpSignature() instead of just the name.
10459 * expression.cs (Invocation.OverloadResolve): Provide better error
10461 (Invocation.DoResolve): OverloadResolve() never returns null
10462 without reporting an error, so removed the error -6 reporting here.
10464 2004-03-23 Martin Baulig <martin@ximian.com>
10466 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10469 * cs-parser.jay (delegate_declaration): Support generic delegates.
10471 * delegate.cs: Support generic delegates.
10473 2004-03-22 Martin Baulig <martin@ximian.com>
10475 * expression.cs (Invocation.InferParamsTypeArguments): New static
10476 method; does type inference for params arguments.
10478 2004-03-21 Martin Baulig <martin@ximian.com>
10480 * typemanager.cs (TypeManager.IsGenericMethod): New public static
10481 method; checks whether a method is a generic method.
10483 * expression.cs (Invocation.InferTypeArguments): New static method;
10484 infer type arguments for generic method invocation.
10486 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10487 property; we set this to true if we're resolving a generic method
10488 invocation and the user specified type arguments, ie. we're not
10489 doing type inference.
10491 2004-03-20 Martin Baulig <martin@ximian.com>
10493 * class.cs (MethodData.DeclaringType): New public property.
10494 (MethodData.Define): Set DeclaringType here.
10495 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10496 instead of OperatorMethodBuilder.DeclaringType.
10498 2004-03-20 Martin Baulig <martin@ximian.com>
10500 * cs-tokenizer.cs (xtoken): Return a special
10501 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10503 * cs-parser.jay (default_value_expression): Switch to the new
10506 2004-03-19 Martin Baulig <martin@ximian.com>
10508 * decl.cs (MemberName): New class. We use this to "construct"
10509 namespace_or_type_name's.
10511 * generics.cs (TypeArguments.GetDeclarations): New public method;
10512 returns the type arguments as a string[] and reports a CS0081 if
10513 one of them is not an identifier.
10515 * class.cs (MemberBase): The .ctor now takes the name as a
10516 MemberName instead of a string.
10517 (MemberBase.ExplicitInterfaceName): Changed type from string to
10519 (MemberBase.DoDefine): If we're an explicit implementation, the
10520 InterfaceType may be a generic instance.
10522 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10523 (namespace_name): Call MemberName.GetName () to transform the
10524 MemberName into a string and ensure we don't have any type
10526 (type_name): Call MemberName.GetTypeExpression() to transfrom the
10527 MemberName into an expression.
10528 (method_header): Use namespace_or_type_name instead of member_name.
10530 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10532 * rootcontext.cs: Add new types to the boot resolution.
10534 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10535 MulticastDelegate is not allowed.
10537 * typemanager.cs: Add new types to lookup: System.TypedReference
10540 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10541 check for TypedReference or ArgIterator, they are not allowed.
10543 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10544 makes us properly catch 1510 in some conditions (see bug 56016 for
10547 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10549 * CryptoConvert.cs: update from corlib version
10552 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10554 * class.cs (Indexer.Define): Check indexername declaration
10556 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10558 * attribute.cs (IsClsCompliant): Fixed problem with handling
10559 all three states (compliant, not-compliant, undetected).
10561 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10563 * attribute.cs (Attribute): Location is now public.
10564 (Resolve): Store resolved arguments (pos_values) in attribute class.
10565 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10566 (GetClsCompliantAttributeValue): New method that gets
10567 CLSCompliantAttribute value.
10568 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10569 if exists else null.
10570 (AttributeTester): New class for CLS-Compliant verification routines.
10572 * class.cs (Emit): Add CLS-Compliant verification.
10573 (Method.GetSignatureForError): Implemented.
10574 (Constructor.GetSignatureForError): Implemented
10575 (Constructor.HasCompliantArgs): Returns if constructor has
10576 CLS-Compliant arguments.
10577 (Constructor.Emit): Override.
10578 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10579 is needed to test only parameters.
10580 (FieldBase.GetSignatureForError): Implemented.
10581 (TypeContainer): New member for storing base interfaces.
10582 (TypeContainer.FindMembers): Search in base interfaces too.
10584 * codegen.cs (GetClsComplianceAttribute): New method that gets
10585 assembly or module CLSCompliantAttribute value.
10586 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10588 (ModuleClass.Emit): Add error 3012 test.
10590 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10592 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10593 state for all decl types.
10594 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10595 if CLS-Compliant tests are required.
10596 (IsClsCompliaceRequired): New method. Analyze whether code
10597 must be CLS-Compliant.
10598 (IsExposedFromAssembly): New method. Returns true when MemberCore
10599 is exposed from assembly.
10600 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10601 value or gets cached value.
10602 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10603 is explicitly marked with CLSCompliantAttribute.
10604 (IsIdentifierClsCompliant): New abstract method. This method is
10605 used to testing error 3005.
10606 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10607 for identifier and parameters CLS-Compliant testing.
10608 (VerifyClsCompliance): New method. The main virtual method for
10609 CLS-Compliant verifications.
10610 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10611 null. I don't know why is null (too many public members !).
10612 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10613 and get value of first CLSCompliantAttribute that found.
10615 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10616 (VerifyClsCompliance): Override and add extra tests.
10618 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10619 clscheck- disable CLS-Compliant verification event if assembly is has
10620 CLSCompliantAttribute(true).
10622 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10623 ApllyAttribute is now called in emit section as in the other cases.
10624 Possible future Emit integration.
10625 (IsIdentifierClsCompliant): New override.
10626 (VerifyClsCompliance): New override.
10627 (GetEnumeratorName): Returns full enum name.
10629 * parameter.cs (GetSignatureForError): Implemented.
10631 * report.cs (WarningData): New struct for Warning message information.
10632 (LocationOfPreviousError): New method.
10633 (Warning): New method. Reports warning based on the warning table.
10634 (Error_T): New method. Reports error based on the error table.
10636 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10637 verifications are done here.
10639 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10641 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10642 CLSCompliantAttribute.
10643 (all_imported_types): New member holds all imported types from other
10645 (LoadAllImportedTypes): New method fills static table with exported types
10646 from all referenced assemblies.
10647 (Modules): New property returns all assembly modules.
10649 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10651 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10652 throwing a parser error.
10654 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10655 which removes the hardcoded get_/set_ prefixes for properties, as
10656 IL allows for the properties to be named something else.
10660 * expression.cs: Do not override operand before we know if it is
10661 non-null. Fix 56207
10663 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10665 * typemanager.cs: support for pinned variables.
10667 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10669 * decl.cs, typemanager.cs: Avoid using an arraylist
10670 as a buffer if there is only one result set.
10672 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10674 * expression.cs: Make sure you cant call a static method
10675 with an instance expression, bug #56174.
10677 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10679 * class.cs (IsDuplicateImplementation): Improve error reporting to
10680 flag 663 (method only differs in parameter modifier).
10682 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10683 in preprocessor directives.
10685 * location.cs (LookupFile): Allow for the empty path.
10687 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10688 better approach for some of that patch, but its failing with the
10689 CharSet enumeration. For now try/catch will do.
10691 * typemanager.cs: Do not crash if a struct does not have fields.
10694 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10696 * expression.cs: cs0213, cant fix a fixed expression.
10699 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10701 * cs-parser.jay: detect invalid embeded statements gracefully.
10704 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10706 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10709 the invocation type may not be a subclass of the tye of the item/
10710 The type of the item must be a subclass of the invocation item.
10715 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10717 * attribute.cs: Added methods to get a string and a bool from an
10718 attribute. Required to information from AssemblyKeyFileAttribute,
10719 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10720 * codegen.cs: Modified AssemblyName creation to include support for
10721 strongnames. Catch additional exceptions to report them as CS1548.
10722 * compiler.csproj: Updated include CryptoConvert.cs.
10723 * compiler.csproj.user: Removed file - user specific configuration.
10724 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10725 Mono.Security assembly. The original class is maintained and tested in
10726 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10727 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10728 like CSC 8.0 (C# v2) supports.
10729 * Makefile: Added CryptoConvert.cs to mcs sources.
10730 * rootcontext.cs: Added new options for strongnames.
10732 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10734 * driver.cs: For --expect-error, report error code `2'
10735 if the program compiled with no errors, error code `1' if
10736 it compiled with an error other than the one expected.
10738 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10740 * compiler.csproj: Updated for Visual Studio .NET 2003.
10741 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10742 * compiler.sln: Updated for Visual Studio .NET 2003.
10744 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10746 * expression.cs: Fix bug #47234. We basically need to apply the
10747 rule that we prefer the conversion of null to a reference type
10748 when faced with a conversion to 'object' (csc behaviour).
10750 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10752 * statement.cs: Shorter form for foreach, eliminates
10753 a local variable. r=Martin.
10755 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10757 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10758 checks if we can use brtrue/brfalse to test for 0.
10759 * expression.cs: use the above in the test for using brtrue/brfalse.
10760 cleanup code a bit.
10762 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10764 * expression.cs: Rewrite string concat stuff. Benefits:
10766 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10767 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10768 rather than a concat chain.
10770 * typemanager.cs: Add lookups for more concat overloads.
10772 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10774 * expression.cs: Emit shorter il code for array init.
10791 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10793 * statement.cs: Before, two switch blocks would be merged if the
10794 total size of the blocks (end_item - begin_item + 1) was less than
10795 two times the combined sizes of the blocks.
10797 Now, it will only merge if after the merge at least half of the
10802 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10804 * class.cs : csc build fix for GetMethods(). See bug #52503.
10806 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10808 * expression.cs: Make sure fp comparisons work with NaN.
10809 This fixes bug #54303. Mig approved this patch a long
10810 time ago, but we were not able to test b/c the runtime
10813 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10815 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10817 2004-03-19 Martin Baulig <martin@ximian.com>
10819 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10820 two overloads may unify for some type parameter substitutions and
10821 report a CS0408 if appropriate.
10823 2004-03-19 Martin Baulig <martin@ximian.com>
10825 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10826 error here and not in our caller.
10828 2004-03-19 Martin Baulig <martin@ximian.com>
10830 * interface.cs: Completely killed this file.
10831 (Interface): We're now a TypeContainer and live in class.cs.
10833 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10834 argument; we're now also called for interfaces.
10835 (TypeContainer.DefineMembers): Allow this method being called
10837 (TypeContainer.GetMethods): New public method; formerly known as
10838 Interface.GetMethod(). This is used by PendingImplementation.
10839 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10840 it's now private and non-static.
10841 (Interface): Moved this here; it's now implemented similar to
10843 (Method, Property, Event, Indexer): Added `bool is_interface'
10844 argument to their .ctor's.
10845 (MemberBase.IsInterface): New public field.
10847 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10848 instances instead of InterfaceMethod, InterfaceProperty, etc.
10849 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10850 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10852 2004-03-19 Martin Baulig <martin@ximian.com>
10854 * class.cs (MethodCore.IsDuplicateImplementation): New private
10855 method which does the CS0111 checking.
10856 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10857 Use IsDuplicateImplementation().
10859 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10861 * decl.cs (FindMemberToOverride): New method to find the correct
10862 method or property to override in the base class.
10864 - Make Method/Property use the above method to find the
10865 version in the base class.
10866 - Remove the InheritableMemberSignatureCompare as it is now
10869 This patch makes large code bases much faster to compile, as it is
10870 O(n) rather than O(n^2) to do this validation.
10872 Also, it fixes bug 52458 which is that nested classes are not
10873 taken into account when finding the base class member.
10875 Reviewed/Approved by Martin.
10877 2004-03-17 Martin Baulig <martin@ximian.com>
10879 * expression.cs (MemberAccess.DoResolve): Take the parent's number
10880 of type arguments into account; use the `real_num_type_args'
10881 approach like in DoResolveAsTypeStep().
10883 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10886 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10888 * interface.cs: In all interface classes removed redundant
10889 member initialization.
10891 2004-03-16 Martin Baulig <martin@ximian.com>
10893 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10895 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10897 * decl.cs (DefineTypeAndParents): New helper method to define a
10898 type's containers before the type itself is defined; This is a
10899 bug exposed by the recent changes to Windows.Forms when an
10900 implemented interface was defined inside a class that had not been
10903 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10905 (Check): Loop correctly to report errors modifiers
10906 (UNSAFE was not in the loop, since it was the same as TOP).
10908 * interface.cs: Every interface member now takes a ModFlags,
10909 instead of a "is_new" bool, which we set on the base MemberCore.
10911 Every place where we called "UnsafeOk" in the interface, now we
10912 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10913 the unsafe settings from the member declaration instead of the
10914 container interface.
10916 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10918 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10919 `set_indexer_name' to the pending bits (one per type).
10921 We fixed a bug today that was picking the wrong method to
10922 override, since for properties the existing InterfaceMethod code
10923 basically ignored the method name. Now we make sure that the
10924 method name is one of the valid indexer names.
10926 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10928 * support.cs (SeekableStreamReader): Keep track of stream byte
10929 positions and don't mix them with character offsets to the buffer.
10931 Patch from Gustavo Giráldez
10933 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10935 * interface.cs (InterfaceSetGetBase): Removed double member
10936 initialization, base class does it as well.
10938 2004-03-13 Martin Baulig <martin@ximian.com>
10940 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10941 when compiling corlib.
10943 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10945 * convert.cs (ExplicitConversion): We were reporting an error on
10946 certain conversions (object_type source to a value type, when the
10947 expression was `null') before we had a chance to pass it through
10948 the user defined conversions.
10950 * driver.cs: Replace / and \ in resource specifications to dots.
10953 * class.cs: Add check for duplicate operators. Fixes 52477
10955 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10957 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10958 that are in the middle of the statements, not only at the end.
10961 * class.cs (TypeContainer.AddField): No longer set the
10962 `HaveStaticConstructor' flag, now we call it
10963 `UserDefineStaticConstructor' to diferentiate the slightly
10964 semantic difference.
10966 The situation is that we were not adding BeforeFieldInit (from
10967 Modifiers.TypeAttr) to classes that could have it.
10968 BeforeFieldInit should be set to classes that have no static
10973 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10975 And most importantly Zoltan's comment:
10977 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10979 "I think beforefieldinit means 'it's ok to initialize the type sometime
10980 before its static fields are used', i.e. initialization does not need
10981 to be triggered by the first access to the type. Setting this flag
10982 helps the JIT to compile better code, since it can run the static
10983 constructor at JIT time, and does not need to generate code to call it
10984 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10985 this flag for lots of classes like String.
10987 csc sets this flag if the type does not have an explicit static
10988 constructor. The reasoning seems to be that if there are only static
10989 initalizers for a type, and no static constructor, then the programmer
10990 does not care when this initialization happens, so beforefieldinit
10993 This bug prevents the AOT compiler from being usable, since it
10994 generates so many calls to mono_runtime_class_init that the AOT code
10995 is much slower than the JITted code. The JITted code is faster,
10996 because it does not generate these calls if the vtable is type is
10997 already initialized, which is true in the majority of cases. But the
10998 AOT compiler can't do this."
11000 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11002 * class.cs (MethodData.Emit): Refactor the code so symbolic
11003 information is generated for destructors; For some reasons we
11004 were taking a code path that did not generate symbolic information
11007 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11009 * class.cs: Create a Constructor.CheckBase method that
11010 takes care of all validation type code. The method
11011 contains some code that was moved from Define.
11013 It also includes new code that checks for duplicate ctors.
11014 This fixes bug #55148.
11016 2004-03-09 Joshua Tauberer <tauberer@for.net>
11018 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11019 a { ... }-style array creation invokes EmitStaticInitializers
11020 which is not good for reference-type arrays. String, decimal
11021 and now null constants (NullCast) are not counted toward
11022 static initializers.
11024 2004-03-05 Martin Baulig <martin@ximian.com>
11026 * location.cs (SourceFile.HasLineDirective): New public field;
11027 specifies whether the file contains or is referenced by a "#line"
11029 (Location.DefineSymbolDocuments): Ignore source files which
11030 either contain or are referenced by a "#line" directive.
11032 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11034 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11035 direct access to our parent, so check the method inline there.
11037 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11039 * expression.cs (Invocation.EmitCall): Miguel's last commit
11040 caused a regression. If you had:
11045 In Foo the implict this would be null.
11047 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11049 * expression.cs (Invocation.EmitCall): If the method is not
11050 virtual, do not emit a CallVirt to it, use Call.
11052 * typemanager.cs (GetFullNameSignature): Improve the method to
11053 cope with ".ctor" and replace it with the type name.
11055 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11056 as an argument the ConstructorBuilder where it is being defined,
11057 to catch the recursive constructor invocations.
11059 2004-03-16 Martin Baulig <martin@ximian.com>
11061 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11062 ConstructedType, call ResolveType() on it to get the type rather
11063 than just using `expr.Type'.
11065 2004-03-16 Martin Baulig <martin@ximian.com>
11067 * generics.cs (ConstructedType.GetMemberAccess): Take the
11068 EmitContext instead on the TypeExpr and use
11069 ec.TypeContainer.CurrentType/ec.ContainerType.
11071 2004-03-16 Martin Baulig <martin@ximian.com>
11073 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11074 parameters before aliases.
11076 2004-03-16 Martin Baulig <martin@ximian.com>
11078 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11079 New oublic function; checks whether two generic instances may become
11080 equal under some instantiations (26.3.1).
11082 * class.cs (TypeContainer.Define): Call
11083 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11086 2004-03-16 Martin Baulig <martin@ximian.com>
11088 * class.cs (TypeContainer.GetClassBases): Moved
11089 Error_TypeParameterAsBase() here and also check whether the base
11090 class is not an attribute.
11092 2004-03-16 Martin Baulig <martin@ximian.com>
11094 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11096 2004-03-16 Martin Baulig <martin@ximian.com>
11098 * class.cs (Error_TypeParameterAsBase): Use correct error number
11101 2004-03-16 Martin Baulig <martin@ximian.com>
11103 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11106 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11109 2004-03-15 Martin Baulig <martin@ximian.com>
11111 * typemanager.cs (TypeManager.GetFullName): New public method.
11112 (TypeManager.MemberLookup): Added `int_num_type_arguments'
11113 argument; only return members with the correct number of type
11115 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11116 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11117 whether the number of type arguments matches.
11119 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11120 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11122 * expression.cs (MemberAccess): Added public `NumTypeArguments'
11123 field; it's set by the protected .ctor when we're actually a
11124 GenericMemberAccess.
11125 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11126 arguments and pass it to MemberLookupFinal ().
11128 * ecore.cs (Expression.MemberLookup): Added `int
11129 num_type_arguments' argument; only return members with the correct
11130 number of type arguments.
11131 (Expression.MemberLookupFailed): Check whether the MemberLookup
11132 failed because we did not have the correct number of type
11133 arguments; report CS0305 in this case.
11135 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11136 `e.ResolveAsTypeTerminal()' already did so.
11138 2004-03-15 Martin Baulig <martin@ximian.com>
11140 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11141 we're a ConstructedType; in this case, the caller must report an
11142 error (for instance CS0131).
11144 * generic.cs (TypeArguments): Added Location argument to the .ctor.
11145 (TypeArguments.Resolve): Actually report errors here.
11147 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11149 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11150 `set_indexer_name' to the pending bits (one per type).
11152 We fixed a bug today that was picking the wrong method to
11153 override, since for properties the existing InterfaceMethod code
11154 basically ignored the method name. Now we make sure that the
11155 method name is one of the valid indexer names.
11157 2004-03-15 Martin Baulig <martin@ximian.com>
11159 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11160 for generic instances.
11162 2004-03-13 Martin Baulig <martin@ximian.com>
11164 * class.cs (TypeContainer.DefineType): Call
11165 TypeManager.AddUserType() immediately after creating the
11166 TypeBuilder; pass all type parameters when creating the
11169 * decl.cs (DeclSpace.FindNestedType): New public method.
11170 (DeclSpace.FindType): Added `int num_type_args' argument; only
11171 return types with the correct number of type parameters.
11172 (DeclSpace.CountTypeParams): New public property.
11174 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11175 the number of type parameters; defaults to zero.
11177 * generic.cs (TypeArguments.Count): New public property.
11178 (ConstructedType.DoResolveAsTypeStep): First call
11179 ds.FindNestedType() to find out whether we're nested in the
11180 current generic type; in this case, we inherit all type parameters
11181 from the current class.
11183 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11184 num_type_args' argument.
11185 (RootContext.LookupType): Added overloaded version which takes the
11186 number of type arguments; only return types with the correct
11187 number of type arguments.
11189 * typemanager.cs (TypeManager.CheckGeneric): New public function;
11190 checks whether `Type t' has `int num_type_args'.
11192 2004-03-13 Martin Baulig <martin@ximian.com>
11194 * generic.cs (GenericMethod.DefineType): New method; calls
11195 DefineType() on all the type parameters.
11197 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11198 (MethodData.Define): If we're a generic method, call
11199 GenericMethod.DefineType() to define the type parameters.
11201 2004-03-10 Martin Baulig <martin@ximian.com>
11203 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11204 instead of IsAssignableFrom.
11206 2004-03-10 Martin Baulig <martin@ximian.com>
11208 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11210 * support.cs (ParameterData.HasArrayParameter): New property.
11211 (ReflectionParameters.ctor): Take a MethodBase instead of a
11212 ParameterInfo[]. If we have any type parameters, get the generic
11213 method definition and ask it whether we have variable arguments.
11215 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11217 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11218 routines to check if a type is an enumerable/enumerator allow
11219 classes that implement the IEnumerable or IEnumerator interfaces.
11221 * class.cs (Property, Operator): Implement IIteratorContainer, and
11222 implement SetYields.
11224 (Property.Define): Do the block swapping for get_methods in the
11225 context of iterators. We need to check if Properties also
11226 include indexers or not.
11228 (Operator): Assign the Block before invoking the
11229 OperatorMethod.Define, so we can trigger the Iterator code
11232 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11233 Property and Operator classes are not created when we parse the
11234 declarator but until we have the block completed, so we use a
11235 singleton SimpleIteratorContainer.Simple to flag whether the
11236 SetYields has been invoked.
11238 We propagate this setting then to the Property or the Operator to
11239 allow the `yield' to function.
11241 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11243 * codegen.cs: Implemented attribute support for modules.
11244 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11245 Assembly/Module functionality.
11247 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11248 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11249 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11251 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11253 * interface.cs (FindMembers): The operation is performed on all base
11254 interfaces and not only on the first. It is required for future CLS Compliance patch.
11256 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11258 * statement.cs, codegen.cs:
11259 This patch deals with patterns such as:
11261 public class List : IEnumerable {
11263 public MyEnumerator GetEnumerator () {
11264 return new MyEnumerator(this);
11267 IEnumerator IEnumerable.GetEnumerator () {
11271 public struct MyEnumerator : IEnumerator {
11276 Before, there were a few things we did wrong:
11277 1) we would emit callvirt on a struct, which is illegal
11278 2) we emited ldarg when we needed to emit ldarga
11279 3) we would mistakenly call the interface methods on an enumerator
11280 type that derived from IEnumerator and was in another assembly. For example:
11282 public class MyEnumerator : IEnumerator
11284 Would have the interface methods called, even if there were public impls of the
11285 method. In a struct, this lead to invalid IL code.
11287 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11289 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11292 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11294 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11296 * cs-parser.jay: Fix small regression: we were not testing V2
11297 compiler features correctly.
11299 * interface.cs: If the emit context is null, then create one
11301 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11303 * decl.cs (GetSignatureForError): New virtual method to get full name
11304 for error messages.
11306 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11307 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11309 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11310 Duplicated members and code in these classes has been removed.
11311 Better encapsulation in these classes.
11313 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11315 * assign.cs (Assign.DoResolve): When dealing with compound
11316 assignments, there is a new rule in ECMA C# 2.4 (might have been
11317 there before, but it is documented here) that states that in:
11321 If b is of type int, and the `op' is a shift-operator, then the
11322 above is evaluated as:
11326 * expression.cs (Binary.ResolveOperator): Instead of testing for
11327 int/uint/long/ulong, try to implicitly convert to any of those
11328 types and use that in pointer arithmetic.
11330 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11331 method to print information for from the type, not from the
11332 null-method we were given.
11334 2004-02-01 Duncan Mak <duncan@ximian.com>
11336 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11337 parsing for cmd, fixes bug #53694.
11339 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11341 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11342 in the member name duplication tests. Property and operator name duplication
11343 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11345 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11347 * interface.cs (PopulateMethod): Fixed crash when interface method
11348 returns not existing type (error test cs0246-3.cs).
11350 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11352 * cs-parser.jay (interface_accessors): Re-write actions to also
11353 store attributes attached to get and set methods. Fix spelling
11356 (inteface_property_declaration): Modify accordingly.
11358 (InterfaceAccessorInfo): New helper class to store information to pass
11359 around between rules that use interface_accessors.
11361 * interface.cs (Emit): Apply attributes on the get and set
11362 accessors of properties and indexers too.
11364 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11365 right MethodBuilder when applying attributes to the get and set accessors.
11367 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11369 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11371 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11373 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11375 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11377 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11378 changes that treat `yield' specially when present before `break'
11379 or `return' tokens.
11381 * cs-tokenizer.cs: yield is no longer a keyword.
11383 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11385 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11386 setting for default constructors.
11387 For default constructors are almost every time set wrong Modifier. The
11388 generated IL code has been alright. But inside mcs this values was
11389 wrong and this was reason why several of my CLS Compliance tests
11392 2004-02-27 Martin Baulig <martin@ximian.com>
11394 * generics.cs (ConstructedType.ResolveType): Make the nested type
11395 stuff actually work.
11397 2004-02-25 Martin Baulig <martin@ximian.com>
11399 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11400 property; returns the type parameters just from the current type,
11401 ie. with the ones from outer classes.
11402 (DeclSpace.LookupGeneric): First search in the current class, then
11404 (DeclSpace.initialize_type_params): When hiding a type parameter
11405 from an outer class, put it into the `type_param_list' anyways.
11407 * expression.cs (MemberAccess.expr): Made this field protected.
11409 * class.cs (TypeContainer.Define): The `CurrentType' just contains
11410 the type parameters from the current class.
11412 * generic.cs (ConstructedType.ResolveType): Support nested generic
11413 types by taking the type parameters which we inherit from outer
11414 classes into account.
11415 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11416 support for nested generic types.
11418 2004-02-23 Martin Baulig <martin@ximian.com>
11420 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11421 field and check whether we're nested inside a generic type.
11422 (DeclSpace.ResolveType): If we're resolving to a generic type
11423 definition, create a ConstructedType and return its resolved type.
11424 (DeclSpace.initialize_type_params): New private method;
11425 initializes the `type_param_list' field from the type parameters
11426 from this and all enclosing classes.
11427 (DeclSpace.TypeParameters): Call initialize_type_params() unless
11428 we're already initialized.
11430 2004-02-23 Martin Baulig <martin@ximian.com>
11432 * class.cs (Method.Define): Create the generic method before
11433 calling DoDefine().
11434 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11435 the TypeContainer one); we use this for generic methods.
11437 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11438 parent's TypeBuilder.
11440 2004-02-18 Martin Baulig <martin@ximian.com>
11442 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11443 to check for equality.
11445 2004-02-05 Martin Baulig <martin@ximian.com>
11447 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11448 `ec.TypeContainer.CurrentType', use it instead of
11449 `ec.ContainerType' to check whether we're in the type's ctor.
11451 2004-01-29 Martin Baulig <martin@ximian.com>
11453 * expression.cs (Invocation.DoResolve): If we're a
11454 `ConstructedType', then we're actually a generic method, so
11455 rewrite the expr as a GenericMemberAccess.
11457 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11458 here; manually parse it into a string.
11460 2004-01-28 Martin Baulig <martin@ximian.com>
11462 * typemanager.cs (TypeManager.IsEqual): New static method.
11463 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11464 check for equality instead of using `=='.
11466 2004-01-26 Martin Baulig <martin@ximian.com>
11468 * decl.cs (DeclSpace.CurrentType): New public field.
11470 * expression.cs (This.ResolveBase): If we have an
11471 `ec.TypeContainer.CurrentType', use it instead of
11472 `ec.ContainerType'.
11474 * class.cs (TypeContainer.DefineType): If we're a generic type,
11475 create the `CurrentType' (unresolved).
11476 (TypeContainer.GenericType): New private field.
11477 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11478 it and store it in `GenericType' before creating the MemberCache.
11479 (TypeContainer.GetMembers): If we have a `GenericType', call
11480 TypeManager.FindMembers() on it.
11482 * interface.cs (Interface.GenericType): New private field.
11483 (Interface.DefineType): If we're a generic type, create the
11484 `CurrentType' (unresolved).
11485 (Interface.DefineMembers): If we have a `CurrentType', resolve it
11486 and store it in `GenericType' before creating the MemberCache.
11487 (Interface.GetMembers): If we have a `GenericType', call
11488 TypeManager.FindMembers() on it.
11490 2004-01-22 Martin Baulig <martin@ximian.com>
11492 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11493 not a QualifiedIdentifier. This is what `type_name_expression'
11494 was previously doing.
11495 (type_name_expression): Removed; the code is now in
11496 `namespace_or_type_name'.
11497 (qualified_identifier): Removed, use `namespace_or_type_name'
11499 (QualifiedIdentifier): Removed this class.
11501 2004-01-22 Martin Baulig <martin@ximian.com>
11503 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11504 not a string as alias name.
11506 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11508 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11509 #52730 bug, and instead compute correctly the need to use a
11510 temporary variable when requesting an address based on the
11511 static/instace modified of the field and the constructor.
11513 2004-01-21 Martin Baulig <martin@ximian.com>
11515 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11516 class and namespace before looking up aliases. Fixes #52517.
11518 2004-01-21 Martin Baulig <martin@ximian.com>
11520 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11521 assinged in a 'try'; fixes exception4.cs.
11523 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11524 * class.cs : Implemented parameter-less constructor for TypeContainer
11526 * decl.cs: Attributes are now stored here. New property OptAttributes
11528 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11530 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11532 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11534 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11535 (CSharpSignature): New method for indexer and property signature.
11537 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11539 * pending.cs (IsVirtualFilter): Faster implementation.
11541 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11543 * typemanager.cs: Avoid inclusion of same assembly more than once.
11545 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11547 * cs-parser.jay: Fixed problem where the last assembly attribute
11548 has been applied also to following declaration (class, struct, etc.)
11550 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11552 * class.cs: Added error CS0538, CS0539 reporting.
11553 Fixed crash on Microsoft runtime when field type is void.
11555 * cs-parser.jay: Added error CS0537 reporting.
11557 * pending.cs: Added error CS0535 reporting.
11558 Improved error report for errors CS0536, CS0534.
11560 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11562 Merge a few bits from the Anonymous Method MCS tree.
11564 * statement.cs (ToplevelBlock): New class for toplevel methods,
11565 will hold anonymous methods, lifted variables.
11567 * cs-parser.jay: Create toplevel blocks for delegates and for
11568 regular blocks of code.
11570 2004-01-20 Martin Baulig <martin@ximian.com>
11572 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11573 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11574 and `NeedExplicitReturn'; added `IsLastStatement'.
11575 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11576 have a `ReturnLabel' or we're not unreachable.
11578 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11579 child's reachability; don't just override ours with it. Fixes
11580 #58058 (lluis's example).
11581 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11582 InFinally(), InLoop(), InSwitch() and
11583 BreakCrossesTryCatchBoundary() methods.
11585 * statement.cs (Return): Do all error checking in Resolve().
11586 Unless we are the last statement in a top-level block, always
11587 create a return label and jump to it.
11588 (Break, Continue): Do all error checking in Resolve(); also make
11589 sure we aren't leaving a `finally'.
11590 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11591 statement in a top-level block.
11592 (Block.Flags): Added `IsDestructor'.
11593 (Block.IsDestructor): New public property.
11595 2004-01-20 Martin Baulig <martin@ximian.com>
11597 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11599 2004-01-20 Martin Baulig <martin@ximian.com>
11601 * statement.cs (Statement.ResolveUnreachable): New public method.
11602 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11603 (Block.Resolve): Resolve unreachable statements.
11605 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11607 * expression.cs: We need to fix the case where we do
11608 not have a temp variable here.
11610 * assign.cs: Only expression compound assignments need
11611 temporary variables.
11613 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11615 * flowanalysis.cs: Reduce memory allocation in a few ways:
11616 - A block with no variables should not allocate a bit
11618 - A method with no out parameters does not need any tracking
11619 for assignment of the parameters, so we need not allocate
11622 public readonly Type[] VariableTypes;
11623 public readonly string[] VariableNames;
11624 Are redundant. The data is already stored in the variable
11625 map, so we need not allocate another array for it.
11626 - We need to add alot of checks for if (params | locals) == null
11627 due to the first two changes.
11629 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11631 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11632 implement IMemoryLocation, we store a copy on a local variable and
11633 take the address of it. Patch from Benjamin Jemlich
11635 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11636 to use a special "type_name_expression" rule which reduces the
11637 number of "QualifiedIdentifier" classes created, and instead
11638 directly creates MemberAccess expressions.
11640 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11642 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11643 that fixes #52853. Null literal assignment to ValueType
11645 * class.cs (MethodData.Emit): Instead of checking the name of the
11646 method to determine if its a destructor, create a new derived
11647 class from Method called Destructor, and test for that.
11649 * cs-parser.jay: Create a Destructor object instead of a Method.
11651 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11655 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11657 * expression.cs (Binary.ResolveOperator): Perform an implicit
11658 conversion from MethodGroups to their delegate types on the
11659 Addition operation.
11661 * delegate.cs: Introduce a new class DelegateCreation that is the
11662 base class for `NewDelegate' and `ImplicitDelegateCreation',
11663 factor some code in here.
11665 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11666 conversion from MethodGroups to compatible delegate types.
11668 * ecore.cs (Expression.Resolve): Do not flag error 654
11669 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11670 we allow conversions from MethodGroups to delegate types now.
11672 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11673 assignments in v2 either.
11675 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11677 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11678 static read-only fields in ctors.
11680 Applied patch from Benjamin Jemlich
11682 * expression.cs (UnaryMutator): Avoid leaking local variables.
11684 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11686 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11687 here to return true, as they can be used like this:
11689 (XXX) int.MEMBER ()
11691 Fixed 49836 and all the other dups
11693 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11695 * driver.cs: Implement /win32res and /win32icon.
11697 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11699 * cs-parser.jay: Add a rule to improve error handling for the
11700 common mistake of placing modifiers after the type.
11702 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11704 * cs-parser.jay (interface_event_declaration): Catch
11705 initialization of events on interfaces, and report cs0068
11707 * cs-parser.jay (interface_event_declaration): Catch
11708 initialization of events.
11710 * ecore.cs: Better report missing constructors.
11712 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11713 the error reporting done in the wrong place. Fix.
11715 * expression.cs (Binary.ResolveOperator): Catch the
11716 operator + (E x, E y) error earlier, and later allow for implicit
11717 conversions in operator +/- (E e, U x) from U to the underlying
11720 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11721 52596, if the container class is abstract, the default constructor
11722 is protected otherwise its public (before, we were always public).
11724 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11727 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11728 Jemlich that fixes bug #52597, MCS was generating invalid code for
11729 idisposable structs. Thanks to Ben for following up with this
11732 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11734 * driver.cs: Allow assemblies without code to be generated, fixes
11737 2004-01-07 Nick Drochak <ndrochak@gol.com>
11739 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11741 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11743 * cs-parser.jay: Add rules to improve error reporting if fields or
11744 methods are declared at the namespace level (error 116)
11746 * Add rules to catch event add/remove
11748 2004-01-04 David Sheldon <dave-mono@earth.li>
11750 * expression.cs: Added matching ")" to error message for
11753 2004-01-03 Todd Berman <tberman@gentoo.org>
11755 * ecore.cs, attribute.cs:
11756 Applying fix from #52429.
11758 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11760 * ecore.cs, expression.cs, statement.cs:
11761 Total rewrite of how we handle branching. We
11762 now handle complex boolean expressions with fewer
11763 jumps. As well if (x == 0) no longer emits a ceq.
11765 if (x is Foo) is much faster now, because we generate
11768 Overall, we get a pretty big improvement on our benchmark
11769 tests. The code we generate is smaller and more readable.
11771 I did a full two-stage bootstrap. The patch was reviewed
11772 by Martin and Miguel.
11774 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11776 * cs-parser.jay: Make primary_expression not take a QI.
11777 we dont need this because the member_access rule covers
11778 us here. So we replace the rule with just IDENTIFIER.
11780 This has two good effects. First, we remove a s/r conflict.
11781 Second, we allocate many fewer QualifiedIdentifier objects.
11783 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11785 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11786 set the correct information via SRE. This prevents
11787 hanging on the MS runtime. Fixes #29374.
11789 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11791 * convert.cs: correctly handle conversions to value types
11792 from Enum and ValueType as unboxing conversions.
11794 Fixes bug #52569. Patch by Benjamin Jemlich.
11796 2004-01-02 Ravi Pratap <ravi@ximian.com>
11798 * expression.cs (BetterConversion): Prefer int -> uint
11799 over int -> ulong (csc's behaviour). This fixed bug #52046.
11801 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11803 * decl.cs (MemberCache.FindMembers): now returns a
11806 * typemanager.cs: In general, go with with ^^.
11807 (CopyNewMethods): take an IList.
11808 (RealMemberLookup): Only allocate an arraylist
11809 if we copy from two sets of methods.
11811 This change basically does two things:
11812 1) Fewer array lists allocated due to CopyNewMethods.
11813 2) the explicit cast in MemberList costed ALOT.
11815 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11817 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11818 a hashtable to avoid needless string allocations when an identifier is
11819 used more than once (the common case).
11821 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11823 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11824 is broken, it will not return anything. So, we
11825 have to use the information we have in mcs to
11828 * typemanager.cs: Add a cache for GetInterfaces,
11829 since this will now be used more often (due to ^^)
11831 (GetExplicitInterfaces) New method that gets the
11832 declared, not effective, interfaces on a type
11833 builder (eg, if you have interface IFoo, interface
11834 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11837 This patch makes MCS able to bootstrap itself on
11840 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11842 * expression.cs: Remove the Nop's that Miguel put
11845 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11847 * report.cs, codegen.cs: Give the real stack trace to
11848 the error when an exception is thrown.
11850 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11852 * decl.cs: only allocate hashtables for ifaces if
11855 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11857 * expression.cs: fix the error from cs0121-2.cs
11858 (a parent interface has two child interfaces that
11859 have a function with the same name and 0 params
11860 and the function is called through the parent).
11862 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11864 * class.cs, rootcontext.cs, typmanager.cs: do not
11867 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11869 * codegen.cs: remove stack for the ec flow branching.
11870 It is already a linked list, so no need.
11872 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11874 * Makefile: Allow custom profiler here.
11876 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11878 * typemanager.cs (LookupType):
11879 - Use a static char [], because split takes
11880 a param array for args, so it was allocating
11882 - Do not store true in a hashtable, it boxes.
11884 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11886 * flowanalysis.cs: bytify common enums.
11888 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11890 * modifiers.cs: Add a new set of flags for the
11891 flags allowed on explicit interface impls.
11892 * cs-parser.jay: catch the use of modifiers in
11893 interfaces correctly.
11894 * class.cs: catch private void IFoo.Blah ().
11896 All related to bug #50572.
11898 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11900 * decl.cs: Rewrite the consistant accessability checking.
11901 Accessability is not linear, it must be implemented in
11902 a tableish way. Fixes #49704.
11904 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11906 * expression.cs: Handle negation in a checked context.
11907 We must use subtraction from zero. Fixes #38674.
11909 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11911 * class.cs: Ignore static void main in DLLs.
11912 * rootcontext.cs: Handle the target type here,
11913 since we are have to access it from class.cs
11914 * driver.cs: account for the above.
11916 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11918 * report.cs: Give line numbers and files if available.
11920 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11922 * driver.cs: Implement /addmodule.
11924 * typemanager.cs: Change 'modules' field so it now contains Modules not
11927 2003-12-20 Martin Baulig <martin@ximian.com>
11929 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11930 (FieldBase.IsAssigned): Removed this field.
11931 (FieldBase.SetAssigned): New public method.
11932 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11934 2003-12-20 Martin Baulig <martin@ximian.com>
11936 * expression.cs (LocalVariableReference.DoResolve): Don't set
11937 `vi.Used' if we're called from DoResolveLValue().
11939 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11940 returns the usage vector it just merged into the current one -
11941 pass this one to UsageWarning().
11942 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11943 of the `EmitContext', don't call this recursively on our children.
11945 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11947 * driver.cs: Implement /target:module.
11949 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11951 * support.cs (CharArrayHashtable): New helper class.
11953 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11954 char arrays, not strings, so we can avoid creating a string in
11955 consume_identifier if the identifier is a keyword.
11957 2003-12-16 Martin Baulig <martin@ximian.com>
11959 * statement.cs (LocalInfo.Assigned): Removed this property.
11960 (LocalInfo.Flags): Removed `Assigned'.
11961 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11962 and uses flow analysis.
11963 (Block.UsageWarning): Made this method private.
11964 (Block.Resolve): Call UsageWarning() if appropriate.
11966 * expression.cs (LocalVariableReference.DoResolve): Always set
11967 LocalInfo.Used here.
11969 2003-12-13 Martin Baulig <martin@ximian.com>
11971 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11972 any value here; we're now using flow analysis to figure out
11973 whether a statement/block returns a value.
11975 2003-12-13 Martin Baulig <martin@ximian.com>
11977 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11979 (FlowBranching.MergeFinally): Don't call
11980 `branching.CheckOutParameters()' here, this is called in
11982 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11983 when adding the `finally' vector.
11985 2003-12-13 Martin Baulig <martin@ximian.com>
11988 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11989 actually work and also fix #48962.
11991 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11993 * decl.cs: Do not check System.Object for nested types,
11994 since we know it does not have any. Big bang for buck:
11997 Run 1: 8.35 seconds
11998 Run 2: 8.32 seconds
11999 corlib: 17.99 seconds
12001 Run 1: 8.17 seconds
12002 Run 2: 8.17 seconds
12003 corlib: 17.39 seconds
12005 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12007 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12008 time we are returning 0 members, so we save alot here.
12010 2003-12-11 Martin Baulig <martin@ximian.com>
12012 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12013 `MergeChild()', also just take the `FlowBranching' as argument;
12014 call Merge() on it and return the result.
12015 (FlowBranching.Merge): We don't need to do anything if we just
12018 2003-12-11 Martin Baulig <martin@ximian.com>
12020 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12021 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12022 Maurer for this idea.
12024 2003-12-11 Martin Baulig <martin@ximian.com>
12026 * flowanalysis.cs (MergeResult): This class is now gone; we now
12027 use the `UsageVector' for this. The reason for this is that if a
12028 branching just has one sibling, we don't need to "merge" them at
12029 all - that's the next step to do.
12030 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12033 2003-12-11 Martin Baulig <martin@ximian.com>
12035 Reworked flow analyis and made it more precise and bug-free. The
12036 most important change is that we're now using a special `Reachability'
12037 class instead of having "magic" meanings of `FlowReturns'. I'll
12038 do some more cleanups and optimizations and also add some more
12039 documentation this week.
12041 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12042 largely reworked this class.
12043 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12044 the new `Reachability' class instead of having "magic" values here.
12045 (FlowBranching): We're now using an instance of `Reachability'
12046 instead of having separate `Returns', `Breaks' etc. fields.
12048 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12049 based on flow analysis; ignore the return value of block.Emit ().
12051 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12053 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12054 if they are private.
12056 2003-12-09 Martin Baulig <martin@ximian.com>
12058 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12059 call them directly on the UsageVector.
12061 2003-12-09 Martin Baulig <martin@ximian.com>
12063 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12064 Changed return type from `FlowReturns' to `Reachability'.
12066 2003-12-09 Martin Baulig <martin@ximian.com>
12068 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12069 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12070 `Reachable' fields with a single `Reachability' one.
12072 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12074 * class.cs (FindMembers): Remove foreach's.
12079 Run 1: 8.74 seconds
12080 Run 2: 8.71 seconds
12083 Run 1: 8.64 seconds
12084 Run 2: 8.58 seconds
12087 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12092 This patch does a few things:
12093 1. EmptyStatement is now a singleton, so it is never reallocated.
12094 2. All blah is EmptyStatement constructs have been changed to
12095 blah == EmptyStatement.Value, which is much faster and valid
12096 now that EmptyStatement is a singleton.
12097 3. When resolving a block, rather than allocating a new array for
12098 the non-empty statements, empty statements are replaced with
12099 EmptyStatement.Value
12100 4. Some recursive functions have been made non-recursive.
12101 Mainly the performance impact is from (3), however (1) and (2) are needed for
12102 this to work. (4) does not make a big difference in normal situations, however
12103 it makes the profile look saner.
12108 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12109 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12110 Total memory allocated: 56397 KB
12113 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12114 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12115 Total memory allocated: 55666 KB
12117 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12119 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12120 than the hashtable in a hashtable version
12122 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12123 we always end up concating a string. This results in a huge perf
12124 loss, because many strings have to be tracked by the GC. In this
12125 patch, we first use a hashtable that works with two keys, so that
12126 the strings do not need to be concat'ed.
12130 Run 1: 8.74 seconds
12131 Run 2: 8.71 seconds
12134 Run 1: 8.65 seconds
12135 Run 2: 8.56 seconds
12137 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12139 * Makefile: Add a new target `do-time' that does a quick and simple
12140 profile, leaving easy to parse output.
12142 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12144 * codegen.cs (Init): Create the dynamic assembly with
12145 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12147 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12149 * support.cs: Make the PtrHashtable use only one
12150 instance of its comparer.
12152 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12154 * typemanager.cs: Fix lookup of GetNamespaces.
12156 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12158 * expression.cs: Removed redundant line.
12160 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12161 ArrayLists, use for loops with bounds.
12163 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12166 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12167 arraylists, use for loop with bounds.
12169 The above three changes give us a 0.071 second performance
12170 improvement out of 3.294 seconds down to 3.223. On my machine
12171 the above changes reduced the memory usage by 1,387 KB during
12172 compiler bootstrap.
12174 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12175 QualifiedIdentifiers. Before we created a new string through
12176 concatenation, and mostly later on, the result would be
12177 manipulated by DecomposeQI through string manipulation.
12179 This reduced the compiler memory usage for bootstrapping from
12180 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12181 compile times in 0.05 seconds.
12183 2003-11-28 Dick Porter <dick@ximian.com>
12185 * support.cs: Do string compares with the Invariant culture.
12193 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12194 the comparison is done with the Invariant culture.
12196 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12198 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12199 GetEnumerator method.
12201 (ProbeCollectionType): Iterate starting at the most specific type
12202 upwards looking for a GetEnumerator
12204 * expression.cs: Shift count can be up to 31 for int/uint and 63
12207 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12209 * statement.cs (Block.LookupLabel): Also look for the label on the
12210 children blocks. Use a hash table to keep track of visited
12213 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12214 we actually did transform the other operand, otherwise fall back
12215 to the common codepath that casts to long.
12217 * cs-tokenizer.cs: Use the same code pattern as the int case.
12218 Maybe I should do the parsing myself, and avoid depending on the
12219 Parse routines to get this done.
12221 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12223 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12224 which fixes bug 51347. This time test it.
12226 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12227 attributes for example can not tell the difference between these.
12228 The difference was only a syntax feature of the language.
12230 * attribute.cs: Apply attributes to delegates.
12232 * delegate.cs: Call the apply attributes method.
12234 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12236 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12237 comparing 0 vs Byte.MinValue, not the value
12239 (ImplicitConversionRequired): When reporting a conversion error,
12240 use error 31 to print out the constant error instead of the
12243 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12244 which fixes bug 51347.
12246 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12248 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12249 which fixes the -warnaserror command line option.
12251 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12253 * cfold.cs (DoNumericPromotions): During constant folding of
12254 additions on UIntConstant, special case intconstants with
12255 IntConstants like we do on the expression binary operator.
12257 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12259 * convert.cs (ImplicitReferenceConversion): We were missing a case
12260 (System.Enum are not value types or class types, so we need to
12261 classify them separatedly).
12263 * driver.cs: We do not support error 2007.
12265 2003-11-12 Jackson Harper <jackson@ximian.com>
12267 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12268 system directory. Also use the full file name so users can
12269 libraries names mscorlib-o-tron.dll in a non system dir.
12271 2004-01-04 David Sheldon <dave-mono@earth.li>
12273 * expression.cs: Added matching ")" to error message for CS0077.
12275 2003-12-19 Martin Baulig <martin@ximian.com>
12277 * typemanager.cs (TypeManager.IsEqualGenericType): New public
12278 static method; see documentation in the method.
12279 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12281 * convert.cs (Convert.ImplicitReferenceConversion,
12282 Convert.ImplicitReferenceConversionExists): Add support for
12283 generic type declarations; see gen-36.cs.
12285 2003-12-19 Martin Baulig <martin@ximian.com>
12287 * pending.cs (Pending.InterfaceMethod): Use
12288 `Type.IsAssignableFrom()' instead of `=='.
12290 2003-12-18 Martin Baulig <martin@ximian.com>
12292 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12295 * convert.cs (Convert.ImplicitStandardConversionExists): Use
12296 `expr_type.Equals (target_type)' instead of `=='.
12298 2003-12-08 Martin Baulig <martin@ximian.com>
12300 * generics.cs (Constraints.Types): Removed.
12301 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12303 (Constraints.ResolveTypes): New public method; resolves the
12304 TypeExpr's to Type's.
12305 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12306 longer takes the constraints.
12307 (TypeParameter.DefineMethod): Likewise.
12308 (TypeParameter.DefineType): New public method. Calls
12309 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12312 2003-12-08 Martin Baulig <martin@ximian.com>
12314 * convert.cs (Convert.ImplicitConversionStandard): Use
12315 `expr_type.Equals (target_type)' instead of `=='.
12317 2003-12-08 Martin Baulig <martin@ximian.com>
12319 * typemanager.cs (TypeManager.GetReferenceType): Call
12320 `Type.MakeByRefType ()'.
12322 2003-12-08 Martin Baulig <martin@ximian.com>
12324 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12325 just has some special meaning in some situations. For instance,
12326 it is allowed to use `where' as the name of a variable etc.
12328 2003-12-04 Martin Baulig <martin@ximian.com>
12330 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12331 `Type.MakeArrayType()' for array types.
12333 2003-11-18 Miguel de Icaza <miguel@ximian.com>
12335 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12338 (SizeOf.DoResolve): assign the `type_queried' field. This gets
12341 2003-11-16 Martin Baulig <martin@ximian.com>
12343 * codegen.cs (EmitContext.IsGeneric): Removed.
12345 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12346 ResolveGeneric() on the DeclSpace.
12348 2003-11-16 Martin Baulig <martin@ximian.com>
12350 * generic.cs (TypeArguments.Resolve):
12351 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12352 `ResolveType()' on it to get the Type.
12354 2003-11-15 Martin Baulig <martin@ximian.com>
12356 * generic.cs (ConstructedType.GetInterfaces): Override this.
12358 2003-11-14 Martin Baulig <martin@ximian.com>
12360 * interface.cs (Interface.DefineType): Define all type parameters
12361 before adding the interfaces we inherit.
12363 2003-11-11 Martin Baulig <martin@ximian.com>
12365 * generic.cs (ConstructedType.ResolveType): Always call
12366 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12368 2003-11-10 Martin Baulig <martin@ximian.com>
12370 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12371 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12372 calling `ResolveType()' on them, directly assign their `Type'.
12374 2003-11-08 Martin Baulig <martin@ximian.com>
12376 * generic.cs (ConstructedType): Override `IsClass' etc.
12378 2003-11-08 Martin Baulig <martin@ximian.com>
12380 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12381 return value and the `out parent' parameter.
12382 (TypeContainer.DefineType): Moved the CS0644 check into
12383 GetClassBases(). Don't pass the interface types to the
12384 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12385 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12387 * ecore.cs (TypeExpr.IsAttribute): New property.
12388 (TypeExpr.GetInterfaces): New method.
12390 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12391 TypeExpr instead of a Type.
12392 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12393 (Interface.DefineType): Don't pass the interface types to the
12394 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12395 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12397 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12398 instead of a `Type[]'.
12399 (TypeManager.RegisterBuilder): Likewise.
12400 (TypeManager.AddUserInterface): Likewise.
12401 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12402 `Type[]' and also return a `TypeExpr[]'.
12403 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12405 2003-11-08 Martin Baulig <martin@ximian.com>
12407 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12410 2003-11-08 Martin Baulig <martin@ximian.com>
12412 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12413 TypeManager.ResolveExpressionTypes().
12415 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12416 instead of an Expression.
12417 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12418 (TypeExpression): New public class; formerly known as `TypeExpr'.
12420 * expression.cs (ComposedCast): Derive from TypeExpr.
12422 * typemanager.cs (TypeManager.system_*_expr): These are now
12423 TypExpr's instead of Expression's.
12424 (TypeManager.ResolveExpressionTypes): New public static function;
12425 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12428 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12430 * expression.cs (New.DoResolve): Do not dereference value that
12431 might be a null return.
12433 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12434 sure that the constant value has the right type. Fixes an
12435 unreported bug, similar to 50425.
12437 * const.cs (Const.LookupConstantValue): Call
12438 ImplicitStandardConversionExists before doing a conversion to
12439 avoid havng the TypeManager.ChangeType do conversions.
12441 Reduced the number of casts used
12443 (Const.ChangeType): New routine to enable reuse of the constant
12444 type changing code from statement.
12446 * typemanager.cs (ChangeType): Move common initialization to
12447 static global variables.
12451 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12452 every value type to go through, even if it was void. Fix that.
12454 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12455 character of the define, and the is_identifier_part_character for
12456 the rest of the string.
12458 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12460 * expression.cs (UnaryMutator.EmitCode): When I updated
12461 LocalVariableReference.DoResolve, I overdid it, and dropped an
12462 optimization done on local variable references.
12464 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12466 * ecore.cs: Convert the return from Ldlen into an int.
12468 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12470 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12471 the accessibility, this is a special case for toplevel non-public
12472 classes (internal for instance).
12474 2003-10-20 Nick Drochak <ndrochak@gol.com>
12476 * ecore.cs: Fix typo and build. Needed another right paren.
12478 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12480 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12481 `internal' case regular and protected, but not allowing protected
12482 to be evaluated later. Bug 49840
12484 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12486 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12487 to kb.Nlast, and not the kb.nFirst to isolate the switch
12490 Extract the underlying type, so enumerations of long/ulong are
12491 treated like long/ulong.
12493 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12495 * expression.cs (New): Overload the meaning of RequestedType to
12496 track the possible creation of the NewDelegate type, since
12497 DoResolve is invoked more than once for new constructors on field
12500 See bugs: #48800 and #37014
12502 * cs-parser.jay (declare_local_constants): Take an arraylist
12503 instead of a single constant.
12505 (local_constant_declaration): It should take a
12506 constant_declarators, not a constant_declarator. Fixes 49487
12508 * convert.cs: Fix error report.
12510 2003-10-13 Jackson Harper <jackson@ximian.com>
12512 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12515 2003-11-03 Martin Baulig <martin@ximian.com>
12517 * expression.cs (ArrayAccess.GetStoreOpcode): Added
12518 `out bool has_type_arg'; if set, we need to pass the type to
12520 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12521 Stelem_Any/Ldelem_Any for generic parameters.
12523 2003-11-02 Martin Baulig <martin@ximian.com>
12525 * expression.cs (Invocation.EmitCall): Use
12526 `TypeManager.IsValueType()' to check whether it's a value type.
12527 Don't set `struct_call' when calling a method on a type parameter.
12529 2003-11-02 Martin Baulig <martin@ximian.com>
12531 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12532 and removed the TypeBuilder argument.
12534 * typemanager.cs (TypeManager.IsValueType): Return
12535 `t.IsGenericParameter || t.IsValueType'.
12537 2003-10-25 Martin Baulig <martin@ximian.com>
12539 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12540 call ConstructedType.Resolve() on it.
12542 * generic.cs (ConstructedType.Resolve): Set `type' on success.
12544 2003-10-25 Martin Baulig <martin@ximian.com>
12546 * class.cs (TypeContainer.GetClassBases): Changed
12547 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
12548 CS8214 reporting here.
12549 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12550 instead of a `Type' for our parent. In case of a recursive
12551 declaration (see tests/gen-23.cs for an example), our parent is a
12552 ConstructedType and it doesn't have its type set. So, first
12553 create our own TypeBuilder, then call constructed.Resolve() to get
12554 the parent's type and finally TypeBuilder.SetParent() it.
12556 * ecore.cs (TypeExpr.Name): New public virtual property.
12559 (ConstructedType): We're now a TypeExpr and not just an Expression.
12560 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12561 arguments here; this is done later.
12562 (ConstructedType.Resolve): New public method to resolve the type
12563 arguments and bind them.
12565 2003-10-21 Martin Baulig <martin@ximian.com>
12567 * convert.cs: Use `TypeManager.IsValueType' instead of
12568 'type.IsValueType' everywhere.
12570 * typemanager.cs (TypeManager.IsValueType): Return true for type
12571 parameters. The reason for this is that we need to box a type
12572 parameter when converting it to a reference type.
12574 * cs-parser.jay: Added support for default value expressions.
12576 * generics.cs (DefaultValueExpression): New public class.
12578 2003-10-17 Martin Baulig <martin@ximian.com>
12580 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12581 TypeContainer so we can also use this for Interfaces.
12582 (TypeParameter.Resolve): Likewise.
12584 * interface.cs (Interface.DefineType): Added support for generic
12587 * cs-parser.jay: Added support for generic structs and interfaces.
12589 2003-10-17 Martin Baulig <martin@ximian.com>
12591 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12592 call generic methods :-)
12594 2003-10-16 Martin Baulig <martin@ximian.com>
12596 * cs-parser.jay (namespace_or_type_name): Only create a
12597 GenericMemberAccess if we actually have type arguments.
12599 2003-10-13 Martin Baulig <martin@ximian.com>
12601 * class.cs (Method.Define): If we're a generic method, call
12602 TypeBuilder.DefineGenericMethod () before resolving
12604 (MethodData): Added .ctor which takes an additional MethodBuilder
12605 argument; this is used for generic methods.
12606 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12607 we already have a MethodBuilder.
12609 2003-10-10 Martin Baulig <martin@ximian.com>
12611 * class.cs (Method): Added .ctor which takes a `GenericMethod'
12612 instead of a `DeclSpace'. This is used for generic methods.
12614 * cs-parser.jay (method_header): Added support for generic
12615 methods; create a `GenericMethod' instance and pass it to the
12616 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12617 parameters and locals.
12619 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12620 since we already have the location. Check whether we're a generic
12621 type declaration or a generic method and create the correct type
12624 * generic.cs (TypeParameter.DefineMethod): New public method.
12625 (GenericMethod): New public class; derives from DeclSpace and is
12626 used for generic methods.
12628 2003-10-09 Martin Baulig <martin@ximian.com>
12630 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12632 (MethodCore.DoDefineParameters): Removed the TypeContainer
12633 argument; use the DeclSpace which was passed to the .ctor instead.
12634 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12635 TypeContainer; we only need a DeclSpace here.
12637 2003-10-09 Martin Baulig <martin@ximian.com>
12639 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12641 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12642 EmitContext's .ctor.
12644 2003-10-09 Martin Baulig <martin@ximian.com>
12646 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12647 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12648 AsAccessible(), moved them as well.
12650 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12652 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12654 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12655 generation for >=, as spotted by Paolo, bug 48679.
12656 Patch from David Waite.
12658 * cs-tokenizer.cs: Add handling for #pragma.
12660 * cs-parser.jay: Allow for both yield and yield return in the
12661 syntax. The anti-cobolization of C# fight will go on!
12663 * class.cs (TypeBuilder.DefineType): Catch error condition here
12664 (Parent.DefineType erroring out and returning null).
12666 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12667 coping with enumerations variables, we were mistakenly processing
12668 them as a regular value type instead of built-in types. Fixes the
12671 * typemanager.cs (IsBuiltinOrEnum): New method.
12673 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12675 * cs-parser.jay: Upgrade: yield now needs the return clause.
12677 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12679 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12681 2003-09-29 Martin Baulig <martin@ximian.com>
12683 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12684 inflated generic methods.
12686 * generics.cs (ConstructedType): Distinguish between open and
12687 closed constructed types; correctly resolve the arguments.
12689 2003-09-22 Martin Baulig <martin@ximian.com>
12691 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12692 all type arguments meet their constraints.
12694 2003-09-19 Martin Baulig <martin@ximian.com>
12696 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12697 `MemberCache parent' argument. Normally, an interface doesn't
12698 have a parent type except System.Object, but we use this in gmcs
12699 for generic type parameters.
12701 2003-09-18 Martin Baulig <martin@ximian.com>
12703 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12704 on `type.IsInterface'; don't check whether the type has a parent
12705 to determine whether it's an interface.
12707 2003-09-17 Martin Baulig <martin@ximian.com>
12709 * generic.cs (ConstructedType.ToString): Always use `name' as the
12712 2003-09-15 Martin Baulig <martin@ximian.com>
12714 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12716 * generic.cs (Constraints.Resolve): New public method; this is
12717 called to resolve the constraint types and to check whether all
12718 the constraints are correct.
12719 (Constraints.Types): New public property.
12720 (TypeParameter.Resolve): New public method; resolves all the
12721 type's constraints.
12723 * class.cs (TypeContainer.DefineType): Call
12724 TypeParameter.Resolve() before actually defining the type.
12726 2003-09-15 Martin Baulig <martin@ximian.com>
12728 * class.cs (TypeContainer.DefineType): Added an error flag to
12729 avoid reporting duplicate CS0146's ("class definition is
12732 * driver.cs (Driver.MainDriver): Abort if
12733 RootContext.ResolveTree() reported any errors.
12735 2003-09-07 Martin Baulig <martin@ximian.com>
12737 * report.cs (Error, Warning): Added overloaded versions which take
12738 a `params object[] args' and call String.Format().
12740 2003-09-07 Martin Baulig <martin@ximian.com>
12742 * decl.cs (DeclSpace..ctor): Don't call
12743 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12744 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12745 (DeclSpace.RecordDecl): New method.
12747 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12749 2003-09-02 Ravi Pratap <ravi@ximian.com>
12751 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12752 value attributes to be applied to ParameterBuilders.
12754 * class.cs (MethodCore.LabelParameters): Make static and more
12755 generic so that it can be used from other places - like interface
12756 methods, for instance.
12758 * interface.cs (Interface.Emit): Call LabelParameters before
12759 emitting attributes on the InterfaceMethod.
12761 2003-09-07 Martin Baulig <martin@ximian.com>
12763 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12764 if the number of type parameters doesn't match.
12766 2003-09-04 Martin Baulig <martin@ximian.com>
12768 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12769 for arrays of generic type params (ie. `!0[]').
12771 2003-09-04 Martin Baulig <martin@ximian.com>
12773 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12776 2003-09-04 Martin Baulig <martin@ximian.com>
12778 * decl.cs (DeclSpace.LookupGeneric): New method.
12779 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12782 * generic.cs (TypeParameterExpr): Take a TypeParameter as
12783 argument, not just a string.
12784 (TypeParameter.Define): New public method; this is called to
12785 actually define the generic parameter; after this, you can use the
12786 new `Type' property to get the type.
12788 2003-09-04 Martin Baulig <martin@ximian.com>
12790 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12791 is now an ArrayList; initialize the result of the `TypeParameters'
12793 (DeclSpace.GetGenericData): Removed.
12794 (DeclSpace.LookupGeneric): Temporarily removed; we need to
12795 implement this in a different way.
12796 (DeclSpace.GetTypeParameters): Removed; there's now a
12797 `TypeParameters' property.
12798 (DeclSpace.TypeParameters): New public property.
12800 * generic.cs (Constraints): Make this class public.
12801 (TypeParameter): New public class.
12803 2003-09-04 Martin Baulig <martin@ximian.com>
12805 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12806 generic parameters.
12808 * class.cs (TypeContainer.DefineType): Call
12809 TypeBuilder.DefineGenericParameter () on all generic parameters if
12810 this is a generic type.
12812 2003-08-28 Martin Baulig <martin@ximian.com>
12814 * sample-stack.il: Compile this with ilasm: "ilasm /dll
12817 * sample-hello.cs: Compile this with gmcs: "gmcs
12818 /r:sample-stack.dll sample-hello.cs".
12820 2003-08-28 Martin Baulig <martin@ximian.com>
12822 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12823 the parameters to the generic type.
12825 2003-08-28 Martin Baulig <martin@ximian.com>
12827 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12829 2003-08-28 Martin Baulig <martin@ximian.com>
12831 * cs-parser.jay (opt_type_argument_list): Use
12832 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12833 (primary_expression): Replace `qualified_identifier' with `type_name'.
12834 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12836 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12837 parser to check whether it is syntactically a type parameter list;
12838 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12841 2003-08-26 Martin Baulig <martin@ximian.com>
12843 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12844 resolving aliases; fixes #47927.
12846 2003-08-26 Martin Baulig <martin@ximian.com>
12848 * statement.cs (Using.DoResolve): This is internally emitting a
12849 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12850 do not always return. Fixes #47681.
12852 2003-08-26 Martin Baulig <martin@ximian.com>
12854 * decl.cs (MemberCore): Moved WarningNotHiding(),
12855 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12857 (AdditionResult): Make this nested in DeclSpace.
12858 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12859 argument; call NamespaceEntry.Define() unless we're nested in a
12862 * namespace.cs (Namespace.DefineName): New public function. This
12863 is called from DeclSpace's .ctor to add
12864 (Namespace.Lookup): Include DeclSpaces in the lookup.
12866 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12868 * const.cs (Const): Derive from MemberBase, not MemberCore.
12870 2003-08-25 Martin Baulig <martin@ximian.com>
12872 * convert.cs (Convert.ExplicitReferenceConversion): When
12873 converting from an interface type to a class, unbox if the target
12874 type is a struct type. Fixes #47822.
12876 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12878 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12881 2003-08-22 Martin Baulig <martin@ximian.com>
12883 * class.cs (TypeManager.DefineType): When defining a nested type,
12884 call DefineType() on our parent; fixes #47801.
12886 2003-08-22 Martin Baulig <martin@ximian.com>
12888 * class.cs (MethodData.Define): While checking if a method is an
12889 interface implementation, improve the test a bit more to fix #47654.
12891 2003-08-22 Martin Baulig <martin@ximian.com>
12893 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12894 correctly; fixes #47722.
12896 2003-08-22 Martin Baulig <martin@ximian.com>
12898 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12899 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12901 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12903 2003-08-22 Martin Baulig <martin@ximian.com>
12905 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12906 can only be assigned in static constructors. Fixes #47161.
12908 2003-08-22 Martin Baulig <martin@ximian.com>
12910 Rewrote and improved the flow analysis code.
12912 * flowbranching.cs (FlowBranching): Make this class abstract.
12913 (FlowBranching.CreateBranching): New static function to create a
12914 new flow branching.
12915 (FlowBranchingBlock, FlowBranchingException): New classes.
12916 (FlowBranching.UsageVector.Type): New public readonly field.
12917 (FlowBranching.UsageVector.Breaks): Removed the setter.
12918 (FlowBranching.UsageVector.Returns): Removed the setter.
12919 (FlowBranching.UsageVector): Added Break(), Return(),
12920 NeverReachable() and Throw() methods to modify the reachability.
12921 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12922 done by FlowBranching.Merge().
12923 (FlowBranching.UsageVector.MergeChild): New method; merges the
12924 merge result into the current vector.
12925 (FlowBranching.Merge): New abstract method to merge a branching.
12927 2003-08-12 Martin Baulig <martin@ximian.com>
12929 * expression.cs (Indirection.CacheTemporaries): Create the
12930 LocalTemporary with the pointer type, not its element type.
12932 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12934 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12935 token was a keyword or not.
12937 Add `error' options where an IDENTIFIER was expected; Provide
12938 CheckToken and CheckIdentifierToken convenience error reporting
12941 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12943 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12944 NameSpaceEntry NameSpaceEntry.
12946 (LookupInterfaceOrClass): Avoid creating a full qualified name
12947 from namespace and name: avoid doing lookups when we know the
12948 namespace is non-existant. Use new Tree.LookupByNamespace which
12949 looks up DeclSpaces based on their namespace, name pair.
12951 * driver.cs: Provide a new `parser verbose' to display the
12952 exception thrown during parsing. This is turned off by default
12953 now, so the output of a failure from mcs is more graceful.
12955 * namespace.cs: Track all the namespaces defined in a hashtable
12958 (IsNamespace): New method
12960 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12962 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12963 we know that we need to concatenate (full typename can never be
12968 * statement.cs: Use a bitfield; Do not initialize to null things
12969 which are done by the constructor by default.
12971 * cs-parser.jay: bug fix, parameter was 4, not 3.
12973 * expression.cs: Just use the property;
12975 * statement.cs: No need for GetVariableInfo method.
12977 2003-08-08 Martin Baulig <martin@ximian.com>
12979 * flowanalysis.cs (FlowReturns): This is now nested in the
12980 `FlowBranching' class.
12981 (MyBitVector): Moved this here from statement.cs.
12982 (FlowBranching.SiblingType): New enum type.
12983 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12985 2003-08-07 Martin Baulig <martin@ximian.com>
12987 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12988 `FlowBranching' class and called `BranchingType'.
12990 2003-08-07 Martin Baulig <martin@ximian.com>
12992 * flowanalysis.cs: Moved all the control flow analysis code into
12995 2003-08-07 Martin Baulig <martin@ximian.com>
12997 * assign.cs (Assign.DoResolve): `target' must either be an
12998 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13001 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13003 * expression.cs (BinaryMethod): This kind of expression is created by the
13004 Binary class if it determines that the operator has to be handled
13007 (BinaryDelegate): This kind of expression is created if we are
13008 dealing with a + or - operator on delegates.
13010 (Binary): remove method, argumetns, and DelegateOperator: when
13011 dealing with methods,
13013 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13015 * statement.cs (Block): use bitfields for the three extra booleans
13016 we had in use. Remove unused topblock parameter.
13018 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13020 * assign.cs: Drop extra unneeded tests.
13022 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13024 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13026 * statement.cs (Foreach): Use VariableStorage instead of
13029 * codegen.cs (VariableStorage): New class used by clients that
13030 require a variable stored: locals or fields for variables that
13031 need to live across yield.
13033 Maybe provide a convenience api for EmitThis+EmitLoad?
13035 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13038 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13040 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13041 RemapParameterLValue): New methods that are used to turn a
13042 precomputed FieldInfo into an expression like this:
13046 The idea is to use this instead of making LocalVariableReference
13047 have more than one meaning.
13049 * cs-parser.jay: Add error production to BASE.
13051 * ecore.cs: Deal with TypeManager.GetField returning null, which
13052 is now a valid return value.
13054 (FieldExprNoAddress): New expression for Fields whose address can
13057 * expression.cs (LocalVariableReference): During the resolve
13058 phases, create new expressions if we are in a remapping context.
13059 Remove code that dealt with remapping here.
13061 (ParameterReference): same.
13063 (ProxyInstance): New expression, like the `This' expression, but
13064 it is born fully resolved. We know what we are doing, so remove
13065 the errors that are targeted to user-provided uses of `this'.
13067 * statement.cs (Foreach): our variable is now stored as an
13068 Expression; During resolution, follow the protocol, dont just
13069 assume it will return this.
13071 2003-08-06 Martin Baulig <martin@ximian.com>
13073 * support.cs (SeekableStreamReader.cs): New public class.
13075 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13076 SeekableStreamReader instead of the normal StreamReader.
13078 2003-08-04 Martin Baulig <martin@ximian.com>
13080 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13081 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13082 deambiguate casts and delegate invocations.
13083 (parenthesized_expression): Use the new tokens to ensure this is
13084 not a cast of method invocation.
13086 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13087 when reading a `)' and Deambiguate_CloseParens () was previously
13090 * expression.cs (ParenthesizedExpression): New class. This is
13091 just used for the CS0075 test.
13092 (Binary.DoResolve): Check for CS0075.
13094 2003-07-29 Ravi Pratap <ravi@ximian.com>
13096 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13097 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13098 reference comparison.
13100 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13101 examine the ReturnType for equality - this is necessary in the
13102 cases of implicit and explicit operators whose signature also
13103 includes the return type.
13105 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13107 * namespace.cs: Cache the result of the namespace computation,
13108 instead of computing it every time.
13110 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13112 * decl.cs: Use a global arraylist that we reuse over invocations
13113 to avoid excesive memory consumption. Reduces memory usage on an
13114 mcs compile by one meg (45 average).
13116 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13117 private, work around that.
13119 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13121 * literal.cs (IntLiteral): Define Zero and One static literals.
13123 * cs-parser.jay (integer_literal): use static literals to reduce
13124 memory usage for the most used literals (0, 1 and -1). 211kb
13125 reduced in memory usage.
13127 Replace all calls to `new ArrayList' with `new
13128 ArrayList(4)' which is a good average number for most allocations,
13129 and also requires only 16 bytes of memory for its buffer by
13132 This reduced MCS memory usage in seven megabytes for the RSS after
13135 2003-07-28 Ravi Pratap <ravi@ximian.com>
13137 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13138 handle params methods the correct way by forming only one
13139 applicable set with params and normal methods in them. Earlier we
13140 were looking at params methods only if we found no normal methods
13141 which was not the correct thing to do.
13143 (Invocation.BetterFunction): Take separate arguments indicating
13144 when candidate and the best method are params methods in their
13147 This fixes bugs #43367 and #46199.
13149 * attribute.cs: Documentation updates.
13151 (CheckAttribute): Rename to CheckAttributeTarget.
13152 (GetValidPlaces): Rename to GetValidTargets.
13154 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13155 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13159 2003-07-28 Miguel de Icaza <miguel@ximian.com>
13161 * codegen.cs: Compute IsGeneric correctly.
13163 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13166 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13167 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
13168 regressions, and I was chasing more bugs than I required.
13170 * interface.cs: Use expressions for base type names (like classes
13171 and structs have been doing for a while now), and resolve that.
13172 This patch should probably go into head as well.
13174 This makes it one less user of FindType.
13176 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13178 This compiler can not self host currently. Need to fix that.
13180 * Makefile: compile to `gmcs.exe'
13182 * driver.cs: Turn on v2 by default on gmcs.
13184 * generic.cs (ConstructedType): Does no longer take a container
13185 type argument; That will be taken care of later.
13187 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13188 Use SimpleName to resolve for now, so we can continue the work on
13189 the parser, until we get Type.GetType that understands generics.
13191 (ConstructedType.ToString): Implement
13193 (TypeArguments.Resolve): Resolve the child expressions as types.
13195 * cs-parser.jay: Rename interface_constraints to
13196 type_parameter_constraints
13198 (namespace_or_type_name): Only use constructed types for the basic
13199 construction, we will deal with identifier<...> later.
13201 (type/type_name): No longer call DecomposeQI, as
13202 namespace_or_type_name is always decoded now.
13204 2003-07-22 Ravi Pratap <ravi@ximian.com>
13206 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13207 closely: we eliminate methods in base types when we have an
13208 applicable method in a top-level type.
13210 Please see section 14.5.5.1 for an exact description of what goes
13213 This fixes bug #45127 and a host of other related to corlib compilation.
13215 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13216 array is the method corresponding to the top-level type (this is
13217 because of the changes made to icall.c) so we change this
13220 (MethodGroupExpr.Name): This too.
13222 * typemanager.cs (GetElementType): New method which does the right
13223 thing when compiling corlib.
13225 * everywhere: Make use of the above in the relevant places.
13227 2003-07-22 Martin Baulig <martin@ximian.com>
13229 * cs-parser.jay (invocation_expression): Moved
13230 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13231 `cast_expression', but create a InvocationOrCast which later
13232 resolves to either an Invocation or a Cast.
13234 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13235 method; call this before EmitStatement() to make sure that this
13236 expression can be used as a statement.
13238 * expression.cs (InvocationOrCast): New class; resolves to either
13239 an Invocation or a Cast.
13241 * statement.cs (StatementExpression): Call ResolveStatement() on
13242 the ExpressionStatement before emitting it.
13244 2003-07-21 Martin Baulig <martin@ximian.com>
13246 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13247 `ref' and `out' attributes match; fixes #46220.
13248 (MemberAccess.ResolveMemberAccess): You can't reference a type
13249 through an expression; fixes #33180.
13250 (Indexers.GetIndexersForType): Don't return the indexers from
13251 interfaces the class implements; fixes #46502.
13253 2003-07-21 Martin Baulig <martin@ximian.com>
13255 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13256 CS0661 checks; fixes bug #30442.
13258 2003-07-21 Martin Baulig <martin@ximian.com>
13260 * decl.cs (AdditionResult): Added `Error'.
13262 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13264 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13265 cs0031.cs actually work.
13267 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13269 * cs-parser.jay (namespace_name): do not use
13270 namespace_or_type_name, use qualified_identifier, because
13271 namespace_or_type_name will soon return a composed expression
13272 instead of a string.
13274 (namespace_or_type_name): Instead of returning a string, now this
13275 production returns an expression.
13277 * codegen.cs (EmitContext): Setup IsGeneric property based on
13278 whether our DeclSpace is generic, our the method is generic.
13280 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13281 the method is generic.
13283 * cs-parser.jay (type_arguments, opt_type_argument_list,
13284 type_parameters, type_parameter_list, opt_type_parameter_list,
13285 type_parameter,, opt_type_parameter_constraints_clauses,
13286 type_parameter_constraints_clauses,
13287 type_parameter_constraint_clause, type_parameter_constraint,
13288 interface_constraints): Add new production
13290 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13291 DeclSpace is generic or not.
13293 (DeclSpace.SetParameterInfo): New routine, used to set the
13294 parameter info for a type.
13296 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13297 returns a GenericTypeExpr
13299 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13300 generic, lookup the generic argument.
13302 * attribute.cs: Do not allow TypeParameterExpressions in
13305 * class.cs: Do not allow the Main method to be defined in a
13308 * expression.cs (SizeOf): Do not allow generic types to be used as
13309 arguments to sizeof.
13311 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13312 it: whether a type is generic or not. Only works for types we are
13313 currently building for now.
13315 2003-07-20 Martin Baulig <martin@ximian.com>
13317 * namespace.cs: Fixed that bug which caused a crash when compiling
13318 the debugger's GUI.
13320 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13322 * typemanager.cs (LookupTypeReflection): Never expose types which
13323 are NotPublic, NestedPrivate, NestedAssembly, or
13324 NestedFamANDAssem. We used to return these, and later do a check
13325 that would report a meaningful error, but the problem is that we
13326 would not get the real match, if there was a name override.
13328 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13330 * namespace.cs (Namespace, Name): Do not compute the namespace
13331 name dynamically, compute it in the constructor. This reduced
13332 memory usage by 1697 KB.
13334 * driver.cs: Use --pause to pause at the end.
13336 2003-07-17 Peter Williams <peter@newton.cx>
13338 * Makefile: Change the name of the test target so that it doesn't
13339 conflict with the recursive test target.
13341 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13343 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13344 AddressOf): Do not use EmitThis, that was wrong, use the actual
13347 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13349 * class.cs (MethodData.Define): While checking if a method is an
13350 interface implementation, improve the test: If we are not public
13351 (use new test here: use the computed MethodAttributes directly,
13352 instead of the parsed modifier flags) check if the `implementing'
13353 method comes from an interface or not.
13355 * pending.cs (VerifyPendingMethods): Slightly better error
13358 * makefile: add test target that does the mcs bootstrap.
13360 2003-07-16 Ravi Pratap <ravi@ximian.com>
13362 * interface.cs (Define): Do nothing here since there are no
13363 members to populate etc. Move the attribute emission out of here
13364 since this was just totally the wrong place to put it. Attribute
13365 application happens during the 'Emit' phase, not in the 'Define'
13368 (Emit): Add this method and move the attribute emission here
13370 * rootcontext.cs (EmitCode): Call the Emit method on interface
13373 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13375 * expression.cs (OverloadResolve): Report error only if Location
13376 is not 'Null' which means that there was a probe going on.
13378 2003-07-14 Martin Baulig <martin@ximian.com>
13380 * expression.cs (ConditionalLogicalOperator): New public class to
13381 implement user defined conditional logical operators.
13382 This is section 14.11.2 in the spec and bug #40505.
13384 2003-07-14 Martin Baulig <martin@ximian.com>
13386 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13388 2003-07-14 Martin Baulig <martin@ximian.com>
13390 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13392 * ecore.cs (IVariable.VerifyFixed): New interface method.
13394 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13395 operator, check whether the variable is actually fixed. Fixes bug
13396 #36055. Set a variable definitely assigned when taking its
13397 address as required by the spec.
13399 * statement.cs (LocalInfo.IsFixed): New field.
13400 (LocalInfo.MakePinned): Set `IsFixed' to true.
13402 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13404 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13405 for .ctors, ensure that we only ask for members declared in the
13406 attribute type (BindingFlags.DeclaredOnly).
13410 * expression.cs (Error_WrongNumArguments): Report error 1501
13411 correctly the way CSC does.
13413 2003-07-13 Martin Baulig <martin@ximian.com>
13415 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13416 lookup on the fully qualified name, to make things like "X.X" work
13417 where "X.X" is a fully qualified type name, but we also have a
13418 namespace "X" in the using list. Fixes #41975.
13420 2003-07-13 Martin Baulig <martin@ximian.com>
13422 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13423 function. If we're a CompoundAssign, we need to create an embedded
13424 CompoundAssign, not an embedded Assign.
13425 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13428 2003-07-13 Martin Baulig <martin@ximian.com>
13430 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13431 work to fix bug #46088.
13433 2003-07-13 Ravi Pratap <ravi@ximian.com>
13435 * class.cs (Operator.Emit): Do not emit attributes here - it is
13436 taken care of by the Method class that we delegate too. This takes
13437 care of bug #45876.
13439 2003-07-10 Martin Baulig <martin@ximian.com>
13441 * expression.cs (TypeOfVoid): New class.
13442 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13444 2003-07-10 Martin Baulig <martin@ximian.com>
13446 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13449 2003-07-10 Martin Baulig <martin@ximian.com>
13451 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13452 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13454 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13456 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13458 2003-07-10 Martin Baulig <martin@ximian.com>
13460 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13461 of decimal. Fixes #42850.
13463 NOTE: I also fixed the created byte blob, but this doesn't work on
13464 the MS runtime and csc never produces any byte blobs for decimal
13467 2003-07-10 Martin Baulig <martin@ximian.com>
13469 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13470 structs; fixes #32068.
13471 (Block.AddChildVariableNames): Fixed #44302.
13473 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13475 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13477 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13479 * attribute.cs: And this test is onger needed.
13481 2003-07-08 Martin Baulig <martin@ximian.com>
13483 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13484 inaccessible types. Fixes #36313.
13486 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13488 * namespace.cs (NamespaceEntry): Create implicit entries for all
13489 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13490 implicit entries for N1.N2 and N1.
13492 2003-07-08 Martin Baulig <martin@ximian.com>
13494 Rewrote the handling of namespaces to fix a lot of the issues
13495 wrt. `using' aliases etc.
13497 * namespace.cs (Namespace): Splitted this class into a
13498 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13500 * typemanager.cs (TypeManager.IsNamespace): Removed.
13501 (TypeManager.ComputeNamespaces): Only compute namespaces from
13502 loaded assemblies here, not the namespaces from the assembly we're
13503 currently compiling.
13505 2003-07-08 Martin Baulig <martin@ximian.com>
13507 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13509 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13511 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13514 I thought about the memory savings here, but LookupTypeReflection
13515 is used under already very constrained scenarios. Compiling
13516 corlib or mcs only exposes one hit, so it would not really reduce
13517 any memory consumption.
13519 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13521 * typemanager.cs: fixes bug #45889 by only adding public types from
13522 other assemblies to the list of known types.
13524 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13526 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13527 on the type we resolved.
13529 2003-07-05 Martin Baulig <martin@ximian.com>
13531 * pending.cs (PendingImplementation.ParentImplements): Don't
13532 create the proxy if the parent is abstract.
13534 * class.cs (TypeContainer.DefineIndexers): Process explicit
13535 interface implementations first. Fixes #37714.
13537 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13539 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13540 defined recursively; but since we modify the input parameters
13541 (left is set to `this' temporarily), we reset this value if the
13542 left_is_explicit is false, which gives the original semantics to
13545 * literal.cs (NullPointer): new class used to represent a null
13546 literal in a pointer context.
13548 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13549 type is a pointer, use a NullPointer object instead of a
13550 NullLiteral. Closes 43687
13552 (ExplicitConversion): Convert pointer values using
13553 the conv opcode to the proper type.
13555 * ecore.cs (New): change ValueTypeVariable property into a method,
13556 that returns whether the valuetype is suitable for being used.
13558 * expression.cs (Binary.DoNumericPromotions): Only return if we
13559 the int constant was a valid uint, and we can return both left and
13560 right as uints. If not, we continue processing, to trigger the
13561 type conversion. This fixes 39018.
13563 * statement.cs (Block.EmitMeta): During constant resolution, set
13564 the CurrentBlock property on the emitcontext, so that we resolve
13565 constants propertly.
13567 2003-07-02 Martin Baulig <martin@ximian.com>
13569 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13570 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13572 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13573 than emitting it here.
13575 * statement.cs: Fixed some more flow analysis bugs.
13577 2003-07-02 Martin Baulig <martin@ximian.com>
13579 * class.cs (MethodData.Define): When implementing interface
13580 methods, set Final unless we're Virtual.
13582 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13583 check work for interface methods.
13585 2003-07-01 Martin Baulig <martin@ximian.com>
13587 * ecore.cs (EmitContext.This): Replaced this property with a
13588 GetThis() method which takes a Location argument. This ensures
13589 that we get the correct error location for a CS0188.
13591 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13593 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13594 ImplicitStandardConversion.
13596 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13598 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13600 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13603 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13605 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13608 (MethodData.Define): Turn off initlocals for unsafe methods.
13610 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13612 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13613 complete; Fixes #37521.
13615 * delegate.cs: Use Modifiers.TypeAttr to compute the
13616 TypeAttributes, instead of rolling our own. This makes the flags
13617 correct for the delegates.
13619 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13621 * class.cs (Constructor.Define): Set the private flag for static
13622 constructors as well.
13624 * cs-parser.jay (statement_expression): Set the return value to
13625 null, to avoid a crash when we catch an error.
13627 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13629 * cs-parser.jay: Applied patch from Jackson that adds support for
13630 extern and unsafe modifiers to destructor declarations.
13632 * expression.cs: Report error 21 if the user is trying to index a
13635 * driver.cs: Add an error message, suggested by the bug report.
13637 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13638 if we do not have a ": this ()" constructor initializer. Fixes 45149
13640 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13642 * namespace.cs: Add some information to reduce FAQs.
13644 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13646 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13647 underlying enumeration types. Fixes #43915.
13649 * expression.cs: Treat ushort/short as legal values to be used in
13650 bitwise operations.
13652 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13654 * delegate.cs: transfer custom attributes for paramenters from
13655 the delegate declaration to Invoke and BeginInvoke.
13657 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13659 * attribute.cs: handle custom marshalers and emit marshal info
13662 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13664 * makefile.gnu: Added anonymous.cs to the compiler sources.
13666 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13668 * iterators.cs: Change the name of the proxy class to include two
13671 * cs-parser.jay: Update grammar to include anonymous methods.
13673 * anonymous.cs: new file.
13675 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13677 * class.cs (Field.Define): Add missing test for pointers and
13680 2003-05-27 Ravi Pratap <ravi@ximian.com>
13682 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13683 we use the stobj opcode.
13685 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13686 since it wasn't the correct fix.
13688 It still is puzzling that we are required to use stobj for IntPtr
13689 which seems to be a ValueType.
13691 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13693 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13694 during regular simple name resolution. Now, the trick is that
13695 instead of returning for processing the simplename, we do a
13696 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13697 contextual lookup type). If a match is found, return that, if
13698 not, return for further composition.
13700 This fixes long-standing 30485.
13702 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13703 using the address to initialize an object, do an Stobj instead of
13704 using the regular Stelem.
13706 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13707 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13708 Because if we are a BaseIndexerAccess that value will be true.
13711 * statement.cs (GotoCase.Resolve): Return after reporting an
13712 error, do not attempt to continue.
13714 * expression.cs (PointerArithmetic.Emit): If our operand is a
13715 long, convert our constants to match the operand before
13716 multiplying. Convert to I type before adding. Fixes 43670.
13718 2003-05-14 Ravi Pratap <ravi@ximian.com>
13720 * enum.cs (ImplicitConversionExists) : Rename to
13721 ImplicitEnumConversionExists to remove ambiguity.
13723 * ecore.cs (NullCast): New type of cast expression class which
13724 basically is very similar to EmptyCast with the difference being
13725 it still is a constant since it is used only to cast a null to
13727 (eg. (string) null)
13729 * convert.cs (ImplicitReferenceConversion): When casting a null
13730 literal, we return a NullCast.
13732 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13733 should be around anymore.
13735 The renaming (reported was slightly wrong). Corrections:
13737 ConvertImplicitStandard -> ImplicitConversionStandard
13738 ConvertExplicitStandard -> ExplicitConversionStandard
13740 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13741 before passing them in !
13743 * convert.cs (ImplicitConversionStandard): When comparing for
13744 equal expr and target types, ensure that expr is not a
13747 In general, we must not be checking (expr_type ==
13748 target_type) in the top level conversion methods
13749 (ImplicitConversion, ExplicitConversion etc). This checking is
13750 done in the methods that they delegate to.
13752 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13754 * convert.cs: Move Error_CannotConvertType,
13755 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13756 ImplicitNumericConversion, ImplicitConversionExists,
13757 ImplicitUserConversionExists, StandardConversionExists,
13758 FindMostEncompassedType, FindMostSpecificSource,
13759 FindMostSpecificTarget, ImplicitUserConversion,
13760 ExplicitUserConversion, GetConversionOperators,
13761 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13762 TryImplicitIntConversion, Error_CannotConvertImplicit,
13763 ConvertImplicitRequired, ConvertNumericExplicit,
13764 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13765 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13768 Perform the following renames:
13770 StandardConversionExists -> ImplicitStandardConversionExists
13771 ConvertImplicit -> ImplicitConversion
13772 ConvertImplicitStandard -> ImplicitStandardConversion
13773 TryImplicitIntConversion -> ImplicitIntConversion
13774 ConvertImplicitRequired -> ImplicitConversionRequired
13775 ConvertNumericExplicit -> ExplicitNumericConversion
13776 ConvertReferenceExplicit -> ExplicitReferenceConversion
13777 ConvertExplicit -> ExplicitConversion
13778 ConvertExplicitStandard -> ExplicitStandardConversion
13780 2003-05-19 Martin Baulig <martin@ximian.com>
13782 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13783 (TypeInfo): Added support for structs having structs as fields.
13785 * ecore.cs (FieldExpr): Implement IVariable.
13786 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13787 VariableInfo for the field.
13789 2003-05-18 Martin Baulig <martin@ximian.com>
13791 * expression.cs (This.DoResolve): Report a CS0027 if we're
13792 emitting a field initializer.
13794 2003-05-18 Martin Baulig <martin@ximian.com>
13796 * expression.cs (This.ResolveBase): New public function.
13797 (This.DoResolve): Check for CS0188.
13799 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13802 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13803 `instance_expression' to null if we don't have any non-static
13806 2003-05-18 Martin Baulig <martin@ximian.com>
13808 Reworked the way how local variables and parameters are handled by
13809 the flow analysis code.
13811 * statement.cs (TypeInfo, VariableMap): New public classes.
13812 (VariableInfo): New public class. This is now responsible for
13813 checking whether a variable has been assigned. It is used for
13814 parameters and local variables.
13815 (Block.EmitMeta): Take the InternalParameters as argument; compute
13816 the layout of the flow vectors here.
13817 (Block.LocalMap, Block.ParameterMap): New public properties.
13818 (FlowBranching): The .ctor doesn't get the InternalParameters
13819 anymore since Block.EmitMeta() now computes the layout of the flow
13821 (MyStructInfo): This class is now known as `StructInfo' and nested
13822 in `TypeInfo'; we don't access this directly anymore.
13824 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13825 property and removed IsAssigned(), IsFieldAssigned(),
13826 SetAssigned() and SetFieldAssigned(); we now call them on the
13827 VariableInfo so we don't need to duplicate this code everywhere.
13829 * expression.cs (ParameterReference): Added `Block block' argument
13831 (LocalVariableReference, ParameterReference, This): The new
13832 VariableInfo class is now responsible for all the definite
13835 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13836 IsParameterAssigned, SetParameterAssigned): Removed.
13838 2003-05-18 Martin Baulig <martin@ximian.com>
13840 * typemanager.cs (InitCoreTypes): Try calling
13841 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13842 the 3-args-version. Corlib now also needs our `void_type'.
13843 (GetMethod): Added overloaded version which takes an optional
13844 `bool report_errors' to allow lookups of optional methods.
13846 2003-05-12 Martin Baulig <martin@ximian.com>
13848 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13849 only used for locals and not for parameters.
13851 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13853 * support.cs (InternalParameters.ParameterType): Return the
13854 ExternalType of the parameter.
13856 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13859 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13861 * class.cs (MethodData.Define): Do not set the `newslot' on
13862 interface members, if they are also flagged as "override".
13864 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13865 better code for ++i and i++. This only works for static fields
13866 and local variables.
13868 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13869 want to pull the DeclSpace out of the builder_to_declspace instead
13870 of the TypeBuilder (like in TypeContainer.FindMembers).
13872 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13873 instead of LookupTypeContainer. Fixes the crash on .NET for
13874 looking up interface members.
13876 * const.cs: Create our own emit context during the Definition
13877 stage, so that constants are evaluated in the proper context, when
13878 a recursive definition happens.
13880 2003-05-11 Martin Baulig <martin@ximian.com>
13882 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13883 new block for a switch section.
13884 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13885 the adding/lookup in the switch block. Fixes #39828.
13887 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13889 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13890 functionality: I needed to convert the data after I had performed
13891 the add/sub operation into the operands type size.
13893 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13894 pass the type for the box operation, otherwise the resulting
13895 object would have been of type object.
13897 (BoxedCast): Add constructor to specify the type to box as.
13899 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13901 * iterators.cs: I was reusing the `count' variable inadvertently,
13902 take steps to not allow this to happen.
13904 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13906 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13907 by creating an array at the point where the params starts and
13908 putting all those arguments there, then adjusting the size of the
13911 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13913 * expression.cs (New.AddressOf): Implement interface
13914 IMemoryLocation. This is used when the `new' operator is used in
13915 the context of an invocation to a method on a value type.
13917 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13920 * namespace.cs: Also check the using aliases here.
13922 * driver.cs: Move the test for using validity after the types have
13923 been entered, so we do a single pass that also includes the using
13926 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13927 in the regular case. CreateSiblingForFinally is doing extra
13930 * attribute.cs (GetAttributeArgumentExpression): Store the result
13931 on an out value, and use the return value to indicate failure
13932 instead of using null (which is a valid return for Constant.GetValue).
13934 * statement.cs: Perform the analysis flow for the increment
13935 portion after the statement, because this will be the real flow of
13936 execution. Fixes #42385
13938 * codegen.cs (EmitContext.EmitArgument,
13939 EmitContext.EmitStoreArgument): New helper functions when the
13940 RemapToProxy flag is set.
13942 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13945 Add support for remapping parameters.
13947 * iterators.cs: Propagate parameter values; Store parameter
13948 values in the proxy classes.
13950 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13952 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13953 need a proxy reference; I do not know what I was thinking
13955 * cs-parser.jay (constructor_initializer): catch another error,
13956 and display nice message.
13958 (field_declaration): catch void field declaration
13959 to flag a better error.
13961 * class.cs (MemberBase.CheckBase): Report an error instead of a
13962 warning if a new protected member is declared in a struct.
13963 (Field.Define): catch the error of readonly/volatile.
13965 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13967 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13968 volatile variable is taken
13970 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13972 * statement.cs (Fixed.Resolve): Report an error if we are not in
13975 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13977 * typemanager.cs: reuse the code that handles type clashes for
13978 delegates and enumerations.
13980 * class.cs (Report28): Always report.
13982 * expression.cs (EncodeAsAttribute): Allow nulls here.
13984 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13986 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13987 the functionality for testing whether an expression is valid for
13988 an attribute here. Also handle the case of arrays of elements
13991 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13992 encoding a linear array into an array of objects that are suitable
13993 to be passed to an CustomAttributeBuilder.
13995 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13997 * ecore.cs: (FieldExpr): Handle field remapping here.
13999 * iteratators.cs: Pass the instance variable (if the method is an
14000 instance method) to the constructors, so we can access the field
14001 variables on the class.
14003 TODO: Test this with structs. I think the THIS variable on
14004 structs might have to be a pointer, and not a refenrece
14006 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14008 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14009 local variables to fields in a proxy class.
14011 * iterators.cs (PopulateProxy): Rename our internal fields to
14013 Create a <THIS> field if we are an instance method, so we can
14014 reference our parent container variables.
14015 (MapVariable): Called back from the EmitContext code to enter a
14016 new variable to field mapping into the proxy class (we just create
14020 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14021 for using the remapped locals to fields.
14023 I placed the code here, because that gives the same semantics to
14024 local variables, and only changes the Emit code.
14026 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14027 statements inside iterators.
14028 (VariableInfo): Add a FieldBuilder for the cases when we are
14029 remapping local variables to fields in a proxy class
14031 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14032 current_block != null.
14034 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14035 not cope with strings, as it has been moved to the
14036 TableSwitchEmit. Fixed bug in switch generation.
14038 * expression.cs (New.DoResolve): Provide more context for the user
14039 when reporting an error.
14041 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14044 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14045 check the permissions for it. Note than in a type-resolution
14046 context the check was already present in DeclSpace.ResolveType,
14047 but was missing from the MemberAccess.
14049 (ArrayCreation.CheckIndices): warn if the user has
14050 more nested levels of expressions, but there are no more
14051 dimensions specified. Avoids crash on bug 41906.
14053 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14055 * statement.cs (Block): replace Implicit bool, for a generic
14057 New flag: `Unchecked'. This is used during the EmitMeta phase
14058 (which is out-of-line with the regular Resolve/Emit process for a
14059 statement, as this is done ahead of time, but still gets a chance
14060 to call constant resolve).
14062 (Block.Flags): new enum for adding a new flag.
14064 (Block.EmitMeta): track the state of unchecked.
14066 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14067 to enable constant resolution to work there as well.
14069 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14071 * typemanager.cs (ienumerable_type): Also look up
14072 System.Collections.IEnumerable.
14074 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14076 TODO: Test more than one conditional per method.
14078 * class.cs (Indexer.Define): Report the location where the user is
14079 referencing the unsupported feature.
14081 (MethodData): Overload the use of `conditionals' to
14082 minimize the creation of needless ArrayLists. This saves roughly
14083 212kb on my machine.
14085 (Method): Implement the new IIteratorContainer interface.
14086 (Method.SetYields): Implement the method by setting the ModFlags
14087 to contain METHOD_YIELDS.
14089 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14090 which just got set to null.
14092 * iterators.cs: New file.
14094 (Yield, YieldBreak): New statements.
14096 * statement.cs (Return.Resolve): Flag an error if we are used in
14097 an iterator method.
14099 * codegen.cs (InIterator): New flag set if the code is being
14100 compiled in an iterator method.
14102 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14103 internal modifier, and we just use it to avoid adding extra
14104 fields, as this is seldom used.
14106 * cs-parser.jay: Add yield_statement (yield and yield break).
14108 * driver.cs: New flag -v2 to turn on version 2 features.
14110 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14111 hashtable when v2 is enabled.
14113 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14115 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14116 there is already a namespace defined with this name.
14118 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14119 people upgraded their corlibs.
14121 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14122 always use fully qualified types, no need to use the compiler
14125 (TypeManager.IsNamespace): Use binarysearch.
14127 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14128 AddDelegate): I did not quite use the new IsValid API properly: I
14129 have to pass the short-name and the fullname. I was passing only
14130 the basename instead of the fullname sometimes.
14132 (TypeContainer.DefineType): call NamespaceClash.
14134 * interface.cs (Interface.DefineType): use NamespaceClash before
14137 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14140 * enum.cs: (Enum.DefineType): use NamespaceClash before
14143 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14144 speed increase. First, use the negative_hits cache when we get a
14145 negative. Second, add the type with its full original name
14146 instead of the new . and + encoded name (reflection uses + to
14147 separate type from a nested type). Use LookupTypeReflection
14148 directly which bypasses the type->name hashtable (that we already
14149 know does not contain the type.
14151 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14152 location/container type.
14154 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14156 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14158 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14160 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14161 method is being referenced in the method group from a static
14162 context, and report error 120 if so.
14164 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14167 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14168 is created, we create the A namespace).
14170 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14173 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14175 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14176 invocation to ModuleBuilder.GetType with the same values will
14177 return a new type instance, so we need to cache its return
14180 * expression.cs (Binary.ResolveOperator): Only allow the compare
14181 operators on enums if they are of the same type.
14183 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14184 types of ValueType on their own case. Before we were giving them
14185 the same treatment as objects.
14187 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14188 fullname. Short name is used to compare against container name.
14189 Fullname is used to check against defined namespace names.
14191 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14192 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14194 (Method.CheckBase): Call parent.
14195 (MemberBase.CheckBase): Check for protected members on sealed
14197 (PropertyBase.CheckBase): Call parent.
14198 (Field.Define): Call parent.
14200 * report.cs: Negative error codes are now mapped to 8000 - code,
14201 so that the display is render more nicely.
14203 * typemanager.cs: Do not use try/catch, instead report a regular
14206 (GetPointerType, GetReferenceType): These methods provide
14207 mechanisms to obtain the T* and T& from a T. We had the code
14208 previously scattered around the code base, and it also used
14209 TypeManager.LookupType that would go through plenty of caches.
14210 This one goes directly to the type source.
14212 In some places we did the Type.GetType followed by
14213 ModuleBuilder.GetType, but not in others, so this unifies the
14214 processing as well.
14216 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14217 statements now that we have namespace information.
14219 * typemanager.cs (IsNamespace): New method, returns whether the
14220 string presented is a namespace or not.
14222 (ComputeNamespaces): New public entry point, computes the list of
14223 available namespaces, using the GetNamespaces API call in Mono, or
14224 the slower version in MS.NET.
14226 Now before we start the semantic analysis phase, we have a
14227 complete list of namespaces including everything that the user has
14230 Deleted old code to cache namespaces in .nsc files.
14232 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14234 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14235 class/struct location definition Location for the implicit
14236 constructor location.
14238 (Operator.Define): Use the location of the operator for the
14239 implicit Method definition.
14241 (Constructor.Emit): use the constructor location for the implicit
14242 base initializer constructor.
14244 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14245 and the Expression class now contains two new methods:
14247 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14248 isolate type lookup from the rest of the resolution process.
14250 Since we use Expressions to hold type definitions due to the way
14251 we parse the input we have historically overloaded Resolve to
14252 perform the Type lookups if a special flag is passed. Now this is
14253 eliminated and two methods take their place.
14255 The differences in the two methods between xStep and xTerminal is
14256 that xStep is involved in our current lookup system that uses
14257 SimpleNames to compose a name, while xTerminal is used just to
14258 catch the case where the simplename lookup failed.
14260 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14262 * expression.cs (ResolveMemberAccess): Remove redundant code.
14263 TypeExpr expressions are always born fully resolved.
14265 * interface.cs (PopulateMethod): Do not lookup the types twice.
14266 We were doing it once during SemanticAnalysis and once during
14269 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14270 in local variable type definitions, were being returned as a
14271 SimpleName (we decomposed everything into a string), that is
14272 because primary_expression was being used instead of a type in the
14273 grammar (reduce/reduce conflicts).
14275 The part that was wrong is that we converted the expression into a
14276 string (an oversimplification in one hand, compounded with primary
14277 expressions doing string concatenation).
14283 Would return "A.B.C[]" as a SimpleName. This stopped things like
14284 using clauses from working on this particular context. And a type
14285 was being matched directly against "A.B.C[]".
14287 We now use the correct approach, and allow for ComposedCast to be
14288 part of the unary expression. So the "A.B.C []" become a composed
14289 cast of "A.B.C" (as a nested group of MemberAccess with a
14290 SimpleName at the end) plus the rank composition "[]".
14294 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14296 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14297 for the access level checking.
14299 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14300 `TypeContainer container', because I kept getting confused when I
14301 was debugging this code.
14303 * expression.cs (Indexers): Instead of tracking getters/setters,
14304 we now track them in parallel. We create one arraylist less, but
14305 most importantly it is possible now for the LValue code to find a
14306 matching get for a set.
14308 (IndexerAccess.DoResolveLValue): Update the code.
14309 GetIndexersForType has been modified already to extract all the
14310 indexers from a type. The code assumed it did not.
14312 Also make the code set the correct return type for the indexer.
14313 This was fixed a long time ago for properties, but was missing for
14314 indexers. It used to be void_type.
14316 (Binary.Emit): Test first for doubles instead of
14317 floats, as they are more common.
14319 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14320 when dealing with floats and the <=, >= operators. This fixes bug
14323 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14324 to load the array value by emitting a load on the foreach variable
14325 type. This was incorrect.
14327 We now emit the code to load an element using the the array
14328 variable type, and then we emit the conversion operator.
14332 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14334 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14336 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14338 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14339 test for protection before we test for signatures.
14341 (MethodSignature.ToString): implement.
14343 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14344 to the case where we reduced into a LongConstant.
14346 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14347 depend on whether the information is acurrate, because the
14348 Microsoft runtime will always claim that the array type is public,
14349 regardless of the real state.
14351 If the type is a pointer, another problem happens: the type is
14352 reported as non-public in Microsoft.
14354 In both cases we have to call CheckAccessLevel recursively with
14355 the underlying type as the argument to be tested.
14357 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14359 * assign.cs (Assign.Emit): If we are dealing with a compound
14360 assignment expression, we should use the code path that stores the
14361 intermediate result in a temporary value. This fixes #40903.
14363 *expression.cs (Indirection.ToString): Provide ToString method for
14366 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14368 * class.cs: Null out fields holding references to Block objects so
14369 they can be garbage collected.
14371 * expression.cs (OverloadResolve): Remove unused local.
14373 2003-04-07 Martin Baulig <martin@ximian.com>
14375 * codegen.cs (EmitContext.CurrentFile): New public field.
14376 (EmitContext.Mark): Use the CurrentFile to check whether the
14377 location is in the correct file.
14378 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14380 2003-04-07 Martin Baulig <martin@ximian.com>
14382 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14384 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14385 location. [FIXME: The location argument which gets passed to this
14386 method is sometimes wrong!]
14388 2003-04-07 Nick Drochak <ndrochak@gol.com>
14390 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14392 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14394 * expression.cs (Indirection.EmitAssign): We were using the
14395 temporary, but returning immediately instead of continuing the
14398 2003-04-06 Martin Baulig <martin@ximian.com>
14400 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14401 if it's a nested child, but also deriving from the outer class.
14404 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14405 nested child, but also deriving from the outer class. See
14407 (FilterWithClosure): We may access private members of the outer
14408 class if we're a nested child and deriving from the outer class.
14409 (RealMemberLookup): Only set `closure_private_ok' if the
14410 `original_bf' contained BindingFlags.NonPublic.
14412 2003-04-05 Martin Baulig <martin@ximian.com>
14414 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14415 probe if its a type parameter, and if so, flag an error.
14417 * decl.cs: Move here the SetParameterInfo code from class.cs.
14418 Handle IsGeneric here.
14420 Handle a variety of errors in the parameter info definition.
14422 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14423 type parameters here.
14425 * cs-parser.jay (class_declaration): report errors for parameters
14428 2003-01-21 Miguel de Icaza <miguel@ximian.com>
14430 * generic.cs: New file, contains support code for generics.
14432 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14433 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14435 Update parser for the above removals.
14437 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
14438 now taken care of in the parser.
14440 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14442 * class.cs (Event.Define): Do not allow abstract events to have
14445 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14447 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14448 block in event declarations.
14450 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14451 value type, get its address.
14453 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14454 leaving a class on the stack instead of a boolean value (int
14455 0/1). Change the code so we compare against null, and then the
14456 result against zero.
14458 * class.cs (TypeContainer.GetClassBases): We were checking for the
14459 parent class being sealed too late.
14461 * expression.cs (Binary.Emit): For <= and >= when dealing with
14462 floating point values, use cgt.un and clt.un instead of cgt and
14465 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14467 * statement.cs: Apply the same optimization as MS: skip the
14468 GetEnumerator returning an IEnumerator, and use the one returning a
14469 CharEnumerator instead. This allows us to avoid the try-finally block
14472 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14474 * cs-parser.jay: Attributes cannot be applied to
14475 namespaces. Fixes #40473
14477 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14480 (Add*): check if the name is valid using the full name for constants,
14481 fields, properties and events.
14483 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14485 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14486 char constants to be part of the enumeration.
14488 * expression.cs (Conditional.DoResolve): Add support for operator
14489 true. Implements the missing functionality from 14.12
14491 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14492 operator true/false as required by the spec.
14494 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14495 implicit conversion to boolean.
14497 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14498 also one where the type implements `operator true'.
14500 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14501 get an expression that will invoke operator true based on an
14504 (GetConversionOperators): Removed the hack that called op_True
14507 (Expression.ResolveBoolean): Move this from Statement.
14509 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14511 * ecore.cs (FieldExpr): do not allow initialization of initonly
14512 fields on derived classes
14514 2003-03-13 Martin Baulig <martin@ximian.com>
14516 * statement.cs (Block.Emit): Call ig.BeginScope() and
14517 ig.EndScope() when compiling with debugging info; call
14518 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14520 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14522 * expression.cs (Indexers): Do not construct immediately, allow
14523 for new members to be appended as we go. Fixes 38143
14525 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14527 * expression.cs: save/restore context when resolving an unchecked
14530 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14532 * cfold.cs: Catch division by zero in modulus operator during
14535 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14537 * interface.cs (Interface.DefineMembers): Avoid defining members
14540 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14542 * driver.cs: handle the +/- options for -noconfig
14544 * statement.cs (Unckeched.Resolve): Also track the state of
14545 unchecked in the Resolve phase.
14547 2003-02-27 Martin Baulig <martin@ximian.com>
14549 * ecore.cs (Expression.MemberLookup): Don't create a
14550 MethodGroupExpr for something which is not a method. Fixes #38291.
14552 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14554 * class.cs (MemberBase.CheckParameters): Also check that the type
14555 is unmanaged if it is a pointer.
14557 * expression.cs (SizeOf.Resolve): Add location information.
14559 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14560 a managed type is declared.
14562 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14563 parameter modifiers as well. Fixes bug 38606
14565 * class.cs: Very sad. Am backing out the speed up changes
14566 introduced by the ArrayList -> Array in the TypeContainer, as they
14567 were not actually that much faster, and introduced a bug (no error
14568 reports on duplicated methods).
14570 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14571 source first, this will guarantee that we have a valid expression
14572 before calling in lower levels functions that will require a
14573 resolved object. Then use this original_source in the
14574 target.ResolveLValue instead of the original source that was
14577 Another change. Use target.Resolve instead of LValueResolve.
14578 Although we are resolving for LValues, we will let the Assign code
14579 take care of that (it will be called again from Resolve). This
14580 basically allows code like this:
14582 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14583 class Y { void A (X x) { x [0] += o; }
14585 The problem was that the indexer was trying to resolve for
14586 set_Item (idx, object o) and never finding one. The real set_Item
14587 was set_Item (idx, X). By delaying the process we get the right
14592 2003-02-23 Martin Baulig <martin@ximian.com>
14594 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14595 while calling DoEmit ().
14597 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14598 source files; if you use the #line directive inside a method, the
14599 compiler stops emitting line numbers for the debugger until it
14600 reaches the end of the method or another #line directive which
14601 restores the original file.
14603 2003-02-23 Martin Baulig <martin@ximian.com>
14605 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14607 2003-02-23 Martin Baulig <martin@ximian.com>
14609 * statement.cs (Block.AddChildVariableNames): We need to call this
14610 recursively, not just for our immediate children.
14612 2003-02-23 Martin Baulig <martin@ximian.com>
14614 * class.cs (Event.Define): Always make the field private, like csc does.
14616 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14617 actually work, fixes bug #37521.
14619 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14621 * delegate.cs: When creating the various temporary "Parameters"
14622 classes, make sure that we call the ComputeAndDefineParameterTypes
14623 on those new parameters (just like we do with the formal ones), to
14624 allow them to be resolved in the context of the DeclSpace.
14626 This fixes the bug that Dick observed in Bugzilla #38530.
14628 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14630 * expression.cs (ResolveMemberAccess): When resolving a constant,
14631 do not attempt to pull a constant if the value was not able to
14632 generate a valid constant.
14634 * const.cs (LookupConstantValue): Do not report more errors than required.
14636 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14638 * expression.cs: fixes bug #38328.
14640 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14642 * class.cs: Changed all the various members that can be part of a
14643 class from being an ArrayList to be an Array of the right type.
14644 During the DefineType type_list, interface_list, delegate_list and
14645 enum_list are turned into types, interfaces, delegates and enums
14648 And during the member population, indexer_list, event_list,
14649 constant_list, field_list, instance_constructor_list, method_list,
14650 operator_list and property_list are turned into their real arrays.
14652 Although we could probably perform this operation earlier, for
14653 good error reporting we need to keep the lists and remove the
14654 lists for longer than required.
14656 This optimization was triggered by Paolo profiling the compiler
14657 speed on the output of `gen-sample-program.pl' perl script.
14659 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14660 not crash in methods like MemberLookupFailed that use this field.
14662 This problem arises when the compiler fails to resolve a type
14663 during interface type definition for example.
14665 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14667 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14668 inherit from System.Object, so we have to stop at null, not only
14669 when reaching System.Object.
14671 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14673 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14674 DeclaredOnly because the parent indexer might have had a different
14675 name, but did not loop until the top of the hierarchy was reached.
14677 The problem this one fixes is 35492: when a class implemented an
14678 indexer from an interface, we were getting the interface method
14679 (which was abstract) and we were flagging an error (can not invoke
14682 This also keeps bug 33089 functioning, and test-148 functioning.
14684 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14685 out if a method is special is to see if it is declared in a
14686 property or event, or whether it is one of the predefined operator
14687 names. This should fix correctly #36804.
14689 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14691 The goal here is to remove the dependency on EmptyCast.Peel ().
14692 Killing it completely.
14694 The problem is that currently in a number of places where
14695 constants are expected, we have to "probe" for an EmptyCast, and
14696 Peel, which is not the correct thing to do, as this will be
14697 repetitive and will likely lead to errors.
14699 The idea is to remove any EmptyCasts that are used in casts that
14700 can be reduced to constants, so we only have to cope with
14703 This bug hunt was triggered by Bug 37363 and the desire to remove
14704 the duplicate pattern where we were "peeling" emptycasts to check
14705 whether they were constants. Now constants will always be
14708 * ecore.cs: Use an enumconstant here instead of wrapping with
14711 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14712 throwing me off. By handling this we can get rid of a few hacks.
14714 * statement.cs (Switch): Removed Peel() code.
14716 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14718 * class.cs: Location information for error 508
14720 * expression.cs (New.DoResolve): Add a guard against double
14721 resolution of an expression.
14723 The New DoResolve might be called twice when initializing field
14724 expressions (see EmitFieldInitializers, the call to
14725 GetInitializerExpression will perform a resolve on the expression,
14726 and later the assign will trigger another resolution
14728 This leads to bugs (#37014)
14730 * delegate.cs: The signature for EndInvoke should contain any ref
14731 or out parameters as well. We were not doing this in the past.
14733 * class.cs (Field.Define): Do not overwrite the type definition
14734 inside the `volatile' group. Turns out that volatile enumerations
14735 were changing the type here to perform a validity test, which
14738 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14740 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14741 and structs, we do not want to load the instance variable
14743 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14744 enum_type has to be handled like an object reference (implicit
14745 conversions exists from this to object), but the regular IsClass
14746 and IsValueType tests will never return true for this one.
14748 Also we use TypeManager.IsValueType instead of type.IsValueType,
14749 just for consistency with the rest of the code (this is only
14750 needed if we ever use the construct exposed by test-180.cs inside
14751 corlib, which we dont today).
14753 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14755 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14758 2003-02-09 Martin Baulig <martin@ximian.com>
14760 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14761 (Namespace.DefineNamespaces): New static public method; this is
14762 called when we're compiling with debugging to add all namespaces
14763 to the symbol file.
14765 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14766 pass it to the Namespace's .ctor.
14768 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14769 and MethodBase arguments; pass the namespace ID to the symwriter;
14770 pass the MethodBase instead of the token to the symwriter.
14771 (SymbolWriter.DefineNamespace): New method to add a namespace to
14774 2003-02-09 Martin Baulig <martin@ximian.com>
14776 * symbolwriter.cs: New file. This is a wrapper around
14777 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14778 methods here in near future.
14780 2003-02-09 Martin Baulig <martin@ximian.com>
14782 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14783 ILGenerator.MarkSequencePoint() which are actually used by the
14786 2003-02-09 Martin Baulig <martin@ximian.com>
14788 * location.cs (SourceFile): New public sealed class. This
14789 contains the name and an index which is used in the location's token.
14790 (Location): Reserve an appropriate number of bits in the token for
14791 the source file instead of walking over that list, this gives us a
14792 really huge performance improvement when compiling with debugging.
14794 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14795 `SourceFile' argument instead of a string.
14796 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14797 but don't parse/tokenize here, we need to generate the list of all
14798 source files before we do that.
14799 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14802 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14803 instead of a string.
14805 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14808 2003-02-09 Martin Baulig <martin@ximian.com>
14810 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14811 filename on `#line default'.
14813 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14815 * statement.cs: don't clear the pinned var when the fixed statement
14816 returns from the method (fixes bug#37752).
14818 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14820 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14823 2003-02-07 Martin Baulig <martin@ximian.com>
14825 * driver.cs: Removed the `--debug-args' command line argument.
14827 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14828 automatically by the AsssemblyBuilder.
14829 (CodeGen.InitializeSymbolWriter): We don't need to call any
14830 initialization function on the symbol writer anymore. This method
14831 doesn't take any arguments.
14833 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14835 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14836 from referenced assemblies as well.
14838 2003-02-02 Martin Baulig <martin@ximian.com>
14840 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14842 2003-02-02 Martin Baulig <martin@ximian.com>
14844 * class.cs (Constructor.Emit): Open the symbol writer before
14845 emitting the constructor initializer.
14846 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14847 single-stepping through constructor initializers.
14849 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14851 * class.cs: Handle error 549: do not allow virtual methods in
14854 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14856 * decl.cs: Check access levels when resolving types
14858 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14860 * statement.cs: Add parameters and locals set in catch blocks that might
14861 return to set vector
14863 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14865 * class.cs (Operator): Set the SpecialName flags for operators.
14867 * expression.cs (Invocation.DoResolve): Only block calls to
14868 accessors and operators on SpecialName methods.
14870 (Cast.TryReduce): Handle conversions from char constants.
14873 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14875 * statement.cs: small memory and time optimization in FlowBranching.
14877 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14879 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14880 problem that the last fix but in the other sid (Set).
14882 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14883 access when there is no indexer in the hierarchy.
14885 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14887 * class.cs: Combine some if statements.
14889 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14891 * driver.cs: fixed bug #37187.
14893 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14895 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14896 any indexer, it's needed to build a list with all the indexers in the
14897 hierarchy (AllGetters), else we have problems. Fixes #35653.
14899 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14901 * class.cs (MethodData.Define): It is wrong for an interface
14902 implementation to be static in both cases: explicit and implicit.
14903 We were only handling this in one case.
14905 Improve the if situation there to not have negations.
14907 * class.cs (Field.Define): Turns out that we do not need to check
14908 the unsafe bit on field definition, only on usage. Remove the test.
14910 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14912 * driver.cs: use assembly.Location instead of Codebase (the latest
14913 patch made mcs fail when using MS assemblies).
14915 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14917 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14918 get the path to *corlib.dll.
14920 2003-01-21 Nick Drochak <ndrochak@gol.com>
14924 * typemanager.cs: Remove compiler warnings
14926 2003-01-20 Duncan Mak <duncan@ximian.com>
14928 * AssemblyInfo.cs: Bump the version number to 0.19.
14930 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14932 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14934 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14936 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14938 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14940 * cs-parser.jay: Small fix: we were not comparing the constructor
14941 name correctly. Thanks to Zoltan for the initial pointer.
14943 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14945 * cs-tokenizer.cs: Set file name when specified with #line
14947 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14949 * cs-parser.jay: Only perform the constructor checks here if we
14950 are named like the class; This will help provider a better
14951 error. The constructor path is taken when a type definition is
14952 not found, but most likely the user forgot to add the type, so
14953 report that rather than the constructor error.
14955 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14957 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14960 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14962 * cs-parser.jay: Add cleanup call.
14964 2003-01-13 Duncan Mak <duncan@ximian.com>
14966 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14967 consistent with other methods.
14969 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14971 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14973 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14975 * attribute.cs: only set GuidAttr to true when we have a
14978 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14982 * typemanager.cs: fixes to allow mcs compile corlib with the new
14983 Type.IsSubclassOf fix.
14985 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14987 * expression.cs (LocalVariableReference.DoResolve): Classify a
14988 constant as a value, not as a variable. Also, set the type for
14991 * cs-parser.jay (fixed_statement): take a type instead of a
14992 pointer_type, so we can produce a better error message later.
14994 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14997 (For.DoEmit): Make inifinite loops have a
14998 non-conditional branch back.
15000 (Fixed.DoEmit): First populate the pinned variables, then emit the
15001 statement, then clear the variables. Before I was emitting the
15002 code once for each fixed piece.
15005 2003-01-08 Martin Baulig <martin@ximian.com>
15007 * statement.cs (FlowBranching.MergeChild): A break in a
15008 SWITCH_SECTION does not leave a loop. Fixes #36155.
15010 2003-01-08 Martin Baulig <martin@ximian.com>
15012 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15013 lives in the same number space than `param_map'. Fixes #36154.
15015 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15017 * cs-parser.jay (constructor_declaration): Set the
15018 Constructor.ModFlags before probing for it. This makes the
15019 compiler report 514, 515 and 132 (the code was there, but got
15022 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15023 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15024 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15026 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15028 * enum.cs: create the enum static fields using the enum type.
15030 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15032 * class.cs: don't try to create the ParamBuilder for the return
15033 type if it's not needed (and handle it breaking for the ms runtime
15036 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15038 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15040 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15042 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15043 the command. This showed up while compiling the JANET source
15044 code, which used \r as its only newline separator.
15046 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15048 * class.cs (Method.Define): If we are an operator (because it
15049 reuses our code), then set the SpecialName and HideBySig. #36128
15051 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15053 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15054 exception, report error 120 `object reference required'.
15056 * driver.cs: Add --pause option, used during to measure the size
15057 of the process as it goes with --timestamp.
15059 * expression.cs (Invocation.DoResolve): Do not allow methods with
15060 SpecialName to be invoked.
15062 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15064 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15065 number before adding it.
15067 2002-12-21 Ravi Pratap <ravi@ximian.com>
15069 * ecore.cs (StandardImplicitConversion): When in an unsafe
15070 context, we allow conversion between void * to any other pointer
15071 type. This fixes bug #35973.
15073 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15075 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15076 is not thrown when extensionless outputs are used
15078 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15080 * rootcontext.cs: fixed compilation of corlib.
15082 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15084 * attribute.cs (Attributes.Contains): Add new method.
15086 * class.cs (MethodCore.LabelParameters): if the parameter is an
15087 `out' parameter, check that no attribute `[In]' has been passed.
15089 * enum.cs: Handle the `value__' name in an enumeration.
15091 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15093 * decl.cs: Added special case to allow overrides on "protected
15096 2002-12-18 Ravi Pratap <ravi@ximian.com>
15098 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15099 since it makes much more sense.
15101 (Attributes.ctor): Don't require a Location parameter.
15103 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15105 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15106 since we already have that information per attribute.
15108 * everywhere : make appropriate changes.
15110 * class.cs (LabelParameters): Write the code which actually
15111 applies attributes to the return type. We can't do this on the MS
15112 .NET runtime so we flag a warning in the case an exception is
15115 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15117 * const.cs: Handle implicit null conversions here too.
15119 2002-12-17 Ravi Pratap <ravi@ximian.com>
15121 * class.cs (MethodCore.LabelParameters): Remove the extra
15122 Type [] parameter since it is completely unnecessary. Instead
15123 pass in the method's attributes so that we can extract
15124 the "return" attribute.
15126 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15128 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15129 of ignoring it and letting the compile continue.
15131 * typemanager.cs (ChangeType): use an extra argument to return an
15132 error condition instead of throwing an exception.
15134 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15136 * expression.cs (Unary.TryReduce): mimic the code for the regular
15137 code path. Perform an implicit cast in the cases where we can
15138 implicitly convert to one of the integral types, and then reduce
15139 based on that constant. This fixes bug #35483.
15141 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15143 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15145 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15147 * namespace.cs: fixed bug #35489.
15149 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15151 * class.cs: Remove some dead code.
15153 * cs-parser.jay: Estimate the number of methods needed
15154 (RootContext.MethodCount);
15156 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15157 numbers instead of StringBuilders.
15159 * support.cs (PtrHashtable): Add constructor with initial size;
15160 We can now reduce reallocations of the method table.
15162 2002-12-10 Ravi Pratap <ravi@ximian.com>
15164 * attribute.cs (ApplyAttributes): Keep track of the emitted
15165 attributes on a per-target basis. This fixes bug #35413.
15167 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15169 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15170 default to the Windows 1252 encoding.
15172 (UnixParseOption): Support version, thanks to Alp for the missing
15175 * AssemblyInfo.cs: Add nice assembly information.
15177 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15180 * cs-parser.jay: Allow a trailing comma before the close bracked
15181 in the attribute_section production.
15183 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15184 address of the instance was being taken, I will take this out,
15185 because we take the address of the object immediately here.
15187 2002-12-09 Ravi Pratap <ravi@ximian.com>
15189 * typemanager.cs (AreMultipleAllowed): Take care of the most
15190 obvious case where attribute type is not in the current assembly -
15193 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15195 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15196 definitions, instead of doing that afterwards.
15198 Also we use a nice little hack, depending on the constructor, we
15199 know if we are a "composed" name or a simple name. Hence, we
15200 avoid the IndexOf test, and we avoid
15202 * codegen.cs: Add code to assist in a bug reporter to track down
15203 the source of a compiler crash.
15205 2002-12-07 Ravi Pratap <ravi@ximian.com>
15207 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15208 types have been emitted for a given element and flag an error
15209 if something which does not have AllowMultiple set is used more
15212 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15213 attribute types and their corresponding AllowMultiple properties
15215 (AreMultipleAllowed): Check the property for a given type.
15217 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15218 property in the case we have a TypeContainer.
15220 (Attributes.AddAttribute): Detect duplicates and just skip on
15221 adding them. This trivial fix catches a pretty gross error in our
15222 attribute emission - global attributes were being emitted twice!
15224 Bugzilla bug #33187 is now fixed.
15226 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15228 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15229 instead of pp_and).
15231 * expression.cs (Binary.ResolveOperator): I can only use the
15232 Concat (string, string, string) and Concat (string, string,
15233 string, string) if the child is actually a concatenation of
15236 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15238 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15239 context where we need a 2-character lookahead.
15241 * pending.cs (PendingImplementation): Rework so we can keep track
15242 of interface types all the time, and flag those which were
15243 implemented by parents as optional.
15245 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15247 * expression.cs (Binary.ResolveOperator): Use
15248 String.Concat(string,string,string) or
15249 String.Concat(string,string,string,string) when possible.
15251 * typemanager: More helper methods.
15254 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15256 * pending.cs: remove the bogus return from GetMissingInterfaces()
15257 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15259 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15261 * namespace.cs: avoid duplicated 'using xxx' being added to
15262 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15263 when we get more than one 'using' statement for the same namespace.
15264 Report a CS0105 warning for it.
15266 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15268 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15269 of calling getChar/putback, uses internal knowledge of it.
15271 (xtoken): Reorder tokenizer so most common patterns are checked
15272 first. This reduces the compilation time in another 5% (from 8.11s
15273 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15275 The parsing time is 22% of the compilation in mcs, and from that
15276 64% is spent on the tokenization process.
15278 I tried using a binary search for keywords, but this is slower
15279 than the hashtable. Another option would be to do a couple of
15282 * Not use a StringBuilder, instead use an array of chars,
15283 with a set value. Notice that this way we could catch
15284 the 645 error without having to do it *afterwards*.
15286 * We could write a hand-parser to avoid the hashtable
15287 compares altogether.
15289 The identifier consumption process takes 37% of the tokenization
15290 time. Another 15% is spent on is_number. 56% of the time spent
15291 on is_number is spent on Int64.Parse:
15293 * We could probably choose based on the string length to
15294 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15297 Another 3% is spend on wrapping `xtoken' in the `token' function.
15299 Handle 0xa0 as whitespace (#34752)
15301 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15303 * typemanager.cs (IsCLRType): New routine to tell whether a type
15304 is one of the builtin types.
15306 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15307 typecode in more places instead of doing pointer comparissions.
15308 We could leverage some knowledge about the way the typecodes are
15311 New code to cache namespaces in assemblies, it is currently not
15312 invoked, to be used soon.
15314 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15316 * expression.cs (Binary.ResolveOperator): specially handle
15317 strings, and do not perform user-defined operator overloading for
15320 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15322 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15323 internalcall as it is a pretty simple operation; Avoid whenever
15324 possible to call Char.IsLetter.
15326 (consume_identifier): Cut by half the number of
15327 hashtable calls by merging the is_keyword and GetKeyword behavior.
15329 Do not short-circuit, because if we do, we
15330 report errors (ie, #if false && true would produce an invalid
15334 2002-11-24 Martin Baulig <martin@ximian.com>
15336 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15337 check constant ranges and report a CS0221. Fixes #33186.
15339 2002-11-24 Martin Baulig <martin@ximian.com>
15341 * cs-parser.jay: Make this work for uninitialized variable
15342 declarations in the `for' initializer. Fixes #32416.
15344 2002-11-24 Martin Baulig <martin@ximian.com>
15346 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15347 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15349 2002-11-24 Martin Baulig <martin@ximian.com>
15351 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15352 argument; if true, we also check for user-defined conversions.
15353 This is only needed if both arguments are of a user-defined type.
15354 Fixes #30443, added test-175.cs.
15355 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15357 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15359 2002-11-24 Martin Baulig <martin@ximian.com>
15361 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15362 function to get the store opcode.
15363 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15364 only emit the Ldelema if the store opcode is Stobj. You must run
15365 both test-34 and test-167 to test this. Fixes #34529.
15367 2002-11-23 Martin Baulig <martin@ximian.com>
15369 * ecore.cs (Expression.MemberLookup): Added additional
15370 `qualifier_type' argument which is used when we're being called
15371 from MemberAccess.DoResolve() and null if we're called from a
15373 (Expression.MemberLookupFailed): New method to report errors; this
15374 does the CS1540 check and reports the correct error message.
15376 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15377 argument for the CS1540 check and redone the way how we're dealing
15378 with private members. See the comment in the source code for details.
15379 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15380 `closure_start_type' to `closure_qualifier_type' and check whether
15381 it's not null. It was not this filter being broken, it was just
15382 being called with the wrong arguments.
15384 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15385 and pass it the correct `qualifier_type'; this also does the error
15388 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15390 * expression.cs (Invocation.EmitParams): If the we are dealing
15391 with a non-built-in value type, load its address as well.
15393 (ArrayCreation): Use a a pretty constant instead
15394 of the hardcoded value 2. Use 6 instead of 2 for the number of
15395 static initializers.
15397 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15398 because they are not really value types, just glorified integers.
15400 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15402 * ecore.cs: Remove redundant code for enumerations, make them use
15403 the same code path as everything else, fixes the casting issue
15404 with enumerations in Windows.Forms.
15406 * attribute.cs: Do only cast to string if it is a string, the
15407 validation happens later.
15409 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15410 people upgrade their corlibs.
15412 * ecore.cs: Oops, enumerations were not following the entire code path
15414 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15416 * typemanager.cs (FilterWithClosure): Commented out the test for
15417 1540 in typemanager.cs, as it has problems when accessing
15418 protected methods from a parent class (see test-174.cs).
15420 * attribute.cs (Attribute.ValidateGuid): new method.
15421 (Attribute.Resolve): Use above.
15423 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15425 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15427 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15428 handling for enumerations, as we only needed the TypeContainer
15429 functionality to begin with (this is required for the fix below to
15430 work for enums that reference constants in a container class for
15433 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15435 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15436 a valid TypeBuilder to perform lookups on.o
15438 * class.cs (InheritableMemberSignatureCompare): Use true in the
15439 call to GetGetMethod and GetSetMethod, because we are comparing
15440 the signature, and we need to get the methods *even* if they are
15443 (PropertyBase.CheckBase): ditto.
15445 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15446 GotoCase.Resolve): Use Peel on EmpytCasts.
15448 * ecore.cs (EmptyCast): drop child, add Peel method.
15450 2002-11-17 Martin Baulig <martin@ximian.com>
15452 * ecore.cs (EmptyCast.Child): New public property.
15454 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15455 label resolved to an EmptyCast. Fixes #34162.
15456 (GotoCase.Resolve): Likewise.
15457 (Block.EmitMeta): Likewise.
15459 2002-11-17 Martin Baulig <martin@ximian.com>
15461 * expression.cs (Invocation.BetterConversion): Prefer int over
15462 uint; short over ushort; long over ulong for integer literals.
15463 Use ImplicitConversionExists instead of StandardConversionExists
15464 since we also need to check for user-defined implicit conversions.
15465 Fixes #34165. Added test-173.cs.
15467 2002-11-16 Martin Baulig <martin@ximian.com>
15469 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15470 with the `true' and `false' literals. Fixes #33151.
15472 2002-11-16 Martin Baulig <martin@ximian.com>
15474 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15475 October 22nd; don't do the cs1540 check for static members.
15477 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15478 now using our own filter here and doing the cs1540 check again.
15480 2002-11-16 Martin Baulig <martin@ximian.com>
15482 * support.cs (InternalParameters): Don't crash if we don't have
15483 any fixed parameters. Fixes #33532.
15485 2002-11-16 Martin Baulig <martin@ximian.com>
15487 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15488 when looking up static methods to make this work on Windows.
15491 2002-11-16 Martin Baulig <martin@ximian.com>
15493 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15494 a setter rather than using PropertyInfo.CanWrite.
15496 2002-11-15 Nick Drochak <ndrochak@gol.com>
15498 * class.cs: Allow acces to block member by subclasses. Fixes build
15501 2002-11-14 Martin Baulig <martin@ximian.com>
15503 * class.cs (Constructor.Emit): Added the extern/block check.
15506 2002-11-14 Martin Baulig <martin@ximian.com>
15508 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15509 iteration while looking for indexers, this is needed because the
15510 indexer may have a different name in our base classes. Fixed the
15511 error reporting (no indexers at all, not get accessor, no
15512 overloaded match). Fixes bug #33089.
15513 (IndexerAccess.DoResolveLValue): Likewise.
15515 2002-11-14 Martin Baulig <martin@ximian.com>
15517 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15518 indexers. Fixes the first part of bug #33089.
15519 (MethodSignature.InheritableMemberSignatureCompare): Added support
15522 2002-11-13 Ravi Pratap <ravi@ximian.com>
15524 * attribute.cs (Attribute.Resolve): Catch the
15525 NullReferenceException and report it since it isn't supposed to
15528 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15530 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15531 LogicalOr and LogicalAnd that can benefit from recursively
15532 handling EmitBranchable. The code now should be nice for Paolo.
15534 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15536 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15537 the Type lookups, as we perform quite a number of lookups on
15538 non-Types. This can be removed once we can deterministically tell
15539 whether we have a type or a namespace in advance.
15541 But this might require special hacks from our corlib.
15545 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15546 and double which avoids a conversion from an integer to a double.
15548 * expression.cs: tiny optimization, avoid calling IsConstant,
15549 because it effectively performs the lookup twice.
15551 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15553 But a bogus return here to keep the semantics of the old code
15554 until the Mono runtime is fixed.
15556 * pending.cs (GetMissingInterfaces): New method used to remove all
15557 the interfaces that are already implemented by our parent
15558 classes from the list of pending methods.
15560 * interface.cs: Add checks for calls after ResolveTypeExpr.
15562 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15564 * class.cs (Class.Emit): Report warning 67: event not used if the
15565 warning level is beyond 3.
15567 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15568 being a NullLiteral.
15570 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15573 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15574 path that might fail if a type can not be resolved.
15576 * expression.cs (Binary.Emit): Emit unsigned versions of the
15579 * driver.cs: use error 5.
15581 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15583 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15585 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15587 * cs-parser.jay (switch_section): A beautiful patch from Martin
15588 Baulig that fixed 33094.
15590 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15592 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15593 Check whether the base is abstract and report an error if so.
15595 * expression.cs (IndexerAccess.DoResolveLValue,
15596 IndexerAccess.DoResolve): ditto.
15598 (Invocation.DoResolve): ditto.
15600 (Invocation.FullMethodDesc): Improve the report string.
15602 * statement.cs (Block): Eliminate IsVariableDefined as it is
15603 basically just a wrapper for GetVariableInfo.
15605 * ecore.cs (SimpleName): Use new
15607 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15608 type, as we return the actual parameter ref/unref state on a
15611 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15613 * support.cs: Return proper flags REF/OUT fixing the previous
15616 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15617 not used to mean `ref' but `ref or out' in ParameterReference
15619 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15620 full type signature instead of calling TypeManger.CSharpName
15623 * support.cs (InternalParameters.ParameterDesc): Do not compare
15624 directly to the modflags, because REF/OUT will actually be bitsets
15627 * delegate.cs (VerifyMethod): Check also the modifiers.
15629 * cs-tokenizer.cs: Fix bug where floating point values with an
15630 exponent where a sign was missing was ignored.
15632 * driver.cs: Allow multiple assemblies to be specified in a single
15635 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15637 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15638 because identifiers after a parenthesis would end up in this kind
15639 of production, and we needed to desamiguate it for having casts
15642 (UserDefinedType *) xxx
15644 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15646 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15647 we should set on the Bindingflags.NonPublic, but not turn on
15648 private_ok. private_ok controls whether a Private member is
15649 returned (this is chekced on the filter routine), while the
15650 BindingFlags.NonPublic just controls whether private/protected
15651 will be allowed. This fixes the problem part of the problem of
15652 private properties being allowed to be used in derived classes.
15654 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15655 so we can call the children DoResolveLValue method (this will
15656 properly signal errors on lvalue assignments to base properties)
15658 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15659 getter are null, and we have a property info, we know that this
15660 happened because the lookup failed, so we report an error 122 for
15661 protection level violation.
15663 We also silently return if setter and getter are null in the
15664 resolve functions, this condition only happens if we have flagged
15665 the error before. This is the other half of the problem.
15667 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15668 not have accessibility information, that is why we were returning
15669 true in the filter function in typemanager.cs.
15671 To properly report 122 (property is inaccessible because of its
15672 protection level) correctly, we report this error in ResolveAccess
15673 by failing if both the setter and the getter are lacking (ie, the
15676 DoResolve and DoLResolve have been modified to check for both
15677 setter/getter being null and returning silently, the reason being
15678 that I did not want to put the knowledge about this error in upper
15681 int old = Report.Errors;
15682 x = new PropertyExpr (...);
15683 if (old != Report.Errors)
15688 So the property expr is returned, but it is invalid, so the error
15689 will be flagged during the resolve process.
15691 * class.cs: Remove InheritablePropertySignatureCompare from the
15692 class, as we no longer depend on the property signature to compute
15693 whether it is possible to implement a method or not.
15695 The reason is that calling PropertyInfo.GetGetMethod will return
15696 null (in .NET, in Mono it works, and we should change this), in
15697 cases where the Get Method does not exist in that particular
15702 class X { public virtual int A { get { return 1; } } }
15704 class Z : Y { public override int A { get { return 2; } } }
15706 Would fail in Z because the parent (Y) would not have the property
15707 defined. So we avoid this completely now (because the alternative
15708 fix was ugly and slow), and we now depend exclusively on the
15711 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15712 reference method, instead of using the property.
15714 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15715 routines are gone now.
15717 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15718 names, they were incorrectly named.
15720 * cs-tokenizer.cs: Return are more gentle token on failure.
15722 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15723 had an out-of-sync index variable, which caused it to remove from
15724 the list of pending methods the wrong method sometimes.
15726 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15728 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15729 CanWrite, because those refer to this particular instance of the
15730 property, and do not take into account the fact that we can
15731 override single members of a property.
15733 Constructor requires an EmitContext. The resolution process does
15734 not happen here, but we need to compute the accessors before,
15735 because the resolution does not always happen for properties.
15737 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15738 subclass, before we did not update this flag, but we did update
15741 (GetAccessors): Drop this routine, as it did not work in the
15742 presence of partially overwritten set/get methods.
15744 Notice that this broke the cs1540 detection, but that will require
15747 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15751 * driver.cs: issue a warning instead of an error if we don't support
15752 debugging for the platform. Also ignore a couple of errors that may
15753 arise when trying to write the symbols. Undo my previous patch.
15755 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15757 * driver.cs: ignore /debug switch except for Unix platforms.
15759 2002-10-23 Nick Drochak <ndrochak@gol.com>
15761 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15763 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15765 * driver.cs: Do not make mcs-debug conditional, so we do not break
15766 builds that use it.
15768 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15769 review this patch. But basically after all the children variables
15770 have been merged, the value of "Breaks" was not being set to
15771 new_breaks for Switch blocks. I think that it should be set after
15772 it has executed. Currently I set this to the value of new_breaks,
15773 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15774 conservative, but I do not understand this code very well.
15776 I did not break anything in the build, so that is good ;-)
15778 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15780 2002-10-20 Mark Crichton <crichton@gimp.org>
15782 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15784 2002-10-20 Nick Drochak <ndrochak@gol.com>
15786 * cfold.cs: Fixed compile blocker.
15788 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15790 * driver.cs: I was chekcing the key, not the file.
15792 2002-10-19 Ravi Pratap <ravi@ximian.com>
15794 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15795 message that we were generating - we just need to silently return
15798 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15800 * class.cs (Event.Define): Change my previous commit, as this
15801 breaks the debugger. This is a temporary hack, as it seems like
15802 the compiler is generating events incorrectly to begin with.
15804 * expression.cs (Binary.ResolveOperator): Added support for
15805 "U operator - (E x, E y)"
15807 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15810 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15811 init-only variables, but this path did not take into account that
15812 there might be also instance readonly variables. Correct this
15815 This fixes bug 32253
15817 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15820 * driver.cs: Change the extension for modules to `netmodule'
15822 * cs-parser.jay: Improved slightly the location tracking for
15823 the debugger symbols.
15825 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15826 modifiers that were specified instead of the hardcoded value
15827 (FamAndAssem). This was basically ignoring the static modifier,
15828 and others. Fixes 32429.
15830 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15831 fixed a bug in the process (32476)
15833 * expression.cs (ArrayAccess.EmitAssign): Patch from
15834 hwang_rob@yahoo.ca that fixes bug 31834.3
15836 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15838 * driver.cs: Make the module extension .netmodule.
15840 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15842 * driver.cs: Report an error if the resource file is not found
15843 instead of crashing.
15845 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15846 false, like Emit does.
15848 2002-10-16 Nick Drochak <ndrochak@gol.com>
15850 * typemanager.cs: Remove unused private member. Also reported mcs
15851 bug to report this as a warning like csc.
15853 2002-10-15 Martin Baulig <martin@gnome.org>
15855 * statement.cs (Statement.Emit): Made this a virtual method; emits
15856 the line number info and calls DoEmit().
15857 (Statement.DoEmit): New protected abstract method, formerly knows
15858 as Statement.Emit().
15860 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15862 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15864 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15865 have fixed a remaining problem: not every AddXXXX was adding a
15866 fully qualified name.
15868 Now everyone registers a fully qualified name in the DeclSpace as
15869 being defined instead of the partial name.
15871 Downsides: we are slower than we need to be due to the excess
15872 copies and the names being registered this way.
15874 The reason for this is that we currently depend (on the corlib
15875 bootstrap for instance) that types are fully qualified, because
15876 we dump all the types in the namespace, and we should really have
15877 types inserted into the proper namespace, so we can only store the
15878 basenames in the defined_names array.
15880 2002-10-10 Martin Baulig <martin@gnome.org>
15882 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15883 from bug #31834, see the bug report for a testcase which is
15886 2002-10-10 Martin Baulig <martin@gnome.org>
15888 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15889 flow analysis code for this.
15891 * statement.cs (Do, While, For): Tell the flow analysis code about
15893 (FlowBranching.UsageVector): Added support for infinite loops.
15894 (Block.Resolve): Moved the dead code elimination here and use flow
15897 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15899 * class.cs (Field.Define): Catch cycles on struct type
15902 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15903 fields if the fields are static. We only need to check instance
15906 * expression.cs (As.DoResolve): Test for reference type.
15908 * statement.cs (Using.ResolveExpression): Use
15909 ConvertImplicitRequired, not ConvertImplicit which reports an
15911 (Using.ResolveLocalVariableDecls): ditto.
15913 * expression.cs (Binary.ResolveOperator): Report errors in a few
15914 places where we had to.
15916 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15918 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15920 * expression.cs: Use StoreFromPtr instead of extracting the type
15921 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15923 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15924 an enumeration value to a System.Enum, but System.Enum is not a
15925 value type, but an class type, so we need to box.
15927 (Expression.ConvertExplicit): One codepath could return
15928 errors but not flag them. Fix this. Fixes #31853
15930 * parameter.cs (Resolve): Do not allow void as a parameter type.
15932 2002-10-06 Martin Baulig <martin@gnome.org>
15934 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15935 if it's a class type and not a struct. Fixes #31815.
15937 2002-10-06 Martin Baulig <martin@gnome.org>
15939 * statement.cs: Reworked the flow analysis code a bit to make it
15940 usable for dead code elimination.
15942 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15944 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15946 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15948 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15949 to fix the test 165, will investigate deeper.
15951 2002-10-04 Martin Baulig <martin@gnome.org>
15953 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15954 finally blocks actually work.
15955 (Try.Resolve): We don't need to create a sibling for `finally' if
15956 there is no finally block.
15958 2002-10-04 Martin Baulig <martin@gnome.org>
15960 * class.cs (Constructor.Define): The default accessibility for a
15961 non-default constructor is private, not public.
15963 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15965 * class.cs (Constructor): Make AllowedModifiers public, add
15968 * cs-parser.jay: Perform the modifiers test here, as the
15969 constructor for the Constructor class usually receives a zero
15970 because of the way we create it (first we create, later we
15971 customize, and we were never checking the modifiers).
15973 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15974 is a version of LookupTypeReflection that includes the type-name
15975 cache. This can be used as a fast path for functions that know
15976 the fully qualified name and are only calling into *.GetType() to
15977 obtain a composed type.
15979 This is also used by TypeManager.LookupType during its type
15982 (LookupType): We now also track the real type name, as sometimes
15983 we can get a quey for the real type name from things like
15984 ComposedCast. This fixes bug 31422.
15986 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15987 complete type fullname, it does not have to go through the type
15988 resolution system to obtain the composed version of the type (for
15989 obtaining arrays or pointers).
15991 (Conditional.Emit): Use the EmitBoolExpression to
15992 generate nicer code, as requested by Paolo.
15994 (ArrayCreation.CheckIndices): Use the patch from
15995 hwang_rob@yahoo.ca to validate the array initializers.
15997 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15999 * class.cs (ConstructorInitializer.Emit): simplify code by using
16000 Invocation.EmitCall, and at the same time, fix the bugs in calling
16001 parent constructors that took variable arguments.
16003 * ecore.cs (Expression.ConvertNumericExplicit,
16004 Expression.ImplicitNumericConversion): Remove the code that
16005 manually wrapped decimal (InternalTypeConstructor call is now gone
16008 * expression.cs (Cast.TryReduce): Also handle decimal types when
16009 trying to perform a constant fold on the type.
16011 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16013 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16014 that only turned off an error report, and did nothing else.
16016 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16018 * driver.cs: Handle and ignore /fullpaths
16020 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16022 * expression.cs (Binary.ResolveOperator): Catch the case where
16023 DoNumericPromotions returns true,
16025 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16027 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16029 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16032 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16034 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16035 conversion exists, but it is also required that the conversion be
16036 performed. This manifested in "(Type64Enum) 2".
16038 * class.cs (TypeManager.AddMethod): The fix is not to change
16039 AddEnum, because that one was using a fully qualified name (every
16040 DeclSpace derivative does), but to change the AddMethod routine
16041 that was using an un-namespaced name. This now correctly reports
16042 the duplicated name.
16044 Revert patch until I can properly fix it. The issue
16045 is that we have a shared Type space across all namespaces
16046 currently, which is wrong.
16048 Options include making the Namespace a DeclSpace, and merge
16049 current_namespace/current_container in the parser.
16051 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16053 * cs-parser.jay: Improve error reporting when we get a different
16054 kind of expression in local_variable_type and
16055 local_variable_pointer_type.
16057 Propagate this to avoid missleading errors being reported.
16059 * ecore.cs (ImplicitReferenceConversion): treat
16060 TypeManager.value_type as a target just like object_type. As
16065 Is valid, and needs to result in the int 1 being boxed before it
16066 is assigned to the value type v.
16068 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16069 to validate the enumeration name.
16071 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16072 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16073 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16075 * ecore.cs (TryImplicitIntConversion): When doing an
16076 implicit-enumeration-conversion, check if the type is 64-bits and
16077 perform a conversion before passing to EnumConstant.
16079 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16081 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16082 report ambiguous type references. Unlike the MS version, we
16083 report what the ambiguity is. Innovation at work ;-)
16085 (DeclSpace.FindType): Require a location argument to
16086 display when we display an ambiguous error.
16088 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16090 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16092 * expression.cs (EmitDynamicInitializers): Apply patch from
16093 hwang_rob@yahoo.ca that fixes the order in which we emit our
16096 2002-09-21 Martin Baulig <martin@gnome.org>
16098 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16099 delegate takes no arguments.
16101 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16103 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16106 * expression.cs: Extract the underlying type.
16108 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16110 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16112 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16114 * class.cs (TypeContainer.DefineType): We can not use the nice
16115 PackingSize with the size set to 1 DefineType method, because it
16116 will not allow us to define the interfaces that the struct
16119 This completes the fixing of bug 27287
16121 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16122 means also structs. This fixes part of the problem.
16123 (Expresion.ImplicitReferenceConversionExists): ditto.
16125 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16126 error if there were no errors reported during the type lookup
16127 process, to avoid duplicates or redundant errors. Without this
16128 you would get an ambiguous errors plus a type not found. We have
16129 beaten the user enough with the first error.
16131 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16134 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16135 during the resolution process, stop the lookup, this avoids
16136 repeated error reports (same error twice).
16138 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16140 * typemanager.cs (LookupType): Redo the type lookup code to match
16141 the needs of System.Reflection.
16143 The issue is that System.Reflection requires references to nested
16144 types to begin with a "+" sign instead of a dot. So toplevel
16145 types look like: "NameSpace.TopLevelClass", and nested ones look
16146 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16149 2002-09-19 Martin Baulig <martin@gnome.org>
16151 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16152 says that a method always returns or always throws an exception,
16153 don't report the CS0161.
16155 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16156 set `Returns = new_returns'.
16158 2002-09-19 Martin Baulig <martin@gnome.org>
16160 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16161 to an enum constant, check for a CS0176.
16163 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16165 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16166 for operators that must be in pairs and report errors.
16168 * ecore.cs (SimpleName.DoResolveType): During the initial type
16169 resolution process, when we define types recursively, we must
16170 check first for types in our current scope before we perform
16171 lookups in the enclosing scopes.
16173 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16175 (Invocation.VerifyArgumentsCompat): Call
16176 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16177 I thought we were supposed to always call this, but there are a
16178 few places in the code where we dont do it.
16180 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16182 * driver.cs: Add support in -linkres and -resource to specify the
16183 name of the identifier.
16185 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16187 * ecore.cs (StandardConversionExists): Sync with the conversion
16188 code: allow anything-* to void* conversions.
16190 (FindMostSpecificSource): Use an Expression argument
16191 instead of a Type, because we might be handed over a Literal which
16192 gets a few more implicit conversions that plain types do not. So
16193 this information was being lost.
16195 Also, we drop the temporary type-holder expression when not
16198 2002-09-17 Martin Baulig <martin@gnome.org>
16200 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16201 this is an explicit interface implementation.
16203 2002-09-17 Martin Baulig <martin@gnome.org>
16205 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16206 different `IndexerName' attributes.
16208 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16209 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16210 virtual CommonResolve().
16212 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16214 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16215 and convert that to the UnderlyingType.
16217 * statement.cs (Foreach.Resolve): Indexers are just like variables
16218 or PropertyAccesses.
16220 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16221 inside quoted strings, we were not doing this before.
16223 2002-09-16 Martin Baulig <martin@gnome.org>
16225 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16226 resolve it. This is needed for the definite assignment check of the
16227 instance expression, fixes bug #29846.
16228 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16230 2002-09-16 Nick Drochak <ndrochak@gol.com>
16232 * parameter.cs: Fix compile error. Cannot reference static member
16233 from an instance object. Is this an mcs bug?
16235 2002-09-14 Martin Baulig <martin@gnome.org>
16237 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16238 multiple times. Fixes bug #30295, added test-166.cs.
16240 2002-09-14 Martin Baulig <martin@gnome.org>
16242 * statement.cs (Block.Emit): Don't emit unreachable code.
16243 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16244 `break' statements.
16245 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16247 2002-09-14 Martin Baulig <martin@gnome.org>
16249 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16252 2002-09-14 Martin Baulig <martin@gnome.org>
16254 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16255 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16256 be false on the ms runtime.
16258 2002-09-13 Martin Baulig <martin@gnome.org>
16260 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16261 the CS0038 error message.
16263 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16265 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16266 constant inside, return it.
16268 2002-09-12 Martin Baulig <martin@gnome.org>
16270 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16271 implicit conversion can be done between enum types.
16273 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16274 check whether an implicit conversion to the current enum's UnderlyingType
16275 exists and report an error if not.
16277 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16278 without debugging support.
16280 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16281 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16283 2002-09-12 Martin Baulig <martin@gnome.org>
16285 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16287 * ecore.cs (IMemberExpr.DeclaringType): New property.
16288 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16289 nonstatic member of an outer type (CS0038).
16291 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16293 * driver.cs: Activate the using-error detector at warning level
16294 4 (at least for MS-compatible APIs).
16296 * namespace.cs (VerifyUsing): Small buglett fix.
16298 * pending.cs (PendingImplementation): pass the container pointer.
16300 * interface.cs (GetMethods): Allow for recursive definition. Long
16301 term, I would like to move every type to support recursive
16302 definitions, not the current ordering mechanism that we have right
16305 The situation is this: Attributes are handled before interfaces,
16306 so we can apply attributes to interfaces. But some attributes
16307 implement interfaces, we will now handle the simple cases
16308 (recursive definitions will just get an error).
16310 * parameter.cs: Only invalidate types at the end if we fail to
16313 2002-09-09 Martin Baulig <martin@gnome.org>
16315 * ecore.cs (PropertyExpr.Emit): Also check for
16316 TypeManager.system_int_array_get_length so this'll also work when
16317 compiling corlib. Fixes #30003.
16319 2002-09-09 Martin Baulig <martin@gnome.org>
16321 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16322 and throw an exception if we can't get the type's size. Fixed #30040,
16325 2002-09-09 Martin Baulig <martin@gnome.org>
16327 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16329 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16330 context. Fixes bug #30027.
16332 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16333 virtual functions. Fixes bug #30043, added test-164.cs.
16335 2002-09-08 Ravi Pratap <ravi@ximian.com>
16337 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16339 2002-09-08 Nick Drochak <ndrochak@gol.com>
16341 * driver.cs: Use an object to get the windows codepage since it's not a
16344 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16346 * statement.cs (For.Emit): for infinite loops (test == null)
16347 return whether there is a break inside, not always "true".
16349 * namespace.cs (UsingEntry): New struct to hold the name of the
16350 using definition, the location where it is defined, and whether it
16351 has been used in a successful type lookup.
16353 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16358 2002-09-06 Ravi Pratap <ravi@ximian.com>
16360 * attribute.cs : Fix incorrect code which relied on catching
16361 a NullReferenceException to detect a null being passed in
16362 where an object was expected.
16364 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16366 * statement.cs (Try): flag the catch variable as assigned
16368 * expression.cs (Cast): Simplified by using ResolveType instead of
16369 manually resolving.
16371 * statement.cs (Catch): Fix bug by using ResolveType.
16373 2002-09-06 Ravi Pratap <ravi@ximian.com>
16375 * expression.cs (BetterConversion): Special case for when we have
16376 a NullLiteral as the argument and we have to choose between string
16377 and object types - we choose string the way csc does.
16379 * attribute.cs (Attribute.Resolve): Catch the
16380 NullReferenceException and report error #182 since the Mono
16381 runtime no more has the bug and having this exception raised means
16382 we tried to select a constructor which takes an object and is
16385 2002-09-05 Ravi Pratap <ravi@ximian.com>
16387 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16388 message (1502, 1503) when we can't locate a method after overload
16389 resolution. This is much more informative and closes the bug
16392 * interface.cs (PopulateMethod): Return if there are no argument
16393 types. Fixes a NullReferenceException bug.
16395 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16396 expressions too. Previously we were checking only in one place for
16397 positional arguments leaving out named arguments.
16399 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16400 type to the enum type is not allowed. Remove code corresponding to
16403 (ConvertNumericExplicit): Allow explicit conversions from
16404 the underlying type to enum type. This precisely follows the spec
16405 and closes a bug filed by Gonzalo.
16407 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16410 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16412 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16414 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16415 it was important that we stored the right value after the
16416 reduction in `converted'.
16418 2002-09-04 Martin Baulig <martin@gnome.org>
16420 * location.cs (Location.SymbolDocument): Use full pathnames for the
16423 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16425 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16426 of the expression resolve mechanism, because that will catch the
16427 SimpleName error failures.
16429 (Conditional): If we can not resolve the
16430 expression, return, do not crash.
16432 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16435 (location): display token name instead of its number.
16437 2002-08-28 Martin Baulig <martin@gnome.org>
16439 * expression.cs (Binary.ResolveOperator): Don't silently return
16440 but return an error if an operator cannot be applied between two
16443 2002-08-28 Martin Baulig <martin@gnome.org>
16445 * class.cs (Constructor.Define): Set the permission attributes
16446 correctly instead of making all constructors public.
16448 2002-08-28 Martin Baulig <martin@gnome.org>
16450 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16451 for private members before reporting a CS0103; if we find anything,
16454 2002-08-28 Martin Baulig <martin@gnome.org>
16456 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16457 to check whether `closure_start_type == closure_invocation_type',
16458 we also need to check whether `m.DeclaringType == closure_invocation_type'
16459 before bypassing the permission checks. We might be accessing
16460 protected/private members from the base class.
16461 (TypeManager.RealMemberLookup): Only set private_ok if private
16462 members were requested via BindingFlags.NonPublic.
16464 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16466 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16467 MethodGroupExpr.IsExplicitImpl if appropriate.
16468 (Invocation.DoResolve): Don't report the CS0120 for explicit
16469 interface implementations.
16471 2002-08-27 Martin Baulig <martin@gnome.org>
16473 * expression.cs (Invocation.DoResolve): If this is a static
16474 method and we don't have an InstanceExpression, we must report
16477 2002-08-25 Martin Baulig <martin@gnome.org>
16479 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16480 `==' between a valuetype and an object.
16482 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16484 * ecore.cs (TypeExpr): Provide a ToString method.
16486 2002-08-24 Martin Baulig <martin@gnome.org>
16488 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16489 now called proggie.dbg and it's a binary file.
16491 2002-08-23 Martin Baulig <martin@gnome.org>
16493 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16495 2002-08-23 Martin Baulig <martin@gnome.org>
16497 * struct.cs (MyStructInfo.ctor): Make this work with empty
16498 structs; it's not allowed to use foreach() on null.
16500 2002-08-23 Martin Baulig <martin@gnome.org>
16502 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16503 writer the full pathname of the generated assembly.
16505 2002-08-23 Martin Baulig <martin@gnome.org>
16507 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16508 A `finally' block never returns or breaks; improved handling of
16511 2002-08-23 Martin Baulig <martin@gnome.org>
16513 * statement.cs (Throw.Resolve): Allow `throw null'.
16515 2002-08-23 Martin Baulig <martin@gnome.org>
16517 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16518 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16519 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16520 MemberLookup would return a wrong event if this is an explicit
16521 interface implementation and the class has an event with the same
16524 2002-08-23 Martin Baulig <martin@gnome.org>
16526 * statement.cs (Block.AddChildVariableNames): New public method.
16527 (Block.AddChildVariableName): Likewise.
16528 (Block.IsVariableNameUsedInChildBlock): Likewise.
16529 (Block.AddVariable): Check whether a variable name has already
16530 been used in a child block.
16532 * cs-parser.jay (declare_local_variables): Mark all variable names
16533 from the current block as being used in a child block in the
16536 2002-08-23 Martin Baulig <martin@gnome.org>
16538 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16539 find the symbol writer.
16541 * driver.cs: csc also allows the arguments to /define being
16542 separated by commas, not only by semicolons.
16544 2002-08-23 Martin Baulig <martin@gnome.org>
16546 * interface.cs (Interface.GetMembers): Added static check for events.
16548 2002-08-15 Martin Baulig <martin@gnome.org>
16550 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16551 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16553 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16554 why the MethodData.EmitDestructor() change was necessary.
16556 2002-08-20 Martin Baulig <martin@gnome.org>
16558 * class.cs (TypeContainer.FindMembers): Added static check for events.
16560 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16562 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16563 use Type.GetEvents(), not Type.FindMembers().
16565 2002-08-20 Martin Baulig <martin@gnome.org>
16567 * decl.cs (MemberCache): Added a special method cache which will
16568 be used for method-only searched. This ensures that a method
16569 search will return a MethodInfo with the correct ReflectedType for
16572 2002-08-20 Martin Baulig <martin@gnome.org>
16574 * decl.cs (DeclSpace.FindMembers): Made this public.
16576 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16578 * delegate.cs: fixed build on windows.
16579 [FIXME: Filed as bug #29150: MCS must report these errors.]
16581 2002-08-19 Ravi Pratap <ravi@ximian.com>
16583 * ecore.cs (StandardConversionExists): Return a false
16584 if we are trying to convert the void type to anything else
16585 since that is not allowed.
16587 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16588 we flag error 70 in the event an event is trying to be accessed
16589 directly from outside the declaring type.
16591 2002-08-20 Martin Baulig <martin@gnome.org>
16593 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16594 MemberCache from typemanager.cs to decl.cs.
16596 2002-08-19 Martin Baulig <martin@gnome.org>
16598 * class.cs (TypeContainer): Implement IMemberContainer.
16599 (TypeContainer.DefineMembers): Create the MemberCache.
16600 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16601 return public members if BindingFlags.Public was given, check
16602 whether members are static.
16604 2002-08-16 Martin Baulig <martin@gnome.org>
16606 * decl.cs (DeclSpace.Define): Splitted this in Define and
16607 DefineMembers. DefineMembers is called first and initializes the
16610 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16611 DefineMembers() on all our DeclSpaces.
16613 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16614 but call DefineMembers() on all nested interfaces. We call their
16615 Define() in our new Define() function.
16617 * interface.cs (Interface): Implement IMemberContainer.
16618 (Interface.Define): Moved all code except the attribute stuf to
16620 (Interface.DefineMembers): Initialize the member cache.
16622 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16623 need this anymore since we can use MemberCache.FindMembers directly.
16625 2002-08-19 Martin Baulig <martin@gnome.org>
16627 * typemanager.cs (MemberCache): When creating the cache for an
16628 interface type, add all inherited members.
16629 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16630 to `out bool used_cache' and documented it.
16631 (TypeManager.MemberLookup): If we already used the cache in the first
16632 iteration, we don't need to do the interfaces check.
16634 2002-08-19 Martin Baulig <martin@gnome.org>
16636 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16637 here from IMemberFinder and don't implement this interface anymore.
16638 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16640 * typemanager.cs (IMemberFinder): This interface is now only used by
16641 classes which actually support the member cache.
16642 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16643 since we only put DeclSpaces into this Hashtable.
16644 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16645 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16647 2002-08-16 Martin Baulig <martin@gnome.org>
16649 * typemanager.cs (ICachingMemberFinder): Removed.
16650 (IMemberFinder.MemberCache): New property.
16651 (TypeManager.FindMembers): Merged this with RealFindMembers().
16652 This function will never be called from TypeManager.MemberLookup()
16653 so we can't use the cache here, just the IMemberFinder.
16654 (TypeManager.MemberLookup_FindMembers): Check whether the
16655 IMemberFinder has a MemberCache and call the cache's FindMembers
16657 (MemberCache): Rewrote larger parts of this yet another time and
16658 cleaned it up a bit.
16660 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16662 * driver.cs (LoadArgs): Support quoting.
16664 (Usage): Show the CSC-like command line arguments.
16666 Improved a few error messages.
16668 2002-08-15 Martin Baulig <martin@gnome.org>
16670 * typemanager.cs (IMemberContainer.Type): New property.
16671 (IMemberContainer.IsInterface): New property.
16673 The following changes are conditional to BROKEN_RUNTIME, which is
16674 defined at the top of the file.
16676 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16677 class'es members, but add all members from TypeHandle.ObjectType
16678 if we're an interface.
16679 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16680 is the current type.
16681 (MemberCache.CacheEntry.Container): Removed this field.
16682 (TypeHandle.GetMembers): Include inherited members.
16684 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16686 * typemanager.cs: fixed compilation and added a comment on a field that
16689 2002-08-15 Martin Baulig <martin@gnome.org>
16691 * class.cs (ConstructorInitializer.Resolve): In the
16692 Expression.MemberLookup call, use the queried_type as
16695 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16696 declared' attribute, it's always true.
16697 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16698 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16699 temporary wrapper for FindMembers which tells MemberLookup whether
16700 members from the base classes are included in the return value.
16701 This will go away soon.
16702 (TypeManager.MemberLookup): Use this temporary hack here; once the
16703 new MemberCache is completed, we don't need to do the DeclaredOnly
16704 looping here anymore since the MemberCache will take care of this.
16705 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16706 (MemberCache): When creating the MemberCache for a class, get
16707 members from the current class and all its base classes.
16708 (MemberCache.CacheEntry.Container): New field. This is a
16709 temporary hack until the Mono runtime is fixed to distinguish
16710 between ReflectedType and DeclaringType. It allows us to use MCS
16711 with both the MS runtime and the unfixed Mono runtime without
16712 problems and without accecting performance.
16713 (MemberCache.SearchMembers): The DeclaredOnly looping from
16714 TypeManager.MemberLookup is now done here.
16716 2002-08-14 Martin Baulig <martin@gnome.org>
16718 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16719 Type.GetFields on dynamic types but get the fields from the
16720 corresponding TypeContainer.
16721 (MyStructInfo.GetStructInfo): Added check for enum types.
16723 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16724 (MemberList.SyncRoot): Implemented.
16725 (TypeManager.FilterWithClosure): No need to check permissions if
16726 closure_start_type == closure_invocation_type, don't crash if
16727 closure_invocation_type is null.
16729 2002-08-13 Martin Baulig <martin@gnome.org>
16731 Rewrote TypeContainer.FindMembers to use a member cache. This
16732 gives us a speed increase of about 35% for the self-hosting MCS
16733 build and of about 15-20% for the class libs (both on GNU/Linux).
16735 * report.cs (Timer): New class to get enhanced profiling. This
16736 whole class is "TIMER" conditional since it remarkably slows down
16739 * class.cs (MemberList): New class. This is an IList wrapper
16740 which we're now using instead of passing MemberInfo[]'s around to
16741 avoid copying this array unnecessarily.
16742 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16743 (ICachingMemberFinder, IMemberContainer): New interface.
16744 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16745 has already been checked, otherwise use it for the name comparision.
16746 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16747 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16748 if possible. Returns a MemberList, not a MemberInfo [].
16749 (TypeHandle): New class, implements IMemberContainer. We create
16750 one instance of this class per type, it contains a MemberCache
16751 which is used to do the member lookups.
16752 (MemberCache): New class. Each instance of this class contains
16753 all members of a type and a name-based hash table.
16754 (MemberCache.FindMembers): This is our new member lookup
16755 function. First, it looks up all members of the requested name in
16756 the hash table. Then, it walks this list and sorts out all
16757 applicable members and returns them.
16759 2002-08-13 Martin Baulig <martin@gnome.org>
16761 In addition to a nice code cleanup, this gives us a performance
16762 increase of about 1.4% on GNU/Linux - not much, but it's already
16763 half a second for the self-hosting MCS compilation.
16765 * typemanager.cs (IMemberFinder): New interface. It is used by
16766 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16767 Enum, Delegate or Interface.
16768 (TypeManager.finder_to_member_finder): New PtrHashtable.
16769 (TypeManager.finder_to_container): Removed.
16770 (TypeManager.finder_to_delegate): Removed.
16771 (TypeManager.finder_to_interface): Removed.
16772 (TypeManager.finder_to_enum): Removed.
16774 * interface.cs (Interface): Implement IMemberFinder.
16776 * delegate.cs (Delegate): Implement IMemberFinder.
16778 * enum.cs (Enum): Implement IMemberFinder.
16780 * class.cs (TypeContainer): Implement IMemberFinder.
16782 2002-08-12 Martin Baulig <martin@gnome.org>
16784 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16786 2002-08-12 Martin Baulig <martin@gnome.org>
16788 * ecore.cs (ITypeExpression): New interface for expressions which
16790 (TypeExpression): Renamed to TypeLookupExpression.
16791 (Expression.DoResolve): If we're doing a types-only lookup, the
16792 expression must implement the ITypeExpression interface and we
16793 call DoResolveType() on it.
16794 (SimpleName): Implement the new ITypeExpression interface.
16795 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16796 hack, the situation that we're only looking up types can't happen
16797 anymore when this method is called. Moved the type lookup code to
16798 DoResolveType() and call it.
16799 (SimpleName.DoResolveType): This ITypeExpression interface method
16800 is now doing the types-only lookup.
16801 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16802 (ResolveFlags): Added MaskExprClass.
16804 * expression.cs (MemberAccess): Implement the ITypeExpression
16806 (MemberAccess.DoResolve): Added support for a types-only lookup
16807 when we're called via ITypeExpression.DoResolveType().
16808 (ComposedCast): Implement the ITypeExpression interface.
16810 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16811 Expression.Resolve() with ResolveFlags.Type instead.
16813 2002-08-12 Martin Baulig <martin@gnome.org>
16815 * interface.cs (Interface.Define): Apply attributes.
16817 * attribute.cs (Attribute.ApplyAttributes): Added support for
16818 interface attributes.
16820 2002-08-11 Martin Baulig <martin@gnome.org>
16822 * statement.cs (Block.Emit): Only check the "this" variable if we
16823 do not always throw an exception.
16825 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16826 whether the property has a set accessor.
16828 2002-08-11 Martin Baulig <martin@gnome.org>
16830 Added control flow analysis support for structs.
16832 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16833 with control flow analysis turned off.
16834 (IVariable): New interface.
16835 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16836 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16837 (FieldExpr.DoResolve): Resolve the instance expression with flow
16838 analysis turned off and do the definite assignment check after the
16839 resolving when we know what the expression will resolve to.
16841 * expression.cs (LocalVariableReference, ParameterReference):
16842 Implement the new IVariable interface, only call the flow analysis
16843 code if ec.DoFlowAnalysis is true.
16844 (This): Added constructor which takes a Block argument. Implement
16845 the new IVariable interface.
16846 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16847 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16848 This does the definite assignment checks for struct members.
16850 * class.cs (Constructor.Emit): If this is a non-static `struct'
16851 constructor which doesn't have any initializer, call
16852 Block.AddThisVariable() to tell the flow analysis code that all
16853 struct elements must be initialized before control returns from
16856 * statement.cs (MyStructInfo): New public class.
16857 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16858 argument to this indexer. If non-zero, check an individual struct
16859 member, not the whole struct.
16860 (FlowBranching.CheckOutParameters): Check struct members.
16861 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16862 overloaded versions of these methods which take an additional
16863 `int field_idx' argument to check struct members.
16864 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16865 overloaded versions of these methods which take an additional
16866 `string field_name' argument to check struct member.s
16867 (VariableInfo): Implement the IVariable interface.
16868 (VariableInfo.StructInfo): New public property. Returns the
16869 MyStructInfo instance of the variable if it's a struct or null.
16870 (Block.AddThisVariable): New public method. This is called from
16871 Constructor.Emit() for non-static `struct' constructor which do
16872 not have any initializer. It creates a special variable for the
16873 "this" instance variable which will be checked by the flow
16874 analysis code to ensure that all of the struct's fields are
16875 initialized before control returns from the constructor.
16876 (UsageVector): Added support for struct members. If a
16877 variable/parameter is a struct with N members, we reserve a slot
16878 in the usage vector for each member. A struct is considered fully
16879 initialized if either the struct itself (slot 0) or all its
16880 members are initialized.
16882 2002-08-08 Martin Baulig <martin@gnome.org>
16884 * driver.cs (Driver.MainDriver): Only report an error CS5001
16885 if there were no compilation errors.
16887 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16888 `UnsafeContext' property to determine whether the parent is in
16889 unsafe context rather than checking the parent's ModFlags:
16890 classes nested in an unsafe class are unsafe as well.
16892 2002-08-08 Martin Baulig <martin@gnome.org>
16894 * statement.cs (UsageVector.MergeChildren): Distinguish between
16895 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16896 we return. Added test17() and test18() to test-154.cs.
16898 2002-08-08 Martin Baulig <martin@gnome.org>
16900 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16901 Family access, make sure the invoking type isn't a subclass of the
16902 queried type (that'd be a CS1540).
16904 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16905 this method which takes an additional `Type invocation_type'.
16907 * expression.cs (BaseAccess.DoResolve): Use the base type as
16908 invocation and query type.
16909 (MemberAccess.DoResolve): If the lookup failed and we're about to
16910 report a CS0122, try a lookup with the ec.ContainerType - if this
16911 succeeds, we must report a CS1540.
16913 2002-08-08 Martin Baulig <martin@gnome.org>
16915 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16916 (MethodGroupExpr): Implement the IMemberExpr interface.
16918 * expression (MemberAccess.ResolveMemberAccess): No need to have
16919 any special code for MethodGroupExprs anymore, they're now
16922 2002-08-08 Martin Baulig <martin@gnome.org>
16924 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16925 Family, FamANDAssem and FamORAssem permissions.
16926 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16928 2002-08-08 Martin Baulig <martin@gnome.org>
16930 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16931 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16934 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16936 * driver.cs: implemented /resource option to embed managed resources.
16938 2002-08-07 Martin Baulig <martin@gnome.org>
16940 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16941 (FieldBase.HasFieldInitializer): New public property.
16942 (FieldBase.GetInitializerExpression): New public method. Resolves and
16943 returns the field initializer and makes sure it is only resolved once.
16944 (TypeContainer.EmitFieldInitializers): Call
16945 FieldBase.GetInitializerExpression to get the initializer, this ensures
16946 that it isn't resolved multiple times.
16948 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16949 the resolving process (SimpleName/MemberLookup) that we're currently
16950 emitting a field initializer (which must not access any instance members,
16951 this is an error CS0236).
16953 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16954 argument, if the `IsFieldInitializer' flag is set, we must report and
16955 error CS0236 and not an error CS0120.
16957 2002-08-07 Martin Baulig <martin@gnome.org>
16959 * ecore.cs (IMemberExpr): New public interface.
16960 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16961 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16962 if the expression is an IMemberExpr.
16964 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16965 to be null, implicitly default to `this' if we're non-static in
16966 this case. Simplified the code a lot by using the new IMemberExpr
16967 interface. Also fixed bug #28176 here.
16969 2002-08-06 Martin Baulig <martin@gnome.org>
16971 * cs-parser.jay (SimpleLookup): Removed. We need to create
16972 ParameterReferences during semantic analysis so that we can do a
16973 type-only search when resolving Cast, TypeOf and SizeOf.
16974 (block): Pass the `current_local_parameters' to the Block's
16977 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16978 argument to the constructor.
16979 (ConstructorInitializer.Resolve): Create a temporary implicit
16980 block with the parameters.
16982 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16983 references here if we aren't doing a type-only search.
16985 * statement.cs (Block): Added constructor which takes a
16986 `Parameters parameters' argument.
16987 (Block.Parameters): New public property.
16989 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16990 to `Parameters' and made it public readonly.
16992 2002-08-06 Martin Baulig <martin@gnome.org>
16994 * ecore.cs (Expression.Warning): Made this public as well.
16996 * report.cs (Report.Debug): Print the contents of collections.
16998 2002-08-06 Martin Baulig <martin@gnome.org>
17000 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17001 used to tell Resolve() which kinds of expressions it may return.
17002 (Expression.Resolve): Added overloaded version of this method which
17003 takes a `ResolveFlags flags' argument. This can be used to tell
17004 Resolve() which kinds of expressions it may return. Reports a
17006 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17007 ResolveFlags.SimpleName.
17008 (Expression.Error118): Added overloaded version of this method which
17009 takes a `ResolveFlags flags' argument. It uses the flags to determine
17010 which kinds of expressions are allowed.
17012 * expression.cs (Argument.ResolveMethodGroup): New public method.
17013 Resolves an argument, but allows a MethodGroup to be returned.
17014 This is used when invoking a delegate.
17016 * TODO: Updated a bit.
17018 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17020 Fixed compilation with csc.
17022 * ecore.cs: Expression.Error made public. Is this correct? Should
17023 Warning be made public too?
17025 * expression.cs: use ea.Location instead of ea.loc.
17026 [FIXME: Filed as bug #28607: MCS must report these errors.]
17028 2002-08-06 Martin Baulig <martin@gnome.org>
17030 * ecore.cs (Expression.loc): Moved the location here instead of
17031 duplicating it in all derived classes.
17032 (Expression.Location): New public property.
17033 (Expression.Error, Expression.Warning): Made them non-static and
17034 removed the location argument.
17035 (Expression.Warning): Added overloaded version which takes an
17036 `int level' argument.
17037 (Expression.Error118): Make this non-static and removed the
17038 expression and location arguments.
17039 (TypeExpr): Added location argument to the constructor.
17041 * expression.cs (StaticCallExpr): Added location argument to
17043 (Indirection, PointerArithmetic): Likewise.
17044 (CheckedExpr, UnCheckedExpr): Likewise.
17045 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17046 (StringPtr): Likewise.
17049 2002-08-05 Martin Baulig <martin@gnome.org>
17051 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17053 * assign.cs (Assign.DoResolve): Check whether the source
17054 expression is a value or variable.
17056 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17057 while resolving the corresponding blocks.
17059 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17060 an error, don't silently return null.
17062 * statement.cs (Block.AddVariable): Do the error reporting here
17063 and distinguish between CS0128 and CS0136.
17064 (Block.DoResolve): Report all unused labels (warning CS0164).
17065 (LabeledStatement): Pass the location to the constructor.
17066 (LabeledStatement.HasBeenReferenced): New property.
17067 (LabeledStatement.Resolve): Set it to true here.
17069 * statement.cs (Return.Emit): Return success even after reporting
17070 a type mismatch error (CS0126 or CS0127), this is what csc does and
17071 it avoids confusing the users with any consecutive errors.
17073 2002-08-05 Martin Baulig <martin@gnome.org>
17075 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17077 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17079 * expression.cs (MemberAccess.DoResolve): Silently return if an
17080 error has already been reported.
17082 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17083 error has already been reported.
17085 2002-08-05 Martin Baulig <martin@gnome.org>
17087 * statement.cs (UsageVector): Only initialize the `parameters'
17088 vector if we actually have any "out" parameters.
17090 2002-08-05 Martin Baulig <martin@gnome.org>
17092 * expression.cs (Binary.ResolveOperator): When combining delegates,
17093 they must have the same type.
17095 2002-08-05 Martin Baulig <martin@gnome.org>
17097 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17098 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17099 work with the ms runtime and we also don't need it: if we're a
17100 PropertyBuilder and not in the `indexer_arguments' hash, then we
17101 are a property and not an indexer.
17103 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17104 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17105 since the latter one doesn't work with the ms runtime.
17107 2002-08-03 Martin Baulig <martin@gnome.org>
17109 Fixed bugs #27998 and #22735.
17111 * class.cs (Method.IsOperator): New public field.
17112 (Method.CheckBase): Report CS0111 if there's already a method
17113 with the same parameters in the current class. Report CS0508 when
17114 attempting to change the return type of an inherited method.
17115 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17116 and it's not marked abstract or extern.
17117 (PropertyBase): New abstract base class for Property and Indexer.
17118 (PropertyBase.CheckBase): Moved here from Property and made it work
17120 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17121 the same so we can reuse it there.
17122 (Property, Indexer): Derive from PropertyBase.
17123 (MethodSignature.inheritable_property_signature_filter): New delegate
17124 to find properties and indexers.
17126 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17127 argument and improved error reporting.
17129 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17130 EmptyReadOnlyParameters and made it a property.
17132 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17133 version of this method which takes a `PropertyInfo indexer'.
17134 (TypeManager.RegisterIndexer): New method.
17136 * class.cs: Added myself as author of this file :-)
17138 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17140 * class.cs: fixed compilation on windoze.
17142 2002-08-03 Martin Baulig <martin@gnome.org>
17144 * interface.cs (Interface.GetInterfaceBases): Check whether all
17145 base interfaces are at least as accessible than the current one.
17147 * class.cs (TypeContainer.GetClassBases): Check whether base types
17148 are at least as accessible than the current type.
17149 (TypeContainer.AsAccessible): Implemented and made non-static.
17150 (MemberBase.CheckParameters): Report errors if the accessibility
17153 * delegate.cs (Delegate.Delegate): The default visibility is
17154 internal for top-level types and private for nested types.
17155 (Delegate.Define): Report errors if the accessibility checks fail.
17157 * enum.cs (Enum.Enum): The default visibility is internal for
17158 top-level types and private for nested types.
17159 (Enum.DefineType): Compute the correct visibility.
17161 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17162 function which takes a `bool is_toplevel' instead of a TypeContainer.
17164 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17167 2002-08-02 Martin Baulig <martin@gnome.org>
17169 * expression.cs (LocalVariableReferenc): Added constructor which
17170 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17171 (LocalVariableReference.IsReadOnly): New property.
17172 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17173 variable is readonly, use our own readonly flag to do this; you can
17174 use the new constructor to get a writable reference to a read-only
17177 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17178 reference to the local variable.
17180 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17182 * rootcontext.cs (ResolveCore): Also include System.Exception
17184 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17185 we reach an EmptyStatement.
17187 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17190 * expression.cs (Binary.ResolveOperator): Check error result in
17193 use brtrue/brfalse directly and avoid compares to null.
17195 2002-08-02 Martin Baulig <martin@gnome.org>
17197 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17198 Fixes bug #28407, added test-155.cs.
17200 2002-08-01 Martin Baulig <martin@gnome.org>
17202 * class.cs (Event.EmitDefaultMethod): Make this work with static
17203 events. Fixes #28311, added verify-3.cs.
17205 2002-08-01 Martin Baulig <martin@gnome.org>
17207 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17208 `is_disposable' fields.
17209 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17210 `hm.is_disposable' if we're using the collection pattern.
17211 (Foreach.EmitCollectionForeach): Use the correct type for the
17212 enumerator's local variable, only emit the try/finally block if
17213 necessary (fixes #27713).
17215 2002-08-01 Martin Baulig <martin@gnome.org>
17217 * ecore.cs (Expression.report118): Renamed to Error118 and made
17220 * statement.cs (Throw.Resolve): Check whether the expression is of
17221 the correct type (CS0118) and whether the type derives from
17222 System.Exception (CS0155).
17223 (Catch.Resolve): New method. Do the type lookup here and check
17224 whether it derives from System.Exception (CS0155).
17225 (Catch.CatchType, Catch.IsGeneral): New public properties.
17227 * typemanager.cs (TypeManager.exception_type): Added.
17229 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17231 * driver.cs: Updated About function.
17233 2002-07-31 Martin Baulig <martin@gnome.org>
17235 Implemented Control Flow Analysis.
17237 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17238 (EmitContext.CurrentBranching): Added.
17239 (EmitContext.StartFlowBranching): Added.
17240 (EmitContext.EndFlowBranching): Added.
17241 (EmitContext.KillFlowBranching): Added.
17242 (EmitContext.IsVariableAssigned): Added.
17243 (EmitContext.SetVariableAssigned): Added.
17244 (EmitContext.IsParameterAssigned): Added.
17245 (EmitContext.SetParameterAssigned): Added.
17246 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17247 Added control flow analysis stuff here.
17249 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17250 resolve the expression as lvalue.
17251 (LocalVariableReference.DoResolve): Check whether the variable has
17252 already been assigned.
17253 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17254 the parameter as assigned here.
17255 (ParameterReference.DoResolve): Check whether the parameter has already
17257 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17258 expression as lvalue.
17260 * statement.cs (FlowBranching): New class for the flow analysis code.
17261 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17262 (LabeledStatement.IsDefined): New public property.
17263 (LabeledStatement.AddUsageVector): New public method to tell flow
17264 analyis that the label may be reached via a forward jump.
17265 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17267 (VariableInfo.Number): New public field. This is used by flow analysis
17268 to number all locals of a block.
17269 (Block.CountVariables): New public property. This is the number of
17270 local variables in this block (including the locals from all parent
17272 (Block.EmitMeta): Number all the variables.
17274 * statement.cs: Added flow analysis support to all classes.
17276 2002-07-31 Martin Baulig <martin@gnome.org>
17278 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17279 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17280 then use this argument.
17282 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17284 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17285 use this to specify /define options.
17287 2002-07-29 Martin Baulig <martin@gnome.org>
17289 * statement.cs (Fixed): Moved all code that does variable lookups
17290 and resolvings from Emit to Resolve.
17292 * statement.cs (For): Moved all code that does variable lookups
17293 and resolvings from Emit to Resolve.
17295 * statement.cs (Using): Moved all code that does variable lookups
17296 and resolvings from Emit to Resolve.
17298 2002-07-29 Martin Baulig <martin@gnome.org>
17300 * attribute.cs (Attribute.Resolve): Explicitly catch a
17301 System.NullReferenceException when creating the
17302 CustromAttributeBuilder and report a different warning message.
17304 2002-07-29 Martin Baulig <martin@gnome.org>
17306 * support.cs (ParameterData.ParameterName): Added method to
17307 get the name of a parameter.
17309 * typemanager.cs (TypeManager.IsValueType): New public method.
17311 2002-07-29 Martin Baulig <martin@gnome.org>
17313 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17314 is a flag which specifies that it's either ref or out.
17315 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17316 the out parameter to `out Parameter.Modifier mod', also set the
17317 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17319 * support.cs (InternalParameters.ParameterModifier): Distinguish
17320 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17321 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17323 * expression.cs (Argument.GetParameterModifier): Distinguish
17324 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17325 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17327 2002-07-29 Martin Baulig <martin@gnome.org>
17329 * expression.cs (ParameterReference.ParameterReference): Added
17330 `Location loc' argument to the constructor.
17332 * cs-parser.jay: Pass location to ParameterReference.
17334 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17336 * statement.cs (Try): Initialize the location.
17338 * cs-parser.jay: pass location to Try.
17340 * expression.cs (Unary.Reduce): Change the prototype to return
17341 whether a constant fold could be performed or not. The result is
17342 returned in an out parameters. In the case of Indirection and
17343 AddressOf, we want to perform the full tests.
17345 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17347 * statement.cs (Statement.Emit): Flag dead code.
17349 2002-07-27 Andrew Birkett <andy@nobugs.org>
17351 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17353 2002-07-27 Martin Baulig <martin@gnome.org>
17355 * class.cs (MethodData.Define): Put back call to
17356 TypeManager.AddMethod(), accidentally commented this out.
17358 * report.cs (Debug): New public method to print debugging information,
17359 this is `[Conditional ("DEBUG")]'.
17361 2002-07-26 Martin Baulig <martin@gnome.org>
17363 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17364 (switch_statement): Push the current_block to the switch_stack and
17365 pop it again when we're done with the switch.
17366 (switch_section): The new block is a child of the current_block.
17367 Fixes bug #24007, added test-152.cs.
17369 2002-07-27 Martin Baulig <martin@gnome.org>
17371 * expression.cs (Invocation.EmitArguments): When calling a varargs
17372 function with only its fixed arguments, we need to pass an empty
17375 2002-07-27 Martin Baulig <martin@gnome.org>
17377 Mono 0.13 has been released.
17379 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17381 * driver.cs: Rename --resource to --linkres, because that is what
17382 we do currently, we dont support --resource yet.
17384 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17386 2002-07-25 Martin Baulig <martin@gnome.org>
17388 * class.cs (MethodData): New public class. This is a `method builder'
17389 class for a method or one accessor of a Property/Indexer/Event.
17390 (MethodData.GetMethodFlags): Moved here from MemberBase.
17391 (MethodData.ApplyAttributes): Likewise.
17392 (MethodData.ApplyObsoleteAttribute): Likewise.
17393 (MethodData.ApplyConditionalAttribute): Likewise.
17394 (MethodData.ApplyDllImportAttribute): Likewise.
17395 (MethodData.CheckAbstractAndExternal): Likewise.
17396 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17397 (MethodData.Emit): Formerly known as Method.Emit().
17398 (MemberBase): Moved everything which was specific to a single
17399 accessor/method to MethodData.
17400 (Method): Create a new MethodData and call Define() and Emit() on it.
17401 (Property, Indexer, Event): Create a new MethodData objects for each
17402 accessor and call Define() and Emit() on them.
17404 2002-07-25 Martin Baulig <martin@gnome.org>
17406 Made MethodCore derive from MemberBase to reuse the code from there.
17407 MemberBase now also checks for attributes.
17409 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17410 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17412 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17413 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17414 (MemberBase.ApplyAttributes): New virtual method; applies the
17415 attributes to a method or accessor.
17416 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17417 (MemberBase.ApplyConditionalAttribute): Likewise.
17418 (MemberBase.ApplyDllImportAttribute): Likewise.
17419 (MemberBase.CheckAbstractAndExternal): Likewise.
17420 (MethodCore.ParameterTypes): This is now a property instead of a
17421 method, it's initialized from DoDefineParameters().
17422 (MethodCore.ParameterInfo): Removed the set accessor.
17423 (MethodCore.DoDefineParameters): New protected virtual method to
17424 initialize ParameterTypes and ParameterInfo.
17425 (Method.GetReturnType): We can now simply return the MemberType.
17426 (Method.GetMethodFlags): Override the MemberBase version and add
17427 the conditional flags.
17428 (Method.CheckBase): Moved some code from Define() here, call
17429 DoDefineParameters() here.
17430 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17431 here to avoid some larger code duplication.
17432 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17433 ensure that abstract and external accessors don't declare a body.
17435 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17436 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17437 lookup in the attribute's parent classes, so we need to abort as soon
17438 as we found the first match.
17439 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17440 the attribute has no arguments.
17442 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17445 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17447 * cs-parser.jay: reverted previous patch.
17449 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17451 * cs-parser.jay: fixed bug #22119.
17453 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17455 * attribute.cs: fixed compilation. The error was:
17456 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17457 be assigned to before control leaves the current method."
17458 [FIXME: Filed as bug #28186: MCS must report this error.]
17460 2002-07-25 Martin Baulig <martin@gnome.org>
17462 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17463 method to pull the condition name ouf of a Conditional attribute.
17464 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17465 the obsolete message and error flag out of an Obsolete attribute.
17467 * class.cs (Method.GetMethodFlags): New public method to get the
17468 TypeManager.MethodFlags for this method.
17469 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17471 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17472 if we're overriding a virtual function, set the new private variable
17473 `parent_method'; call the new TypeManager.AddMethod().
17475 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17476 the MethodBuilder and the Method in a PtrHashtable.
17477 (TypeManager.builder_to_method): Added for this purpose.
17478 (TypeManager.MethodFlags): Added IsObsoleteError.
17479 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17480 Obsolete and Conditional arguments in MethodBuilders. If we discover
17481 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17482 the message from the attribute.
17484 2002-07-24 Martin Baulig <martin@gnome.org>
17486 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17487 preprocessor directives, ensure that the argument to #define/#undef is
17488 exactly one identifier and that it's actually an identifier.
17490 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17493 2002-07-24 Martin Baulig <martin@gnome.org>
17495 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17496 initialize it to TypeManager.object_type in the constructor.
17497 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17498 of the `hm.get_current' method if we're using the collection pattern.
17499 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17500 for the explicit conversion to make it work when we're using the collection
17501 pattern and the `Current' property has a different return type than `object'.
17504 2002-07-24 Martin Baulig <martin@gnome.org>
17506 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17507 does not match, but don't report any errors. This method is called in
17508 order for all methods in a MethodGroupExpr until a matching method is
17509 found, so we don't want to bail out if the first method doesn't match.
17510 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17511 matches, report the 123. Fixes #28070.
17513 2002-07-24 Martin Baulig <martin@gnome.org>
17515 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17516 TypeManager.TypeToCoreType() to the top of the method so the
17517 following equality checks will work. Fixes #28107.
17519 2002-07-24 Martin Baulig <martin@gnome.org>
17521 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17522 operand is of type uint, and the other operand is of type sbyte,
17523 short or int, the operands are converted to type long." -
17524 Actually do what this comment already told us. Fixes bug #28106,
17527 2002-07-24 Martin Baulig <martin@gnome.org>
17529 * class.cs (MethodBase): New abstract class. This is now a base
17530 class for Property, Indexer and Event to avoid some code duplication
17531 in their Define() and DefineMethods() methods.
17532 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17533 generic methods for Define() and DefineMethods().
17534 (FieldBase): Derive from MemberBase, not MemberCore.
17535 (Property): Derive from MemberBase, not MemberCore.
17536 (Property.DefineMethod): Moved all the code from this method to the
17537 new MethodBase.DefineAccessor(), just call it with appropriate
17539 (Property.Define): Call the new Property.DoDefine(), this does some
17540 sanity checks and we don't need to duplicate the code everywhere.
17541 (Event): Derive from MemberBase, not MemberCore.
17542 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17543 accessors, this will also make them work with interface events.
17544 (Indexer): Derive from MemberBase, not MemberCore.
17545 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17546 (Indexer.Define): Use the new MethodBase functions.
17548 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17549 argument to the constructor.
17550 (Interface.FindMembers): Added support for interface events.
17551 (Interface.PopluateEvent): Implemented.
17553 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17555 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17557 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17558 but this is required to check for a method name being the same as
17559 the containing class.
17563 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17565 * interface.cs: initialize variable.
17567 2002-07-23 Martin Baulig <martin@gnome.org>
17569 Implemented the IndexerName attribute in interfaces.
17571 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17572 name if this is an explicit interface implementation.
17573 (Indexer.InterfaceIndexerName): New public variable. If we're
17574 implementing an interface indexer, this is the IndexerName in that
17575 interface. Otherwise, it's the IndexerName.
17576 (Indexer.DefineMethod): If we're implementing interface indexer,
17577 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17578 and Pending.ImplementIndexer methods.
17579 (Indexer.Define): Also define the PropertyBuilder if we're
17580 implementing an interface indexer and this is neither an explicit
17581 interface implementation nor do the IndexerName match the one in
17584 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17585 If a method is defined here, then we always need to create a proxy
17586 for it. This is used when implementing interface indexers.
17587 (Pending.IsInterfaceIndexer): New public method.
17588 (Pending.ImplementIndexer): New public method.
17589 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17590 This is used when implementing interface indexers to define a proxy
17592 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17593 define a proxy if necessary.
17595 * interface.cs (Interface.IndexerName): New public variable.
17596 (Interface.PopulateIndexer): Set the IndexerName.
17597 (Interface.DefineIndexers): New private method. Populate all the
17598 indexers and make sure their IndexerNames match.
17600 * typemanager.cs (IndexerPropertyName): Added support for interface
17603 2002-07-22 Martin Baulig <martin@gnome.org>
17605 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17606 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17607 ret if HasReturnLabel.
17608 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17611 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17612 and set the ec.LoopBeginTryCatchLevel.
17613 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17614 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17615 the current ec.TryCatchLevel, the branch goes out of an exception
17616 block. In this case, we need to use Leave and not Br.
17618 2002-07-22 Martin Baulig <martin@gnome.org>
17620 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17621 block unless the block does not always return or it is contained in
17622 another try { ... } catch { ... } block. Fixes bug #26506.
17623 Added verify-1.cs to the test suite.
17625 2002-07-22 Martin Baulig <martin@gnome.org>
17627 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17628 then we do not always return. Fixes bug #24985.
17630 2002-07-22 Martin Baulig <martin@gnome.org>
17632 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17633 lookup on a per-class level; ie. walk up the class hierarchy until we
17634 found at least one applicable method, then choose the best among them.
17635 Fixes bug #24463 and test-29.cs.
17637 2002-07-22 Martin Baulig <martin@gnome.org>
17639 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17640 return types of the methods. The return type is not part of the
17641 signature and we must not check it to make the `new' modifier work.
17642 Fixes bug #27999, also added test-147.cs.
17643 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17645 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17646 on the method's return type.
17648 2002-07-21 Martin Baulig <martin@gnome.org>
17650 * assign.cs: Make this work if the rightmost source is a constant and
17651 we need to do an implicit type conversion. Also adding a few more tests
17652 to test-38.cs which should have caught this.
17654 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17655 target in the makefile for this. The makefile.gnu is primarily intended
17656 for end-users who don't want to debug the compiler.
17658 2002-07-21 Martin Baulig <martin@gnome.org>
17660 * assign.cs: Improved the Assign class so it can now handle embedded
17661 assignments (X = Y = Z = something). As a side-effect this'll now also
17662 consume less local variables. test-38.cs now passes with MCS, added
17663 a few new test cases to that test.
17665 2002-07-20 Martin Baulig <martin@gnome.org>
17667 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17668 instructions. Fixes bug #27977, also added test-146.cs.
17670 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17672 * cs-tokenizer.cs: fixed getHex ().
17674 2002-07-19 Martin Baulig <martin@gnome.org>
17676 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17677 not Type.GetType() to lookup the array type. This is needed when
17678 we're constructing an array of a user-defined type.
17679 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17680 single-dimensional arrays, but also for single-dimensial arrays of
17683 2002-07-19 Martin Baulig <martin@gnome.org>
17685 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17686 this function is called, it's not allowed to share LocalBuilders
17687 among ILGenerators.
17689 2002-07-19 Martin Baulig <martin@gnome.org>
17691 * expression.cs (Argument.Resolve): Report an error 118 when trying
17692 to pass a type as argument.
17694 2002-07-18 Martin Baulig <martin@gnome.org>
17696 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17697 Conv_R_Un for the signed `long' type.
17699 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17701 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17702 `expr' for the temporary result, as that will fail if we do
17703 multiple resolves on the same expression.
17705 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17707 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17708 ec.TypeContainer for looking up aliases.
17710 * class.cs (TypeContainer): Remove LookupAlias from here.
17712 * decl.cs (DeclSpace); Move here.
17714 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17716 * class.cs (FindMembers): Only call filter if the constructor
17717 bulider is not null.
17719 Also handle delegates in `NestedTypes' now. Now we will perform
17720 type lookups using the standard resolution process. This also
17723 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17724 This uses Expressions (the limited kind that can be parsed by the
17725 tree) instead of strings.
17727 * expression.cs (ComposedCast.ToString): Implement, used to flag
17728 errors since now we have to render expressions.
17730 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17733 * ecore.cs (SimpleName.ToString): ditto.
17735 * cs-parser.jay: Instead of using strings to assemble types, use
17736 Expressions to assemble the type (using SimpleName, ComposedCast,
17737 MemberAccess). This should fix the type lookups in declarations,
17738 because we were using a different code path for this.
17740 * statement.cs (Block.Resolve): Continue processing statements
17741 even when there is an error.
17743 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17745 * class.cs (Event.Define): Also remove the `remove' method from
17746 the list of pending items.
17748 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17749 generate more compact code.
17751 2002-07-17 Martin Baulig <martin@gnome.org>
17753 * const.cs (Const.LookupConstantValue): Add support for constant
17754 `unchecked' and `checked' expressions.
17755 Also adding test case test-140.cs for this.
17757 2002-07-17 Martin Baulig <martin@gnome.org>
17759 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17760 check whether mi.ReturnType implements the IEnumerator interface; the
17761 `==' and the IsAssignableFrom() will fail in this situation.
17763 2002-07-16 Ravi Pratap <ravi@ximian.com>
17765 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17768 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17770 * expression.cs: fixed bug #27811.
17772 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17774 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17775 Molaro: when we are a ref, the value already contains a pointer
17776 value, do not take the address of it.
17778 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17779 * removed mb-parser.jay and mb-tokenizer.cs
17781 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17783 * expression.cs: check against the building corlib void type.
17785 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17787 * ecore.cs: fix for valuetype static readonly fields: when
17788 initializing them, we need their address, not the address of a copy.
17790 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17792 * typemanager.cs: register also enum_type in corlib.
17794 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17796 * class.cs: allow calling this (but not base) initializers in structs.
17798 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17800 * ecore.cs: make sure we compare against the building base types
17803 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17805 * typemanager.cs: fix TypeToCoreType() to handle void and object
17806 (corlib gets no more typerefs after this change).
17808 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17810 * expression.cs (ArrayCreation.EmitArrayArguments): use
17811 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17813 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17814 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17815 array indexes, the runtime actually forbids them.
17817 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17818 for array arguments here.
17820 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17821 instead of the default for ValueTypes.
17823 (New.DoEmit): Use IsValueType instead of
17824 IsSubclassOf (value_type)
17825 (New.DoResolve): ditto.
17826 (Invocation.EmitCall): ditto.
17828 * assign.cs (Assign): ditto.
17830 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17831 Statements *are* currently doing part of their resolution during
17834 Expressions do always resolve during resolve, but statements are
17835 only required to propagate resolution to their children.
17837 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17839 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17841 (LoadAssembly): Do not add the dll if it is already specified
17843 (MainDriver): Add the System directory to the link path at the end,
17844 after all the other -L arguments.
17846 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17847 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17848 ldelem.u1) and using the opposite for sbytes.
17850 This fixes Digger, and we can finally run it.
17852 * driver.cs (UnixParseOption): Move the option parsing here.
17853 (CSCParseOption): Implement CSC-like parsing of options.
17855 We now support both modes of operation, the old Unix way, and the
17856 new CSC-like way. This should help those who wanted to make cross
17857 platform makefiles.
17859 The only thing broken is that /r:, /reference: and /lib: are not
17860 implemented, because I want to make those have the same semantics
17861 as the CSC compiler has, and kill once and for all the confussion
17862 around this. Will be doing this tomorrow.
17864 * statement.cs (Unsafe.Resolve): The state is checked during
17865 resolve, not emit, so we have to set the flags for IsUnsfe here.
17867 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17869 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17870 not catch the Error_ObjectRefRequired in SimpleName (as it is
17871 possible to have a class/instance variable name that later gets
17872 deambiguated), we have to check this here.
17874 2002-07-10 Ravi Pratap <ravi@ximian.com>
17876 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17877 make static and put into Expression.
17879 (Event.Define): Register the private field of the event with the
17880 TypeManager so that GetFieldFromEvent can get at it.
17882 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17883 keep track of the private field associated with an event which
17886 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17889 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17891 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17893 * expression.cs (Binary.EmitBranchable): this routine emits the
17894 Binary expression in a branchable context. This basically means:
17895 we need to branch somewhere, not just get the value on the stack.
17897 This works together with Statement.EmitBoolExpression.
17899 * statement.cs (Statement.EmitBoolExpression): Use
17902 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17904 * statement.cs (For): Reduce the number of jumps in loops.
17906 (For): Implement loop inversion for the For statement.
17908 (Break): We can be breaking out of a Try/Catch controlled section
17909 (foreach might have an implicit try/catch clause), so we need to
17910 use Leave instead of Br.
17912 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17913 now). If the instace expression supports IMemoryLocation, we use
17914 the AddressOf method from the IMemoryLocation to extract the
17915 address instead of emitting the instance.
17917 This showed up with `This', as we were emitting the instance
17918 always (Emit) instead of the Address of This. Particularly
17919 interesting when This is a value type, as we dont want the Emit
17920 effect (which was to load the object).
17922 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17924 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17926 * statement.cs (Checked): Set the CheckedState during the resolve
17927 process too, as the ConvCast operations track the checked state on
17928 the resolve process, and not emit.
17930 * cs-parser.jay (namespace_member_declaration): Flag that we have
17931 found a declaration when we do. This is used to flag error 1529
17933 * driver.cs: Report ok when we display the help only.
17935 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17937 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17939 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17941 * cs-tokenizer.cs (define): We also have to track locally the
17942 defines. AllDefines is just used for the Conditional Attribute,
17943 but we also need the local defines for the current source code.
17945 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17947 * statement.cs (While, For, Do): These loops can exit through a
17948 Break statement, use this information to tell whether the
17949 statement is the last piece of code.
17951 (Break): Flag that we break.
17953 * codegen.cs (EmitContexts): New `Breaks' state variable.
17955 2002-07-03 Martin Baulig <martin@gnome.org>
17957 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17958 modifiers in method declarations in structs. Otherwise, you won't
17959 be able to override things like Object.Equals().
17961 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17963 * class.cs (Method, Property, Indexer): Do not allow the public
17964 modifier to be used in explicit interface implementations.
17966 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17967 override modifiers in method declarations in structs
17969 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17971 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17972 integer or real overflow, report an error
17974 2002-07-02 Martin Baulig <martin@gnome.org>
17976 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17977 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17978 to tell the runtime about our newly created System.Object and
17979 System.ValueType types.
17981 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17983 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17984 struct instead of Ldarg/Starg.
17986 2002-07-02 Martin Baulig <martin@gnome.org>
17988 * expression.cs (Indirection.Indirection): Call
17989 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17991 2002-07-02 Martin Baulig <martin@gnome.org>
17993 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17994 ValueType, call TypeManager.TypeToCoreType() on it.
17995 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17996 the OpCodes.Newarr argument.
17998 2002-07-02 Martin Baulig <martin@gnome.org>
18000 * expression.cs (Invocation.EmitCall): When compiling corlib,
18001 replace all calls to the system's System.Array type to calls to
18002 the newly created one.
18004 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18005 System.Array methods.
18006 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18007 from the system's System.Array type which must be replaced.
18009 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18011 * typemanager.cs: load unverifiable_code_ctor so we can build
18012 corlib using the correct type. Avoid using GetTypeCode() with
18014 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18015 TypeManager.object_type to allow building corlib.
18017 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18019 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18021 2002-07-01 Martin Baulig <martin@gnome.org>
18023 * class.cs: Make the last change actually work, we need to check
18024 whether `ifaces != null' to avoid a crash.
18026 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18028 * class.cs: when we build structs without fields that implement
18029 interfaces, we need to add the interfaces separately, since there is
18030 no API to both set the size and add the interfaces at type creation
18033 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18035 * expression.cs: the dimension arguments to the array constructors
18036 need to be converted if they are a long.
18038 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18040 * class.cs: don't emit ldarg.0 if there is no parent constructor
18041 (fixes showstopper for corlib).
18043 2002-06-29 Martin Baulig <martin@gnome.org>
18045 MCS now compiles corlib on GNU/Linux :-)
18047 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18048 ie. check for MethodImplOptions.InternalCall.
18050 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18051 and TypeManager.attribute_type are null, so we must explicitly check
18052 whether parent is not null to find out whether it's an attribute type.
18053 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18054 and SetBuilder, not only if the property is neither abstract nor external.
18055 This is necessary to set the MethodImplOptions on the accessor methods.
18056 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18057 SetBuilder, see Property.Emit().
18059 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18060 populate "System.Object", "System.ValueType" and "System.Attribute" since
18061 they've already been populated from BootCorlib_PopulateCoreTypes().
18063 2002-06-29 Martin Baulig <martin@gnome.org>
18065 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18066 is the NullLiteral, we also need to make sure that target_type is not
18069 2002-06-29 Martin Baulig <martin@gnome.org>
18071 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18072 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18073 before calling BootstrapCorlib_ResolveDelegate ().
18075 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18077 * statement.cs: fixed build-breaker. All tests passed ok.
18079 2002-06-27 Martin Baulig <martin@gnome.org>
18081 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18082 for System.Decimal when compiling corlib.
18084 2002-06-27 Martin Baulig <martin@gnome.org>
18086 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18087 switch blocks which contain nothing but a default clause.
18089 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18091 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18093 2002-06-27 Martin Baulig <martin@gnome.org>
18095 * ecore.cs (PropertyExpr.PropertyExpr): Call
18096 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18098 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18099 is already a TypeBuilder.
18101 2002-06-27 Martin Baulig <martin@gnome.org>
18103 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18104 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18105 the "from an array-type to System.Array" case. This makes it work
18106 when compiling corlib.
18108 2002-06-27 Martin Baulig <martin@gnome.org>
18110 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18111 non-static PropertyExpr, set its InstanceExpression. This makes
18112 the `ICollection.Count' property work in System/Array.cs.
18114 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18116 * driver.cs: Made error handling more consistent. Errors now
18117 tracked by Report class, so many methods which used to return int
18118 now return void. Main() now prints success/failure and
18119 errors/warnings message.
18121 Renamed '--probe' compiler argument to '--expect-error'. Removed
18122 the magic number return values (123 and 124). Now, if the
18123 expected error occurs, the compiler exits with success (exit value
18124 0). If the compilation completes without seeing that particular
18125 error, the compiler exits with failure (exit value 1). The
18126 makefile in mcs/errors has been changed to handle the new behaviour.
18128 * report.cs: Made 'expected error' number a property and renamed
18129 it from 'Probe' to 'ExpectedError'.
18131 * genericparser.cs: Removed error handling support, since it is
18132 now all done by Report class.
18134 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18135 class, so parse() no longer returns an int.
18137 * namespace.cs: Use Report.Error instead of GenericParser.error
18139 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18141 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18142 TypeContainer.AddOperator): At the front of the list put the
18143 explicit implementations, so they get resolved/defined first.
18145 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18147 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18148 interface type is implemented by this TypeContainer. Used during
18149 explicit interface implementation.
18151 (Property.Define, Indexer.Define, Method.Define): Validate that
18152 the given interface in the explicit implementation is one of the
18153 base classes for the containing type.
18155 Also if we are explicitly implementing an interface, but there is
18156 no match in the pending implementation table, report an error.
18158 (Property.Define): Only define the property if we are
18159 not explicitly implementing a property from an interface. Use the
18160 correct name also for those properties (the same CSC uses,
18161 although that is really not needed).
18163 (Property.Emit): Do not emit attributes for explicitly implemented
18164 properties, as there is no TypeBuilder.
18166 (Indexer.Emit): ditto.
18168 Hiding then means that we do not really *implement* a pending
18169 implementation, which makes code fail.
18171 2002-06-22 Martin Baulig <martin@gnome.org>
18173 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18174 the return value of Object.GetType(). [FIXME: we need to do this whenever
18175 we get a type back from the reflection library].
18177 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18179 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18181 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18183 * attribute.cs: Return null if we can not look up the type.
18185 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18186 the interface types found.
18188 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18189 interface types found.
18191 * typemanager.cs (GetInterfaces): Make this routine returns alll
18192 the interfaces and work around the lame differences between
18193 System.Type and System.Reflection.Emit.TypeBuilder in the results
18194 result for GetInterfaces.
18196 (ExpandInterfaces): Given an array of interface types, expand and
18197 eliminate repeated ocurrences of an interface. This expands in
18198 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18201 2002-06-21 Martin Baulig <martin@gnome.org>
18203 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18206 2002-06-21 Martin Baulig <martin@gnome.org>
18208 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18209 and called with one of the core types, return the corresponding typebuilder for
18212 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18215 2002-06-21 Martin Baulig <martin@gnome.org>
18217 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18218 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18219 (Expression.ConvertReferenceExplicit): Likewise.
18221 * expression.cs (ElementAccess.DoResolve): Likewise.
18222 (ElementAccess.DoResolveLValue): Likewise.
18224 2002-06-10 Martin Baulig <martin@gnome.org>
18226 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18227 add the "value" parameter to the parameter list.
18229 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18232 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18234 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18235 the argument to an int, uint, long or ulong, per the spec. Also
18236 catch negative constants in array creation.
18238 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18240 * class.cs: do not allow the same interface to appear twice in
18241 the definition list.
18243 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18245 * ecore.cs: don't use ldlen with System.Array.
18247 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18249 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18251 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18253 * modifiers.cs: produce correct field attributes for protected
18254 internal. Easy fix so miguel can work on ther harder stuff:-)
18256 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18258 * pending.cs: New file. Move the code from class.cs here.
18259 Support clearning the pending flag for all methods (when not doing
18260 explicit interface implementation).
18262 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18264 * rootcontext.cs: added a couple more types needed to bootstrap.
18266 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18268 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18269 constructor in the type, instead of any constructor in the type
18270 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18271 a bug in the Mono runtime when applying the params attribute).
18273 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18274 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18276 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18278 * expression.cs (Unary.ResolveOperator): Use TypeManager
18279 to resolve the type.
18281 2002-06-13 Ravi Pratap <ravi@ximian.com>
18283 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18286 * enum.cs (AddEnumMember): Add support to store the attributes associated
18287 with each member too.
18289 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18290 field builders too - this takes care of the enum member case.
18292 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18294 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18295 address-of operator on both value types and pointers.
18297 2002-06-10 Martin Baulig <martin@gnome.org>
18299 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18300 PropertyBuilder to the `property_builders' list.
18302 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18303 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18304 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18305 find any indexers which are inherited from an interface.
18307 2002-06-09 Martin Baulig <martin@gnome.org>
18309 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18310 the same type as the constant if necessary. There's also a test-130.cs
18313 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18315 * typemanager.cs (TypeManager.ChangeType): Previously known as
18316 Enum.ChangeEnumType().
18318 2002-06-09 Martin Baulig <martin@gnome.org>
18320 * expression.cs (Cast.TryReduce): Added support for consts.
18322 2002-06-08 Ravi Pratap <ravi@ximian.com>
18324 * class.cs (Accessor): Hold attributes information so we can pass
18327 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18328 Modify to pass in attributes attached to the methods.
18330 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18332 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18333 to handle the Accessor kind :-)
18335 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18337 2002-06-08 Martin Baulig <martin@gnome.org>
18339 * expression.cs (Unary.TryReduceNegative): Added support for
18342 2002-06-08 Martin Baulig <martin@gnome.org>
18344 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18345 name can't be found in the `defined_names' - the caller will do a
18346 MemberLookup in this case and thus find methods in System.Enum
18347 such as Enum.IsDefined().
18349 2002-06-08 Martin Baulig <martin@gnome.org>
18351 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18352 Convert.ChangeType() which works with TypeBuilder created types.
18353 (Enum.LookupEnumValue, Enum.Define): Use it here.
18355 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18356 `TypeBuilder.BaseType != null' check.
18357 (TypeContainer.FindMembers): Only lookup parent members if we
18358 actually have a parent.
18359 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18360 (ConstructorInitializer.Resolve): Likewise.
18362 * interface.cs (Interface.FindMembers): Added
18363 `TypeBuilder.BaseType != null' check.
18365 * rootcontext.cs (RootContext.ResolveCore): Added
18366 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18367 classes_second_stage.
18369 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18370 debug_type and trace_type when compiling with --nostdlib.
18372 2002-06-07 Martin Baulig <martin@gnome.org>
18374 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18375 (AddField): Set it to true when adding a non-static field.
18376 (DefineType): Use `have_nonstatic_fields' to find out whether we
18377 have non-static fields, not `Fields != null'.
18379 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18381 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18382 dereferencing a null on the static-field code path)
18384 2002-05-30 Martin Baulig <martin@gnome.org>
18386 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18387 to take command line arguments. Use reflection to call the new
18388 custom `Initialize' function on the symbol writer and pass it the
18389 command line arguments.
18391 * driver.cs (--debug-args): New command line argument to pass command
18392 line arguments to the symbol writer.
18394 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18396 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18397 the target type for indexers and properties. Thanks to Joe for
18400 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18402 * typemanager.cs (MethodFlags): returns the method flags
18403 (Obsolete/ShouldIgnore) that control warning emission and whether
18404 the invocation should be made, or ignored.
18406 * expression.cs (Invocation.Emit): Remove previous hack, we should
18407 not do this on matching a base type, we should do this based on an attribute
18409 Only emit calls to System.Diagnostics.Debug and
18410 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18411 on the command line.
18413 * rootcontext.cs: Global settings for tracing and debugging.
18415 * cs-tokenizer.cs (define): New utility function to track
18416 defines. Set the global settings for TRACE and DEBUG if found.
18418 2002-05-25 Ravi Pratap <ravi@ximian.com>
18420 * interface.cs (Populate*): Pass in the TypeContainer as well as
18421 the DeclSpace as parameters so that we can create EmitContexts and
18422 then use that to apply attributes etc.
18424 (PopulateMethod, PopulateEvent, PopulateProperty)
18425 (PopulateIndexer): Apply attributes everywhere.
18427 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18430 (ApplyAttributes): Update accordingly.
18432 We now apply interface attributes for all members too.
18434 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18436 * class.cs (Indexer.Define); Correctly check if we are explicit
18437 implementation (instead of checking the Name for a ".", we
18438 directly look up if the InterfaceType was specified).
18440 Delay the creation of the PropertyBuilder.
18442 Only create the PropertyBuilder if we are not an explicit
18443 interface implementation. This means that explicit interface
18444 implementation members do not participate in regular function
18445 lookups, and hence fixes another major ambiguity problem in
18446 overload resolution (that was the visible effect).
18448 (DefineMethod): Return whether we are doing an interface
18451 * typemanager.cs: Temporary hack until we get attributes in
18452 interfaces (Ravi is working on that) and we get IndexerName
18453 support in interfaces.
18455 * interface.cs: Register the indexers as properties.
18457 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18458 warning, I have verified that this is a bug in the .NET runtime
18459 (JavaScript suffers of the same problem).
18461 * typemanager.cs (MemberLookup): When looking up members for
18462 interfaces, the parent of an interface is the implicit
18463 System.Object (so we succeed in searches of Object methods in an
18464 interface method invocation. Example: IEnumerable x; x.ToString
18467 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18469 * class.cs (Event): Events should also register if they do
18470 implement the methods that an interface requires.
18472 * typemanager.cs (MemberLookup); use the new GetInterfaces
18475 (GetInterfaces): The code used to lookup interfaces for a type is
18476 used in more than one place, factor it here.
18478 * driver.cs: Track the errors at the bottom of the file, we kept
18481 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18482 instance if the method we are calling is static!
18484 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18486 * attribute.cs (ApplyAttributes): Make this function filter out
18487 the IndexerName attribute (as that attribute in reality is never
18488 applied) and return the string constant for the IndexerName
18491 * class.cs (TypeContainer.Emit): Validate that all the indexers
18492 have the same IndexerName attribute, and if so, set the
18493 DefaultName attribute on the class.
18495 * typemanager.cs: The return value might contain other stuff (not
18496 only methods). For instance, consider a method with an "Item"
18497 property and an Item method.
18499 * class.cs: If there is a problem with the parameter types,
18502 2002-05-24 Ravi Pratap <ravi@ximian.com>
18504 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18505 looks at user defined conversion after making a call to
18506 StandardConversionExists - we need this for overload resolution.
18508 * expression.cs : Update accordingly the various method calls.
18510 This fixes 2 bugs filed against implicit user defined conversions
18512 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18514 * statement.cs: Track the result of the assignment.
18516 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18518 * expression.cs (MemberAccess): Improved error reporting for
18519 inaccessible members.
18521 2002-05-22 Martin Baulig <martin@gnome.org>
18523 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18524 itself with debugging support.
18526 2002-05-22 Martin Baulig <martin@gnome.org>
18528 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18529 Removed, this isn't needed anymore.
18531 2002-05-20 Martin Baulig <martin@gnome.org>
18533 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18534 be underlying type for an enum.
18536 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18538 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18539 that splits out the loading of just the core types.
18541 * rootcontext.cs (ResolveCore): Split the struct resolution in
18542 two, so we can load the enumeration underlying types before any
18545 * expression.cs (Is): Bandaid until we fix properly Switch (see
18546 bug #24985 for details).
18548 * typemanager.cs (ImplementsInterface): The hashtable will contain
18549 a null if there are no interfaces implemented.
18551 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18553 * cs-parser.jay (indexer_declarator): It is fine to have array
18556 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18558 * typemanager.cs: (RegisterBuilder): New function used to register
18559 TypeBuilders that implement interfaces. Since
18560 TypeBuilder.GetInterfaces (as usual) does not work with lame
18562 (AddUserType): register interfaces.
18564 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18565 dealing with TypeBuilder. Also, arrays are showing up as
18566 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18567 methods can not be invoked on them!
18569 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18570 (ImplicitReferenceConversionExists): Split out from
18571 StandardConversionExists.
18573 * expression.cs (As): We were only implementing one of the three
18574 cases for the as operator. We now implement them all.
18575 (Is): Implement the various other cases for Is as well.
18577 * typemanager.cs (CACHE): New define used to control if we want or
18578 not the FindMembers cache. Seems to have a negative impact on
18579 performance currently
18581 (MemberLookup): Nested types have full acess to
18582 enclosing type members
18584 Remove code that coped with instance/static returns for events, we
18585 now catch this in RealFindMembers.
18587 (RealFindMembers): only perform static lookup if the instance
18588 lookup did not return a type or an event.
18590 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18592 * assign.cs (CompoundAssign): We pass more semantic information
18593 now to Compound Assignments than we did before: now we have all
18594 the information at hand, and now we resolve the target *before* we
18595 do the expression expansion, which allows the "CacheValue" method
18596 to have the effect we intended (before, a [x] += 1 would generate
18597 two differen ArrayAccess expressions from the ElementAccess,
18598 during the resolution process).
18600 (CompoundAssign.DoResolve): Resolve target and original_source here.
18602 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18604 * expression.cs (ArrayAccess): dropped debugging information.
18606 * typemanager.cs: Small bug fix: I was always returning i_members,
18607 instead of one of i_members or s_members (depending on which had
18610 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18611 method is invoked before any code generation takes place, and it
18612 is a mechanism to inform that the expression will be invoked more
18613 than once, and that the method should use temporary values to
18614 avoid having side effects
18616 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18618 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18621 * expression.cs (Indirection, ArrayAccess): Add support for
18622 CacheTemporaries in these two bad boys.
18624 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18625 ldobj or ldind_ref.
18626 (StoreFromPtr): Handle stobj as well.
18628 * expression.cs (UnaryMutator): Share more code.
18630 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18631 down: I was not tracking the Filter function as well, which
18632 was affecting the results of the cache.
18634 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18636 * attribute.cs: Remove the hack to handle the CharSet property on
18639 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18641 * attribute.cs (DoResolve): More uglyness, we now only try to
18642 resolve the attribute partially, to extract the CharSet
18643 information (only if we are a StructLayout attribute). Otherwise
18645 (GetExtraTypeInfo): Add some code to conditionally kill in the
18646 future this. I am more and more convinced that the .NET
18647 framework has special code to handle the attribute setting on
18650 * expression.cs (IsParamsMethodApplicable): Revert my previous
18651 foreach change here, it was wrong.
18653 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18655 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18656 (pp_expr): do not abort on unknown input, just return.
18657 (eval): abort if there are pending chars.
18659 * attribute.cs (Attribute.Resolve): Positional parameters are
18660 optional. Deal with that case.
18662 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18663 the Ansi/Unicode/Auto information for the type.
18665 (TypeContainer.DefineType): instantiate the EmitContext here, as
18666 we will be using it during the type definition (to resolve
18667 attributes) and during the emit phase.
18669 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18670 to pull type information out of the attributes
18672 (Attribute.Resolve): track the constructor builder, and allow for
18673 multiple invocations (structs and classes will use this).
18675 * ecore.cs (MemberLookupFinal): new version with all the
18676 parameters customizable.
18678 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18679 constructors. Return if the result value is null (as the error
18680 would have been flagged already by MemberLookupFinal)
18682 Do not allow instances of abstract classes or interfaces to be
18685 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18686 We have to compare the assembly property here when dealing with
18687 FamANDAssem and Assembly access modifiers, because we might be
18688 creating an assembly from *modules* (that means that we are not
18689 getting TypeBuilders for types defined in other modules that are
18690 part of this assembly).
18692 (Method.Emit): If the method is marked abstract and has a body,
18695 (TypeContainer.DefineMembers): If both the defined member and the
18696 parent name match are methods, then do not emit any warnings: let
18697 the Method.Define routine take care of flagging warnings. But if
18698 there is a mismatch (method overrides something else, or method is
18699 overriwritten by something, then emit warning).
18701 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18702 set to null, this means `do not check for the return type on the
18705 (Method.Define): set the return type for the method signature to
18706 null, so that we get methods with the same name and parameters and
18707 different return types. This is used to flag warning 114 (you are
18708 hiding a method, and you probably want to use the new/override
18711 * typemanager.cs (MemberLookup): Implemented proper access
18712 control, closing a long standing set of bug reports. The problem
18713 was that the Framework only has two bits: Public and NonPublic,
18714 and NonPublic includes private and protected methods, but we need
18715 to enforce the FamANDAssem, FamOrAssem and Family.
18717 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18719 * statement.cs (GotoCase): Return true: Ammounts to giving up
18720 knowledge on whether we return or not, and letting the other case
18721 be responsible for it.
18723 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18725 * driver.cs: Do not load directories for each file processed, only
18726 do it if there is a pattern.
18728 * ecore.cs: Report readonly assigns here as well, as we might have
18729 been resolved only by MemberAccess.
18731 (SimpleName.SimpleNameResolve): Also be useful for LValue
18732 resolution. We need this to propagate assign to local readonly variables
18734 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18735 do not want to reuse potential criteria memory.
18737 * class.cs (MyEventBuilder): Set reflected_type;
18739 * ecore.cs (Constantify): Added support for constifying bools.
18741 (RootContext.LookupType): Added a cache for values looked up in
18742 the declaration space.
18744 * typemanager.cs (FindMembers): Now is a front-end to
18745 RealFindMembers, and provides a two-level hashtable-based cache to
18748 15% performance improvement: from 22.5 to 19.2 seconds.
18750 * expression.cs (IsParamsMethodApplicable): use foreach.
18751 (Invocation.DoResolve): ditto.
18752 (New.DoResolve): ditto.
18753 (ArrayCreation.DoResolve): ditto.
18755 * ecore.cs (FindMostEncompassingType): use foreach.
18757 * delegate.cs (NewDelegate.DoResolve): Use foreach
18759 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18760 (RemoveMethods): use foreach.
18762 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18763 nested foreach statements instead of for, and also break out of
18764 the inner loop once a match is found.
18766 (Invocation.OverloadResolve): Use foreach, simplify the code.
18768 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18770 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18771 we actually unwrap the expression to allow for extra information
18774 * expression.cs: Use Shr_Un on unsigned operations.
18776 2002-05-08 Ravi Pratap <ravi@ximian.com>
18778 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18779 applicable operators was not being considered correctly. This closes
18780 the bug Miguel reported.
18782 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18784 * attribute.cs: check that the type derives from System.Attribute
18785 and report the correct error in that case (moved the duplicate code to
18786 its own method, too).
18788 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18790 * attribute.cs: lookup attribute type name as the spec says: first the
18791 bare attribute name and then name + "Attribute" (nant compiles with
18792 mcs after this fix).
18794 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18796 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18797 Because of the way we parse things, we should try to see if a
18798 UIntConstant can fit in an integer.
18800 2002-05-07 Ravi Pratap <ravi@ximian.com>
18802 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18803 when we are in an explicit context.
18805 (ConvertReferenceExplicit): When converting from Iface type S to Class
18806 T make sure the rules are implemented as an OR.
18808 * parameter.cs (ParameterType): Make it a property for now although the
18809 purpose really isn't anything immediate.
18811 * expression.cs (Is*Applicable): Do better checking on the parameter type
18812 of a ref/out parameter. The ones from the system assemblies are already
18813 marked with the correct type so we don't need to do any correction.
18815 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18816 the object type is standard too so include that.
18818 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18820 * ecore.cs (StandardConversionExists): Augment with missing code:
18821 deal with IntConstant, LongConstants and Enumerations.
18823 * assign.cs: Report the error, instead of failing silently
18825 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18826 typecontainer that they are declared, because the
18827 typecontainer/namespace will have the list of using clauses that
18828 need to be applied.
18830 Assembly Attributes were escaping the normal registration
18833 (EmitCode): Apply attributes within an EmitContext that represents
18834 the container they were declared on.
18836 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18838 2002-05-06 Ravi Pratap <ravi@ximian.com>
18840 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18841 Revamp completely - make much cleaner as we now operate only
18844 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18845 to implement the logic detailed in the spec more correctly.
18847 (UserDefinedConversion): Update accordingly.
18849 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18851 * statement.cs: Return flow analysis information up.
18853 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18856 (token): Do not consume an extra character before calling
18859 2002-05-06 Piers Haken <piersh@friskit.com>
18861 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18863 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18865 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18866 EmitContext during the instance constructor initializer
18867 resolution, to stop access to instance variables.
18869 This is mandated by the spec, last paragraph of the `constructor
18870 initializers' section.
18872 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18874 * cs-parser.jay, class.cs (Accessor): new class used to represent
18875 an accessor (get or set). In the past we used `null' to represent
18876 a missing accessor. But this is ambiguous because there was no
18877 way to tell in abstract indexers/properties if one of them was
18880 Now there is a way of addressing that.
18882 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18883 instead of FindMembers.
18885 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18886 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18888 * attribute.cs: Treat indexers and properties as the same in terms
18889 of applying attributes
18891 * ecore.cs (FindMostEncompassedType): Use statically initialized
18892 EmptyExpressions()s like we do elsewhere to avoid creating useless
18893 objects (and we take this out of the tight loop).
18895 (GetConversionOperators): Move the code to extract the actual
18896 operators to a separate routine to clean things up.
18898 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18900 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18901 events are always registered FieldBuilders.
18903 * class.cs (FieldBase): New class shared by Fields
18905 * delegate.cs: If we are a toplevel delegate, use our full name.
18906 If we are a nested delegate, then only use our tail name.
18908 2002-05-02 Ravi Pratap <ravi@ximian.com>
18910 * expression.cs (IsApplicable): Ensure that we add the "&" to
18911 ref/out types before comparing it with the type of the argument.
18913 (IsParamsMethodApplicable): Ditto.
18915 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18918 * delegate.cs : Handle the case when we have more than one applicable
18919 method. Flag an error only when we finish checking all.
18921 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18923 * expression.cs: Add support for boolean static initializers.
18925 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18927 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18929 * parameter.cs (ComputeParameterTypes,
18930 ComputeAndDefineParameterTypes): Better error handling: now we
18931 clear the `types' cache if we fail during any of the type lookups.
18932 We also return the status code correctly to our caller
18934 * delegate.cs: If we fail to define a delegate, abort the extra
18937 * expression.cs (Binary.ResolveOperator): for
18938 operator==(object,object) and operator !=(object, object) we also
18939 have to verify that there is an implicit conversion from one to
18942 (ArrayAccess.DoResolve): Array Access can operate on
18945 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18947 * assign.cs (CompoundAssign): A new class used as a "flag" that
18948 the assignment actually is happening as part of a compound
18949 assignment operator.
18951 During compound assignment, a few new rules exist to enable things
18958 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18959 to the type of x) if y is implicitly convertible to the type of x,
18960 and the operator is a builtin operator and the return type of the
18961 operator is explicitly convertible to the type of x.
18963 * rootcontext.cs: Reset warning level to 2. 4 catches various
18964 "interesting" features in mcs, we must clean this up at some
18965 point, but currently am trying to kill other bugs ;-)
18967 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18968 in container classes as well.
18970 * expression.cs (Binary.ResolveOperator): Handle string case
18971 before anything else (as operator overloading does emit an error
18972 before doing anything else).
18974 This code could go away when we move to a table driven model, but
18975 i could not come up with a good plan last night.
18977 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18979 * typemanager.cs (CSharpName): reimplementation using regex.
18980 * class.cs: added null check for fields in Emit
18981 * rootcontext.cs: set warninglevel to 4
18983 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18985 * typemanager.cs (CSharpName): reimplemented with Lupus
18988 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18990 * statement.cs (If): correclty implement Resolve, because we were
18991 not catching sem errors in there. The same process is needed
18993 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18996 (Statement.Warning_DeadCodeFound): Factorize code.
18997 (While): Report dead code here too.
18999 (Statement): Added Resolve virtual method to allow
19000 for resolution split from the emit code.
19002 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19004 * statement.cs (EmitBoolExpression): No longer try to resolve the
19006 (MakeBoolean): New utility function that resolve, implicitly
19007 converts to boolean and tags the expression.
19010 (If, Do): Implement dead code elimination.
19011 (While): Implement loop inversion
19013 (Do, While, For, If): Resolve the expression prior to calling our
19016 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19019 - added method Report28 (warning: program has more than one entry point)
19020 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19021 - modified method Method.Define, the part at the end of the method
19023 * rootcontext.cs: added static public Location EntryPointLocation;
19025 * ../errors/cs0028.cs : Add test case for the above warning.
19028 - modified method CSharpName to allow arrays of primitive type to
19029 be printed nicely (e.g. instead of System.Int32[][] it now prints
19031 - added method CSharpSignature: returns the signature of a method
19032 in string format to be used in reporting errors, warnings, etc.
19034 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19037 2002-04-26 Ravi Pratap <ravi@ximian.com>
19039 * delegate.cs (Define): Fix extremely silly bug where I was
19040 setting the type of the 'object' parameter of the BeginInvoke
19041 method to System.IAsyncResult instead of System.Object ;-)
19043 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19045 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19048 (Constructor.Emit): return if we fail to initialize the
19049 constructor. Another door closed!
19051 * expression.cs (New.DoResolve): Improve error message (from -6 to
19052 1501). Use DeclaredOnly lookup to find the exact constructor.
19054 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19055 loop. This is useful.
19057 * cs-parser.jay: Adjust the default parameters so that destructors
19058 have the proper signature.
19060 2002-04-26 Martin Baulig <martin@gnome.org>
19062 * driver.cs (LoadAssembly): If `assembly' contains any characters
19063 which are only valid in path names and not in assembly names
19064 (currently slash, backslash and point), use Assembly.LoadFrom ()
19065 instead of Assembly.Load () on the `assembly' (before iteration
19066 over the link_paths).
19068 2002-04-26 Martin Baulig <martin@gnome.org>
19070 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19072 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19074 * class.cs (Property): use the new typemanager.MemberLookup
19076 (TypeContainer.MemberLookup): Implement using the
19077 TypeManager.MemberLookup now.
19079 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19080 and return MemberInfos, so that these can be used without an
19081 EmitContext (what we had before).
19083 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19085 * expression.cs: Fix the case where the argument to params if the
19086 type of the params. I omitted handling this before. Fixed
19088 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19090 * driver.cs: Call BootCorlib_PopulateCoreType
19092 * class.cs (Property.CheckBase): Check for properties only, not
19095 * interface.cs: Temporary hack: try/catch around the
19096 CustomAttributeBuilder, because I am getting an exception that I
19099 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19100 types whose definitions are required to be there (attributes are
19101 defined before standard types).
19103 Compute definitions as we boot the various types, as they are used
19104 immediately (value_type class will need object_type, but if we do
19105 not initialize object_type, we will pass a null, which will let
19106 the runtime pick the System.Object from the existing corlib, which
19107 is not what we want).
19109 2002-04-22 Patrik Torstensson <totte@labs2.com>
19111 * cs-tokenizer.cs: fixed a number of trim() issues.
19113 2002-04-22 Ravi Pratap <ravi@ximian.com>
19115 * expression.cs (Argument.Type): Ensure that we return the correct
19116 type when we have out or ref parameters [in which case we
19119 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19121 * class.cs (Property, Indexer): Allow extern modifier in there.
19123 * typemanager.cs (InitBaseTypes): Initializes object_type and
19124 value_type, since those will be used early on during the bootstrap
19125 process to compile corlib.
19127 (InitCoreTypes): Move code from here to InitBaseTypes.
19129 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19131 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19132 single-dimension arrays as using the ldlen opcode.
19134 Daniel Lewis discovered this optimization.
19136 * typemanager.cs: Add signature for System.Array::get_Length
19138 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19140 * statement.cs: report the error when the foreach does not apply to an
19141 array nor a collection.
19143 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19145 * expression.cs: Add implicit conversions to the operator ~.
19147 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19149 * typemanager.cs: Locate the decimal constructor.
19151 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19153 * attribute.cs: use the new property of TypeOf.
19154 * expression.cs: added 'get' property around typearg.
19156 These changes fix a build breaker reported by NickD. Is this the
19157 correct way to fix? If not, please, revert my changes and make it
19160 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19162 * attribute.cs: Add support for typeof in attribute invocations.
19163 I am not sure that this is right though.
19165 2002-04-14 Duncan Mak <duncan@ximian.com>
19167 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19168 Binary.Operator.Division case.
19170 2002-04-13 Ravi Pratap <ravi@ximian.com>
19172 * class.cs (DefineType): Ensure that we do a proper check on
19173 attribute types and also register it with the TypeManager.
19175 (TypeContainer.Targets): The default for attribute types is
19176 AttributeTargets.All.
19178 * attribute.cs (ApplyAttributes): Registering the attribute type
19179 is done elsewhere, not when we discover we have a Usage attribute.
19181 2002-04-12 Ravi Pratap <ravi@ximian.com>
19183 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19184 and get rid of is_delegate parameter.
19186 * everywhere : update.
19188 2002-04-12 Ravi Pratap <ravi@ximian.com>
19190 * cs-parser.jay (compilation_unit): Revamp completely to use
19191 some new ideas that I got from Rhys' grammar to solve the problems
19192 with assembly level attributes.
19194 (outer_declaration): New grammar production.
19196 (attribute_sections): Add.
19198 (opt_attributes): Base on attribute_sections
19200 (namespace_declaration): Allow opt_attributes to tackle the case
19201 when we have assembly level attributes - we are clever in this
19204 * attribute.cs (ApplyAttributes): Do not worry about assembly
19205 attributes in the non-global context.
19207 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19208 instead of SetGlobalAttributes.
19210 * class.cs, rootcontext.cs : Ensure we define and generate
19211 attribute types before anything else.
19213 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19214 and flag the new error -20 for the case when the attribute type
19215 does not have valid targets specified. csc does not catch this.
19217 * ../errors/errors.txt : update for error # -20
19219 2002-04-11 Ravi Pratap <ravi@ximian.com>
19221 * support.cs (InternalParameters.ParameterModifier): Do some null
19222 checking and return sane values.
19224 * class.cs (Method.Define): If we are a PInvoke method, ensure
19225 that we are static and extern. Report error # 601
19227 * ../errors/cs0601.cs : Add test case for the above error.
19229 2002-04-07 Ravi Pratap <ravi@ximian.com>
19231 * rootcontext.cs (attribute_types): We need to keep type of
19232 all attribute types separately and emit code for them first.
19234 (RegisterAttribute) : Implement.
19236 * class.cs (DefineType): Check if the current Type is a custom
19237 attribute type and register it accordingly.
19239 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19240 adding the first attribute twice and rename to
19242 (SetGlobalAttributes): this.
19244 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19247 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19248 if we are processing global arguments. Hmm, I am unsure of this.
19250 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19252 * expression.cs: added static array of strings to avoid calling
19253 Enum.ToString () for Operator in Binary. Significant recover of
19256 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19258 * class.cs (FindMembers): Allow the Builders of the various
19259 members to be null. If they are skip them. This only happens
19260 during the PInvoke declaration.
19262 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19264 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19265 failure, so we do not keep going afterwards.
19267 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19268 wanted to pass `false' as the `is_delegate' argument. If this is
19269 the case, why not use delegate_type == null to mean `is_delegate =
19270 false' and anything else as is_delegate = true.
19272 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19274 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19275 code for the section, not the beginning of the tests.
19277 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19279 * cfold.cs: Handle operator + (Enum x, Underlying x)
19281 * expression.cs (Binary): same. Warn about errors where we have
19282 Enum/Enum in operator + as well.
19284 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19287 - added support for switch(bool)
19288 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19289 - add TableSwitchEmit() to handle table-based switch statements
19291 2002-04-05 Ravi Pratap <ravi@ximian.com>
19293 * expression.cs (Invocation.OverloadResolve): Factor out code which
19294 does parameter compatibility checking with arguments so that we can
19295 re-use the code even from Delegate.VerifyApplicability
19297 (VerifyArgumentsCompat): Move above code here.
19299 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19300 and instead make a call to the above method.
19302 2002-03-31 Ravi Pratap <ravi@ximian.com>
19304 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19305 We use it to keep track of classes which are attribute types.
19307 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19309 * delegate.cs (Delegate.Define): Correctly define the types in the
19310 presence of fixed and array parameters.
19312 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19315 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19316 include NonPublic after the first iteration.
19318 * class.cs (Indexer.CheckBase): Only check if both parents are
19321 * cs-parser.jay (accessor_body): If empty, set to null.
19323 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19324 same code path here to resolve constants names that we did have in
19325 MemberAccess.DoResolve. There is too much code duplicated here.
19327 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19329 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19331 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19334 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19335 tokens, numbers and strings.
19337 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19340 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19341 asyncronous parameters and the regular parameters.
19343 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19344 specify the target directory.
19346 * expression.cs: (This.DoResolve): Simplify
19347 (As.Emit): Optimize, do not generate IsInst if the expression is
19348 always of the given type.
19350 (Is.DoResolve): Bug fix, we were reporting both always/never for
19353 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19354 creating too many unnecessary arrays.
19356 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19358 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19359 fields instead of rolling our own initializer. Takes care of all
19360 implicit conversions, and drops unnecessary static checks/argument.
19362 2002-03-31 Dick Porter <dick@ximian.com>
19364 * driver.cs: use the GetDirectories() return values properly, and
19365 use "/" as path separator.
19367 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19369 * expression.cs (Unary): Optimize - - expr into expr.
19370 (Binary): Optimize a + (-b) into a -b.
19372 * codegen.cs (CodeGen): Made all methods static.
19374 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19378 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19379 TypeBuilder property.
19381 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19384 * tree.cs: Removed the various RecordXXXX, and replaced with a
19385 single RecordDecl. Removed all the accessor methods, and just
19386 left a single access point Type
19388 * enum.cs: Rename DefineEnum to DefineType.
19390 * decl.cs: New abstract method `DefineType' used to unify the
19391 Defines for Enumerations, Interfaces, TypeContainers and
19394 (FindType): Moved LookupInterfaceOrClass here. Moved the
19395 LookupBaseClasses method that used to live in class.cs and
19396 interface.cs here, and renamed to FindType.
19398 * delegate.cs: Implement DefineType. Take advantage of the
19399 refactored pattern for locating the parent builder without taking
19400 the parent_builder argument (which we know does not work if we are
19401 nested, and triggering a toplevel definition).
19403 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19405 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19406 accessibility of a member has changed during override and report
19409 * class.cs (Method.Define, Property.Define): Only complain on
19410 overrides if the method is private, any other accessibility is
19411 fine (and since we just checked the permission is the same, we are
19414 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19415 and elif are processed always. The other pre-processing
19416 directives are only processed if we are "taking" the path
19418 2002-03-29 Martin Baulig <martin@gnome.org>
19420 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19421 current location is not Null.
19423 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19424 a separate method so we can profile it.
19426 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19427 `span.Seconds' are just seconds, but no minutes or hours.
19428 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19430 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19432 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19433 Remove the gratuitous set of Final:
19435 // If an interface implementation, then we can set Final.
19436 if (((flags & MethodAttributes.Abstract) == 0) &&
19437 implementing.DeclaringType.IsInterface)
19438 flags |= MethodAttributes.Final;
19440 I do not know what I was smoking when I used that.
19443 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19444 step into fixing the name resolution issues for delegates and
19445 unifying the toplevel name resolution.
19447 2002-03-28 Martin Baulig <martin@gnome.org>
19449 * class.cs (Method.Emit): If we have a symbol writer, call its
19450 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19451 tell it about the current method.
19453 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19454 writer that we're going to emit the first byte of IL code for a new
19455 statement (a new source line).
19456 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19457 EmitContext.Mark() before emitting any code.
19459 * location.cs (SymbolDocument): Return null when we're Null.
19461 * statement.cs (Statement): Moved the `Location loc' variable here.
19462 (Statement.EmitBoolExpression): If we have a symbol writer, call
19463 ec.Mark() before emitting any code to tell it that we're at the
19464 beginning of a new statement.
19465 (StatementExpression): Added `Location' argument to the constructor.
19466 (Block): Added public readonly variable `StartLocation' and public
19467 variable `EndLocation'. The latter is to be set using SetEndLocation().
19468 (Block): Added constructor which takes a start and end location.
19469 (Block.SetEndLocation): New method. This sets the end location.
19470 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19471 local variables we create.
19472 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19473 each statement and do also mark the begin and end of the block.
19475 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19476 tell it the current lexer.Location, use Location.Null for the end of the
19478 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19479 current block, set its end location using SetEndLocation().
19480 (statement_expression): StatementExpression constructor now takes the
19481 lexer.Location as additional argument.
19482 (for_statement, declare_local_variables): Likewise.
19483 (declare_local_variables): When creating a new implicit block, use the
19484 new Block constructor and pass it the lexer.Location.
19486 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19488 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19489 members also on the parent interfaces recursively.
19491 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19493 * report.cs: Use new formats, since Gonzalo finished the missing
19496 * expression.cs (Binary.ResolveOperator): added missing operator|
19497 operator& and operator^ for bool/bool.
19499 * cs-parser.jay: CheckDef now takes a Location argument that is
19500 used to report errors more precisly (instead of reporting the end
19501 of a definition, we try to track something which is a lot closer
19502 to the source of the problem).
19504 * cs-tokenizer.cs: Track global token use, so we can properly flag
19505 the use of #define/#undef after the first token has been seen.
19507 Also, rename the reportXXXX to Error_DescriptiveName
19509 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19510 TypeContainer, so that Enum and Interface can use this too.
19512 * class.cs (TypeContainer.LookupInterfaceOrClass,
19513 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19514 `builder' argument. Typically this was used to pass the parent
19515 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19518 The problem is that a nested class could trigger the definition of
19519 a toplevel class, and the builder would be obviously wrong in that
19522 So we drop this argument, and we compute dynamically the
19523 TypeBuilder/ModuleBuilder (the correct information was available
19524 to us anyways from DeclSpace.Parent)
19526 * interface.cs (Interface.DefineInterface): Drop builder
19527 parameter cleanup like class.cs
19529 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19532 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19535 (Try.Emit): Propagate the returns value from the statement.
19537 (Return.Emit): Even if we are leavning
19539 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19541 * modifiers.cs: Fix the computation of MethodAttributes flags.
19543 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19545 * driver.cs: allow compilation of files that start with '/'.
19546 Add a default case when checking the argument of --target.
19548 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19550 * interface.cs: Implement the same search algorithm for types in
19551 the interface code.
19553 * delegate.cs: Do not allow multiple definition.
19555 * Recovered ChangeLog that got accidentally amputated
19557 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19559 * rootcontext.cs: Load manually enum to allow core classes to
19560 contain enumerations.
19562 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19563 Update to new static methods in TypeManager.
19565 * typemanager.cs (GetMethod, GetConstructor): Use our
19566 implementation of FindMembers to find the members, since during
19567 corlib compilation, the types are TypeBuilders and GetMethod and
19568 GetConstructor do not work.
19570 Make all methods in TypeManager static.
19572 (InitCodeHelpers): Split the functionality from
19573 the InitCodeTypes function.
19575 * driver.cs: Call InitCodeHelpers after we have populated the
19578 * cs-parser.jay (delegate_declaration): we did not used to compute
19579 the delegate name correctly for void delegates.
19581 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19583 * rootcontext.cs (RootContext): Init the interface_resolve_order
19584 and type_container_resolve_order always.
19586 (ResolveCore, BootstrapCorlib_ResolveClass,
19587 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19588 compiler when compiling with --nostdlib
19590 * class.cs (TypeContainer.DefineType): Check that our parent is
19591 not null. This test is most important when we are bootstraping
19594 * codegen.cs: Split out the symbol writing code.
19596 2002-03-25 Martin Baulig <martin@gnome.org>
19598 * driver.cs (-g): Made -g an alias for --debug.
19600 2002-03-24 Martin Baulig <martin@gnome.org>
19602 * codegen.cs (SymbolWriter): New public variable. Returns the
19603 current symbol writer.
19604 (CodeGen): Added `bool want_debugging_support' argument to the
19605 constructor. If true, tell the ModuleBuild that we want debugging
19606 support and ask it for the ISymbolWriter.
19607 (Save): If we have a symbol writer, call it's Close() method after
19608 saving the assembly.
19610 * driver.c (--debug): New command line argument to create a
19611 debugger information file.
19613 * location.cs (SymbolDocument): New public property. Returns an
19614 ISymbolDocumentWriter object for the current source file or null
19615 if we don't have a symbol writer.
19617 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19619 * driver.cs (LoadAssembly): Correctly return when all the paths
19620 have been tried and not before.
19622 * statement.cs (Switch.Emit): return the actual coverage for this
19623 statement (returns/not-returns)
19625 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19626 switch of the statement if we are the last switch section. That
19627 kills two problems: try/catch problems (we used to emit an empty
19628 nop at the end) and switch statements where all branches would
19631 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19633 * driver.cs: Add default assemblies (the equivalent to the
19634 Microsoft CSC.RSP file)
19636 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19637 also update tokens_seen and set it to false.
19639 * driver.cs: Implement --recurse for Mike.
19641 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19642 correctly splitting out the paths.
19644 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19646 * interface.cs (Interface.PopulateProperty): Instead of using
19647 `parent' as the declaration space for the set parameters, use
19650 * support.cs (InternalParameters): InternalParameters constructor
19651 takes a DeclSpace instead of a TypeContainer.
19653 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19654 types are being initialized, load the address of it before calling
19657 (New): Provide a mechanism to disable the generation of local
19658 value type temporaries when the caller will be providing us with
19659 an address to store it.
19661 (ArrayCreation.EmitDynamicInitializers): Use it.
19663 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19665 * expression.cs (Invocation.EmitArguments): Only probe for array
19666 property if there is more than one argument. Sorry about that.
19668 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19669 empty param arrays.
19671 * class.cs (Method.LabelParameters): Fix incorrect code path that
19672 prevented the `ParamArrayAttribute' from being applied to the
19675 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19677 * support.cs (ReflectionParameters): Correctly compute whether the
19678 last argument is a params array. Fixes the problem with
19681 * typemanager.cs: Make the assemblies array always be non-null
19682 (empty, but non-null)
19684 * tree.cs (RecordDecl): New function that abstracts the recording
19685 of names. This reports error 101, and provides a pointer to the
19686 previous declaration. Fixes a crash in the compiler.
19688 * cs-parser.jay (constructor_declaration): Update to new grammar,
19689 and provide a constructor_body that can be empty.
19691 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19693 * driver.cs: Add support for --resources.
19695 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19696 Make all types for the various array helper methods be integer.
19698 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19699 CheckState to ConvCast.
19701 (ConvCast): Now it takes a `checked' state argument, to avoid
19702 depending on the emit context for the conversion, and just using
19703 the resolve time setting.
19705 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19706 instead of Invocation.EmitArguments. We do not emit the original
19707 arguments, instead we emit those which have been converted to
19708 unsigned int expressions.
19710 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19712 * codegen.cs: ditto.
19714 * expression.cs (LocalVariableReference): Drop the use of the
19715 Store function that depended on the variable index.
19717 * statement.cs (VariableInfo): Drop the `Idx' property from this
19718 class, as this is not taking into account the indexes for
19719 temporaries tat we generate during the execution, getting the
19722 * class.cs: First emit class initializers, then call the parent
19725 * expression.cs (Binary): Fix opcode emision.
19726 (UnaryMutator.EmitCode): Support checked code generation
19728 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19729 matches for events for both the Static and Instance scans,
19730 pointing to the same element. Fix that.
19732 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19734 * rootcontext.cs (ResolveTree): Always set the
19735 interface_resolve_order, because nested interfaces will be calling
19738 * class.cs (GetInterfaceOrClass): Track the same resolution
19739 process used by TypeManager.LookupType. This fixes the nested
19740 type lookups in class declarations (separate path from
19743 (TypeContainer.DefineType): Also define nested interfaces.
19744 (TypeContainer.RegisterOrder): New public function used to
19745 register the order in which child interfaces need to be closed.
19747 Nested interfaces need to be closed after their parents have been
19750 * interface.cs (InterfaceAttr): Put all the logic for computing
19751 the interface attribute here.
19753 (DefineInterface): Register our interface order with the
19754 RootContext or with the TypeContainer depending on the case.
19756 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19758 * cs-parser.jay: rework foreach statement to work with the new
19759 changes to the policy on SimpleNames.
19761 * report.cs: support Stacktrace on warnings as well.
19763 * makefile: drop --unsafe and /unsafe from the compile.
19765 2002-03-13 Ravi Pratap <ravi@ximian.com>
19767 * ecore.cs (StandardConversionExists): Modify to take an Expression
19768 as the first parameter. Ensure we do null -> reference type conversion
19771 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19772 temporary Expression objects.
19774 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19776 * interface.cs: workaround bug in method overloading resolution
19777 (there is already a bugzilla bug for it).
19779 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19781 We could also solve this problem by having a separate path for
19782 performing type lookups, instead of DoResolve, we could have a
19783 ResolveType entry point, and only participating pieces of the
19784 production (simplename, deref, array) would implement this.
19786 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19787 signal SimpleName to only resolve type names and not attempt to
19788 resolve anything else.
19790 * expression.cs (Cast): Set the flag.
19792 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19794 * class.cs: Only report 108 if there is no `new' modifier.
19796 * cs-parser.jay: rework foreach statement to work with the new
19797 changes to the policy on SimpleNames.
19799 * report.cs: support Stacktrace on warnings as well.
19801 * makefile: drop --unsafe and /unsafe from the compile.
19803 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19805 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19806 lookups here, instead of doing that at parse time. This means
19807 that our grammar will not introduce `LocalVariableReferences' as
19808 expressions at this point. That solves the problem of code like
19812 static void Main ()
19816 This is only half the fix. The full fix requires parameters to
19817 also be handled in this way.
19819 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19820 makes the use more obvious of the DeclSpace. The
19821 ec.TypeContainer.TypeBuilder is now only used to pull the
19822 TypeBuilder for it.
19824 My theory is that I can get rid of the TypeBuilder completely from
19825 the EmitContext, and have typecasts where it is used (from
19826 DeclSpace to where it matters).
19828 The only pending problem is that the code that implements Aliases
19829 is on TypeContainer, and probably should go in DeclSpace.
19831 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19832 lookups here, instead of doing that at parse time. This means
19833 that our grammar will not introduce `LocalVariableReferences' as
19834 expressions at this point. That solves the problem of code like
19838 static void Main ()
19842 This is only half the fix. The full fix requires parameters to
19843 also be handled in this way.
19845 * class.cs (Property.DefineMethod): When implementing an interface
19846 method, set newslot, when implementing an abstract method, do not
19847 set the flag (before we tried never setting it, or always setting
19848 it, which is the difference).
19849 (Indexer.DefineMethod): same.
19850 (Method.DefineMethod): same.
19852 * ecore.cs: Only set the status used flag if we get back a Field.
19854 * attribute.cs: Temporary hack, so Paolo can keep working.
19856 2002-03-08 Ravi Pratap <ravi@ximian.com>
19858 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19859 the unmanaged type in the case we have a MarshalAs attribute.
19861 (Resolve): Handle the case when we are parsing the special MarshalAs
19862 attribute [we need to store the unmanaged type to use later]
19864 * typemanager.cs (marshal_as_attr_type): Built in type for the
19865 MarshalAs Attribute.
19867 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19868 on parameters and accordingly set the marshalling info.
19870 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19872 * class.cs: Optimizing slightly by removing redundant code after
19873 we switched to the `NoTypes' return value.
19874 (Property.DefineMethod): use NoTypes here too.
19876 This fixes the bug I introduced in my last batch of changes.
19878 2002-03-05 Ravi Pratap <ravi@ximian.com>
19880 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19882 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19883 Enums since those are types too.
19885 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19887 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19888 thanks to a call during the lookup process.
19890 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19892 * statement.cs (Foreach): Lots of work to accomodate a particular
19893 kind of foreach statement that I had not kept in mind. It is
19894 possible to have foreachs on classes that provide a GetEnumerator
19895 method that return objects that implement the "pattern" for using
19896 a foreach, there is no need to support GetEnumerator
19899 This is needed to compile nant.
19901 * decl.cs: Only report 114 if the member is not `Finalize' and if
19902 the warning level is at least 2.
19904 * class.cs: Moved the compare function from Method to
19907 (MethodSignature.InheritableMemberSignatureCompare): Add new
19908 filter function that is used to extract inheritable methods from a
19911 (Method.Define): Use the new `inheritable_method_signature_filter'
19914 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19917 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19919 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19921 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19923 * expression.cs: Pass location information to
19924 ConvertImplicitStandard.
19926 * class.cs: Added debugging code to track return values from
19929 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19931 * expression.cs (Is.DoResolve): If either side of the `is' is an
19932 interface, do not flag the warning.
19934 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19937 * report.cs: Allow for --fatal to be used with --probe.
19939 * typemanager.cs (NoTypes): Move the definition for the empty Type
19942 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19944 (TypeContainer.DefineProxy): New function used to proxy to parent
19945 implementations when implementing interfaces.
19946 (TypeContainer.ParentImplements): used to lookup if our parent
19947 implements a public function that is required by an interface.
19948 (TypeContainer.VerifyPendingMethods): Hook this up.
19950 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19951 `modules' and `assemblies' arraylists into arrays. We only grow
19952 these are the very early start up of the program, so this improves
19953 the speedof LookupType (nicely measured).
19955 * expression.cs (MakeByteBlob): Replaced unsafe code with
19956 BitConverter, as suggested by Paolo.
19958 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19959 folding of string concatenation, but if either side is a string,
19960 and the other is not, then return null, and let the runtime use
19961 the concatenation on the string plus the object (using
19962 `Object.ToString').
19964 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19966 Constant Folding has been implemented now.
19968 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19969 the error instead on types that are not supported in one's
19972 * constant.cs (Constant and all children): New set of functions to
19973 perform implict and explicit conversions.
19975 * ecore.cs (EnumConstant): Implement the new functions to perform
19976 conversion by proxying to the child expression.
19978 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19979 own separate setting that can not be turned off from the command
19980 line using --unchecked or --checked and is only controlled using
19981 the checked/unchecked statements and expressions. This setting is
19982 used by the constant folder to flag errors.
19984 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19985 ConstantCheckState as well.
19987 During Resolve, they also have to flag the state, because the
19988 constant folder runs completely in the Resolve phase.
19990 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19993 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19995 * cfold.cs: New file, this file contains the constant folder.
19997 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19998 argument to track whether we are using the resulting address to
19999 load or store a value and provide better error messages.
20001 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20002 new AddressOf arguments.
20004 * statement.cs (Foreach.EmitCollectionForeach): Update
20006 * expression.cs (Argument.Emit): Call AddressOf with proper
20007 arguments to track usage.
20009 (New.DoEmit): Call AddressOf with new arguments.
20011 (Unary.Emit): Adjust AddressOf call.
20013 2002-03-01 Ravi Pratap <ravi@ximian.com>
20015 * cs-parser.jay (member_access): Change the case for pre-defined types
20016 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20019 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20022 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20023 essentially like methods and apply attributes like MethodImplOptions to them too.
20025 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20028 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20029 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20032 * Update code everywhere accordingly.
20034 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20036 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20038 2002-02-28 Ravi Pratap <ravi@ximian.com>
20040 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20041 try performing lookups against those instead of jumping straight into using
20042 the 'using' clauses.
20044 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20046 (LookupType): Perform lookups in implicit parents too.
20048 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20049 sequence as RootContext.LookupType.
20051 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20052 the various cases of namespace lookups into this method.
20054 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20056 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20057 in positional arguments)
20059 * class.cs (Operator): Update the AllowedModifiers to contain
20062 * cs-parser.jay: Update operator declaration to allow for the
20063 operator body to be empty.
20065 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20068 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20070 * class.cs (Method.Emit): Label parameters.
20072 * driver.cs: Return 1 or 0 as the program exit code.
20074 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20076 * expression.cs: Special case the `null' object when trying to
20077 auto-compute the type, as anything can be explicitly converted to
20080 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20081 spotting this Paolo.
20083 (Expression.ImplicitNumericConversion): Perform comparissions of
20084 the type using the underlying type in the case of an enumeration
20085 rather than using the enumeration type for the compare.
20087 Cope with the underlying == type case, which is not possible to
20090 (Expression.ConvertNumericExplicit): Perform comparissions of
20091 the type using the underlying type in the case of an enumeration
20092 rather than using the enumeration type for the compare.
20094 * driver.cs: If the user does not supply an extension, assume .exe
20096 * cs-parser.jay (if_statement): Rewrote so that we can track the
20097 location for the if statement.
20099 * expression.cs (Binary.ConstantFold): Only concat strings when
20100 the operation is "+", not everything ;-)
20102 * statement.cs (Statement.EmitBoolExpression): Take a location
20104 (If, While, Do): Track location.
20106 * expression.cs (Binary.ResolveOperator): In the object + string
20107 case, I was missing a call to ConvertImplicit
20109 2002-02-25 Ravi Pratap <ravi@ximian.com>
20111 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20112 Location arguments. Ensure we use RootContext.LookupType to do our work
20113 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20115 * interface.cs (PopulateMethod): Handle the type of the parameter being
20118 * expression.cs (Invocation.BetterFunction): Handle the case when we
20119 have a params method with no fixed arguments and a call is made with no
20122 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20124 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20125 the verbatim-string-literal
20127 * support.cs (InternalParameters.ParameterModifier): handle null
20129 (InternalParameters.ParameterType): ditto.
20131 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20132 duplicating the name of the variable parameter.
20133 (GetParameterByName): Fix bug where we were not looking up array
20134 paramters if they were the only present (thanks Paolo!).
20135 (GetParameterInfo): We only have an empty set of types if both
20136 fixed and array are set to null.
20137 (GetParameterInfo-idx): Handle FixedParameter == null
20139 * cs-parser.jay: Handle the case where there is no catch
20140 statements (missing null test).
20142 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20144 * driver.cs (MainDriver): Be conservative on our command line
20147 Catch DirectoryNotFoundException when calling GetFiles.
20149 (SplitPathAndPattern): Used to split the input specification into
20150 a path and a pattern that we can feed to Directory.GetFiles.
20152 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20154 * statement.cs (Fixed): Implement the last case of the Fixed
20155 statement (string handling).
20157 * expression.cs (StringPtr): New class used to return a char * to
20158 a string; Used by the Fixed statement.
20160 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20162 * expression.cs (Binary.ResolveOperator): Remove redundant
20163 MemberLookup pn parent type.
20164 Optimize union call, we do not need a union if the types are the same.
20165 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20168 Specialize the use of MemberLookup everywhere, instead of using
20169 the default settings.
20171 (StackAlloc): Implement stackalloc keyword.
20173 * cs-parser.jay: Add rule to parse stackalloc.
20175 * driver.cs: Handle /h, /help, /?
20177 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20178 before we supported unsafe code.
20180 * makefile: add --unsafe to the self compilation of mcs.
20182 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20184 * expression.cs (PointerArithmetic): New class that is used to
20185 perform pointer arithmetic.
20186 (Binary.Resolve): Handle pointer arithmetic
20187 Handle pointer comparission.
20188 (ArrayPtr): Utility expression class that is used to take the
20189 address of an array.
20191 (ElementAccess): Implement array access for pointers
20193 * statement.cs (Fixed): Implement fixed statement for arrays, we
20194 are missing one more case before we are done.
20196 * expression.cs (Indirection): Implement EmitAssign and set the
20197 ExprClass to Variable. This allows pointer dereferences to be
20198 treated as variables, and to have values assigned to them.
20200 * ecore.cs (Expression.StoreFromPtr): New utility function to
20201 store values dereferencing.
20203 2002-02-20 Ravi Pratap <ravi@ximian.com>
20205 * expression.cs (Binary.ResolveOperator): Ensure that we are
20206 not trying to operate on a void type - this fixes the reported
20209 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20210 the parent implementation is sealed.
20212 * ../errors/cs0239.cs : Add.
20214 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20216 * typemanager.cs (unverifiable_code_type): Corresponds to
20217 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20218 which have unsafe code in them.
20220 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20223 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20225 * cs-tokenizer.cs: Add support for @"litreal strings"
20227 Make tokenizer accept pre-processor directives
20228 on any column (remove the old C-like limitation).
20230 * rootcontext.cs (EmitCode): Emit any global attributes.
20231 (AddGlobalAttributes): Used to keep track of assembly attributes.
20233 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20235 * cs-parser.jay: Add support for global attributes.
20237 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20239 * expression.cs (Indirection): New helper class. Unary will
20240 create Indirection classes to be able to implement the
20241 IMemoryLocation interface on it.
20243 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20245 * cs-parser.jay (fixed_statement): reference the right statement.
20247 * statement.cs (Fixed.Emit): Finish implementing the fixed
20248 statement for the &x case.
20250 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20252 * class.cs (Property.Define, Method.Define): Remove newslot when
20255 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20256 wrong. NewSlot should only be used if the `new' keyword is present.
20258 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20259 locating our system dir. Sorry about this.
20261 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20263 * driver.cs (GetSystemDir): Compute correctly the location of our
20264 system assemblies. I was using the compiler directory instead of
20265 the library directory.
20267 2002-02-13 Ravi Pratap <ravi@ximian.com>
20269 * expression.cs (BetterFunction): Put back in what Miguel commented out
20270 since it is the correct fix. The problem is elsewhere ;-)
20272 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20273 parameters of the parms method are themselves compatible or not !
20275 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20276 to check that a class implements an interface before saying that an implicit
20277 conversion was allowed. Use ImplementsInterface to do the checking.
20279 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20281 * class.cs (Method.Define): Track whether we are an explicit
20282 implementation or not. And only call DefineMethodOverride if we
20283 are an explicit implementation.
20285 (Property.DefineMethod): Ditto.
20287 2002-02-11 Ravi Pratap <ravi@ximian.com>
20289 * expression.cs (BetterFunction): Catch hideous bug which was
20290 preventing us from detecting ambiguous calls due to implicit casts i.e
20293 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20295 * support.cs (Pair): Remove un-needed method. I figured why I was
20296 getting the error in cs-parser.jay, the variable in a foreach loop
20297 is readonly, and the compiler does not really treat this as a variable.
20299 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20300 instead of EQUALS in grammar.
20302 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20304 * expression.cs (Unary.DoResolve): Check whether the argument is
20307 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20309 * support.cs: Api for Pair to set a value. Despite the fact that
20310 the variables are public the MS C# compiler refuses to compile
20311 code that accesses the field if the variable is part of a foreach
20314 * statement.cs (Fixed): Begin implementation of the fixed
20317 (Block.AddVariable): Return the VariableInfo on success and null
20318 on failure instead of true/false.
20320 * cs-parser.jay (foreach): Catch errors on variables already
20321 defined (we were ignoring this value before) and properly unwind
20322 the block hierarchy
20324 (fixed_statement): grammar for the fixed statement.
20326 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20328 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20329 pointer types to be incretemented.
20331 (SizeOf): Implement.
20333 * cs-parser.jay (pointer_member_access): Implement
20334 expr->IDENTIFIER production.
20336 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20337 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20340 (Unary): Implement indirection.
20342 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20343 use in non-unsafe context).
20345 (SimpleName.DoResolve): Check for pointers in field access on safe
20348 (Expression.LoadFromPtr): Factor the load-indirect code in this
20349 function. This was duplicated in UnboxCast and ParameterReference
20351 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20353 * expression.cs (ComposedCast): report an error if a pointer cast
20354 is used in a safe region.
20356 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20357 pointer type casts in unsafe context.
20359 * codegen.cs (EmitContext): Set up IsUnsafe.
20361 * cs-parser.jay (non_expression_type): Add productions for pointer
20364 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20365 code. We should not use force into static mode if the method is
20366 not virtual. Fixes bug in MIS
20368 * statement.cs (Do.Emit, While.Emit, For.Emit,
20369 Statement.EmitBoolExpression): Add support to Do and While to
20370 propagate infinite loop as `I do return' semantics.
20372 Improve the For case to also test for boolean constants.
20374 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20375 to the list of attributes we can add.
20377 Remove `EmitContext' argument.
20379 * class.cs (Method.Define): Apply parameter attributes.
20380 (Constructor.Define): Apply parameter attributes.
20381 (MethodCore.LabelParameters): Move here the core of labeling
20384 * support.cs (ReflectionParameters.ParameterModifier,
20385 InternalParameters.ParameterModifier): Use IsByRef on the type and
20386 only return the OUT bit for these parameters instead of in/out/ref
20389 This is because I miss-understood things. The ParameterInfo.IsIn
20390 and IsOut represent whether the parameter has the [In] and [Out]
20393 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20395 * ecore.cs (FieldExpr.Emit): Release temporaries.
20397 * assign.cs (LocalTemporary.Release): new function.
20399 * codegen.cs (EmitContext.GetTemporaryStorage,
20400 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20401 temporary storage. Now we can "put back" localbuilders when we
20404 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20406 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20407 need to make a copy of the variable to generate verifiable code.
20409 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20411 * driver.cs: Compute dynamically the system directory.
20413 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20414 Slower, but more generally useful. Used by the abstract
20415 registering implementation.
20417 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20418 the rules for the special rule on Type/instances. First check if
20419 we have the same name, and if so, try that special static path
20420 rather than the instance path.
20422 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20424 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20427 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20428 Enum, ValueType, Delegate or Array for non-corlib compiles.
20430 * cs-tokenizer.cs: Catch long identifiers (645)
20432 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20435 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20436 fix, we were returning too early, so we were not registering
20437 pending methods from abstract classes.
20439 Do not register pending methods if the class is abstract.
20441 * expression.cs (Conditional.DoResolve): Report circular implicit
20442 conversions when we neecd to compute it for conditional
20445 (Is.DoResolve): If the expression is always of the provided type,
20446 flag warning 183. If the expression can not ever be of the
20447 provided type flag warning 184.
20449 * class.cs: Catch 169 as well.
20451 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20454 2002-01-18 Nick Drochak <ndrochak@gol.com>
20456 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20458 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20460 * interface.cs: (PopulateMethod): Check for pointers being defined
20461 only if the unsafe context is active.
20462 (PopulateProperty): ditto.
20463 (PopulateIndexer): ditto.
20465 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20466 specified. If pointers are present, make sure that they are
20467 present in an unsafe context.
20468 (Constructor, Constructor.Define): ditto.
20469 (Field, Field.Define): ditto.
20470 (Property, Property.Define): ditto.
20471 (Event, Event.Define): ditto.
20473 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20474 hashtable if there are classes or structs defined.
20476 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20477 code, as the constant resolution moved.
20479 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20480 the metadata, so we can flag error 133.
20482 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20483 pointer is being declared in an unsafe context.
20485 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20487 * modifiers.cs (Modifiers.Check): Require a Location argument.
20488 Report error 227 for Unsafe use.
20490 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20492 * statement.cs (For.Emit): If the test is null, then report that
20493 we do `return', as we wont reach anything afterwards.
20495 (Switch.SwitchGoverningType): Track the expression that matched
20498 * driver.cs: Allow negative numbers as an error code to flag.
20500 * cs-parser.jay: Handle 1551.
20502 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20504 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20506 * cs-parser.jay: Report 1518 (type declaration can only contain
20507 class, struct, interface, enum or delegate)
20509 (switch_label): Report 1523 (keywords `case' or `default' must
20512 (opt_switch_sections): Report 1522 (empty switch)
20514 * driver.cs: Report 1515 (response file specified multiple times)
20515 Report 1516 (Source file specified multiple times).
20517 * expression.cs (Argument.Resolve): Signal 1510
20519 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20520 access not allowed in static code)
20522 2002-01-11 Ravi Pratap <ravi@ximian.com>
20524 * typemanager.cs (IsPointerType): Utility method which we are going
20527 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20528 the object type, so we take care of that.
20530 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20532 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20533 added to non-params parameters :-)
20535 * typemanager.cs (CSharpName): Include 'void' type too.
20537 (void_ptr_type): Include in the set of core types.
20539 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20542 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20545 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20546 completely forgotten about it.
20548 2002-01-10 Ravi Pratap <ravi@ximian.com>
20550 * cs-parser.jay (pointer_type): Add. This begins our implementation
20551 of parsing rules for unsafe code.
20553 (unsafe_statement): Implement.
20555 (embedded_statement): Modify to include the above.
20557 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20559 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20560 if the current context is an unsafe one.
20562 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20563 are handled differently, we need separate rules for them.
20565 (local_variable_declaration): Update to use local_variable_pointer_type
20566 to allow variable declarations of unmanaged pointer types.
20568 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20569 in unsafe contexts.
20571 * ../errors/cs0214.cs : Add.
20573 2002-01-16 Nick Drochak <ndrochak@gol.com>
20575 * makefile: remove 'response' file when cleaning.
20577 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20579 * cs-parser.jay: Report 1524.
20581 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20583 * typemanager.cs (RegisterMethod): drop checking if we have
20584 registered this from here
20586 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20588 * class.cs (Method.EmitDestructor): Implement calling our base
20591 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20592 value of InFinally.
20594 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20595 this routine and will wrap the call in a try/catch block. Deal
20598 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20600 * ecore.cs (Expression.MemberLookup): instead of taking a
20601 parameter `same_type' that was used to tell whether we could
20602 access private members we compute our containing type from the
20605 (FieldExpr): Added partial support for volatile fields. This does
20606 not work for volatile fields exposed from assemblies, as I can not
20607 figure out how to extract the modreq from it.
20609 Updated all the source files to use this.
20611 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20612 because it is referenced by MemberLookup very often.
20614 2002-01-09 Ravi Pratap <ravi@ximian.com>
20616 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20617 TypeBuilder.GetCustomAttributes to retrieve what we need.
20619 Get rid of redundant default_member_attr_type as this is the same as
20620 default_member_type which already exists.
20622 * interface.cs, attribute.cs : Update accordingly.
20624 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20626 * typemanager.cs: Enable IndexerPropertyName again. It does not
20627 work for TYpeBuilders though. Ravi, can you please fix this?
20629 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20631 * expression.cs (Argument.Emit): Handle the case of ref objects
20632 being passed to ref functions;
20634 (ParameterReference.EmitLoad): Loads the content of the pointer
20635 without dereferencing.
20637 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20639 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20641 2002-01-08 Ravi Pratap <ravi@ximian.com>
20643 * class.cs (Indexer.DefineMethod): Incorporate the interface
20644 type in the name of the method if we are doing explicit interface
20647 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20649 (BetterConversion): Fix extremely trivial bug where we were referring to
20650 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20653 * ../errors/bug16.cs : Add although we have fixed it.
20655 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20657 * expression.cs (BaseIndexer): Begin implementation.
20659 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20661 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20662 production directly to remove a shift/reduce, and implement
20663 explicit interface implementation.
20665 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20666 after a floating point suffix.
20668 * expression.cs (DoNumericPromotions): Improved the conversion for
20669 uint/uint. If we have a constant, we avoid doing a typecast to a
20672 * class.cs (Indexer): Implement explicit interface implementation
20675 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20677 * class.cs: make the default instance constructor public and hidebysig.
20679 2001-01-03 Ravi Pratap <ravi@ximian.com>
20681 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20682 so we can call it from elsewhere.
20684 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20685 we emit it internally if the class has a defined indexer; otherwise the user
20686 emits it by decorating the class definition with the DefaultMemberAttribute.
20688 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20689 attribute is not used on a type which defines an indexer.
20691 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20692 character when we skip whitespace.
20694 * ../errors/cs0646.cs : Add.
20696 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20698 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20701 * makefile: Add practical target `mcs3.exe' which builds the third
20702 generation compiler.
20704 * expression.cs (New): Fix structures constructor calling.
20706 * class.cs (Property, Method, Indexer): Emit Final flag on the
20707 method if we are an interface implementation and we are not
20710 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20711 whether this property is referencing a `base' method.
20713 * expression.cs (Invocation.EmitCall): take an extra argument:
20714 is_base, this is used to determine whether the `call' or
20715 `callvirt' opcode should be used.
20718 * delegate.cs: update EmitCall.
20720 * class.cs (Method.Define): Set NewSlot for the cases where we are
20721 not implementing an interface method.
20723 (Property.Define): ditto.
20725 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20727 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20728 'r'. Allows mcs to parse itself fully.
20730 2002-01-02 Ravi Pratap <ravi@ximian.com>
20732 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20733 of the number of initializers that require the InitializeArray method.
20735 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20736 update the above field where necessary.
20738 (MakeByteBlob): Update accordingly.
20740 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20743 (EmitDynamicInitializers): Update in accordance with the new optimization.
20745 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20746 same OpCode applies.
20748 * cs-parser.jay : Fix some glaring errors I introduced.
20750 2002-01-01 Ravi Pratap <ravi@ximian.com>
20752 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20753 so that we can check for name clashes there too.
20755 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20756 for interface indexers.
20758 * interfaces.cs (Define): Emit the default member attribute.
20760 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20761 variable was being referred to while setting the value ;-)
20763 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20765 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20766 byte-by-byte information when we know the data is zero.
20768 Make the block always a multiple of 4, because
20769 DefineInitializedData has a bug.
20771 * assign.cs: Fix, we should assign from the temporary, not from
20774 * expression.cs (MakeByteBlob): Fix my incorrect code.
20776 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20778 * typemanager.cs (EnumToUnderlying): This function is used to get
20779 the underlying type from an enumeration, because it does not
20782 * constant.cs: Use the I4_S form for values between -128 and 127.
20784 * statement.cs (Block.LookupLabel): Looks up a label.
20785 (Block): Drop support for labeled blocks.
20787 (LabeledStatement): New kind of statement that represents a label
20790 (Goto): Finally implement this bad boy.
20792 * cs-parser.jay: Update to reflect new mechanism to implement
20795 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20797 * codegen.cs (EmitContext.This): a codegen property that keeps the
20798 a single instance of this instead of creating many different this
20801 * delegate.cs (Delegate.DoResolve): Update to use the property;
20803 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20805 * expression.cs (BaseAccess.DoResolve): Ditto.
20807 2001-12-29 Ravi Pratap <ravi@ximian.com>
20809 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20810 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20812 (InitCoreTypes): Update accordingly.
20814 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20815 so we can quickly store the state.
20817 (ApplyAttributes): Set the correct implementation flags
20818 for InternalCall methods.
20820 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20822 * expression.cs (EmitCall): if a method is not virtual, then do
20823 not use callvirt on it.
20825 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20826 user defined stuff) requires the use of stobj, which takes an
20827 address on the stack instead of an array and an index. So emit
20828 the Ldelema operation for it.
20830 (EmitStoreOpcode): Use stobj for valuetypes.
20832 (UnaryMutator.EmitCode): Use the right 1 value depending on
20833 whether we are dealing with int64/uint64, float or doubles.
20835 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20836 constructors that I implemented last night.
20838 (Constructor.IsDefault): Fix to work properly for static
20841 * cs-parser.jay (CheckDef): report method signature errors.
20842 Update error number 103 to be 132.
20844 * decl.cs: New AdditionResult enumeration value: MethodExists.
20845 Although we do this check for methods later on in the semantic
20846 analysis, catching repeated default constructors is so easy that
20847 we catch these here.
20849 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20852 (ParameterReference.EmitAssign, Emit): handle
20855 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20856 (ArrayAccess.EmitStoreOpcode): ditto.
20858 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20860 * expression.cs (MakeByteBlob): Complete all the missing types
20861 (uint, short, ushort, byte, sbyte)
20863 * class.cs: Only init instance field initializers on instance
20866 Rename `constructors' to instance_constructors.
20868 (TypeContainer.AddConstructor): Only add constructors to the list
20869 if it is not static.
20871 Make sure that we handle default_static_constructor independently
20872 everywhere where we handle instance_constructors
20874 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20876 * class.cs: Do not lookup or create a base initializer for a
20877 static constructor.
20879 (ConstructorInitializer.Resolve): use the proper type to lookup
20882 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20884 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20887 * decl.cs: CloseType is now an virtual method, the default
20888 implementation just closes this type.
20890 2001-12-28 Ravi Pratap <ravi@ximian.com>
20892 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20893 to PreserveSig by default. Also emit HideBySig on such methods.
20895 Basically, set the defaults to standard values.
20897 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20898 argument, if candidate is better, it can't be worse than the best !
20900 (Invocation): Re-write bits to differentiate between methods being
20901 applicable in their expanded form and their normal form - for params
20904 Get rid of use_standard everywhere as only standard conversions are allowed
20905 in overload resolution.
20907 More spec conformance.
20909 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20911 * driver.cs: Add --timestamp, to see where the compiler spends
20914 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20915 `this' in static code.
20917 (SimpleName.DoResolve): Implement in terms of a helper function
20918 that allows static-references to be passed upstream to
20921 (Expression.ResolveWithSimpleName): Resolve specially simple
20922 names when called by MemberAccess to implement the special
20925 (Expression.ImplicitReferenceConversion): Handle conversions from
20926 Null to reference types before others, as Null's type is
20929 * expression.cs (Invocation.EmitCall): Handle the special case of
20930 calling methods declared on a reference type from a ValueType
20931 (Base classes System.Object and System.Enum)
20933 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20934 the left hand side is a TypeExpr, not on every enumeration.
20936 (Binary.Resolve): If types are reference types, then do a cast to
20937 object on operators != and == of both arguments.
20939 * typemanager.cs (FindMembers): Extract instance and static
20940 members if requested.
20942 * interface.cs (PopulateProperty): Use void_type instead of null
20943 as the return type for the setter method.
20945 (PopulateIndexer): ditto.
20947 2001-12-27 Ravi Pratap <ravi@ximian.com>
20949 * support.cs (ReflectionParameters): Fix minor bug where we
20950 were examining the wrong parameter for the ParamArray attribute.
20952 Cope with requests for the type of the parameter at position
20953 greater than the params parameter's. We now return the element
20954 type of the params array as that makes more sense.
20956 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20957 accordingly as we no longer have to extract the element type
20960 (Invocation.OverloadResolve): Update.
20962 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20964 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20965 against IEnumerator, test whether the return value is a descendant
20966 of the IEnumerator interface.
20968 * class.cs (Indexer.Define): Use an auxiliary method to implement
20969 the other bits of the method definition. Begin support for
20970 explicit interface implementation.
20972 (Property.DefineMethod): Use TypeManager.void_type instead of null
20973 for an empty return value.
20975 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20977 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20978 dealing with a FieldExpr which is composed of a FieldBuilder, in
20979 the code path we did extract the constant, but we should have
20980 obtained the underlying value to be able to cast it (otherwise we
20981 end up in an infinite loop, this is what Ravi was running into).
20983 (ArrayCreation.UpdateIndices): Arrays might be empty.
20985 (MemberAccess.ResolveMemberAccess): Add support for section
20986 14.5.4.1 that deals with the special case of E.I when E is a type
20987 and something else, that I can be a reference to a static member.
20989 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20990 handle a particular array type to create byte blobs, it is just
20991 something we dont generate byteblobs for.
20993 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20996 * location.cs (Push): remove the key from the hashtable that we
20997 are about to add. This happens for empty files.
20999 * driver.cs: Dispose files after we have parsed them.
21001 (tokenize): new function that only runs the tokenizer on its
21002 input, for speed testing.
21004 2001-12-26 Ravi Pratap <ravi@ximian.com>
21006 * class.cs (Event.Define): Define the private field only if there
21007 are no accessors defined.
21009 * expression.cs (ResolveMemberAccess): If there is no associated
21010 field with the event, that means we have an event defined with its
21011 own accessors and we should flag error cs0070 since transforming
21012 ourselves into a field is not valid in that case.
21014 * ecore.cs (SimpleName.DoResolve): Same as above.
21016 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21017 and charset to sane values.
21019 2001-12-25 Ravi Pratap <ravi@ximian.com>
21021 * assign.cs (DoResolve): Perform check on events only if they
21022 are being accessed outside the declaring type.
21024 * cs-parser.jay (event_declarations): Update rules to correctly
21025 set the type of the implicit parameter etc.
21027 (add_accessor, remove_accessor): Set current local parameters.
21029 * expression.cs (Binary): For delegate addition and subtraction,
21030 cast the return value from the method into the appropriate delegate
21033 2001-12-24 Ravi Pratap <ravi@ximian.com>
21035 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21036 of these as the workaround is unnecessary.
21038 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21039 delegate data - none of that is needed at all.
21041 Re-write bits to extract the instance expression and the delegate method
21044 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21047 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21048 of attaching attributes instead of duplicating code everywhere.
21050 * everywhere : Update code to do attribute emission using the above method.
21052 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21054 * expression.cs (IsParamsMethodApplicable): if there are not
21055 parameters, return immediately.
21057 * ecore.cs: The 0 literal can be implicity converted to an enum
21060 (SimpleName.DoResolve): First lookup the type, then lookup the
21063 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21064 want to get its address. If the InstanceExpression is not
21065 addressable, store the result in a temporary variable, then get
21068 * codegen.cs: Only display 219 errors on warning level or above.
21070 * expression.cs (ArrayAccess): Make it implement the
21071 IMemoryLocation interface.
21073 (Binary.DoResolve): handle the operator == (object a, object b)
21074 and operator != (object a, object b) without incurring into a
21075 BoxedCast (because 5 != o should never be performed).
21077 Handle binary enumerator operators.
21079 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21080 value type, otherwise use Ldelem_ref.
21082 Use precomputed names;
21084 (AddressOf): Implement address of
21086 * cs-parser.jay (labeled_statement): Fix recursive block
21087 addition by reworking the production.
21089 * expression.cs (New.DoEmit): New has a special case:
21091 If we are dealing with a ValueType, we have a few
21092 situations to deal with:
21094 * The target of New is a ValueType variable, that is
21095 easy, we just pass this as the variable reference
21097 * The target of New is being passed as an argument,
21098 to a boxing operation or a function that takes a
21101 In this case, we need to create a temporary variable
21102 that is the argument of New.
21105 2001-12-23 Ravi Pratap <ravi@ximian.com>
21107 * rootcontext.cs (LookupType): Check that current_type is not null before
21108 going about looking at nested types.
21110 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21111 not implement the IAssignMethod interface any more.
21113 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21114 where we tranform them into FieldExprs if they are being resolved from within
21115 the declaring type.
21117 * ecore.cs (SimpleName.DoResolve): Do the same here.
21119 * assign.cs (DoResolve, Emit): Clean up code considerably.
21121 * ../errors/bug10.cs : Add.
21123 * ../errors/cs0070.cs : Add.
21125 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21127 * assign.cs : Get rid of EventIsLocal everywhere.
21129 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21131 * ecore.cs (ConvertIntLiteral): finished the implementation.
21133 * statement.cs (SwitchLabel): Convert the value we are using as a
21134 key before looking up the table.
21136 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21138 * codegen.cs (EmitTopBlock): Require a Location argument now.
21140 * cs-parser.jay (constructor_declarator): We need to setup
21141 current_local_parameters before we parse the
21142 opt_constructor_initializer, to allow the variables to be bound
21143 to the constructor arguments.
21145 * rootcontext.cs (LookupType): First lookup nested classes in our
21146 class and our parents before we go looking outside our class.
21148 * expression.cs (ConstantFold): Extract/debox the values at the
21151 * rootcontext.cs (EmitCode): Resolve the constants first before we
21152 resolve the types. This is not really needed, but it helps debugging.
21154 * statement.cs: report location.
21156 * cs-parser.jay: pass location to throw statement.
21158 * driver.cs: Small bug fix.
21160 * report.cs: Updated format to be 4-zero filled digits.
21162 2001-12-22 Ravi Pratap <ravi@ximian.com>
21164 * expression.cs (CheckIndices): Fix minor bug where the wrong
21165 variable was being referred to ;-)
21167 (DoEmit): Do not call EmitStaticInitializers when the
21168 underlying type is System.Object.
21170 2001-12-21 Ravi Pratap <ravi@ximian.com>
21172 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21173 and do the usual workaround for SRE.
21175 * class.cs (MyEventBuilder.EventType): New member to get at the type
21176 of the event, quickly.
21178 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21180 * assign.cs (Assign.DoResolve): Handle the case when the target
21181 is an EventExpr and perform the necessary checks.
21183 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21186 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21188 (EventExpr): Set the type in the constructor itself since we
21189 are meant to be born fully resolved.
21191 (EventExpr.Define): Revert code I wrote earlier.
21193 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21194 instance expression is null. The instance expression is a This in that case
21195 or a null, depending on whether it is a static method or not.
21197 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21198 refers to more than one method.
21200 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21201 and accordingly flag errors.
21203 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21205 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21207 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21209 * location.cs (ToString): Provide useful rutine.
21211 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21213 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21214 objects, return the actual integral boxed.
21216 * statement.cs (SwitchLabel): define an ILLabel for each
21219 (Switch.CheckSwitch): If the value is a Literal, extract
21220 the underlying literal.
21222 Also in the unused hashtable we had, add the SwitchLabel so we can
21223 quickly look this value up.
21225 * constant.cs: Implement a bunch of new constants. Rewrite
21226 Literal based on this. Made changes everywhere to adapt to this.
21228 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21229 dereferencing array only once, and also copes with enumrations.
21231 bytes are two bytes wide, not one.
21233 (Cast): Perform constant conversions.
21235 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21236 wrappers to the literals here.
21238 * expression.cs (DoNumericPromotions): long literals can converted
21239 to ulong implicity (this is taken care of elsewhere, but I was
21240 missing this spot).
21242 * ecore.cs (Expression.Literalize): Make the return type Literal,
21243 to improve type checking.
21245 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21247 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21249 * literal.cs: Revert code from ravi that checked the bounds. The
21250 bounds are sane by the definition of the type itself.
21252 * typemanager.cs: Fix implementation of ImplementsInterface. We
21253 need to actually look up in our parent hierarchy for interfaces
21256 * const.cs: Use the underlying type for enumerations
21258 * delegate.cs: Compute the basename for the delegate creation,
21259 that should fix the delegate test case, and restore the correct
21260 Type Lookup semantics in rootcontext
21262 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21263 referencing a nested type with the Reflection API is using the "+"
21266 * cs-parser.jay: Do not require EOF token at the end.
21268 2001-12-20 Ravi Pratap <ravi@ximian.com>
21270 * rootcontext.cs (LookupType): Concatenate type names with
21271 a '.' instead of a '+' The test suite passes again.
21273 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21274 field of the enumeration.
21276 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21277 the case when the member is an EventExpr.
21279 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21280 static has an associated instance expression.
21282 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21284 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21286 * class.cs (Event.Define): Register event and perform appropriate checks
21289 We define the Add and Remove methods even if the use provides none because
21290 in that case, we provide default implementations ourselves.
21292 Define a private field of the type of the event. This is done by the CSC compiler
21293 and we should be doing it too ;-)
21295 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21296 More methods we use in code we generate.
21298 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21301 (InitCoreTypes): Update accordingly for the above.
21303 * class.cs (Event.Emit): Generate code for default accessors that we provide
21305 (EmitDefaultMethod): Do the job in the above.
21307 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21310 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21312 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21313 builders even if we were missing one.
21315 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21316 pass the Basename as our class name instead of the Name. The
21317 basename will be correctly composed for us.
21319 * parameter.cs (Paramters): Now takes a Location argument.
21321 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21322 make all the code call directly LookupType in RootContext and take
21323 this chance to pass the Location information everywhere.
21325 * Everywhere: pass Location information.
21327 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21329 * class.cs (Constructor.Define): Updated way of detecting the
21330 length of the parameters.
21332 (TypeContainer.DefineType): Use basename as the type name for
21335 (TypeContainer.Define): Do not recursively define types here, as
21336 definition is taken care in order by the RootContext.
21338 * tree.cs: Keep track of namespaces in a per-file basis.
21340 * parameter.cs (Parameter.ComputeSignature): Update to use
21343 (Parameters.GetSignature): ditto.
21345 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21346 instead of a TypeContainer.
21348 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21349 resolve names. Because we need to be resolve in our context, not
21352 * driver.cs: Implement response files.
21354 * class.cs (TypeContainer.DefineType): If we are defined, do not
21355 redefine ourselves.
21357 (Event.Emit): Emit the code for add/remove handlers.
21358 (Event.Define): Save the MethodBuilders for add/remove.
21360 * typemanager.cs: Use pair here too.
21362 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21363 DictionaryEntry requires the first argument to be non-null.
21365 (enum_declaration): Compute full name for registering the
21368 (delegate_declaration): Instead of using
21369 formal_parameter_list, use opt_formal_parameter_list as the list
21372 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21373 (EventParsing): New property that controls whether `add' and
21374 `remove' are returned as tokens or identifiers (for events);
21376 2001-12-19 Ravi Pratap <ravi@ximian.com>
21378 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21379 use MyEventBuilder only and let it wrap the real builder for us.
21381 (MyEventBuilder): Revamp constructor etc.
21383 Implement all operations that we perform on EventBuilder in precisely the same
21386 (FindMembers): Update to use the EventBuilder member.
21388 (Event.Emit): Update accordingly.
21390 2001-12-18 Ravi Pratap <ravi@ximian.com>
21392 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21393 by calling the appropriate methods.
21395 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21398 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21400 2001-12-17 Ravi Pratap <ravi@ximian.com>
21402 * delegate.cs (Delegate.Populate): Check that the return type
21403 and various parameters types are indeed accessible.
21405 * class.cs (Constructor.Define): Same here.
21407 (Field.Define): Ditto.
21409 (Event.Define): Ditto.
21411 (Operator.Define): Check that the underlying Method defined itself
21412 correctly - so it's MethodBuilder should not be null.
21414 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21415 expression happens to be null.
21417 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21418 members but as of now we don't seem to be able to do anything really useful with it.
21420 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21421 not the EventBuilder.
21423 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21425 * cs-tokenizer.cs: Add support for defines.
21426 Add support for #if, #elif, #else, #endif
21428 (eval_var): evaluates a variable.
21429 (eval): stubbed for evaluating functions.
21431 * cs-parser.jay: Pass the defines information
21433 * driver.cs: Add --define command line option.
21435 * decl.cs: Move MemberCore here.
21437 Make it the base class for DeclSpace. This allows us to catch and
21438 report 108 and 109 for everything now.
21440 * class.cs (TypeContainer.Define): Extract all the members
21441 before populating and emit the warning 108 (new keyword required
21442 to override) instead of having each member implement this.
21444 (MemberCore.Define): New abstract method, we will be using this in
21445 the warning reporting engine in Populate.
21447 (Operator.Define): Adjust to new MemberCore protocol.
21449 * const.cs (Const): This does not derive from Expression, it is a
21450 temporary object we use to create fields, it is a MemberCore.
21452 * class.cs (Method.Define): Allow the entry point to be in a
21455 * driver.cs: Rewrite the argument handler to clean it up a bit.
21457 * rootcontext.cs: Made it just an auxiliary namespace feature by
21458 making everything static.
21460 * driver.cs: Adapt code to use RootContext type name instead of
21463 * delegate.cs: Remove RootContext argument.
21465 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21468 * class.cs (Event.Define): The lookup can fail.
21470 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21472 * expression.cs: Resolve the this instance before invoking the code.
21474 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21476 * cs-parser.jay: Add a production in element_access that allows
21477 the thing to become a "type" reference. This way we can parse
21478 things like "(string [])" as a type.
21480 Note that this still does not handle the more complex rules of
21484 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21486 * ecore.cs: (CopyNewMethods): new utility function used to
21487 assemble the list of methods from running FindMembers.
21489 (MemberLookup): Rework FindMembers so that
21491 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21493 * class.cs (TypeContainer): Remove Delegates who fail to be
21496 * delegate.cs (Populate): Verify that we dont get null return
21497 values. TODO: Check for AsAccessible.
21499 * cs-parser.jay: Use basename to emit error 574 (destructor should
21500 have the same name as container class), not the full name.
21502 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21503 possible representation.
21505 Also implements integer type suffixes U and L.
21507 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21509 * expression.cs (ArrayCreation.DoResolve): We need to do the
21510 argument resolution *always*.
21512 * decl.cs: Make this hold the namespace. Hold the root context as
21514 (LookupType): Move here.
21516 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21518 * location.cs (Row, Name): Fixed the code, it was always returning
21519 references to the first file.
21521 * interface.cs: Register properties defined through interfaces.
21523 * driver.cs: Add support for globbing on the command line
21525 * class.cs (Field): Make it derive from MemberCore as well.
21528 2001-12-15 Ravi Pratap <ravi@ximian.com>
21530 * class.cs (Event::Define): Check that the type of the event is a delegate
21531 type else flag error #66.
21533 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21536 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21537 values of EntryPoint, CharSet etc etc.
21539 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21541 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21542 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21543 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21544 which needs this to do its work.
21546 * ../errors/cs0066.cs : Add.
21548 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21550 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21553 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21554 clears out the parameters field.
21555 (MemberSignatureCompare): Cleanup
21557 (MemberCore): New base class used to share code between MethodCore
21560 (RegisterRequiredImplementations) BindingFlags.Public requires
21561 either BindingFlags.Instace or Static. Use instance here.
21563 (Property): Refactored code to cope better with the full spec.
21565 * parameter.cs (GetParameterInfo): Return an empty array instead
21568 * class.cs (Property): Abstract or extern properties have no bodies.
21570 * parameter.cs (GetParameterInfo): return a zero-sized array.
21572 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21573 method modifier validation to the typecontainer so we can reuse
21574 this on properties.
21576 (MethodCore.ParameterTypes): return an empty sized array of types.
21578 (Property.Define): Test property modifier validity.
21580 Add tests for sealed/override too.
21582 (Method.Emit): abstract or extern methods have no bodies.
21584 2001-12-14 Ravi Pratap <ravi@ximian.com>
21586 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21589 (Method::Define, ::Emit): Modify accordingly.
21591 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21593 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21595 * makefile: Pass in /unsafe.
21597 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21599 * class.cs (MakeKey): Kill routine.
21601 * class.cs (TypeContainer.Define): Correctly define explicit
21602 method implementations (they require the full interface name plus
21605 * typemanager.cs: Deply the PtrHashtable here and stop using the
21606 lame keys. Things work so much better.
21608 This of course broke everyone who depended on `RegisterMethod' to
21609 do the `test for existance' test. This has to be done elsewhere.
21611 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21612 the object stupid Equals method (because, that like fails all over
21613 the place). We still do not use it.
21615 * class.cs (TypeContainer.SetRequiredInterface,
21616 TypeContainer.RequireMethods): Killed these two routines and moved
21617 all the functionality to RegisterRequiredImplementations.
21619 (TypeContainer.RegisterRequiredImplementations): This routine now
21620 registers all the implementations required in an array for the
21621 interfaces and abstract methods. We use an array of structures
21622 which can be computed ahead of time to reduce memory usage and we
21623 also assume that lookups are cheap as most classes will not
21624 implement too many interfaces.
21626 We also avoid creating too many MethodSignatures.
21628 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21629 clear the "pending" bit if we find that there are problems with
21632 (TypeContainer.VerifyPendingMethods): Update to report errors of
21633 methods that look like implementations but are not.
21635 (TypeContainer.Define): Add support for explicit interface method
21638 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21640 * typemanager.cs: Keep track of the parameters here instead of
21641 being a feature of the TypeContainer.
21643 * class.cs: Drop the registration of parameters here, as
21644 InterfaceMethods are also interface declarations.
21646 * delegate.cs: Register methods with the TypeManager not only with
21647 the TypeContainer. This code was buggy.
21649 * interface.cs: Full registation here.
21651 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21653 * expression.cs: Remove reducer for binary expressions, it can not
21656 * const.cs: Put here the code that used to go into constant.cs
21658 * constant.cs: Put here the code for constants, this is a new base
21659 class for Literals.
21661 * literal.cs: Make Literal derive from Constant.
21663 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21665 * statement.cs (Return.Emit): Report error 157 if the user
21666 attempts to return from a finally block.
21668 (Return.Emit): Instead of emitting a return, jump to the end of
21671 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21672 LocalBuilder to store the result of the function. ReturnLabel is
21673 the target where we jump.
21676 2001-12-09 Radek Doulik <rodo@ximian.com>
21678 * cs-parser.jay: remember alias in current namespace
21680 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21683 * class.cs (LookupAlias): lookup alias in my_namespace
21685 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21687 (LookupAlias): lookup alias in this and if needed in parent
21690 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21694 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21695 making things static. I need this to avoid passing the
21696 TypeContainer when calling ParameterType.
21698 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21699 that did string manipulation to compute the type and then call
21700 GetType. Use Parameter.ParameterType instead.
21702 * cs-tokenizer.cs: Consume the suffix for floating values.
21704 * expression.cs (ParameterReference): figure out whether this is a
21705 reference parameter or not. Kill an extra variable by computing
21706 the arg_idx during emission.
21708 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21709 function that returns whether a parameter is an out/ref value or not.
21711 (Parameter.ParameterType): The type of the parameter (base,
21712 without ref/out applied).
21714 (Parameter.Resolve): Perform resolution here.
21715 (Parameter.ExternalType): The full type (with ref/out applied).
21717 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21718 support for expressions on the using statement.
21720 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21722 * statement.cs (Using.EmitLocalVariableDecls): Split the
21723 localvariable handling of the using statement.
21725 (Block.EmitMeta): Keep track of variable count across blocks. We
21726 were reusing slots on separate branches of blocks.
21728 (Try.Emit): Emit the general code block, we were not emitting it.
21730 Check the type of the declaration to be an IDisposable or
21731 something that can be implicity converted to it.
21733 Emit conversions if required.
21735 * ecore.cs (EmptyExpression): New utility class.
21736 (Expression.ImplicitConversionExists): New utility function.
21738 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21740 * statement.cs (Using): Implement.
21742 * expression.cs (LocalVariableReference): Support read only variables.
21744 * statement.cs: Remove the explicit emit for the Leave opcode.
21745 (VariableInfo): Add a readonly field.
21747 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21749 * ecore.cs (ConvCast): new class used to encapsulate the various
21750 explicit integer conversions that works in both checked and
21751 unchecked contexts.
21753 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21754 properly generate the overflow opcodes.
21756 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21758 * statement.cs: The correct type for the EmptyExpression is the
21759 element_type, not the variable type. Ravi pointed this out.
21761 2001-12-04 Ravi Pratap <ravi@ximian.com>
21763 * class.cs (Method::Define): Handle PInvoke methods specially
21764 by using DefinePInvokeMethod instead of the usual one.
21766 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21767 above to do the task of extracting information and defining the method.
21769 2001-12-04 Ravi Pratap <ravi@ximian.com>
21771 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21772 of the condition for string type.
21774 (Emit): Move that here.
21776 (ArrayCreation::CheckIndices): Keep string literals in their expression
21779 (EmitDynamicInitializers): Handle strings appropriately.
21781 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21783 * codegen.cs (EmitContext): Replace multiple variables with a
21784 single pointer to the current Switch statement.
21786 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21789 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21793 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21796 (Foreach.Emit): Foreach on arrays was not setting
21797 up the loop variables (for break/continue).
21799 (GotoCase): Semi-implented.
21801 2001-12-03 Ravi Pratap <ravi@ximian.com>
21803 * attribute.cs (CheckAttribute): Handle system attributes by using
21804 Attribute.GetAttributes to examine information we need.
21806 (GetValidPlaces): Same here.
21808 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21810 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21812 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21814 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21816 (Method::Emit): Handle the case when we are a PInvoke method.
21818 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21820 * expression.cs: Use ResolveWithSimpleName on compound names.
21822 2001-12-02 Ravi Pratap <ravi@ximian.com>
21824 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21825 before trying to reduce it.
21827 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21829 * constant.cs (LookupConstantValue): Implement.
21831 (EmitConstant): Use the above in emitting the constant.
21833 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21834 that are user-defined by doing a LookupConstantValue on them.
21836 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21839 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21841 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21843 (BaseAccess.DoResolve): Implement.
21845 (MemberAccess.DoResolve): Split this routine into a
21846 ResolveMemberAccess routine that can be used independently
21848 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21850 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21851 As that share bits of the implementation. Is returns a boolean,
21852 while As returns the Type that is being probed.
21854 2001-12-01 Ravi Pratap <ravi@ximian.com>
21856 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21857 instead of a Literal - much easier.
21859 (EnumInTransit): Remove - utterly useless :-)
21861 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21863 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21865 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21866 chain when we have no associated expression.
21868 2001-11-30 Ravi Pratap <ravi@ximian.com>
21870 * constant.cs (Define): Use Location while reporting the errror.
21872 Also emit a warning when 'new' is used and there is no inherited
21875 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21878 (LookupEnumValue): Implement to lookup an enum member's value and define it
21881 (Populate): Re-write accordingly to use the above routine.
21883 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21885 * expression.cs (This): Fix prototype for DoResolveLValue to
21886 override the base class DoResolveLValue.
21888 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21891 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21892 (we need to load the address of the field here). This fixes
21895 (FieldExpr.DoResolveLValue): Call the DoResolve
21896 function to initialize the Instance expression.
21898 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21899 correctly the GetEnumerator operation on a value type.
21901 * cs-parser.jay: Add more simple parsing error catches.
21903 * statement.cs (Switch): Add support for string switches.
21904 Handle null specially.
21906 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21908 2001-11-28 Ravi Pratap <ravi@ximian.com>
21910 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21912 (declare_local_constant): New helper function.
21914 * statement.cs (AddConstant): Keep a separate record of constants
21916 (IsConstant): Implement to determine if a variable is a constant.
21918 (GetConstantExpression): Implement.
21920 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21922 * statement.cs (IsVariableDefined): Re-write.
21924 2001-11-27 Ravi Pratap <ravi@ximian.com>
21926 * class.cs (TypeContainer::FindMembers): Look for constants
21927 in the case when we are looking for MemberTypes.Field
21929 * expression.cs (MemberAccess::DoResolve): Check that in the
21930 case we are a FieldExpr and a Literal, we are not being accessed
21931 by an instance reference.
21933 * cs-parser.jay (local_constant_declaration): Implement.
21935 (declaration_statement): Implement for constant declarations.
21937 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21939 * statement.cs (Switch): Catch double defaults.
21941 (Switch): More work on the switch() statement
21942 implementation. It works for integral values now, need to finish
21946 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21948 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21949 integer literals into other integer literals. To be used by
21952 2001-11-24 Ravi Pratap <ravi@ximian.com>
21954 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21957 (EmitDynamicInitializers): Cope with the above since we extract data
21958 directly from ArrayData now.
21960 (ExpectInitializers): Keep track of whether initializers are mandatory
21963 (Bounds): Make it a hashtable to prevent the same dimension being
21964 recorded for every element in that dimension.
21966 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21969 Also fix bug which was causing the indices to be emitted in the reverse
21972 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21974 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21975 unfinished. They do not work, because the underlying code is
21978 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21980 * cs-parser.jay: Remove bogus fixme.
21982 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21983 on Switch statement.
21985 2001-11-23 Ravi Pratap <ravi@ximian.com>
21987 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21990 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21991 parameter. Apparently, any expression is allowed.
21993 (ValidateInitializers): Update accordingly.
21995 (CheckIndices): Fix some tricky bugs thanks to recursion.
21997 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21998 I was being completely brain-dead.
22000 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22001 and re-write acordingly.
22003 (DelegateInvocation): Re-write accordingly.
22005 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22007 (MakeByteBlob): Handle types more correctly.
22009 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22010 initialization from expressions but it is incomplete because I am a complete
22013 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22015 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22016 on If. Basically, we have to return `true' (ie, we do return to
22017 our caller) only if both branches of the if return.
22019 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22020 short-circuit operators, handle them as short circuit operators.
22022 (Cast.DoResolve): Resolve type.
22023 (Cast.Cast): Take an expression as the target type.
22025 * cs-parser.jay (cast_expression): Remove old hack that only
22026 allowed a limited set of types to be handled. Now we take a
22027 unary_expression and we resolve to a type during semantic
22030 Use the grammar productions from Rhys to handle casts (this is
22031 not complete like Rhys syntax yet, we fail to handle that corner
22032 case that C# has regarding (-x), but we will get there.
22034 2001-11-22 Ravi Pratap <ravi@ximian.com>
22036 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22037 field which is an array type.
22039 * cs-parser.jay (declare_local_variables): Support array initialization too.
22041 * typemanager.cs (MakeKey): Implement.
22043 (everywhere): Use the above appropriately.
22045 * cs-parser.jay (for_statement): Update for array initialization while
22046 declaring variables.
22048 * ecore.cs : The error message was correct, it's the variable's names that
22049 were misleading ;-) Make the code more readable.
22051 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22052 the correct type etc.
22054 (ConvertExplicit): Handle Enum types by examining the underlying type.
22056 2001-11-21 Ravi Pratap <ravi@ximian.com>
22058 * parameter.cs (GetCallingConvention): Always return
22059 CallingConventions.Standard for now.
22061 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22063 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22064 and `r' after calling DoNumericPromotions.
22066 * ecore.cs: Fix error message (the types were in the wrong order).
22068 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22069 BindingFlags.Instance as well
22071 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22072 implicit int literal conversion in an empty cast so that we
22073 propagate the right type upstream.
22075 (UnboxCast): new class used to unbox value types.
22076 (Expression.ConvertExplicit): Add explicit type conversions done
22079 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22080 the target type before applying the implicit LongLiterals to ULong
22083 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22085 * cs-parser.jay (for_statement): Reworked the way For works: now
22086 we declare manually any variables that are introduced in
22087 for_initializer to solve the problem of having out-of-band code
22088 emition (that is what got for broken).
22090 (declaration_statement): Perform the actual variable declaration
22091 that used to be done in local_variable_declaration here.
22093 (local_variable_declaration): Do not declare anything, just pass
22094 the information on a DictionaryEntry
22096 2001-11-20 Ravi Pratap <ravi@ximian.com>
22098 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22099 re-write of the logic to now make it recursive.
22101 (UpdateIndices): Re-write accordingly.
22103 Store element data in a separate ArrayData list in the above methods.
22105 (MakeByteBlob): Implement to dump the array data into a byte array.
22107 2001-11-19 Ravi Pratap <ravi@ximian.com>
22109 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22112 * constant.cs (Define): Implement.
22114 (EmitConstant): Re-write fully.
22116 Pass in location info.
22118 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22121 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22122 DictionaryEntry since we need location info too.
22124 (constant_declaration): Update accordingly.
22126 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22127 code into another method : UpdateIndices.
22129 2001-11-18 Ravi Pratap <ravi@ximian.com>
22131 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22132 some type checking etc.
22134 2001-11-17 Ravi Pratap <ravi@ximian.com>
22136 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22137 bits to provide dimension info if the user skips doing that.
22139 Update second constructor to store the rank correctly.
22141 2001-11-16 Ravi Pratap <ravi@ximian.com>
22143 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22144 and try to implement.
22146 * ../errors/cs0150.cs : Add.
22148 * ../errors/cs0178.cs : Add.
22150 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22152 * statement.cs: Implement foreach on multi-dimensional arrays.
22154 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22155 name of the params argument.
22157 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22158 initializing the array.
22160 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22161 we can use this elsewhere.
22163 * statement.cs: Finish implementation of foreach for single
22166 * cs-parser.jay: Use an out-of-band stack to pass information
22167 around, I wonder why I need this.
22169 foreach_block: Make the new foreach_block the current_block.
22171 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22172 function used to return a static Parameters structure. Used for
22173 empty parameters, as those are created very frequently.
22175 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22177 2001-11-15 Ravi Pratap <ravi@ximian.com>
22179 * interface.cs : Default modifier is private, not public. The
22180 make verify test passes again.
22182 2001-11-15 Ravi Pratap <ravi@ximian.com>
22184 * support.cs (ReflectionParameters): Fix logic to determine
22185 whether the last parameter is a params one. Test 9 passes again.
22187 * delegate.cs (Populate): Register the builders we define with
22188 RegisterParameterForBuilder. Test 19 passes again.
22190 * cs-parser.jay (property_declaration): Reference $6 instead
22191 of $$ to get at the location.
22193 (indexer_declaration): Similar stuff.
22195 (attribute): Ditto.
22197 * class.cs (Property): Register parameters for the Get and Set methods
22198 if they exist. Test 23 passes again.
22200 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22201 call to EmitArguments as we are sure there aren't any params arguments.
22202 Test 32 passes again.
22204 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22205 IndexOutOfRangeException.
22207 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22208 Test 33 now passes again.
22210 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22212 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22213 broke a bunch of things. Will have to come up with a better way
22214 of tracking locations.
22216 * statement.cs: Implemented foreach for single dimension arrays.
22218 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22220 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22221 an error. This removes the lookup from the critical path.
22223 * cs-parser.jay: Removed use of temporary_loc, which is completely
22226 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22228 * support.cs (ReflectionParameters.ParameterModifier): Report
22229 whether the argument is a PARAMS argument or not.
22231 * class.cs: Set the attribute `ParamArrayAttribute' on the
22232 parameter argument.
22234 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22235 and cons_param_array_attribute (ConstructorInfo for
22236 ParamArrayAttribute).,
22238 * codegen.cs: Emit the return using the `Return' statement, that
22239 way we can report the error correctly for missing return values.
22241 * class.cs (Method.Emit): Clean up.
22243 * expression.cs (Argument.Resolve): Take another argument: the
22244 location where this argument is used. Notice that this is not
22245 part of the "Argument" class as to reduce the size of the
22246 structure (we know the approximate location anyways).
22248 Test if the argument is a variable-reference, if not, then
22249 complain with a 206.
22251 (Argument.Emit): Emit addresses of variables.
22253 (Argument.FullDesc): Simplify.
22255 (Invocation.DoResolve): Update for Argument.Resolve.
22257 (ElementAccess.DoResolve): ditto.
22259 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22260 method should be virtual, as this method is always virtual.
22262 (NewDelegate.DoResolve): Update for Argument.Resolve.
22264 * class.cs (ConstructorInitializer.DoResolve): ditto.
22266 * attribute.cs (Attribute.Resolve): ditto.
22268 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22270 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22272 * expression.cs (ParameterReference): Drop IStackStorage and implement
22273 IAssignMethod instead.
22275 (LocalVariableReference): ditto.
22277 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22278 IAssignMethod instead.
22280 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22282 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22283 enumerations that are used in heavily used structures derive from
22284 byte in a laughable and pathetic attempt to reduce memory usage.
22285 This is the kind of pre-optimzations that you should not do at
22286 home without adult supervision.
22288 * expression.cs (UnaryMutator): New class, used to handle ++ and
22289 -- separatedly from the other unary operators. Cleans up the
22290 code, and kills the ExpressionStatement dependency in Unary.
22292 (Unary): Removed `method' and `Arguments' from this class, making
22293 it smaller, and moving it all to SimpleCall, so I can reuse this
22294 code in other locations and avoid creating a lot of transient data
22295 strucutres when not required.
22297 * cs-parser.jay: Adjust for new changes.
22299 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22301 * enum.cs (Enum.Populate): If there is a failure during
22304 * cs-parser.jay (opt_enum_base): we used to catch type errors
22305 here, but this is really incorrect. The type error should be
22306 catched during semantic analysis.
22308 2001-12-11 Ravi Pratap <ravi@ximian.com>
22310 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22311 current_local_parameters as expected since I, in my stupidity, had forgotten
22314 * attribute.cs (GetValidPlaces): Fix stupid bug.
22316 * class.cs (Method::Emit): Perform check on applicability of attributes.
22318 (Constructor::Emit): Ditto.
22320 (Field::Emit): Ditto.
22322 (Field.Location): Store location information.
22324 (Property, Event, Indexer, Operator): Ditto.
22326 * cs-parser.jay (field_declaration): Pass in location for each field.
22328 * ../errors/cs0592.cs : Add.
22330 2001-11-12 Ravi Pratap <ravi@ximian.com>
22332 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22334 (InitCoreTypes): Update accordingly.
22336 (RegisterAttrType, LookupAttr): Implement.
22338 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22339 info about the same.
22341 (Resolve): Update to populate the above as necessary.
22343 (Error592): Helper.
22345 (GetValidPlaces): Helper to the above.
22347 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22349 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22351 2001-11-12 Ravi Pratap <ravi@ximian.com>
22353 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22355 * ../errors/cs0617.cs : Add.
22357 2001-11-11 Ravi Pratap <ravi@ximian.com>
22359 * enum.cs (Emit): Rename to Populate to be more consistent with what
22360 we expect it to do and when exactly it is called.
22362 * class.cs, rootcontext.cs : Update accordingly.
22364 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22365 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22367 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22369 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22370 of a fieldinfo using the above, when dealing with a FieldBuilder.
22372 2001-11-10 Ravi Pratap <ravi@ximian.com>
22374 * ../errors/cs0031.cs : Add.
22376 * ../errors/cs1008.cs : Add.
22378 * ../errrors/cs0543.cs : Add.
22380 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22383 (FindMembers): Implement.
22385 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22386 enums and delegates too.
22388 (enum_types): Rename to builder_to_enum.
22390 (delegate_types): Rename to builder_to_delegate.
22392 * delegate.cs (FindMembers): Implement.
22394 2001-11-09 Ravi Pratap <ravi@ximian.com>
22396 * typemanager.cs (IsEnumType): Implement.
22398 * enum.cs (Emit): Re-write parts to account for the underlying type
22399 better and perform checking etc.
22401 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22402 of the underlying type.
22404 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22407 * enum.cs (error31): Helper to report error #31.
22409 * cs-parser.jay (enum_declaration): Store location of each member too.
22411 * enum.cs (member_to_location): New hashtable.
22413 (AddEnumMember): Update location hashtable.
22415 (Emit): Use the location of each member while reporting errors.
22417 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22419 * cs-parser.jay: A for_initializer if is a
22420 local_variable_declaration really ammount to have an implicit
22421 block with the variable declaration and no initializer for for.
22423 * statement.cs (For.Emit): Cope with null initializers.
22425 This fixes the infinite loop on for initializers.
22427 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22429 * enum.cs: More cleanup.
22431 * ecore.cs: Remove dead code.
22433 * class.cs (Property.Emit): More simplification.
22434 (Event.Emit): ditto.
22436 Reworked to have less levels of indentation.
22438 2001-11-08 Ravi Pratap <ravi@ximian.com>
22440 * class.cs (Property): Emit attributes.
22450 * enum.cs (Emit): Ditto.
22452 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22455 * class.cs (Field, Event, etc.): Move attribute generation into the
22456 Emit method everywhere.
22458 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22459 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22460 as we had no way of defining nested enums !
22462 * rootcontext.cs : Adjust code accordingly.
22464 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22466 2001-11-07 Ravi Pratap <ravi@ximian.com>
22468 * expression.cs (EvalConstantExpression): Move into ecore.cs
22470 * enum.cs (Enum): Rename some members and make them public and readonly
22471 according to our convention.
22473 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22476 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22478 (Enum::Emit): Write a simple version for now which doesn't try to compute
22479 expressions. I shall modify this to be more robust in just a while.
22481 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22483 (TypeContainer::CloseType): Create the Enum types too.
22485 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22487 * expression.cs (EvalConstantExpression): Get rid of completely.
22489 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22490 user-defined values and other cases.
22492 (IsValidEnumLiteral): Helper function.
22494 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22495 out there in the case we had a literal FieldExpr.
22497 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22499 (Literalize): Revamp a bit to take two arguments.
22501 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22503 2001-11-06 Ravi Pratap <ravi@ximian.com>
22505 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22507 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22509 (Resolve): Use the above to ensure we have proper initializers.
22511 2001-11-05 Ravi Pratap <ravi@ximian.com>
22513 * expression.cs (Expression::EvalConstantExpression): New method to
22514 evaluate constant expressions.
22516 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22518 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22520 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22523 (Binary.ResolveOperator): Handle operator != (object a, object b)
22524 and operator == (object a, object b);
22526 (Binary.DoNumericPromotions): Indicate whether the numeric
22527 promotion was possible.
22529 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22532 Made the ArrayAccess implement interface IAssignMethod instead of
22533 IStackStore as the order in which arguments are passed reflects
22536 * assign.cs: Instead of using expr.ExprClass to select the way of
22537 assinging, probe for the IStackStore/IAssignMethod interfaces.
22539 * typemanager.cs: Load InitializeArray definition.
22541 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22542 static data that can be used to initialize arrays.
22544 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22546 * expression.cs: Handle operator== and operator!= for booleans.
22548 (Conditioal.Reduce): Implement reducer for the ?: operator.
22550 (Conditional.Resolve): Implement dead code elimination.
22552 (Binary.Resolve): Catch string literals and return a new
22553 concatenated string.
22555 (Unary.Reduce): Implement reduction of unary expressions.
22557 * ecore.cs: Split out the expression core handling here.
22559 (Expression.Reduce): New method used to perform constant folding
22560 and CSE. This is needed to support constant-expressions.
22562 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22563 targets, and optimize for !x.
22565 2001-11-04 Ravi Pratap <ravi@ximian.com>
22567 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22568 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22569 set custom atttributes.
22571 * literal.cs (Literal::GetValue): New abstract method to return the actual
22572 value of the literal, cast as an object.
22574 (*Literal): Implement GetValue method.
22576 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22577 expressions to the arraylist but objects of type Argument.
22579 * class.cs (TypeContainer::Emit): Emit our attributes too.
22581 (Method::Emit, Constructor::Emit): Ditto.
22583 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22584 to be ignoring earlier.
22586 2001-11-03 Ravi Pratap <ravi@ximian.com>
22588 * attribute.cs (AttributeSection::Define): Implement to do the business
22589 of constructing a CustomAttributeBuilder.
22591 (Attribute): New trivial class. Increases readability of code.
22593 * cs-parser.jay : Update accordingly.
22595 (positional_argument_list, named_argument_list, named_argument): New rules
22597 (attribute_arguments): Use the above so that we are more correct.
22599 2001-11-02 Ravi Pratap <ravi@ximian.com>
22601 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22602 to perform all checks for a method with a params parameter.
22604 (Invocation::OverloadResolve): Update to use the above method and therefore
22605 cope correctly with params method invocations.
22607 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22610 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22611 constructors in our parent too because we can't afford to miss out on
22614 * attribute.cs (AttributeSection): New name for the class Attribute
22616 Other trivial changes to improve readability.
22618 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22619 use the new class names.
22621 2001-11-01 Ravi Pratap <ravi@ximian.com>
22623 * class.cs (Method::Define): Complete definition for params types too
22625 (Indexer::Define): Ditto.
22627 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22628 Cope everywhere with a request for info about the array parameter.
22630 2001-11-01 Ravi Pratap <ravi@ximian.com>
22632 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22634 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22635 local_variable_type to extract the string corresponding to the type.
22637 (local_variable_type): Fixup the action to use the new helper method.
22639 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22642 * expression.cs : Clean out code which uses the above.
22644 2001-10-31 Ravi Pratap <ravi@ximian.com>
22646 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22647 and bale out if necessary by returning a false.
22649 (RegisterProperty): Ditto.
22651 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22652 and print out appropriate error messages.
22654 * interface.cs (everywhere): Ditto.
22656 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22657 location to constructor.
22659 * class.cs (Property, Event, Indexer): Update accordingly.
22661 * ../errors/cs111.cs : Added.
22663 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22664 of a method, as laid down by the spec.
22666 (Invocation::OverloadResolve): Use the above method.
22668 2001-10-31 Ravi Pratap <ravi@ximian.com>
22670 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22671 now take a TypeContainer and a Parameters object.
22673 (ParameterData): Modify return type of ParameterModifier method to be
22674 Parameter.Modifier and not a string.
22676 (ReflectionParameters, InternalParameters): Update accordingly.
22678 * expression.cs (Argument::GetParameterModifier): Same here.
22680 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22681 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22682 symbol in it at all so maybe this is only for now.
22684 2001-10-30 Ravi Pratap <ravi@ximian.com>
22686 * support.cs (InternalParameters): Constructor now takes an extra argument
22687 which is the actual Parameters class.
22689 (ParameterDesc): Update to provide info on ref/out modifiers.
22691 * class.cs (everywhere): Update call to InternalParameters to pass in
22692 the second argument too.
22694 * support.cs (ParameterData): Add ParameterModifier, which is a method
22695 to return the modifier info [ref/out etc]
22697 (InternalParameters, ReflectionParameters): Implement the above.
22699 * expression.cs (Argument::ParameterModifier): Similar function to return
22700 info about the argument's modifiers.
22702 (Invocation::OverloadResolve): Update to take into account matching modifiers
22705 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22706 a new SetFormalParameters object which we pass to InternalParameters.
22708 2001-10-30 Ravi Pratap <ravi@ximian.com>
22710 * expression.cs (NewArray): Merge into the ArrayCreation class.
22712 2001-10-29 Ravi Pratap <ravi@ximian.com>
22714 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22715 NewUserdefinedArray into one as there wasn't much of a use in having
22718 * expression.cs (Argument): Change field's name to ArgType from Type.
22720 (Type): New readonly property which returns the proper type, taking into
22721 account ref/out modifiers.
22723 (everywhere): Adjust code accordingly for the above.
22725 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22726 whether we are emitting for a ref or out parameter.
22728 * expression.cs (Argument::Emit): Use the above field to set the state.
22730 (LocalVariableReference::Emit): Update to honour the flag and emit the
22733 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22735 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22737 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22739 (ReflectionParameters, InternalParameters): Implement the above method.
22741 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22744 (Invocation::FullMethodDesc): Ditto.
22746 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22748 * cs-parser.jay: Add extra production for the second form of array
22751 * expression.cs (ArrayCreation): Update to reflect the above
22754 * Small changes to prepare for Array initialization.
22756 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22758 * typemanager.cs (ImplementsInterface): interface might be null;
22759 Deal with this problem;
22761 Also, we do store negative hits on the cache (null values), so use
22762 this instead of calling t.GetInterfaces on the type everytime.
22764 2001-10-28 Ravi Pratap <ravi@ximian.com>
22766 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22768 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22769 split functionality out into different classes.
22771 (New::FormArrayType): Move into NewBuiltinArray.
22773 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22776 (NewBuiltinArray): New class to handle creation of built-in arrays.
22778 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22779 account creation of one-dimensional arrays.
22781 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22783 (NewUserdefinedArray::DoResolve): Implement.
22785 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22787 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22788 we maintain inside the TypeManager. This is necessary to perform lookups on the
22791 (LookupType): Update to perform GetType on the module builders too.
22793 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22795 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22797 2001-10-23 Ravi Pratap <ravi@ximian.com>
22799 * expression.cs (New::DoResolve): Implement guts of array creation.
22801 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22803 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22805 * expression.cs: Fix bug I introduced lsat night that broke
22808 (Expression.Resolve): Report a 246 error (can not resolve name)
22809 if we find a SimpleName in the stream.
22811 (Expression.ResolveLValue): Ditto.
22813 (Expression.ResolveWithSimpleName): This function is a variant of
22814 ResolveName, this one allows SimpleNames to be returned without a
22815 warning. The only consumer of SimpleNames is MemberAccess
22817 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22819 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22820 might arrive here. I have my doubts that this is correct.
22822 * statement.cs (Lock): Implement lock statement.
22824 * cs-parser.jay: Small fixes to support `lock' and `using'
22826 * cs-tokenizer.cs: Remove extra space
22828 * driver.cs: New flag --checked, allows to turn on integer math
22831 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22832 Threading.Monitor.Exit
22834 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22836 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22837 Expression Class to be IndexerAccess.
22839 Notice that Indexer::DoResolve sets the eclass to Value.
22841 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22843 * class.cs (TypeContainer::Emit): Emit code for indexers.
22845 * assign.cs (IAssignMethod): New interface implemented by Indexers
22846 and Properties for handling assignment.
22848 (Assign::Emit): Simplify and reuse code.
22850 * expression.cs (IndexerAccess, PropertyExpr): Implement
22851 IAssignMethod, clean up old code.
22853 2001-10-22 Ravi Pratap <ravi@ximian.com>
22855 * typemanager.cs (ImplementsInterface): New method to determine if a type
22856 implements a given interface. Provides a nice cache too.
22858 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22861 (ConvertReferenceExplicit): Ditto.
22863 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22864 various methods, with correct names etc.
22866 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22867 Operator.UnaryNegation.
22869 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22870 we have a unary plus or minus operator.
22872 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22875 * everywhere : update accordingly.
22877 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22880 * class.cs (Method::Define): For the case where we are implementing a method
22881 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22882 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22884 2001-10-21 Ravi Pratap <ravi@ximian.com>
22886 * interface.cs (FindMembers): Implement to work around S.R.E
22889 * typemanager.cs (IsInterfaceType): Implement.
22891 (FindMembers): Update to handle interface types too.
22893 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22894 use IsAssignableFrom as that is not correct - it doesn't work.
22896 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22897 and accordingly override EmitStatement.
22899 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22900 using the correct logic :-)
22902 2001-10-19 Ravi Pratap <ravi@ximian.com>
22904 * ../errors/cs-11.cs : Add to demonstrate error -11
22906 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22908 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22909 then pass this as a hint to ResolveLValue.
22911 * expression.cs (FieldExpr): Add Location information
22913 (FieldExpr::LValueResolve): Report assignment to readonly
22916 (Expression::ExprClassFromMemberInfo): Pass location information.
22918 (Expression::ResolveLValue): Add new method that resolves an
22921 (Expression::DoResolveLValue): Default invocation calls
22924 (Indexers): New class used to keep track of indexers in a given
22927 (IStackStore): Renamed from LValue, as it did not really describe
22928 what this did. Also ResolveLValue is gone from this interface and
22929 now is part of Expression.
22931 (ElementAccess): Depending on the element access type
22933 * typemanager.cs: Add `indexer_name_type' as a Core type
22934 (System.Runtime.CompilerServices.IndexerNameAttribute)
22936 * statement.cs (Goto): Take a location.
22938 2001-10-18 Ravi Pratap <ravi@ximian.com>
22940 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22941 if two delegates are compatible.
22943 (NewDelegate::DoResolve): Update to take care of the case when
22944 we instantiate a delegate from another delegate.
22946 * typemanager.cs (FindMembers): Don't even try to look up members
22947 of Delegate types for now.
22949 2001-10-18 Ravi Pratap <ravi@ximian.com>
22951 * delegate.cs (NewDelegate): New class to take care of delegate
22954 * expression.cs (New): Split the delegate related code out into
22955 the NewDelegate class.
22957 * delegate.cs (DelegateInvocation): New class to handle delegate
22960 * expression.cs (Invocation): Split out delegate related code into
22961 the DelegateInvocation class.
22963 2001-10-17 Ravi Pratap <ravi@ximian.com>
22965 * expression.cs (New::DoResolve): Implement delegate creation fully
22966 and according to the spec.
22968 (New::DoEmit): Update to handle delegates differently.
22970 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22971 because of which we were printing out arguments in reverse order !
22973 * delegate.cs (VerifyMethod): Implement to check if the given method
22974 matches the delegate.
22976 (FullDelegateDesc): Implement.
22978 (VerifyApplicability): Implement.
22980 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22981 delegate invocations too.
22983 (Invocation::Emit): Ditto.
22985 * ../errors/cs1593.cs : Added.
22987 * ../errors/cs1594.cs : Added.
22989 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22991 2001-10-16 Ravi Pratap <ravi@ximian.com>
22993 * typemanager.cs (intptr_type): Core type for System.IntPtr
22995 (InitCoreTypes): Update for the same.
22997 (iasyncresult_type, asynccallback_type): Ditto.
22999 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23002 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23005 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23006 the builders for the 4 members of a delegate type :-)
23008 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23011 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23013 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23015 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23017 * statement.cs (Break::Emit): Implement.
23018 (Continue::Emit): Implement.
23020 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23021 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23022 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23023 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23026 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23027 properties that track the label for the current loop (begin of the
23028 loop and end of the loop).
23030 2001-10-15 Ravi Pratap <ravi@ximian.com>
23032 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23033 use of emitting anything at all.
23035 * class.cs, rootcontext.cs : Get rid of calls to the same.
23037 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23039 (Populate): Define the constructor correctly and set the implementation
23042 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23045 (AddDelegateType): Implement.
23047 (IsDelegateType): Implement helper method.
23049 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23051 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23052 and accordingly handle it.
23054 * delegate.cs (Populate): Take TypeContainer argument.
23055 Implement bits to define the Invoke method. However, I still haven't figured out
23056 how to take care of the native int bit :-(
23058 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23059 Qualify the name of the delegate, not its return type !
23061 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23064 (StandardConversionExists): Checking for array types turns out to be recursive.
23066 (ConvertReferenceExplicit): Implement array conversion.
23068 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23070 2001-10-12 Ravi Pratap <ravi@ximian.com>
23072 * cs-parser.jay (delegate_declaration): Store the fully qualified
23073 name as it is a type declaration.
23075 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23078 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23079 as TypeContainer::DefineType.
23081 (Populate): Method in which all the definition of the various methods (Invoke)
23084 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23087 (CloseDelegate): Finally creates the delegate.
23089 * class.cs (TypeContainer::DefineType): Update to define delegates.
23090 (Populate, Emit and CloseType): Do the same thing here too.
23092 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23093 delegates in all these operations.
23095 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23097 * expression.cs: LocalTemporary: a new expression used to
23098 reference a temporary that has been created.
23100 * assign.cs: Handle PropertyAccess back here, so that we can
23101 provide the proper semantic access to properties.
23103 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23104 a few more explicit conversions.
23106 * modifiers.cs: `NEW' modifier maps to HideBySig.
23108 * expression.cs (PropertyExpr): Make this into an
23109 ExpressionStatement, and support the EmitStatement code path.
23111 Perform get/set error checking, clean up the interface.
23113 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23114 them into toplevel access objects.
23116 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23118 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23121 * typemanager.cs: Keep track here of our PropertyBuilders again to
23122 work around lameness in SRE.
23124 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23126 * expression.cs (LValue::LValueResolve): New method in the
23127 interface, used to perform a second resolution pass for LValues.
23129 (This::DoResolve): Catch the use of this in static methods.
23131 (This::LValueResolve): Implement.
23133 (This::Store): Remove warning, assigning to `this' in structures
23136 (Invocation::Emit): Deal with invocation of
23137 methods on value types. We need to pass the address to structure
23138 methods rather than the object itself. (The equivalent code to
23139 emit "this" for structures leaves the entire structure on the
23140 stack instead of a pointer to it).
23142 (ParameterReference::DoResolve): Compute the real index for the
23143 argument based on whether the method takes or not a `this' pointer
23144 (ie, the method is static).
23146 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23147 value types returned from functions when we need to invoke a
23148 method on the sturcture.
23151 2001-10-11 Ravi Pratap <ravi@ximian.com>
23153 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23154 defining the type in the Modulebuilder or Typebuilder. This is to take
23155 care of nested types which need to be defined on the TypeBuilder using
23156 DefineNestedMethod.
23158 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23159 methods in RootContext, only ported to be part of TypeContainer.
23161 (TypeContainer::GetInterfaceOrClass): Ditto.
23163 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23165 * interface.cs (Interface::DefineInterface): New method. Does exactly
23166 what RootContext.CreateInterface did earlier, only it takes care of nested types
23169 (Interface::GetInterfaces): Move from RootContext here and port.
23171 (Interface::GetInterfaceByName): Same here.
23173 * rootcontext.cs (ResolveTree): Re-write.
23175 (PopulateTypes): Re-write.
23177 * class.cs (TypeContainer::Populate): Populate nested types too.
23178 (TypeContainer::Emit): Emit nested members too.
23180 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23181 instead just use the name argument passed in as it is already fully
23184 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23185 to TypeContainer mapping to see if a type is user-defined.
23187 * class.cs (TypeContainer::CloseType): Implement.
23189 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23190 the default constructor.
23192 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23195 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23197 * interface.cs (CloseType): Create the type here.
23199 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23202 Remove all the methods which are now in TypeContainer.
23204 2001-10-10 Ravi Pratap <ravi@ximian.com>
23206 * delegate.cs (Define): Re-write bits to define the delegate
23209 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23211 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23213 * expression.cs (ImplicitReferenceConversion): handle null as well
23214 as a source to convert to any reference type.
23216 * statement.cs (Return): Perform any implicit conversions to
23217 expected return type.
23219 Validate use of return statement.
23221 * codegen.cs (EmitContext): Pass the expected return type here.
23223 * class.cs (Method, Constructor, Property): Pass expected return
23224 type to EmitContext.
23226 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23228 * expression.cs: Make DoResolve take an EmitContext instead of a
23231 Replaced `l' and `location' for `loc', for consistency.
23233 (Error, Warning): Remove unneeded Tc argument.
23235 * assign.cs, literal.cs, constant.cs: Update to new calling
23238 * codegen.cs: EmitContext now contains a flag indicating whether
23239 code is being generated in a static method or not.
23241 * cs-parser.jay: DecomposeQI, new function that replaces the old
23242 QualifiedIdentifier. Now we always decompose the assembled
23243 strings from qualified_identifier productions into a group of
23246 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23248 * rootcontext.cs: Deal with field-less struct types correctly now
23249 by passing the size option to Define Type.
23251 * class.cs: Removed hack that created one static field.
23253 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23255 * statement.cs: Moved most of the code generation here.
23257 2001-10-09 Ravi Pratap <ravi@ximian.com>
23259 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23262 (ElementAccess): Remove useless bits for now - keep checks as the spec
23265 2001-10-08 Ravi Pratap <ravi@ximian.com>
23267 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23268 and start performing checks according to the spec.
23270 2001-10-07 Ravi Pratap <ravi@ximian.com>
23272 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23273 rank_specifiers instead.
23275 (rank_specifiers): Change the order in which the rank specifiers are stored
23277 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23279 * expression.cs (ElementAccess): Implement the LValue interface too.
23281 2001-10-06 Ravi Pratap <ravi@ximian.com>
23283 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23284 except that user defined conversions are not included.
23286 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23287 perform the conversion of the return type, if necessary.
23289 (New::DoResolve): Check whether we are creating an array or an object
23290 and accordingly do the needful.
23292 (New::Emit): Same here.
23294 (New::DoResolve): Implement guts of array creation.
23296 (New::FormLookupType): Helper function.
23298 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23300 * codegen.cs: Removed most of the code generation here, and move the
23301 corresponding code generation bits to the statement classes.
23303 Added support for try/catch/finalize and throw.
23305 * cs-parser.jay: Added support for try/catch/finalize.
23307 * class.cs: Catch static methods having the flags override,
23308 virtual or abstract.
23310 * expression.cs (UserCast): This user cast was not really doing
23311 what it was supposed to do. Which is to be born in fully resolved
23312 state. Parts of the resolution were being performed at Emit time!
23316 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23318 * expression.cs: Implicity convert the result from UserCast.
23320 2001-10-05 Ravi Pratap <ravi@ximian.com>
23322 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23323 prevented it from working correctly.
23325 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23326 merely ConvertImplicit.
23328 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23330 * typemanager.cs: Make the LookupTypeContainer function static,
23331 and not per-instance.
23333 * class.cs: Make static FindMembers (the one that takes a Type
23336 * codegen.cs: Add EmitForeach here.
23338 * cs-parser.jay: Make foreach a toplevel object instead of the
23339 inline expansion, as we need to perform semantic analysis on it.
23341 2001-10-05 Ravi Pratap <ravi@ximian.com>
23343 * expression.cs (Expression::ImplicitUserConversion): Rename to
23344 UserDefinedConversion.
23346 (Expression::UserDefinedConversion): Take an extra argument specifying
23347 whether we look for explicit user conversions too.
23349 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23351 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23353 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23354 with the appropriate arguments.
23356 * cs-parser.jay (cast_expression): Record location too.
23358 * expression.cs (Cast): Record location info.
23360 (Expression::ConvertExplicit): Take location argument.
23362 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23363 to determine if we are doing explicit conversions.
23365 (UserCast::Emit): Update accordingly.
23367 (Expression::ConvertExplicit): Report an error if everything fails.
23369 * ../errors/cs0030.cs : Add.
23371 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23373 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23374 virtual and newslot bits.
23376 * class.cs (TypeContainer::RegisterRequiredImplementations):
23377 Record methods we need.
23379 (TypeContainer::MakeKey): Helper function to make keys for
23380 MethodBases, since the Methodbase key is useless.
23382 (TypeContainer::Populate): Call RegisterRequiredImplementations
23383 before defining the methods.
23385 Create a mapping for method_builders_to_methods ahead of time
23386 instead of inside a tight loop.
23388 (::RequireMethods): Accept an object as the data to set into the
23389 hashtable so we can report interface vs abstract method mismatch.
23391 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23393 * report.cs: Make all of it static.
23395 * rootcontext.cs: Drop object_type and value_type computations, as
23396 we have those in the TypeManager anyways.
23398 Drop report instance variable too, now it is a global.
23400 * driver.cs: Use try/catch on command line handling.
23402 Add --probe option to debug the error reporting system with a test
23405 * report.cs: Add support for exiting program when a probe
23406 condition is reached.
23408 2001-10-03 Ravi Pratap <ravi@ximian.com>
23410 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23411 we do a forcible conversion regardless of type, to check if
23412 ForceConversion returns a null.
23414 (Binary::error19): Use location to report error.
23416 (Unary::error23): Use location here too.
23418 * ../errors/cs0019.cs : Check in.
23420 * ../errors/cs0023.cs : Check in.
23422 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23423 case of a non-null MethodInfo object with a length of 0 !
23425 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23426 an applicable member - according to the spec :-)
23427 Also fix logic to find members in base types.
23429 (Unary::ResolveOperator): Same here.
23431 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23432 as I was getting thoroughly confused between this and error19 :-)
23434 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23435 (::FindMostEncompassedType): Implement.
23436 (::FindMostEncompassingType): Implement.
23437 (::StandardConversionExists): Implement.
23439 (UserImplicitCast): Re-vamp. We now need info about most specific
23440 source and target types so that we can do the necessary conversions.
23442 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23443 mathematical union with no duplicates.
23445 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23447 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23448 in order from base classes to child classes, so that we can in
23449 child classes look up in our parent for method names and
23450 attributes (required for handling abstract, virtual, new, override
23451 constructs: we need to instrospect our base class, and if we dont
23452 populate the classes in order, the introspection might be
23453 incorrect. For example, a method could query its parent before
23454 the parent has any methods and would determine that the parent has
23455 no abstract methods (while it could have had them)).
23457 (RootContext::CreateType): Record the order in which we define the
23460 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23462 * class.cs (TypeContainer::Populate): Also method definitions can
23463 fail now, keep track of this.
23465 (TypeContainer::FindMembers): Implement support for
23466 DeclaredOnly/noDeclaredOnly flag.
23468 (Constructor::Emit) Return the ConstructorBuilder.
23470 (Method::Emit) Return the MethodBuilder.
23471 Check for abstract or virtual methods to be public.
23473 * rootcontext.cs (RootContext::CreateType): Register all the
23474 abstract methods required for the class to be complete and the
23475 interface methods that must be implemented.
23477 * cs-parser.jay: Report error 501 (method requires body if it is
23478 not marked abstract or extern).
23480 * expression.cs (TypeOf::Emit): Implement.
23482 * typemanager.cs: runtime_handle_type, new global type.
23484 * class.cs (Property::Emit): Generate code for properties.
23486 2001-10-02 Ravi Pratap <ravi@ximian.com>
23488 * expression.cs (Unary::ResolveOperator): Find operators on base type
23489 too - we now conform exactly to the spec.
23491 (Binary::ResolveOperator): Same here.
23493 * class.cs (Operator::Define): Fix minor quirk in the tests.
23495 * ../errors/cs0215.cs : Added.
23497 * ../errors/cs0556.cs : Added.
23499 * ../errors/cs0555.cs : Added.
23501 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23503 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23504 single integer which is really efficient
23506 2001-10-01 Ravi Pratap <ravi@ximian.com>
23508 * expression.cs (Expression::ImplicitUserConversion): Use location
23509 even in the case when we are examining True operators.
23511 * class.cs (Operator::Define): Perform extensive checks to conform
23512 with the rules for operator overloading in the spec.
23514 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23515 some of the other conversions mentioned in the spec.
23517 * typemanager.cs (array_type): New static member for the System.Array built-in
23520 (cloneable_interface): For System.ICloneable interface.
23522 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23523 we start resolving the tree and populating types.
23525 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23527 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23529 * expression.cs (Expression::ExprClassFromMemberInfo,
23530 Expression::Literalize): Create literal expressions from
23531 FieldInfos which are literals.
23533 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23534 type casts, because they were wrong. The test suite in tests
23537 (ImplicitNumericConversion): ushort to ulong requires a widening
23540 Int32 constant to long requires widening cast as well.
23542 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23543 for integers because the type on the stack is not i4.
23545 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23547 * expression.cs (report118): require location argument.
23549 * parameter.cs: Do not dereference potential null value.
23551 * class.cs: Catch methods that lack the `new' keyword when
23552 overriding a name. Report warnings when `new' is used without
23553 anything being there to override.
23555 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23557 * class.cs: Only add constructor to hashtable if it is non-null
23558 (as now constructors can fail on define).
23560 (TypeManager, Class, Struct): Take location arguments.
23562 Catch field instance initialization in structs as errors.
23564 accepting_filter: a new filter for FindMembers that is static so
23565 that we dont create an instance per invocation.
23567 (Constructor::Define): Catch errors where a struct constructor is
23570 * cs-parser.jay: Pass location information for various new
23573 * delegate.cs (Delegate): take a location argument.
23575 * driver.cs: Do not call EmitCode if there were problesm in the
23576 Definition of the types, as many Builders wont be there.
23578 * decl.cs (Decl::Decl): Require a location argument.
23580 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23581 into integers, and find the most appropiate integer for it.
23583 * literal.cs: Implement ULongLiteral.
23585 * rootcontext.cs: Provide better information about the location of
23586 failure when CreateType fails.
23588 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23590 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23593 * expression.cs (Binary::CheckShiftArguments): Add missing type
23595 (Binary::ResolveOperator): Add type to the logical and and logical
23596 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23599 (Binary::DoNumericPromotions): In the case where either argument
23600 is ulong (and most signed types combined with ulong cause an
23601 error) perform implicit integer constant conversions as well.
23603 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23605 * expression.cs (UserImplicitCast): Method should always be
23607 (Invocation::BetterConversion): Simplified test for IntLiteral.
23609 (Expression::ImplicitNumericConversion): Split this routine out.
23610 Put the code that performs implicit constant integer conversions
23613 (Expression::Resolve): Become a wrapper around DoResolve so we can
23614 check eclass and type being set after resolve.
23616 (Invocation::Badness): Remove this dead function
23618 (Binary::ResolveOperator): Do not compute the expensive argumnets
23619 unless we have a union for it.
23621 (Probe::Emit): Is needs to do an isinst and then
23622 compare against null.
23624 (::CanConvert): Added Location argument. If the Location argument
23625 is null (Location.Null), then we do not report errors. This is
23626 used by the `probe' mechanism of the Explicit conversion. We do
23627 not want to generate an error for something that the user
23628 explicitly requested to be casted. But the pipeline for an
23629 explicit cast first tests for potential implicit casts.
23631 So for now, if the Location is null, it means `Probe only' to
23632 avoid adding another argument. Might have to revise this
23635 (ClassCast): New class used to type cast objects into arbitrary
23636 classes (used in Explicit Reference Conversions).
23638 Implement `as' as well.
23640 Reverted all the patches from Ravi below: they were broken:
23642 * The use of `level' as a mechanism to stop recursive
23643 invocations is wrong. That was there just to catch the
23644 bug with a strack trace but not as a way of addressing
23647 To fix the problem we have to *understand* what is going
23648 on and the interactions and come up with a plan, not
23649 just get things going.
23651 * The use of the type conversion cache that I proposed
23652 last night had an open topic: How does this work across
23653 protection domains. A user defined conversion might not
23654 be public in the location where we are applying the
23655 conversion, a different conversion might be selected
23656 (ie, private A->B (better) but public B->A (worse),
23657 inside A, A->B applies, but outside it, B->A will
23660 * On top of that (ie, even if the above is solved),
23661 conversions in a cache need to be abstract. Ie, `To
23662 convert from an Int to a Short use an OpcodeCast', not
23663 `To convert from an Int to a Short use the OpcodeCast on
23664 the variable 5' (which is what this patch was doing).
23666 2001-09-28 Ravi Pratap <ravi@ximian.com>
23668 * expression.cs (Invocation::ConversionExists): Re-write to use
23669 the conversion cache
23671 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23672 cache all conversions done, not just user-defined ones.
23674 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23675 to determine if a conversion exists instead of acutually trying to
23676 perform the conversion. It's faster too.
23678 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23679 and only then attempt the implicit conversion.
23681 2001-09-28 Ravi Pratap <ravi@ximian.com>
23683 * expression.cs (ConvertImplicit): Use a cache for conversions
23684 already found. Check level of recursion and bail out if necessary.
23686 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23688 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23689 Export standard methods that we expect for string operations.
23691 * statement.cs (Block::UsageWarning): Track usage of variables and
23692 report the errors for not used variables.
23694 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23697 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23699 * codegen.cs: remove unnneded code
23701 * expression.cs: Removed BuiltinTypeAccess class
23703 Fix the order in which implicit conversions are
23706 The previous fixed dropped support for boxed conversions (adding a
23707 test to the test suite now)
23709 (UserImplicitCast::CanConvert): Remove test for source being null,
23710 that code is broken. We should not feed a null to begin with, if
23711 we do, then we should track the bug where the problem originates
23712 and not try to cover it up here.
23714 Return a resolved expression of type UserImplicitCast on success
23715 rather than true/false. Ravi: this is what I was talking about,
23716 the pattern is to use a static method as a "constructor" for
23719 Also, do not create arguments until the very last minute,
23720 otherwise we always create the arguments even for lookups that
23721 will never be performed.
23723 (UserImplicitCast::Resolve): Eliminate, objects of type
23724 UserImplicitCast are born in a fully resolved state.
23726 * typemanager.cs (InitCoreTypes): Init also value_type
23727 (System.ValueType).
23729 * expression.cs (Cast::Resolve): First resolve the child expression.
23731 (LValue): Add new method AddressOf to be used by
23734 Change the argument of Store to take an EmitContext instead of an
23735 ILGenerator, because things like FieldExpr need to be able to call
23736 their children expression to generate the instance code.
23738 (Expression::Error, Expression::Warning): Sugar functions for
23741 (Expression::MemberLookup): Accept a TypeContainer instead of a
23742 Report as the first argument.
23744 (Expression::ResolvePrimary): Killed. I still want to improve
23745 this as currently the code is just not right.
23747 (Expression::ResolveMemberAccess): Simplify, but it is still
23750 (Unary::Resolve): Catch errors in AddressOf operators.
23752 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23753 index to a byte for the short-version, or the compiler will choose
23754 the wrong Emit call, which generates the wrong data.
23756 (ParameterReference::Emit, ::Store): same.
23758 (FieldExpr::AddressOf): Implement.
23760 * typemanager.cs: TypeManager: made public variable instead of
23763 * driver.cs: document --fatal.
23765 * report.cs (ErrorMessage, WarningMessage): new names for the old
23766 Error and Warning classes.
23768 * cs-parser.jay (member_access): Turn built-in access to types
23769 into a normal simplename
23771 2001-09-27 Ravi Pratap <ravi@ximian.com>
23773 * expression.cs (Invocation::BetterConversion): Fix to cope
23774 with q being null, since this was introducing a bug.
23776 * expression.cs (ConvertImplicit): Do built-in conversions first.
23778 2001-09-27 Ravi Pratap <ravi@ximian.com>
23780 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23782 2001-09-27 Ravi Pratap <ravi@ximian.com>
23784 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23785 I had introduced long ago (what's new ?).
23787 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23788 the work of all the checking.
23789 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23790 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23792 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23793 that is the right way.
23795 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23796 overloading resolution. Use everywhere instead of cutting and pasting code.
23798 (Binary::ResolveOperator): Use MakeUnionSet.
23800 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23801 we have to convert to bool types. Not complete yet.
23803 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23805 * typemanager.cs (TypeManager::CSharpName): support ushort.
23807 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23808 to provide an expression that performsn an implicit constant int
23809 conversion (section 6.1.6).
23810 (Expression::ConvertImplicitRequired): Reworked to include
23811 implicit constant expression conversions.
23813 (Expression::ConvertNumericExplicit): Finished.
23815 (Invocation::Emit): If InstanceExpression is null, then it means
23816 that we perform a call on this.
23818 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23820 * expression.cs (Unary::Emit): Remove some dead code.
23821 (Probe): Implement Resolve and Emit for `is'.
23822 (Expression::ConvertImplicitRequired): Attempt to do constant
23823 expression conversions here. Maybe should be moved to
23824 ConvertImplicit, but I am not sure.
23825 (Expression::ImplicitLongConstantConversionPossible,
23826 Expression::ImplicitIntConstantConversionPossible): New functions
23827 that tell whether is it possible to apply an implicit constant
23828 expression conversion.
23830 (ConvertNumericExplicit): Started work on explicit numeric
23833 * cs-parser.jay: Update operator constants.
23835 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23836 (Parameters::GetSignature): Hook up VerifyArgs here.
23837 (Parameters::VerifyArgs): Verifies that no two arguments have the
23840 * class.cs (Operator): Update the operator names to reflect the
23841 ones that the spec expects (as we are just stringizing the
23844 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23845 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23846 previous usage did only work for our methods.
23847 (Expression::ConvertImplicit): Handle decimal implicit numeric
23848 conversions as well.
23849 (Expression::InternalTypeConstructor): Used to invoke constructors
23850 on internal types for default promotions.
23852 (Unary::Emit): Implement special handling for the pre/post
23853 increment/decrement for overloaded operators, as they need to have
23854 the same semantics as the other operators.
23856 (Binary::ResolveOperator): ditto.
23857 (Invocation::ConversionExists): ditto.
23858 (UserImplicitCast::Resolve): ditto.
23860 2001-09-26 Ravi Pratap <ravi@ximian.com>
23862 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23863 operator, return after emitting body. Regression tests pass again !
23865 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23866 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23867 (Invocation::OverloadResolve): Ditto.
23868 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23870 * everywhere : update calls to the above methods accordingly.
23872 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23874 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23876 * expression.cs (ExpressionStatement): New base class used for
23877 expressions that can appear in statements, so that we can provide
23878 an alternate path to generate expression that do not leave a value
23881 (Expression::Emit, and all the derivatives): We no longer return
23882 whether a value is left on the stack or not. Every expression
23883 after being emitted leaves a single value on the stack.
23885 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23886 facilties of ExpressionStatement if possible.
23888 * cs-parser.jay: Update statement_expression.
23890 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23892 * driver.cs: Change the wording of message
23894 2001-09-25 Ravi Pratap <ravi@ximian.com>
23896 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23897 the type of the expression to the return type of the method if
23898 we have an overloaded operator match ! The regression tests pass again !
23899 (Unary::ResolveOperator): Ditto.
23901 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23902 to find "op_Implicit", not "implicit" ;-)
23903 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23904 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23906 * everywhere : Correct calls to the above accordingly.
23908 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23909 (ConvertImplicit): Do user-defined conversion if it exists.
23911 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23913 * assign.cs: track location.
23914 (Resolve): Use implicit conversions on assignment.
23916 * literal.cs: Oops. Not good, Emit of short access values should
23917 pass (Bytes) or the wrong argument will be selected.
23919 * expression.cs (Unary::Emit): Emit code for -expr.
23921 (Unary::ResolveOperator): Handle `Substract' for non-constants
23922 (substract from zero from the non-constants).
23923 Deal with Doubles as well.
23925 (Expression::ConvertImplicitRequired): New routine that reports an
23926 error if no implicit conversion exists.
23928 (Invocation::OverloadResolve): Store the converted implicit
23929 expressions if we make them
23931 2001-09-24 Ravi Pratap <ravi@ximian.com>
23933 * class.cs (ConstructorInitializer): Take a Location argument.
23934 (ConstructorBaseInitializer): Same here.
23935 (ConstructorThisInitializer): Same here.
23937 * cs-parser.jay : Update all calls accordingly.
23939 * expression.cs (Unary, Binary, New): Take location argument.
23940 Update accordingly everywhere.
23942 * cs-parser.jay : Update all calls to the above to take a location
23945 * class.cs : Ditto.
23947 2001-09-24 Ravi Pratap <ravi@ximian.com>
23949 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23950 (Invocation::BetterConversion): Same here
23951 (Invocation::ConversionExists): Ditto.
23953 (Invocation::ConversionExists): Implement.
23955 2001-09-22 Ravi Pratap <ravi@ximian.com>
23957 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23958 Also take an additional TypeContainer argument.
23960 * All over : Pass in TypeContainer as argument to OverloadResolve.
23962 * typemanager.cs (CSharpName): Update to check for the string type and return
23965 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23968 2001-09-21 Ravi Pratap <ravi@ximian.com>
23970 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23971 (Invocation::BetterFunction): Implement.
23972 (Invocation::BetterConversion): Implement.
23973 (Invocation::ConversionExists): Skeleton, no implementation yet.
23975 Okay, things work fine !
23977 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23979 * typemanager.cs: declare and load enum_type, delegate_type and
23982 * expression.cs (Expression::Emit): Now emit returns a value that
23983 tells whether a value is left on the stack or not. This strategy
23984 might be reveted tomorrow with a mechanism that would address
23985 multiple assignments.
23986 (Expression::report118): Utility routine to report mismatches on
23989 (Unary::Report23): Report impossible type/operator combination
23992 (Unary::IsIncrementableNumber): Whether the type can be
23993 incremented or decremented with add.
23994 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23996 (Unary::ResolveOperator): Implement ++, !, ~,
23998 (Invocation::Emit): Deal with new Emit convetion.
24000 * All Expression derivatives: Updated their Emit method to return
24001 whether they leave values on the stack or not.
24003 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24004 stack for expressions that are statements.
24006 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24008 * expression.cs (LValue): New interface. Must be implemented by
24010 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24013 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24014 interface for generating code, simplifies the code.
24016 2001-09-20 Ravi Pratap <ravi@ximian.com>
24018 * expression.cs (everywhere): Comment out return statements in ::Resolve
24019 methods to avoid the warnings.
24021 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24023 * driver.cs (parse): Report error 2001 if we can not open the
24026 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24029 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24032 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24033 otherwise nested blocks end up with the same index.
24035 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24037 * expression.cs: Instead of having FIXMEs in the Resolve
24038 functions, throw exceptions so it is obvious that we are facing a
24041 * cs-parser.jay (invocation_expression): Pass Location information.
24043 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24044 Use a basename for those routines because .NET does not like paths
24047 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24050 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24052 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24053 are loading the correct data types (throws an exception if not).
24054 (TypeManager::InitCoreTypes): Use CoreLookupType
24056 * expression.cs (Unary::ResolveOperator): return the child
24057 expression for expressions which are just +expr.
24058 (Unary::ResolveOperator): Return negative literals for -LITERAL
24059 expressions (otherwise they are Unary {Literal}).
24060 (Invocation::Badness): Take into account `Implicit constant
24061 expression conversions'.
24063 * literal.cs (LongLiteral): Implement long literal class.
24064 (IntLiteral): export the `Value' of the intliteral.
24066 2001-09-19 Ravi Pratap <ravi@ximian.com>
24068 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24070 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24071 instead of 'Operator'
24073 * expression.cs (Binary::ResolveOperator): Update accordingly.
24074 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24077 * cs-parser.jay (unary_expression): Update to use the new names.
24079 * gen-treedump.cs (GetUnary): Same here.
24081 * expression.cs (Unary::Resolve): Implement.
24082 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24083 operators are found instead of making noise ;-)
24084 (Unary::ResolveOperator): New method to do precisely the same thing which
24085 Binary::ResolveOperator does for Binary expressions.
24086 (Unary.method, .Arguments): Add.
24087 (Unary::OperName): Implement.
24088 (Unary::ForceConversion): Copy and Paste !
24090 * class.cs (Operator::Define): Fix a small bug for the case when we have
24093 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24094 for the inbuilt operators. Only overloading works for now ;-)
24096 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24098 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24099 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24101 * expression.cs (This::Emit): Implement.
24102 (This::Resolve): Implement.
24103 (TypeOf:Resolve): Implement.
24104 (Expression::ResolveSimpleName): Add an implicit this to instance
24106 (MemberAccess::Resolve): Deal with Parameters and Fields.
24107 Bind instance variable to Field expressions.
24108 (FieldExpr::Instance): New field used to track the expression that
24109 represents the object instance.
24110 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24112 (FieldExpr::Emit): Implement.
24114 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24115 the last instruction contains a return opcode to avoid generating
24116 the last `ret' instruction (this generates correct code, and it is
24117 nice to pass the peverify output).
24119 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24120 initializer for static and instance variables.
24121 (Constructor::Emit): Allow initializer to be null in the case of
24122 static constructors. Only emit initializer for instance
24125 (TypeContainer::FindMembers): Return a null array if there are no
24128 Also fix the code for the MemberTypes.Method branch, as it was not
24129 scanning that for operators (or tried to access null variables before).
24131 * assign.cs (Assign::Emit): Handle instance and static fields.
24135 * driver.cs: Stop compilation if there are parse errors.
24137 * cs-parser.jay (constructor_declaration): Provide default base
24138 initializer for non-static constructors.
24139 (constructor_declarator): Do not provide a default base
24140 initializers if none was specified.
24141 Catch the fact that constructors should not have parameters.
24143 * class.cs: Do not emit parent class initializers for static
24144 constructors, that should be flagged as an error.
24146 2001-09-18 Ravi Pratap <ravi@ximian.com>
24148 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24149 Move back code into TypeContainer::Populate.
24151 2001-09-18 Ravi Pratap <ravi@ximian.com>
24153 * class.cs (TypeContainer::AddConstructor): Fix the check to
24154 compare against Name, not Basename.
24155 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24157 * cs-parser.jay : Update accordingly.
24159 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24160 for methods, don't forget to look into the operators too.
24161 (RegisterMethodBuilder): Helper method to take care of this for
24162 methods, constructors and operators.
24163 (Operator::Define): Completely revamp.
24164 (Operator.OperatorMethod, MethodName): New fields.
24165 (TypeContainer::Populate): Move the registering of builders into
24166 RegisterMethodBuilder.
24167 (Operator::Emit): Re-write.
24169 * expression.cs (Binary::Emit): Comment out code path to emit method
24170 invocation stuff for the case when we have a user defined operator. I am
24171 just not able to get it right !
24173 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24175 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24178 (Expression::MemberLookup): Provide a version that allows to
24179 specify the MemberTypes and BindingFlags.
24181 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24182 so it was not fetching variable information from outer blocks.
24184 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24185 Beforefieldinit as it was buggy.
24187 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24188 that Ravi put here.
24190 * class.cs (Constructor::Emit): Only emit if block is not null.
24191 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24192 deal with this by semantically definining it as if the user had
24195 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24196 constructors as we now "emit" them at a higher level.
24198 (TypeContainer::DefineDefaultConstructor): Used to define the
24199 default constructors if none was provided.
24201 (ConstructorInitializer): Add methods Resolve and Emit.
24203 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24205 2001-09-17 Ravi Pratap <ravi@ximian.com>
24207 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24208 the default constructor builder with our hashtable for methodbuilders
24211 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24212 and argument_count is 0 in which case we have a match.
24213 (Binary::ResolveOperator): More null checking and miscellaneous coding
24216 2001-09-17 Ravi Pratap <ravi@ximian.com>
24218 * rootcontext.cs (IsNameSpace): Compare against null.
24220 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24222 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24223 and Unary::Operator.
24225 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24228 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24229 we have overloaded operators.
24230 (Binary::ResolveOperator): Implement the part which does the operator overload
24233 * class.cs (Operator::Emit): Implement.
24234 (TypeContainer::Emit): Emit the operators we have too.
24236 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24237 the case when we have a user-defined operator.
24239 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24241 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24243 2001-09-16 Ravi Pratap <ravi@ximian.com>
24245 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24246 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24247 (Constructor::Emit): Implement.
24248 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24249 if we have no work to do.
24250 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24253 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24254 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24256 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24259 2001-09-15 Ravi Pratap <ravi@ximian.com>
24261 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24263 (Tree::RecordNamespace): Method to do what the name says ;-)
24264 (Tree::Namespaces): Property to get at the namespaces hashtable.
24266 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24269 * rootcontext.cs (IsNamespace): Fixed it :-)
24271 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24273 * class.cs (TypeContainer::FindMembers): Add support for
24275 (MethodCore): New class that encapsulates both the shared aspects
24276 of a Constructor and a Method.
24277 (Method, Constructor): Factored pieces into MethodCore.
24279 * driver.cs: Added --fatal which makes errors throw exceptions.
24280 Load System assembly as well as part of the standard library.
24282 * report.cs: Allow throwing exceptions on errors for debugging.
24284 * modifiers.cs: Do not use `parent', instead use the real type
24285 container to evaluate permission settings.
24287 * class.cs: Put Ravi's patch back in. He is right, and we will
24288 have to cope with the
24290 2001-09-14 Ravi Pratap <ravi@ximian.com>
24292 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24293 FamORAssem, not FamANDAssem.
24295 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24297 * driver.cs: Added --parse option that only parses its input files
24300 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24301 incorrect. IsTopLevel is not used to tell whether an object is
24302 root_types or not (that can be achieved by testing this ==
24303 root_types). But to see if this is a top-level *class* (not
24304 necessarly our "toplevel" container).
24306 2001-09-14 Ravi Pratap <ravi@ximian.com>
24308 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24309 parent instead of a direct call to GetType.
24311 2001-09-14 Ravi Pratap <ravi@ximian.com>
24313 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24314 Modifiers.TypeAttr. This should just be a call to that method.
24316 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24317 object so that we can determine if we are top-level or not.
24319 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24322 * enum.cs (Enum::Define): Ditto.
24324 * modifiers.cs (FieldAttr): Re-write.
24326 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24327 (TypeContainer::HaveStaticConstructor): New property to provide access
24328 to precisely that info.
24330 * modifiers.cs (MethodAttr): Re-write.
24331 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24333 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24334 of top-level types as claimed.
24336 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24338 * expression.cs (MemberLookup): Fruitless attempt to lookup
24339 constructors. Maybe I need to emit default constructors? That
24340 might be it (currently .NET emits this for me automatically).
24341 (Invocation::OverloadResolve): Cope with Arguments == null.
24342 (Invocation::EmitArguments): new function, shared by the new
24343 constructor and us.
24344 (Invocation::Emit): Handle static and instance methods. Emit
24345 proper call instruction for virtual or non-virtual invocations.
24346 (New::Emit): Implement.
24347 (New::Resolve): Implement.
24348 (MemberAccess:Resolve): Implement.
24349 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24350 to track instances.
24351 (FieldExpr::Resolve): Set type.
24353 * support.cs: Handle empty arguments.
24355 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24356 SimpleLookup): Auxiliary routines to help parse a qualifier
24359 Update qualifier_identifier rule.
24361 * codegen.cs: Removed debugging messages.
24363 * class.cs: Make this a global thing, this acts just as a "key" to
24364 objects that we might have around.
24366 (Populate): Only initialize method_builders_to_methods once.
24368 * expression.cs (PropertyExpr): Initialize type from the
24371 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24372 Resolve pattern. Attempt to implicitly convert value to boolean.
24375 * expression.cs: Set the type for the int32/int32 argument case.
24376 (Binary::ResolveOperator): Set the return type to boolean for
24377 comparission operators
24379 * typemanager.cs: Remove debugging print code.
24381 (Invocation::Resolve): resolve type.
24383 * class.cs: Allocate a MemberInfo of the correct size, as the code
24384 elsewhere depends on the test to reflect the correct contents.
24386 (Method::) Keep track of parameters, due to System.Reflection holes
24388 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24391 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24392 of the exact size and return that.
24394 (Class::LookupMethodByBuilder): New function that maps
24395 MethodBuilders to its methods. Required to locate the information
24396 on methods because System.Reflection bit us again.
24398 * support.cs: New file, contains an interface ParameterData and
24399 two implementations: ReflectionParameters and InternalParameters
24400 used to access Parameter information. We will need to grow this
24403 * expression.cs (Invocation::GetParameterData): implement a cache
24404 and a wrapper around the ParameterData creation for methods.
24405 (Invocation::OverloadResolve): Use new code.
24407 2001-09-13 Ravi Pratap <ravi@ximian.com>
24409 * class.cs (TypeContainer::EmitField): Remove and move into
24410 (Field::Define): here and modify accordingly.
24411 (Field.FieldBuilder): New member.
24412 (TypeContainer::Populate): Update accordingly.
24413 (TypeContainer::FindMembers): Implement.
24415 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24417 * statement.cs: (VariableInfo::VariableType): New field to be
24418 initialized with the full type once it is resolved.
24420 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24422 * parameter.cs (GetParameterInfo): Use a type cache to compute
24423 things only once, and to reuse this information
24425 * expression.cs (LocalVariableReference::Emit): Implement.
24426 (OpcodeCast::Emit): fix.
24428 (ParameterReference::Resolve): Implement.
24429 (ParameterReference::Emit): Implement.
24431 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24432 that are expressions need to stay as Expressions.
24434 * typemanager.cs (CSharpName): Returns the C# name of a type if
24437 * expression.cs (Expression::ConvertImplicit): New function that
24438 implements implicit type conversions.
24440 (Expression::ImplicitReferenceConversion): Implements implicit
24441 reference conversions.
24443 (EmptyCast): New type for transparent casts.
24445 (OpcodeCast): New type for casts of types that are performed with
24446 a sequence of bytecodes.
24448 (BoxedCast): New type used for casting value types into reference
24449 types. Emits a box opcode.
24451 (Binary::DoNumericPromotions): Implements numeric promotions of
24452 and computation of the Binary::Type.
24454 (Binary::EmitBranchable): Optimization.
24456 (Binary::Emit): Implement code emission for expressions.
24458 * typemanager.cs (TypeManager): Added two new core types: sbyte
24461 2001-09-12 Ravi Pratap <ravi@ximian.com>
24463 * class.cs (TypeContainer::FindMembers): Method which does exactly
24464 what Type.FindMembers does, only we don't have to use reflection. No
24465 implementation yet.
24467 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24468 typecontainer objects as we need to get at them.
24469 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24471 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24472 typecontainer object.
24474 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24475 of just a Report object.
24477 2001-09-11 Ravi Pratap <ravi@ximian.com>
24479 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24481 (TypeContainer::Populate): Now define the delegates of the type too.
24482 (TypeContainer.Delegates): Property to access the list of delegates defined
24485 * delegates.cs (Delegate::Define): Implement partially.
24487 * modifiers.cs (TypeAttr): Handle more flags.
24489 2001-09-11 Ravi Pratap <ravi@ximian.com>
24491 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24493 (Operator::Define): Re-write logic to get types by using the LookupType method
24494 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24495 (Indexer::Define): Ditto.
24496 (Event::Define): Ditto.
24497 (Property::Define): Ditto.
24499 2001-09-10 Ravi Pratap <ravi@ximian.com>
24501 * class.cs (TypeContainer::Populate): Now define operators too.
24502 (TypeContainer.Operators): New property to access the list of operators
24504 (Operator.OperatorMethodBuilder): New member to hold the method builder
24505 for the operator we are defining.
24506 (Operator::Define): Implement.
24508 2001-09-10 Ravi Pratap <ravi@ximian.com>
24510 * class.cs (Event::Define): Make the prefixes of the accessor methods
24511 addOn_ and removeOn_
24513 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24514 of the location being passed in too. Ideally, this should go later since all
24515 error reporting should be done through the Report object.
24517 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24518 (Populate): Iterate thru the indexers we have and define them too.
24519 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24520 for the get and set accessors.
24521 (Indexer::Define): Implement.
24523 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24525 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24526 my previous implementation, did not work.
24528 * typemanager.cs: Add a couple of missing types (the longs).
24530 * literal.cs: Use TypeManager.bool_type instead of getting it.
24532 * expression.cs (EventExpr): New kind of expressions.
24533 (Expressio::ExprClassFromMemberInfo): finish
24535 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24537 * assign.cs: Emit stores to static fields differently.
24539 2001-09-08 Ravi Pratap <ravi@ximian.com>
24541 * Merge in changes and adjust code to tackle conflicts. Backed out my
24542 code in Assign::Resolve ;-)
24544 2001-09-08 Ravi Pratap <ravi@ximian.com>
24546 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24547 instead Report.Error and also pass in the location.
24548 (CSharpParser::Lexer): New readonly property to return the reference
24549 to the Tokenizer object.
24550 (declare_local_variables): Use Report.Error with location instead of plain
24554 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24555 (Operator.CheckBinaryOperator): Ditto.
24557 * cs-parser.jay (operator_declarator): Update accordingly.
24559 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24560 (CheckBinaryOperator): Same here.
24562 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24563 on the name without any prefixes of namespace names etc. This is because we
24564 already might have something already fully qualified like
24565 'System.Console.WriteLine'
24567 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24569 2001-09-07 Ravi Pratap <ravi@ximian.com>
24571 * cs-tokenizer.cs (location): Return a string which also contains
24574 * expression.cs (ElementAccess): New class for expressions of the
24575 type 'element access.'
24576 (BaseAccess): New class for expressions of the type 'base access.'
24577 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24580 * cs-parser.jay (element_access): Implement action.
24581 (base_access): Implement actions.
24582 (checked_expression, unchecked_expression): Implement.
24584 * cs-parser.jay (local_variable_type): Correct and implement.
24585 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24587 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24589 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24590 name and the specifiers.
24592 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24594 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24595 making them all public ;-)
24597 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24600 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24602 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24604 (FieldExpr, PropertyExprs): New resolved expressions.
24605 (SimpleName::MemberStaticCheck): Perform static checks for access
24606 to non-static fields on static methods. Maybe this should be
24607 generalized for MemberAccesses.
24608 (SimpleName::ResolveSimpleName): More work on simple name
24611 * cs-parser.jay (primary_expression/qualified_identifier): track
24612 the parameter index.
24614 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24615 (EmitContext::EmitBoolExpression): Chain to expression generation
24616 instead of temporary hack.
24617 (::EmitStatementExpression): Put generic expression code generation.
24619 * assign.cs (Assign::Emit): Implement variable assignments to
24620 local variables, parameters and fields.
24622 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24624 * statement.cs (Block::GetVariableInfo): New method, returns the
24625 VariableInfo for a variable name in a block.
24626 (Block::GetVariableType): Implement in terms of GetVariableInfo
24628 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24629 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24631 2001-09-06 Ravi Pratap <ravi@ximian.com>
24633 * cs-parser.jay (operator_declaration): Continue on my quest : update
24634 to take attributes argument.
24635 (event_declaration): Ditto.
24636 (enum_declaration): Ditto.
24637 (indexer_declaration): Ditto.
24639 * class.cs (Operator::Operator): Update constructor accordingly.
24640 (Event::Event): Ditto.
24642 * delegate.cs (Delegate::Delegate): Same here.
24644 * enum.cs (Enum::Enum): Same here.
24646 2001-09-05 Ravi Pratap <ravi@ximian.com>
24648 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24650 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24652 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24653 being passed around as an arraylist.
24654 (Attributes::AddAttribute): Method to add attribute sections.
24656 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24657 (struct_declaration): Update accordingly.
24658 (constant_declaration): Update.
24659 (field_declaration): Update.
24660 (method_header): Update.
24661 (fixed_parameter): Update.
24662 (parameter_array): Ditto.
24663 (property_declaration): Ditto.
24664 (destructor_declaration): Ditto.
24666 * class.cs (Struct::Struct): Update constructors accordingly.
24667 (Class::Class): Ditto.
24668 (Field::Field): Ditto.
24669 (Method::Method): Ditto.
24670 (Property::Property): Ditto.
24671 (TypeContainer::OptAttribute): update property's return type.
24673 * interface.cs (Interface.opt_attributes): New member.
24674 (Interface::Interface): Update to take the extra Attributes argument.
24676 * parameter.cs (Parameter::Parameter): Ditto.
24678 * constant.cs (Constant::Constant): Ditto.
24680 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24681 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24682 the attributes as a parameter.
24683 (InterfaceProperty): Update constructor call.
24684 (InterfaceEvent): Ditto.
24685 (InterfaceMethod): Ditto.
24686 (InterfaceIndexer): Ditto.
24688 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24689 pass the attributes too.
24690 (interface_event_declaration): Ditto.
24691 (interface_property_declaration): Ditto.
24692 (interface_method_declaration): Ditto.
24693 (interface_declaration): Ditto.
24695 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24697 * class.cs (Method::Define): Track the "static Main" definition to
24698 create an entry point.
24700 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24701 EntryPoint if we find it.
24703 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24704 (EmitContext::ig): Make this variable public.
24706 * driver.cs: Make the default output file be the first file name
24707 with the .exe extension.
24709 Detect empty compilations
24711 Handle various kinds of output targets. Handle --target and
24712 rename -t to --dumper.
24714 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24715 methods inherited from Expression return now an Expression. This
24716 will is used during the tree rewriting as we resolve them during
24719 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24720 the spec. Missing entirely is the information about
24721 accessability of elements of it.
24723 (Expression::ExprClassFromMemberInfo): New constructor for
24724 Expressions that creates a fully initialized Expression based on
24725 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24728 (Invocation::Resolve): Begin implementing resolution of invocations.
24730 * literal.cs (StringLiteral): Implement Emit.
24732 2001-09-05 Ravi Pratap <ravi@ximian.com>
24734 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24737 2001-09-04 Ravi Pratap <ravi@ximian.com>
24739 * cs-parser.jay (attribute_arguments): Implement actions.
24740 (attribute): Fix bug in production. Implement action.
24741 (attribute_list): Implement.
24742 (attribute_target): Implement.
24743 (attribute_target_specifier, opt_target_specifier): Implement
24744 (CheckAttributeTarget): New method to check if the attribute target
24746 (attribute_section): Implement.
24747 (opt_attributes): Implement.
24749 * attribute.cs : New file to handle attributes.
24750 (Attribute): Class to hold attribute info.
24752 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24753 (attribute_section): Modify production to use 2 different rules to
24754 achieve the same thing. 1 s/r conflict down !
24755 Clean out commented, useless, non-reducing dimension_separator rules.
24757 * class.cs (TypeContainer.attributes): New member to hold list
24758 of attributes for a type.
24759 (Struct::Struct): Modify to take one more argument, the attribute list.
24760 (Class::Class): Ditto.
24761 (Field::Field): Ditto.
24762 (Method::Method): Ditto.
24763 (Property::Property): Ditto.
24765 * cs-parser.jay (struct_declaration): Update constructor call to
24766 pass in the attributes too.
24767 (class_declaration): Ditto.
24768 (constant_declaration): Ditto.
24769 (field_declaration): Ditto.
24770 (method_header): Ditto.
24771 (fixed_parameter): Ditto.
24772 (parameter_array): Ditto.
24773 (property_declaration): Ditto.
24775 * constant.cs (Constant::Constant): Update constructor similarly.
24776 Use System.Collections.
24778 * parameter.cs (Parameter::Parameter): Update as above.
24780 2001-09-02 Ravi Pratap <ravi@ximian.com>
24782 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24783 (TypeContainer.delegates): New member to hold list of delegates.
24785 * cs-parser.jay (delegate_declaration): Implement the action correctly
24786 this time as I seem to be on crack ;-)
24788 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24790 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24791 tell whether an identifier represents a namespace.
24793 * expression.cs (NamespaceExpr): A namespace expression, used only
24794 temporarly during expression resolution.
24795 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24796 utility functions to resolve names on expressions.
24798 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24800 * codegen.cs: Add hook for StatementExpressions.
24802 * class.cs: Fix inverted test for static flag in methods.
24804 2001-09-02 Ravi Pratap <ravi@ximian.com>
24806 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24807 to make it coincide with MS' number.
24808 (Operator::CheckBinaryOperator): Ditto.
24810 * ../errors/errors.txt : Remove error numbers added earlier.
24812 * ../errors/cs1019.cs : Test case for error # 1019
24814 * ../errros/cs1020.cs : Test case for error # 1020
24816 * cs-parser.jay : Clean out commented cruft.
24817 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24818 used anywhere - non-reducing rule.
24819 (namespace_declarations): Non-reducing rule - comment out.
24821 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24822 with TypeContainer::AddEnum.
24824 * delegate.cs : New file for delegate handling classes.
24825 (Delegate): Class for declaring delegates.
24827 * makefile : Update.
24829 * cs-parser.jay (delegate_declaration): Implement.
24831 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24833 * class.cs (Event::Define): Implement.
24834 (Event.EventBuilder): New member.
24836 * class.cs (TypeContainer::Populate): Update to define all enums and events
24838 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24839 readonly fields for all these cases ?
24841 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24843 * class.cs (Property): Revamp to use the convention of making fields readonly.
24844 Accordingly modify code elsewhere.
24846 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24847 the Define method of the Property class.
24849 * class.cs : Clean up applied patch and update references to variables etc. Fix
24851 (TypeContainer::Populate): Update to define all the properties we have. Also
24852 define all enumerations.
24854 * enum.cs (Define): Implement.
24856 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24858 * cs-parser.jay (overloadable_operator): The semantic value is an
24859 enum of the Operator class.
24860 (operator_declarator): Implement actions.
24861 (operator_declaration): Implement.
24863 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24864 validity of definitions.
24865 (Operator::CheckBinaryOperator): Static method to check for binary operators
24866 (TypeContainer::AddOperator): New method to add an operator to a type.
24868 * cs-parser.jay (indexer_declaration): Added line to actually call the
24869 AddIndexer method so it gets added ;-)
24871 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24872 already taken care of by the MS compiler ?
24874 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24876 * class.cs (Operator): New class for operator declarations.
24877 (Operator::OpType): Enum for the various operators.
24879 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24881 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24882 ostensibly handle this in semantic analysis.
24884 * cs-parser.jay (general_catch_clause): Comment out
24885 (specific_catch_clauses, specific_catch_clause): Ditto.
24886 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24887 (catch_args, opt_catch_args): New productions.
24888 (catch_clause): Rewrite to use the new productions above
24889 (catch_clauses): Modify accordingly.
24890 (opt_catch_clauses): New production to use in try_statement
24891 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24892 and re-write the code in the actions to extract the specific and
24893 general catch clauses by being a little smart ;-)
24895 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24896 Hooray, try and catch statements parse fine !
24898 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24900 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24901 string from the hashtable of variables.
24903 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24904 I end up making that mistake ;-)
24905 (catch_clauses): Fixed gross error which made Key and Value of the
24906 DictionaryEntry the same : $1 !!
24908 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24910 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24912 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24913 when the add and remove accessors are specified.
24915 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24917 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24918 information about indexer_declarator.
24919 (indexer_declarator): Implement actions.
24920 (parsing_indexer): New local boolean used to keep track of whether
24921 we are parsing indexers or properties. This is necessary because
24922 implicit_parameters come into picture even for the get accessor in the
24923 case of an indexer.
24924 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24926 * class.cs (Indexer): New class for indexer declarations.
24927 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24928 (TypeContainer::indexers): New member to hold list of indexers for the
24931 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24933 * cs-parser.jay (add_accessor_declaration): Implement action.
24934 (remove_accessor_declaration): Implement action.
24935 (event_accessors_declaration): Implement
24936 (variable_declarators): swap statements for first rule - trivial.
24938 * class.cs (Event): New class to hold information about event
24940 (TypeContainer::AddEvent): New method to add an event to a type
24941 (TypeContainer::events): New member to hold list of events.
24943 * cs-parser.jay (event_declaration): Implement actions.
24945 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24947 * cs-parser.jay (dim_separators): Implement. Make it a string
24948 concatenating all the commas together, just as they appear.
24949 (opt_dim_separators): Modify accordingly
24950 (rank_specifiers): Update accordingly. Basically do the same
24951 thing - instead, collect the brackets here.
24952 (opt_rank_sepcifiers): Modify accordingly.
24953 (array_type): Modify to actually return the complete type string
24954 instead of ignoring the rank_specifiers.
24955 (expression_list): Implement to collect the expressions
24956 (variable_initializer): Implement. We make it a list of expressions
24957 essentially so that we can handle the array_initializer case neatly too.
24958 (variable_initializer_list): Implement.
24959 (array_initializer): Make it a list of variable_initializers
24960 (opt_array_initializer): Modify accordingly.
24962 * expression.cs (New::NType): Add enumeration to help us
24963 keep track of whether we have an object/delegate creation
24964 or an array creation.
24965 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24966 members to hold data about array creation.
24967 (New:New): Modify to update NewType
24968 (New:New): New Overloaded contructor for the array creation
24971 * cs-parser.jay (array_creation_expression): Implement to call
24972 the overloaded New constructor.
24974 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24976 * class.cs (TypeContainer::Constructors): Return member
24977 constructors instead of returning null.
24979 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24981 * typemanager.cs (InitCoreTypes): Initialize the various core
24982 types after we have populated the type manager with the user
24983 defined types (this distinction will be important later while
24984 compiling corlib.dll)
24986 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24987 on Expression Classification. Now all expressions have a method
24988 `Resolve' and a method `Emit'.
24990 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24991 generation from working. Also add some temporary debugging
24994 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24996 * codegen.cs: Lots of code generation pieces. This is only the
24997 beginning, will continue tomorrow with more touches of polish. We
24998 handle the fundamentals of if, while, do, for, return. Others are
24999 trickier and I need to start working on invocations soon.
25001 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25004 * codegen.cs (EmitContext): New struct, used during code
25005 emission to keep a context. Most of the code generation will be
25008 * cs-parser.jay: Add embedded blocks to the list of statements of
25009 this block. So code generation proceeds in a top down fashion.
25011 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25013 * statement.cs: Add support for multiple child blocks.
25015 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25017 * codegen.cs (EmitCode): New function, will emit the code for a
25018 Block of code given a TypeContainer and its ILGenerator.
25020 * statement.cs (Block): Standard public readonly optimization.
25021 (Block::Block constructors): Link children.
25022 (Block::Child): Child Linker.
25023 (Block::EmitVariables): Emits IL variable declarations.
25025 * class.cs: Drop support for MethodGroups here, delay until
25027 (Method::): Applied the same simplification that I did before, and
25028 move from Properties to public readonly fields.
25029 (Method::ParameterTypes): Returns the parameter types for the
25030 function, and implements a cache that will be useful later when I
25031 do error checking and the semantic analysis on the methods is
25033 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25034 and made a method, optional argument tells whether this is a class
25035 or a structure to apply the `has-this' bit.
25036 (Method::GetCallingConvention): Implement, returns the calling
25038 (Method::Define): Defines the type, a second pass is performed
25039 later to populate the methods.
25041 (Constructor::ParameterTypes): implement a cache similar to the
25042 one on Method::ParameterTypes, useful later when we do semantic
25045 (TypeContainer::EmitMethod): New method. Emits methods.
25047 * expression.cs: Removed MethodGroup class from here.
25049 * parameter.cs (Parameters::GetCallingConvention): new method.
25051 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25053 * class.cs (TypeContainer::Populate): Drop RootContext from the
25056 (Constructor::CallingConvention): Returns the calling convention.
25057 (Constructor::ParameterTypes): Returns the constructor parameter
25060 (TypeContainer::AddConstructor): Keep track of default constructor
25061 and the default static constructor.
25063 (Constructor::) Another class that starts using `public readonly'
25064 instead of properties.
25066 (Constructor::IsDefault): Whether this is a default constructor.
25068 (Field::) use readonly public fields instead of properties also.
25070 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25071 track of static constructors; If none is used, turn on
25072 BeforeFieldInit in the TypeAttributes.
25074 * cs-parser.jay (opt_argument_list): now the return can be null
25075 for the cases where there are no arguments.
25077 (constructor_declarator): If there is no implicit `base' or
25078 `this', then invoke the default parent constructor.
25080 * modifiers.cs (MethodAttr): New static function maps a set of
25081 modifiers flags into a MethodAttributes enum
25082 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25083 MethodAttr, TypeAttr to represent the various mappings where the
25084 modifiers are used.
25085 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25087 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25089 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25092 * interface.cs (PopulateIndexer): Implemented the code generator
25093 for interface indexers.
25095 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25097 * interface.cs (InterfaceMemberBase): Now we track the new status
25100 (PopulateProperty): Implement property population. Woohoo! Got
25101 Methods and Properties going today.
25103 Removed all the properties for interfaces, and replaced them with
25104 `public readonly' fields.
25106 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25108 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25109 initialize their hashtables/arraylists only when they are needed
25110 instead of doing this always.
25112 * parameter.cs: Handle refs and out parameters.
25114 * cs-parser.jay: Use an ArrayList to construct the arguments
25115 instead of the ParameterCollection, and then cast that to a
25118 * parameter.cs: Drop the use of ParameterCollection and use
25119 instead arrays of Parameters.
25121 (GetParameterInfo): Use the Type, not the Name when resolving
25124 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25126 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25127 and instead use public readonly fields.
25129 * class.cs: Put back walking code for type containers.
25131 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25133 * class.cs (MakeConstant): Code to define constants.
25135 * rootcontext.cs (LookupType): New function. Used to locate types
25138 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25140 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25141 this System.Reflection code is. Kudos to Microsoft
25143 * typemanager.cs: Implement a type cache and avoid loading all
25144 types at boot time. Wrap in LookupType the internals. This made
25145 the compiler so much faster. Wow. I rule!
25147 * driver.cs: Make sure we always load mscorlib first (for
25148 debugging purposes, nothing really important).
25150 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25151 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25153 * rootcontext.cs: Lookup types on their namespace; Lookup types
25154 on namespaces that have been imported using the `using' keyword.
25156 * class.cs (TypeContainer::TypeAttr): Virtualize.
25157 (Class::TypeAttr): Return attributes suitable for this bad boy.
25158 (Struct::TypeAttr): ditto.
25159 Handle nested classes.
25160 (TypeContainer::) Remove all the type visiting code, it is now
25161 replaced with the rootcontext.cs code
25163 * rootcontext.cs (GetClassBases): Added support for structs.
25165 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25167 * interface.cs, statement.cs, class.cs, parameter.cs,
25168 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25169 Drop use of TypeRefs, and use strings instead.
25171 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25175 * class.cs (Struct::Struct): set the SEALED flags after
25176 checking the modifiers.
25177 (TypeContainer::TypeAttr): new property, returns the
25178 TypeAttributes for a class.
25180 * cs-parser.jay (type_list): Oops, list production was creating a
25181 new list of base types.
25183 * rootcontext.cs (StdLib): New property.
25184 (GetInterfaceTypeByName): returns an interface by type name, and
25185 encapsulates error handling here.
25186 (GetInterfaces): simplified.
25187 (ResolveTree): Encapsulated all the tree resolution here.
25188 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25191 * driver.cs: Add support for --nostdlib, to avoid loading the
25192 default assemblies.
25193 (Main): Do not put tree resolution here.
25195 * rootcontext.cs: Beginning of the class resolution.
25197 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25199 * rootcontext.cs: Provide better error reporting.
25201 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25203 * rootcontext.cs (CreateInterface): Handle the case where there
25204 are no parent interfaces.
25206 (CloseTypes): Routine to flush types at the end.
25207 (CreateInterface): Track types.
25208 (GetInterfaces): Returns an array of Types from the list of
25209 defined interfaces.
25211 * typemanager.c (AddUserType): Mechanism to track user types (puts
25212 the type on the global type hash, and allows us to close it at the
25215 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25217 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25218 RecordInterface instead.
25220 * cs-parser.jay: Updated to reflect changes above.
25222 * decl.cs (Definition): Keep track of the TypeBuilder type that
25223 represents this type here. Not sure we will use it in the long
25224 run, but wont hurt for now.
25226 * driver.cs: Smaller changes to accomodate the new code.
25228 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25231 * rootcontext.cs (CreateInterface): New method, used to create
25232 the System.TypeBuilder type for interfaces.
25233 (ResolveInterfaces): new entry point to resolve the interface
25235 (CodeGen): Property, used to keep track of the code generator.
25237 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25239 * cs-parser.jay: Add a second production for delegate_declaration
25242 (enum_body): Put an opt_comma here instead of putting it on
25243 enum_body or enum_member_declarations so we can handle trailing
25244 commas on enumeration members. Gets rid of a shift/reduce.
25246 (type_list): Need a COMMA in the middle.
25248 (indexer_declaration): Tell tokenizer to recognize get/set
25250 * Remove old targets.
25252 * Re-add the parser target.
25254 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25256 * cs-parser.jay: Add precendence rules for a number of operators
25257 ot reduce the number of shift/reduce conflicts in the grammar.
25259 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25261 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25264 Get rid of old crufty code.
25266 * rootcontext.cs: Use this to keep track of the parsed
25267 representation and the defined types available to the program.
25269 * gen-treedump.cs: adjust for new convention.
25271 * type.cs: Split out the type manager, and the assembly builder
25274 * typemanager.cs: the type manager will live here now.
25276 * cil-codegen.cs: And the code generator here.
25278 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25280 * makefile: Fixed up for easy making.
25282 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25284 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25287 (unary_expression): Expand pre_increment_expression and
25288 post_decrement_expression to reduce a shift/reduce.
25290 2001-07-11 Simon Cozens
25292 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25294 Improve allow_keyword_as_indent name.
25296 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25298 * Adjustments for Beta2.
25300 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25302 * decl.cs: Added `Define' abstract method.
25303 (InTransit): new property, used to catch recursive definitions.
25305 * interface.cs: Implement `Define'.
25307 * modifiers.cs: Map Modifiers.constants to
25308 System.Reflection.TypeAttribute flags.
25310 * class.cs: Keep track of types and user-defined types.
25311 (BuilderInit): New method for creating an assembly
25312 (ResolveType): New function to launch the resolution process, only
25313 used by interfaces for now.
25315 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25316 that are inserted into the name space.
25318 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25320 * ARGH. I have screwed up my tree so many times due to the use of
25321 rsync rather than using CVS. Going to fix this at once.
25323 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25326 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25328 * Experiment successful: Use System.Type rather that our own
25331 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25333 * cs-parser.jay: Removed nsAliases from here.
25335 Use new namespaces, handle `using XXX;'
25337 * namespace.cs: Reimplemented namespace handling, use a recursive
25338 definition of the class. Now we can keep track of using clauses
25339 and catch invalid using clauses.
25341 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25343 * gen-treedump.cs: Adapted for all the renaming.
25345 * expression.cs (Expression): this class now has a Type property
25346 which returns an expression Type.
25348 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25349 `Type', as this has a different meaning now in the base
25351 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25353 * interface.cs, class.cs: Removed from all the sources the
25354 references to signature computation, as we can not do method
25355 signature computation during the parsing time, as we are not
25356 trying to solve at that point distinguishing:
25360 void a (NS.Blah x) {}
25363 Which depending on the context might be valid or not, as we do not
25364 know if Blah is the same thing as NS.Blah at that point.
25366 * Redid everything so the code uses TypeRefs now instead of
25367 Types. TypeRefs are just temporary type placeholders, that need
25368 to be resolved. They initially have a pointer to a string and the
25369 current scope in which they are used. This is used later by the
25370 compiler to resolve the reference to an actual Type.
25372 * DeclSpace is no longer a CIR.Type, and neither are
25373 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25374 are all DeclSpaces, but no Types.
25376 * type.cs (TypeRefManager): This implements the TypeRef manager,
25377 which keeps track of all the types that need to be resolved after
25378 the parsing has finished.
25380 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25382 * ARGH. We are going to have to store `foreach' as a class rather
25383 than resolving it, as we need to verify error 1579 after name
25384 resolution. *OR* we could keep a flag that says `This request to
25385 IEnumerator comes from a foreach statement' which we can then use
25386 to generate the error.
25388 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25390 * class.cs (TypeContainer.AddMethod): we now add methods to the
25391 MethodGroup instead of the method hashtable.
25393 * expression.cs: Add MethodGroup abstraction, which gets us one
25394 step closer to the specification in the way we handle method
25397 * cs-parser.jay (primary_expression): qualified_identifier now
25398 tried to match up an identifier to a local variable reference or
25399 to a parameter reference.
25401 current_local_parameters is now a parser global variable that
25402 points to the current parameters for the block, used during name
25405 (property_declaration): Now creates an implicit `value' argument to
25408 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25410 * parameter.cs: Do not use `param' arguments as part of the
25411 signature, per the spec.
25413 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25415 * decl.cs: Base class for classes, structs and interfaces. This
25416 is the "Declaration Space"
25418 * cs-parser.jay: Use CheckDef for checking declaration errors
25419 instead of having one on each function.
25421 * class.cs: Factor out some code for handling error handling in
25422 accordance to the "Declarations" section in the "Basic Concepts"
25423 chapter in the ECMA C# spec.
25425 * interface.cs: Make all interface member classes derive from
25426 InterfaceMemberBase.
25428 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25430 * Many things: all interfaces are parsed and generated in
25431 gen-treedump. Support for member variables, constructors,
25432 destructors, properties, constants is there.
25434 Beginning of the IL backend, but very little done, just there for
25437 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25439 * cs-parser.jay: Fix labeled statement.
25441 * cs-tokenizer.cs (escape): Escape " and ' always.
25442 ref_line, ref_name: keep track of the line/filename as instructed
25443 by #line by the compiler.
25446 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25448 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25449 to match the values in System.CodeDOM.
25451 Divid renamed to Divide.
25453 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25455 (Statements.set): remove.
25457 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25460 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25461 falseStatements always have valid values.
25463 * cs-parser.jay: Use System.CodeDOM now.